/* --- RESET & BASIS --- */
*, *::before, *::after { box-sizing: border-box; }

:root { 
    --bg-desktop: #1e293b; --bg-calm: #fafaf9; --bg-alt: #f8fafc;
    --accent: #ff6600; --text: #334155; --text-muted: #64748b;
    --hint-bg: #fffbeb; --hint-text: #b45309; --white: #ffffff; 
    --border-color: #e2e8f0; --nav-bg: rgba(255, 255, 255, 0.98);
    --menu-overlay: rgba(250, 250, 249, 0.98); --app-width: 800px; --top-bar-height: 64px; 
}

[data-theme="dark"] {
    --bg-desktop: #000000; --bg-calm: #0f172a; --bg-alt: #1e293b;
    --accent: #ff8533; --text: #f1f5f9; --text-muted: #94a3b8;
    --hint-bg: #1e293b; --hint-text: #fcd34d; --white: #1e293b; 
    --border-color: #334155; --nav-bg: rgba(15, 23, 42, 0.95);
    --menu-overlay: rgba(15, 23, 42, 0.98);
}

body, html { margin: 0; padding: 0; height: 100%; height: 100dvh; font-family: 'Nunito', sans-serif; background: var(--bg-desktop); display: flex; justify-content: center; color: var(--text); overflow: hidden; }

/* De container die alles op 800px dwingt */
.app-container { width: 100% !important; max-width: var(--app-width) !important; height: 100%; background: var(--bg-calm); position: relative; overflow: hidden; }

/* Top Nav */
#top-bar { position: absolute; top: 0; left: 0; right: 0; height: var(--top-bar-height); background: var(--nav-bg); z-index: 9999; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 2px dashed var(--border-color); }
.site-title { font-weight: 800; font-size: 1.2rem; color: var(--accent); }
.hamburger { width: 30px; height: 22px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; }
.hamburger span { display: block; width: 100%; height: 3px; background-color: var(--accent); border-radius: 3px; }

/* --- TABS & MENU --- */
#main-menu-overlay { 
    position: absolute; top: 0; left: 0; right: 0; bottom: 0; 
    background: var(--menu-overlay); z-index: 10000; display: none; 
    padding: calc(var(--top-bar-height) + 20px) 20px 20px 20px; overflow-y: auto;
}
#main-menu-overlay.active { display: block; }

.menu-tabs-wrapper { width: 100%; max-width: 450px; margin: 0 auto; }
.menu-tabs-nav { display: flex; background: var(--bg-alt); border-radius: 15px; padding: 5px; margin-bottom: 25px; border: 1px solid var(--border-color); }
.tab-link { flex: 1; background: transparent; border: none; padding: 12px 5px; font-weight: 800; font-size: 0.85rem; color: var(--text-muted); cursor: pointer; border-radius: 10px; font-family: inherit; }
.tab-link.active { background: var(--white); color: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,0.05); }

/* Tab en View weergave logica (Zonder !important) */
.tab-content { display: none; width: 100%; }
.tab-content.active { display: block; }
.view-container { display: none; }
.view-container.active { display: block; }

