:root {
    --primary-color: #1a73e8;
    --bg-color: #f8f9fa;
    --text-main: #202124;
    --text-muted: #5f6368;
    --verb-regular: #1e8e3e;   
    --verb-irregular: #d93025; 
    --gram-color: #fbbc04;
    --nav-height: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

/* DE ABSOLUTE KOOI: Dit voorkomt alle Android hoogte-bugs (geen vh, dvh of percentages meer) */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    /* We nagelen de 4 hoeken vast aan de randen van het venster */
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    overflow: hidden; /* Scrollen doen we enkel in de content, niet globaal */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color); 
    color: var(--text-main);
    display: flex; 
    flex-direction: column; 
}

.top-nav {
    /* De 'env' functies voegen dynamisch padding toe als een Apple-apparaat dat vereist, op je Android blijft dit 0px */
    height: calc(var(--nav-height) + env(safe-area-inset-top, 0px)); 
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex; 
    align-items: center; 
    padding: env(safe-area-inset-top, 0px) 16px 0 16px; 
    z-index: 10;
    gap: 12px; 
    flex-shrink: 0; /* Mag nooit krimpen */
}

#logo-home-link {
    font-family: 'Nunito', sans-serif; font-size: 22px; font-weight: 900; letter-spacing: 0.5px;
    display: flex; align-items: center; white-space: nowrap;
    flex-shrink: 0; 
}

#big-search-wrapper:focus-within {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    border-color: var(--primary-color) !important;
}

input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

.kleur-vlag {
    display: inline-block; line-height: 1;
    background: linear-gradient(to bottom, #d93025 0%, #d93025 22%, #fbbc04 38%, #fbbc04 62%, #d93025 78%, #d93025 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent; 
    color: transparent; 
    padding-bottom: 2px;
}

.uitroep-extreme-skew { color: #202124; margin: 0 2px; transform: skewX(-20deg); display: inline-block; }
.uitroep-extreme-skew.omgekeerd { transform: skewX(-20deg) translateY(3px); }

.top-actions { 
    display: flex; align-items: center; gap: 10px; 
    flex-shrink: 0; 
    white-space: nowrap; 
}

@keyframes flameFlicker {
    0% { transform: scale(1) rotate(-2deg); }
    50% { transform: scale(1.15) rotate(2deg); }
    100% { transform: scale(1) rotate(-2deg); }
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.streak-flame { display: inline-block; animation: flameFlicker 1.5s infinite ease-in-out; color: #ff9800; font-size: 16px; margin-right: 2px; }

#streak-container {
    display: none; align-items: center; gap: 2px; background: #fff8e1; border: 1px solid #fde293; 
    padding: 4px 10px; border-radius: 16px; font-weight: 900; font-size: 13px; color: #b07d00; 
    cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,0.05); transition: transform 0.2s ease;
}

#streak-container:active { transform: scale(0.95); }

#user-avatar-container { display: none; align-items: center; cursor: pointer; transition: transform 0.2s ease; }
#user-avatar-container:active { transform: scale(0.95); }

#user-avatar-img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid #1a73e8; }
#user-avatar-fallback {
    width: 36px; height: 36px; border-radius: 50%; background: #1a73e8; color: white;
    font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 15px;
    display: flex; align-items: center; justify-content: center; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

#app-content { 
    flex: 1; /* Neemt alle resterende ruimte in beslag */
    overflow-y: auto; 
    -webkit-overflow-scrolling: touch; /* Vloeiend scrollen op mobiel */
    padding: 16px; 
    padding-bottom: 30px; /* Klein kussentje onderaan voor de ademruimte */
}

.wod-widget {
    background: #ffffff; border: 1px solid #fbbc04; border-radius: 16px;
    padding: 16px; margin-bottom: 24px; box-shadow: 0 4px 12px rgba(251, 188, 4, 0.1);
    text-align: center; width: 92%; max-width: 584px; display: none; cursor: pointer; transition: transform 0.2s ease;
}
.wod-widget:active { transform: scale(0.98); }
.wod-titel { font-size: 11px; font-weight: 900; color: #fbbc04; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.wod-spaans { font-size: 20px; font-weight: 900; color: var(--text-main); margin-bottom: 2px; }
.wod-nl { font-size: 14px; color: var(--text-muted); }

/* DE VERNIEUWDE NAVIGATIEBALK */
.bottom-nav {
    flex-shrink: 0; /* Voorkomt dat de balk krimpt als de content lang is */
    width: 100%;
    height: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px)); 
    background: #e8eaed; 
    border-top: 1px solid #dadce0; 
    display: flex; 
    justify-content: space-around; 
    align-items: center; 
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px)) 10px; 
    gap: 8px;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08); 
    z-index: 9999; 
    /* Geen position: fixed meer nodig, de flexbox is nu begrensd door de Absolute Kooi */
}

