/* --- GLOBALE VARIABLEN & RESET --- */
:root {
    --primary: #58cc02;    /* Duolingo Grün */
    --secondary: #1cb0f6;  /* AI Blau */
    --red: #ff4b4b;        /* Fehler/Herzen */
    --orange: #ff9600;     /* Streak */
    --gold: #ffc800;       /* Gems/Liga */
    --bg: #131f24;         /* Deep Dark */
    --card: #1b2c33;       /* Card BG */
    --border: #37464f;     /* Border Color */
    --text: #eeeeee;
    --text-dim: #afafaf;
    --shadow: 0 4px 0 #2b3a42;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* --- NAVIGATION (SIDEBAR & MOBILE) --- */
nav {
    width: 260px;
    border-right: 2px solid var(--border);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg);
    z-index: 100;
}

.logo {
    font-size: 28px;
    font-weight: 900;
    color: var(--primary);
    letter-spacing: 1px;
    margin-bottom: 30px;
    padding-left: 10px;
}

.nav-item {
    padding: 14px 18px;
    border-radius: 16px;
    cursor: pointer;
    font-weight: bold;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    background: rgba(28, 176, 246, 0.1);
    color: var(--secondary);
    border: 2px solid var(--secondary);
}

.beta-badge {
    background: var(--secondary);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 6px;
    margin-left: auto;
    font-weight: 900;
    text-transform: uppercase;
}

@media (max-width: 850px) {
    body { flex-direction: column-reverse; }
    nav {
        width: 100%;
        height: 80px;
        flex-direction: row;
        border-right: none;
        border-top: 2px solid var(--border);
        padding: 5px 10px;
        justify-content: space-around;
        align-items: center;
    }
    nav .logo, nav .nav-item span { display: none; }
    nav .nav-item { padding: 12px; border-radius: 12px; }
}

/* --- MAIN CONTENT --- */
main {
    flex: 1;
    overflow-y: auto;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.content-width {
    width: 100%;
    max-width: 550px;
}

/* --- CARDS & FORMS --- */
.card {
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: 24px;
    padding: 30px;
    box-shadow: var(--shadow);
    width: 100%;
    margin-bottom: 25px;
    animation: fadeIn 0.4s ease-out;
}

input {
    width: 100%;
    padding: 16px;
    margin: 10px 0;
    border: 2px solid var(--border);
    border-radius: 16px;
    background: #202f36;
    color: white;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

input:focus {
    border-color: var(--secondary);
}

/* --- BUTTONS --- */
button {
    padding: 16px;
    border-radius: 16px;
    border: none;
    font-weight: 800;
    cursor: pointer;
    text-transform: uppercase;
    width: 100%;
    font-size: 15px;
    letter-spacing: 0.5px;
    transition: filter 0.2s, transform 0.1s;
}

button:active { transform: translateY(2px); }

.btn-p { 
    background: var(--primary); 
    color: white; 
    border-bottom: 4px solid #46a302; 
}

.btn-s { 
    background: var(--secondary); 
    color: white; 
    border-bottom: 4px solid #1899d6; 
}

.btn-o {
    background: var(--orange);
    color: white;
    border-bottom: 4px solid #cc7a00;
}

/* --- QUIZ & PROGRESS --- */
.prog-container {
    width: 100%;
    background: var(--border);
    height: 16px;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 30px;
}

#prog-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 20px;
}

/* --- AI CALL UI (REPAIRED) --- */
.call-ui {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, #1b2c33 0%, #0b1418 100%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
}

.ai-pulse {
    width: 140px;
    height: 140px;
    background: var(--secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 70px;
    margin-bottom: 40px;
    position: relative;
    box-shadow: 0 0 20px rgba(28, 176, 246, 0.4);
}

.ai-pulse.active::before {
    content: '';
    position: absolute;
    inset: -20px;
    border-radius: 50%;
    border: 2px solid var(--secondary);
    animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

#call-status {
    font-size: 24px;
    font-weight: bold;
    color: var(--text);
    margin: 10px 0;
}

#call-transcript {
    height: 80px;
    max-width: 400px;
    color: var(--secondary);
    font-style: italic;
    font-size: 1.1rem;
    margin-top: 20px;
    overflow: hidden;
}

/* --- ANIMATIONS --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.emoji-pop {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 100px;
    z-index: 10000;
    animation: popOut 0.8s ease-out forwards;
    pointer-events: none;
}

@keyframes popOut {
    0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
    50% { transform: translate(-50%, -60%) scale(1.2); opacity: 1; }
    100% { transform: translate(-50%, -80%) scale(1.5); opacity: 0; }
}

/* --- HELPER --- */
.hidden { display: none !important; }