/* --- WANDELINGEN (ROUTES) OPMAAK --- */
.walk-list-container { margin-top: 10px; }
.walk-item { display: flex; align-items: center; padding: 12px; border: 2px solid var(--border-color); border-radius: 12px; margin-bottom: 10px; background: var(--white); cursor: pointer; transition: all 0.2s; }
.walk-item.active-walk { border-color: var(--accent); background: var(--hint-bg); }
.walk-delete { width: 32px; height: 32px; border-radius: 50%; background: #fee2e2; color: #ef4444; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: bold; margin-right: 15px; }
.walk-load { flex-grow: 1; }
.walk-progress-container { width: 100%; height: 6px; background: var(--border-color); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.walk-progress-bar { height: 100%; background: var(--accent); transition: width 0.3s; }

/* Knoppen */
.menu-btn { 
    display: block; width: 100%; max-width: 400px; margin: 0 auto 15px auto; 
    padding: 15px; background: var(--accent); color: #ffffff !important; 
    border: none; border-radius: 30px; font-size: 1.1rem; font-weight: 800; 
    cursor: pointer; text-align: center; text-decoration: none; font-family: inherit; transition: opacity 0.2s;
}
.menu-btn:hover { opacity: 0.9; }
.menu-btn.secondary { background: var(--white); color: var(--text) !important; border: 2px solid var(--border-color); }
.menu-btn.tertiary { background: transparent; color: var(--text) !important; border: 2px solid var(--border-color); font-size: 1rem; }

/* --- SWIPER --- */
.swiper-main { width: 100%; height: 100%; position: relative; }

.swiper-slide-main { 
    height: 100%; 
    padding: calc(var(--top-bar-height) + 20px) 20px 120px 20px; 
    overflow-y: auto; 
    background: var(--bg-calm); 
    box-sizing: border-box;
}

/* --- KAARTEN & FOTO'S --- */
.map-container { 
    position: relative;
    height: 25vh; /* Verlaagd van 35vh */
    min-height: 180px; 
    width: 100%; 
    border-radius: 16px; 
    margin-bottom: 15px; 
    border: 2px solid var(--white); 
    background: #eee; 
    overflow: hidden; /* Zorgt dat de kaart niet buiten de afgeronde hoeken steekt */
}

/* Onzichtbaar schild over de kleine kaart om klikken te vangen */
.map-container::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1000;
    cursor: zoom-in;
}

.photo-swiper { width: 100%; height: 25vh; margin-bottom: 15px; border-radius: 16px; background: var(--white); overflow: hidden; position: relative; }
.photo-swiper img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }

/* --- NIEUW: FULLSCREEN MAP OVERLAY --- */
#fullscreen-map-overlay {
    position: fixed;
    top: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: var(--app-width);
    height: 100%; height: 100dvh;
    background: var(--bg-desktop);
    z-index: 100000;
    visibility: hidden;
    opacity: 0;
    pointer-events: none; /* VEILIGHEID: steelt geen klikken als hij dicht is */
    transition: opacity 0.3s ease, visibility 0.3s;
}
#fullscreen-map-overlay.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto; /* Klikken weer aanzetten als hij open is */
}

#fullscreen-map-container {
    width: 100%;
    height: 100%;
}
.map-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: #ffffff;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--text);
    cursor: pointer;
    z-index: 100001; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}
.map-close-btn:hover {
    transform: scale(1.05);
    color: var(--accent);
}
/* --- FULLSCREEN OVERLAY --- */
#fullscreen-overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0, 0, 0, 0.9); z-index: 100000; 
    display: none; align-items: center; justify-content: center; 
    cursor: zoom-out;
}
#fullscreen-overlay.active { display: flex; }
#fullscreen-overlay img { max-width: 95%; max-height: 95%; object-fit: contain; border-radius: 8px; }