.nav-btn {
    background: #ffffff; border: 1px solid #dadce0; border-radius: 10px; font-size: 12px;
    color: var(--text-muted); display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 4px; cursor: pointer; flex: 1; height: 100%;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04); transition: all 0.15s ease-in-out;
}
.nav-btn.active {
    background-color: var(--primary-color); color: #ffffff; font-weight: bold; border-color: transparent;
    box-shadow: 0 4px 10px rgba(26, 115, 232, 0.35), inset 0 2px 3px rgba(255, 255, 255, 0.3);
}

.vervoeging-tabel { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed #dadce0; }

.premium-locked-text {
    color: #bdc1c6 !important; font-style: italic; user-select: none; display: inline-flex; align-items: center;
    gap: 4px; background: #f1f3f4; padding: 2px 6px; border-radius: 4px; font-size: 12px;
}
.premium-locked-text::before { content: "🔒"; font-size: 11px; }

.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    z-index: 10000; justify-content: center; align-items: center; padding: 20px; box-sizing: border-box;
}
.modal-overlay.open, .modal-overlay[style*="display: flex"], .modal-overlay[style*="display: block"] { display: flex !important; }

.modal-content {
    background: white; width: 100%; max-width: 400px; max-height: 85vh; overflow-y: auto;
    border-radius: 16px; padding: 24px; position: relative; box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.modal-close-btn {
    position: absolute; top: 12px; right: 16px; background: #f1f3f4; border: none; border-radius: 50%;
    width: 30px; height: 30px; font-size: 16px; font-weight: bold; color: #5f6368; cursor: pointer; display: flex; align-items: center; justify-content: center;
}

#account-dropdown {
    display: none; position: fixed; top: 65px; right: 16px; background: white; border-radius: 12px; 
    box-shadow: 0 8px 24px rgba(0,0,0,0.15); padding: 20px; z-index: 2000; border: 1px solid #e8eaed; text-align: center; min-width: 180px;
}
.dropdown-avatar-groot {
    width: 50px; height: 50px; background: #e8f0fe; color: var(--primary-color); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: bold; margin: 0 auto 12px auto;
}