/* --- CONTENT & TEKSTEN BINNEN DE SLIDES --- */
.header-wrap { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.header-wrap h2 { margin: 0; font-size: 1.5rem; color: var(--accent); }
.description { font-size: 1rem; line-height: 1.6; }

/* Text to Speech knoppen */
.tts-btn { background: var(--bg-alt); border: 2px solid var(--border-color); border-radius: 20px; padding: 6px 12px; font-size: 0.85rem; font-weight: 800; color: var(--text); cursor: pointer; transition: all 0.2s; }
.tts-btn.playing { background: var(--accent); border-color: var(--accent); color: var(--white); }
.tts-btn.paused { background: #f59e0b; border-color: #f59e0b; color: var(--white); }
.tts-btn-small { padding: 4px 8px; font-size: 0.75rem; border-radius: 12px; margin-right: 5px; }

/* --- NIEUW: Reset Knop (Soepele Animatie) --- */
.tts-reset-btn { 
    width: 0; 
    height: 32px; 
    border-radius: 50%; 
    background-color: #3b82f6; /* Hetzelfde blauw als de GPS marker */
    border: none; 
    color: #ffffff; /* Wit icoontje */
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 1rem; 
    padding: 0;
    
    /* Onzichtbaar state */
    opacity: 0;
    margin-left: 0;
    transform: scale(0) rotate(-180deg); /* Start klein en gedraaid */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Geeft een 'bounce' effect */
    pointer-events: none; /* Voorkom onzichtbare kliks */
    overflow: hidden;
}

/* De class die we met Javascript toevoegen om hem te tonen */
.tts-reset-btn.show {
    width: 32px;
    opacity: 1;
    margin-left: 8px; /* Voegt de ruimte tussen de knoppen toe */
    transform: scale(1) rotate(0deg); /* Draait mooi in beeld */
    pointer-events: auto;
}

.tts-reset-btn:hover {
    background-color: #2563eb; /* Iets donkerder blauw bij aanraken */
}

/* Instructie box */
.instruction-box { margin-top: 20px; padding: 15px; background: var(--hint-bg); border-left: 4px solid var(--accent); border-radius: 0 12px 12px 0; color: var(--text); line-height: 1.5; }

/* Introductie */
.intro-screen { text-align: center; width: 100%; }
.intro-icon { font-size: 4rem; margin-bottom: 15px; display: block; }
.intro-title { font-size: 2.2rem; color: var(--accent); font-weight: 800; margin-bottom: 10px; }
.intro-box, .intro-box-account { width: 100%; max-width: 650px; margin: 0 auto 15px auto; text-align: left; padding: 20px; border-radius: 16px; border: 2px solid var(--border-color); background: var(--white); }
.intro-box-account { background: var(--hint-bg); border-left: 4px solid var(--accent); }

/* --- ONDERSTE NAVIGATIE --- */
#ui-layer { position: absolute; bottom: 0; left: 0; right: 0; z-index: 9999; pointer-events: none; padding: 20px; display: flex; justify-content: center; }
.nav-pill { 
    pointer-events: auto; background: var(--nav-bg); backdrop-filter: blur(10px); 
    width: 100%; max-width: 650px; height: 64px; border-radius: 32px; border: 2px solid var(--accent); 
    display: flex; align-items: center; padding: 0 25px; cursor: pointer;
}
.nav-pill.expanded { height: 70vh; border-radius: 24px; flex-direction: column; align-items: flex-start; padding-top: 20px; }

.progress-wrapper { display: flex; align-items: center; width: 100%; }
.progress-container { flex-grow: 1; height: 8px; background: var(--border-color); border-radius: 4px; margin-right: 15px; overflow: hidden; position: relative; }
.progress-bar { position: absolute; left: 0; top: 0; height: 100%; background: var(--accent); transition: width 0.3s; }
.step-label { font-weight: 800; font-size: 0.9rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- NIEUW: De Chevron (Pijltje) Opmaak --- */
.nav-chevron { 
    color: var(--accent); 
    margin-left: 15px; 
    font-size: 1rem; 
    transition: transform 0.3s ease; /* Zorgt voor een soepele draai-animatie */
}
.nav-pill.expanded .nav-chevron { 
    transform: rotate(180deg); /* Draait het pijltje om als het menu open is */
}

.menu-scroll { width: 100%; overflow-y: auto; margin-top: 20px; display: none; }
.nav-pill.expanded .menu-scroll { display: block; }
.menu-item { padding: 15px 10px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; text-align: left; }
.menu-item span { width: 30px; height: 30px; background: var(--border-color); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; margin-right: 15px; font-weight: 800; }
.menu-item.active { color: var(--accent); }

/* --- FORMULIEREN & AUTHENTICATIE LINKS --- */
input, textarea { width: 100%; padding: 12px; margin-bottom: 10px; border-radius: 10px; border: 1px solid var(--border-color); font-family: inherit; font-size: 1rem; color: var(--text); background: var(--white); }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.1); }

.toggle-auth { text-align: center; margin-top: 15px; font-size: 0.95rem; color: var(--text-muted); }
.toggle-auth a { color: var(--accent); font-weight: 800; text-decoration: none; transition: opacity 0.2s; }
.toggle-auth a:hover { opacity: 0.8; text-decoration: underline; }

/* --- GPS MARKER --- */
.gps-marker {
    background-color: #3b82f6;
    border: 3px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(0,0,0,0.4);
    /* Optioneel: een zachte animatie zodat hij "leeft" */
    animation: pulseGps 2s infinite;
}

@keyframes pulseGps {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}