#login-overlay { position: fixed; inset: 0; background: #ffffff; z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; box-sizing: border-box; }
.login-box { width: 100%; max-width: 400px; background: #ffffff; padding: 30px; border-radius: 16px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); text-align: center; }

.gids-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 10px; }
.gids-kaart { background: #ffffff; border: 1px solid #e8eaed; border-radius: 16px; padding: 24px 16px; text-align: center; box-shadow: 0 4px 12px rgba(0,0,0,0.03); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gids-icoon { font-size: 28px; width: 56px; height: 56px; background: #f1f3f4; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.gids-titel { font-size: 14px; font-weight: 800; color: #3c4043; line-height: 1.2; }

.bottom-sheet-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 10000; opacity: 0; visibility: hidden; transition: all 0.3s ease; }
.bottom-sheet-content { position: absolute; bottom: 0; width: 100%; height: 80vh; background: #ffffff; border-radius: 24px 24px 0 0; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); display: flex; flex-direction: column; box-shadow: 0 -4px 20px rgba(0,0,0,0.1); }
.bottom-sheet-overlay.open { opacity: 1; visibility: visible; }
.bottom-sheet-overlay.open .bottom-sheet-content { transform: translateY(0); }
.bs-header { padding: 20px; border-bottom: 1px solid #f1f3f4; display: flex; justify-content: space-between; align-items: center; }
.bs-body { padding: 20px; overflow-y: auto; flex: 1; }

.zin-blok { background: #f8f9fa; border-radius: 12px; padding: 16px; margin-bottom: 12px; border: 1px solid #e8eaed; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.zin-es { font-size: 18px; font-weight: 800; color: var(--primary-color); margin-bottom: 4px; }
.zin-nl { font-size: 14px; color: #5f6368; }

.setup-box { background: #ffffff; padding: 16px; border-radius: 12px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); margin-bottom: 16px; border: 1px solid #dadce0; }
.setup-input { width: 100%; padding: 12px; border: 1px solid #dadce0; border-radius: 8px; background: #f8f9fa; font-size: 16px; outline: none; }

.whatsnew-item {
    background: #ffffff; border: 1px solid #e8eaed; border-radius: 12px; padding: 16px; margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.whatsnew-datum { font-size: 11px; color: var(--primary-color); font-weight: bold; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.whatsnew-titel { font-size: 15px; font-weight: 800; color: var(--text-main); margin-bottom: 6px; line-height: 1.3; }
.whatsnew-tekst { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

/* --- ¡LISTO! LINGO STYLES --- */
.lingo-toggle { background: transparent; border: none; padding: 6px 12px; border-radius: 16px; font-size: 13px; font-weight: bold; color: var(--text-muted); cursor: pointer; transition: all 0.2s; }
.lingo-toggle.active { background: white; color: var(--primary-color); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.lingo-tile { width: 50px; height: 50px; border: 2px solid #d3d6da; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 900; text-transform: uppercase; color: var(--text-main); transition: all 0.3s ease; box-sizing: border-box; background: white; }
.lingo-tile.filled { border-color: #878a8c; animation: popIn 0.1s ease-in-out; }
.lingo-tile.correct { background: #6aaa64; border-color: #6aaa64; color: white; }
.lingo-tile.present { background: #c9b458; border-color: #c9b458; color: white; }
.lingo-tile.absent { background: #787c7e; border-color: #787c7e; color: white; }
@keyframes popIn { 0% { transform: scale(0.8); } 40% { transform: scale(1.1); } 100% { transform: scale(1); } }
.lingo-key-row { display: flex; justify-content: center; gap: 6px; width: 100%; }
.lingo-key {
    flex: 1; height: 50px; background: #d3d6da; border: none; border-radius: 4px; font-weight: bold; font-size: 14px; color: var(--text-main); cursor: pointer; display: flex; align-items: center; justify-content: center; text-transform: uppercase; user-select: none; transition: background 0.2s; min-width: 0; padding: 0;
}
.lingo-key.large { flex: 1.5; font-size: 12px; }
.lingo-key.correct { background: #6aaa64; color: white; }
.lingo-key.present { background: #c9b458; color: white; }
.lingo-key.absent { background: #787c7e; color: white; }

/* Upgrade 1: Opvallende rode hartslag (kleurwissel, max 5% groei) */
@keyframes duidelijkePulse {
    0% { 
        box-shadow: 0 0 0 0 rgba(217, 48, 37, 0.8); 
        background-color: var(--primary-color); 
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 0 15px rgba(217, 48, 37, 0); 
        background-color: #d93025; /* Knalrood */
        transform: scale(1.05); /* Slechts 5% groei */
    }
    100% { 
        box-shadow: 0 0 0 0 rgba(217, 48, 37, 0); 
        background-color: var(--primary-color); 
        transform: scale(1);
    }
}

.pulse-animatie {
    animation: duidelijkePulse 2s 2; /* Speelt exact 2 keer af en stopt dan */
}

/* --- SPRAAKHERKENNING KNOPPEN --- */
.mic-btn {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    background: #ffffff; border: 1px solid #dadce0; border-radius: 24px;
    padding: 10px 20px; font-size: 14px; font-weight: bold; color: var(--text-main);
    cursor: pointer; box-shadow: 0 3px 8px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.08); transition: all 0.2s ease;
    flex: 1; /* max-width is verwijderd, de knoppen vullen nu het hele blok */
}
.mic-btn:active { transform: scale(0.95); }
.mic-icon { font-size: 16px; }
.mic-lang { color: var(--text-muted); }

/* De visuele feedback als de app "luistert" (Rood kloppend) */
@keyframes micPulse {
    0% { box-shadow: 0 0 0 0 rgba(217, 48, 37, 0.4); background-color: #fce8e6; border-color: #f6c8c4; color: #d93025; }
    50% { box-shadow: 0 0 0 8px rgba(217, 48, 37, 0); background-color: #fad2cf; border-color: #f6c8c4; color: #d93025; }
    100% { box-shadow: 0 0 0 0 rgba(217, 48, 37, 0); background-color: #fce8e6; border-color: #f6c8c4; color: #d93025; }
}
.mic-listening {
    animation: micPulse 1.5s infinite;
}
.mic-listening .mic-lang { color: #d93025; }

/* =========================================
   TUTORIAL / KENNISBANK (GARMIN-STIJL)
   ========================================= */
.tutorial-container {
    flex-direction: row;
}
.tutorial-sidebar {
    width: 280px;
    background: #f8f9fa;
    border-right: 1px solid #dadce0;
    overflow-y: auto;
}
.tutorial-menu-item {
    padding: 8px 20px;
    cursor: pointer;
    border-bottom: 1px solid #e8eaed;
    color: #5f6368;
    font-size: 15px;
    font-weight: bold;
    transition: all 0.2s ease;
}
.tutorial-menu-item:hover {
    background: #e8f0fe;
    color: var(--primary-color);
}
.tutorial-menu-item.active {
    background: white;
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}
.tutorial-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: white;
    line-height: 1.6;
    color: var(--text-main);
}
.tutorial-content h3 {
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 24px;
}
.tutorial-content h4 {
    margin-top: 24px;
    margin-bottom: 8px;
    color: #202124;
    font-size: 18px;
}
.tutorial-content p {
    margin-top: 0;
    margin-bottom: 16px;
    color: var(--text-muted);
}

/* Responsief voor smartphones */
@media (max-width: 768px) {
    .tutorial-container {
        flex-direction: column;
    }
    .tutorial-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #dadce0;
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        flex-shrink: 0;
        -webkit-overflow-scrolling: touch;
    }
    .tutorial-menu-item {
        border-bottom: none;
        border-right: 1px solid #e8eaed;
        border-left: none !important;
        border-bottom: 4px solid transparent;
    }
    .tutorial-menu-item.active {
        border-bottom: 4px solid var(--primary-color);
    }
    .tutorial-content {
        padding: 20px;
    }
}