﻿/* Base & Variables */
:root {
    --bg-dark: #0f2027;
    --bg-mid: #203a43;
    --bg-light: #2c5364;
    --text-main: #f8f9fa;
    --text-muted: #adb5bd;
    --accent: #f59f00;
    --accent-hover: #f08c00;
    --danger: #fa5252;
    --success: #40c057;
    
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    
    --nav-height: 70px;
    --header-height: 60px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(-45deg, var(--bg-dark), var(--bg-mid), var(--bg-light), #1a365d);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-main);
    min-height: 100vh;
    padding-top: var(--header-height);
    padding-bottom: calc(var(--nav-height) + 20px);
    overflow-x: hidden;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Extra decorative blob for live background effect */
body::before {
    content: "";
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(245, 159, 0, 0.05) 0%, transparent 40%);
    animation: rotateBlob 30s linear infinite;
    z-index: -1;
    pointer-events: none;
}

@keyframes rotateBlob {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Glassmorphism Utilities */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--glass-shadow);
    margin-bottom: 15px;
}

/* Typography */
h1, h2, h3 { font-weight: 600; margin-bottom: 10px; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; color: var(--accent); }
p { color: var(--text-muted); line-height: 1.5; font-size: 0.95rem; }
.text-center { text-align: center; }

/* Layout & Views */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
}

.app-content {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.view {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}
.view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: rgba(15, 20, 25, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--glass-border);
    border-bottom: none;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    gap: 4px;
    padding: 10px;
    transition: color 0.2s;
}

.nav-item i { font-size: 1.5rem; }
.nav-item.active, .nav-item:active { color: var(--accent); }

/* Buttons & Inputs */
.btn {
    background: var(--glass-bg);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    padding: 10px 20px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn.primary { background: var(--accent); color: var(--bg-dark); border: none; font-weight: 600; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { background: var(--danger); color: white; border: none; }
.btn.small { padding: 5px 10px; font-size: 0.85rem; }

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.icon-btn.round {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
}

.input-group {
    display: flex;
    gap: 10px;
    width: 100%;
}
.input-group > * { flex: 1; }
.input-group .btn { flex: 0 0 auto; }

input, select, textarea {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(0,0,0,0.2);
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
}
input:focus, 

select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
}

/* Dashboard */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}
.quick-actions .nav-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.quick-actions .nav-btn i { font-size: 2rem; color: var(--accent); }

/* Map */
.map-container { padding: 0; overflow: hidden; height: 300px; }
#map { width: 100%; height: 100%; z-index: 1; }

/* Overlay Menu */
.overlay-menu {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.overlay-menu.active { display: flex; animation: fadeIn 0.2s; }
.menu-content { width: 100%; max-width: 450px; }
.menu-item {
    display: block;
    padding: 15px;
    color: var(--text-main);
    text-decoration: none;
    border-bottom: 1px solid var(--glass-border);
    font-size: 1.1rem;
}
.menu-item i { margin-right: 10px; color: var(--accent); }
.menu-item:last-of-type { border-bottom: none; }

/* Utilities */
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 20px; }
.mb-2 { margin-bottom: 10px; }
.w-100 { width: 100%; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.hidden-input { display: none; }

/* Lists & Grids */
.list-view { list-style: none; }
.list-view li {
    padding: 15px;
    border-bottom: 1px solid var(--glass-border);
}
.list-view li:last-child { border-bottom: none; }

.grid-list {
    display: grid;
    gap: 15px;
}
.grid-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
}

.upload-card { cursor: pointer; padding: 40px 20px; }
.upload-icon { font-size: 3rem; color: var(--accent); margin-bottom: 10px; }

/* Tabs CSS for Trip Details */
.tab-buttons { display: flex; gap: 10px; }
.tab-btn { flex: 1; padding: 10px; background: rgba(255, 255, 255, 0.1); border: none; border-radius: 8px; color: var(--text); font-weight: 500; }
.tab-btn.active { background: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* --- TIMELINE (ITINERARY) --- */
.timeline-container {
    position: relative;
    padding-left: 20px;
    margin-top: 10px;
}

.timeline-container::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 29px; /* center of the icon */
    width: 2px;
    background: var(--glass-border);
}

.timeline-date {
    margin: 20px 0 10px 0;
    position: relative;
    z-index: 2;
}

.timeline-date h4 {
    background: var(--bg-dark);
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
    margin: 0;
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
    padding-left: 35px;
}

.timeline-icon {
    position: absolute;
    left: -10px; /* Aligns with the line */
    top: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    z-index: 2;
    box-shadow: 0 0 0 4px var(--bg-dark);
}

.timeline-content {
    padding: 15px;
}

.timeline-content .badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    margin-right: 5px;
    margin-bottom: 5px;
}

.bg-dark { background-color: rgba(0,0,0,0.5); }

/* --- PROFESSIONAL MENU OVERHAUL --- */

/* Sidebar (Off-Canvas Menu) */
.sidebar {
    position: fixed;
    top: 0;
    left: -100%; /* Hidden by default */
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: rgba(15, 32, 39, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 2500;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    border-right: 1px solid var(--glass-border);
    box-shadow: 5px 0 15px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}

.sidebar.open {
    left: 0;
}

.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(3px);
    z-index: 2400;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.sidebar-header {
    padding: 30px 20px;
    background: linear-gradient(135deg, rgba(255,255,255,0.05), transparent);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 15px;
}

.sidebar-avatar {
    width: 60px;
    height: 60px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--bg-dark);
}

.sidebar-user h3 { margin: 0; font-size: 1.2rem; }
.sidebar-user p { margin: 0; font-size: 0.85rem; color: var(--text-muted); }

.sidebar-menu-group {
    padding: 15px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-menu-group-title {
    padding: 0 20px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 1rem;
    transition: background 0.2s;
    gap: 15px;
}

.sidebar-link:hover, .sidebar-link:active {
    background: rgba(255,255,255,0.1);
}

.sidebar-link i {
    font-size: 1.2rem;
    color: var(--accent);
    width: 24px;
    text-align: center;
}

/* Floating Action Button (FAB) */
.fab-container {
    position: relative;
    top: -20px;
    z-index: 1001;
}

.fab {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-dark);
    font-size: 2rem;
    box-shadow: 0 5px 15px rgba(245, 159, 0, 0.4);
    border: 4px solid var(--bg-dark);
    cursor: pointer;
    transition: transform 0.2s;
}

.fab:active {
    transform: scale(0.95);
}

.fab-menu {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    background: var(--bg-light);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: var(--glass-shadow);
    transform-origin: bottom center;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fab-menu.open {
    transform: translateX(-50%) scale(1);
}

.fab-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: var(--text-main);
    text-decoration: none;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    white-space: nowrap;
}

/* Grid Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.grid-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.25); /* Thick visible border */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); /* Extra depth */
    border-radius: 16px;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    color: var(--text-main);
    transition: transform 0.2s, background 0.2s;
}

.grid-card:active {
    transform: scale(0.95);
    background: rgba(255,255,255,0.1);
}

.grid-card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: white;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 90%;
    max-width: 400px;
    pointer-events: none;
}
.toast {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 15px 20px;
    color: white;
    font-size: 0.95rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    animation: slideDownFade 0.3s ease forwards;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--primary); }
@keyframes slideDownFade {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === PRINT / PDF STYLES === */
@media print {
    body {
        background: white !important;
        color: black !important;
        padding: 0 !important;
    }
    
    header, nav.bottom-nav, button, .icon-btn, .hidden-input, input[type="file"], .timeline-item button {
        display: none !important;
    }

    .view, .tab-content {
        display: block !important;
        padding: 0 !important;
    }
    
    /* Only show the Trip Details view when printing, hide everything else */
    section.view:not(#view-trip-details) {
        display: none !important;
    }

    .glass-card {
        background: none !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        page-break-inside: avoid;
        margin-bottom: 10px;
    }
    
    h1, h2, h3, h4, h5, p, span, strong, div {
        color: black !important;
    }
    
    .timeline-container::before {
        background-color: #ccc !important;
    }
    
    .timeline-icon {
        background-color: #eee !important;
        color: #000 !important;
        border: 1px solid #ccc !important;
    }
    
    .badge {
        border: 1px solid #999;
        color: #000 !important;
        background: transparent !important;
    }
}

/* === FLASHCARD CSS === */
.flashcard-scene {
    perspective: 1000px;
    margin-bottom: 15px;
    cursor: pointer;
}

.flashcard {
    position: relative;
    width: 100%;
    min-height: 100px;
    transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
    transform-style: preserve-3d;
}

.flashcard.is-flipped {
    transform: rotateX(180deg);
}

.flashcard__face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.flashcard__face--front {
    /* Front face is visible initially */
}

.flashcard__face--back {
    transform: rotateX(180deg);
    background: rgba(245, 159, 0, 0.15); /* Accent tint */
    border: 1px solid var(--accent);
}

.flashcard-text-main {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.flashcard-text-sub {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* === LIVE TRANSLATOR CSS === */
.mic-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 2px solid var(--accent);
    color: var(--accent);
    font-size: 1.8rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin: 10px auto;
    transition: all 0.3s ease;
}

.mic-btn.listening {
    background: #ff4757;
    color: white;
    border-color: #ff4757;
    animation: pulse-mic 1.5s infinite;
}

@keyframes pulse-mic {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(255, 71, 87, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 71, 87, 0);
    }
}

.translation-result-box {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    border: 1px solid var(--glass-border);
}

/* === MODAL CSS === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 25px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

/* === SURVIVAL KIT CSS === */
.sos-btn {
    background: #ff4757;
    color: white;
    font-weight: 900;
    font-size: 1.2rem;
    padding: 10px 20px;
    border-radius: 8px;
    border: 2px solid white;
    box-shadow: 0 0 15px rgba(255, 71, 87, 0.6);
    animation: pulse-sos 2s infinite;
    width: 100%;
    margin-bottom: 15px;
    text-transform: uppercase;
}

@keyframes pulse-sos {
    0% { transform: scale(1); box-shadow: 0 0 15px rgba(255, 71, 87, 0.6); }
    50% { transform: scale(1.02); box-shadow: 0 0 25px rgba(255, 71, 87, 0.9); }
    100% { transform: scale(1); box-shadow: 0 0 15px rgba(255, 71, 87, 0.6); }
}

.sos-huge-text {
    font-size: 2.5rem;
    font-weight: 900;
    color: #ff4757;
    text-align: center;
    line-height: 1.1;
    margin: 20px 0;
    text-transform: uppercase;
}

.allergy-card {
    background: #fff;
    color: #000;
    border: 5px solid #ff4757;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}
.allergy-card h3 {
    color: #ff4757;
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 10px;
    text-transform: uppercase;
}
.allergy-card p {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
}

.pictogram-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 15px;
}
.pictogram-item {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}
.pictogram-item:active {
    transform: scale(0.95);
}
.pictogram-icon {
    font-size: 2.5rem;
    margin-bottom: 5px;
}
.pictogram-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.pictogram-huge {
    font-size: 8rem;
    text-align: center;
    margin: 20px 0;
}

 / *   D i c t i o n a r y   C a t e g o r y   G r i d   * / 
 . c a t e g o r y - g r i d   { 
         d i s p l a y :   g r i d ; 
         g r i d - t e m p l a t e - c o l u m n s :   r e p e a t ( 2 ,   1 f r ) ; 
         g a p :   1 5 p x ; 
 } 
 . c a t e g o r y - t i l e   { 
         b a c k g r o u n d :   r g b a ( 2 5 5 ,   2 5 5 ,   2 5 5 ,   0 . 0 5 ) ; 
         b o r d e r :   1 p x   s o l i d   v a r ( - - g l a s s - b o r d e r ) ; 
         b o r d e r - r a d i u s :   1 6 p x ; 
         p a d d i n g :   2 0 p x   1 0 p x ; 
         d i s p l a y :   f l e x ; 
         f l e x - d i r e c t i o n :   c o l u m n ; 
         a l i g n - i t e m s :   c e n t e r ; 
         j u s t i f y - c o n t e n t :   c e n t e r ; 
         t e x t - a l i g n :   c e n t e r ; 
         c u r s o r :   p o i n t e r ; 
         t r a n s i t i o n :   0 . 2 s ; 
 } 
 . c a t e g o r y - t i l e : h o v e r   { 
         b a c k g r o u n d :   r g b a ( 2 5 5 ,   2 5 5 ,   2 5 5 ,   0 . 1 ) ; 
         t r a n s f o r m :   t r a n s l a t e Y ( - 2 p x ) ; 
 } 
 . c a t e g o r y - t i l e : a c t i v e   { 
         t r a n s f o r m :   s c a l e ( 0 . 9 5 ) ; 
 } 
 . c a t e g o r y - t i l e - i c o n   { 
         f o n t - s i z e :   2 . 5 r e m ; 
         m a r g i n - b o t t o m :   1 0 p x ; 
 } 
 . c a t e g o r y - t i l e - t i t l e   { 
         f o n t - w e i g h t :   6 0 0 ; 
         f o n t - s i z e :   0 . 9 r e m ; 
 } 
 . q u i z - o p t i o n   { 
         b a c k g r o u n d :   r g b a ( 2 5 5 ,   2 5 5 ,   2 5 5 ,   0 . 0 5 ) ; 
         b o r d e r :   1 p x   s o l i d   v a r ( - - g l a s s - b o r d e r ) ; 
         b o r d e r - r a d i u s :   1 2 p x ; 
         p a d d i n g :   1 5 p x ; 
         f o n t - s i z e :   1 . 1 r e m ; 
         c u r s o r :   p o i n t e r ; 
         t r a n s i t i o n :   0 . 2 s ; 
         t e x t - a l i g n :   l e f t ; 
 } 
 . q u i z - o p t i o n : h o v e r   { 
         b a c k g r o u n d :   r g b a ( 2 5 5 ,   2 5 5 ,   2 5 5 ,   0 . 1 ) ; 
 } 
 . q u i z - o p t i o n . c o r r e c t   { 
         b a c k g r o u n d :   r g b a ( 3 9 ,   1 7 4 ,   9 6 ,   0 . 3 ) ; 
         b o r d e r - c o l o r :   v a r ( - - s u c c e s s ) ; 
 } 
 . q u i z - o p t i o n . w r o n g   { 
         b a c k g r o u n d :   r g b a ( 2 3 1 ,   7 6 ,   6 0 ,   0 . 3 ) ; 
         b o r d e r - c o l o r :   v a r ( - - d a n g e r ) ; 
 } 
  
 
 / *   F l o a t i n g   T o u r i s t   B a c k g r o u n d   * / 
 # f l o a t i n g - b a c k g r o u n d   { 
         p o s i t i o n :   f i x e d ; 
         t o p :   0 ; 
         l e f t :   0 ; 
         w i d t h :   1 0 0 v w ; 
         h e i g h t :   1 0 0 v h ; 
         o v e r f l o w :   h i d d e n ; 
         z - i n d e x :   - 2 ;   / *   B e h i n d   e v e r y t h i n g   * / 
         p o i n t e r - e v e n t s :   n o n e ; 
 } 
 
 . f l o a t i n g - i c o n   { 
         p o s i t i o n :   a b s o l u t e ; 
         b o t t o m :   - 1 0 0 p x ; 
         c o l o r :   r g b a ( 2 5 5 ,   2 5 5 ,   2 5 5 ,   0 . 0 5 ) ; 
         a n i m a t i o n :   f l o a t U p   l i n e a r   i n f i n i t e ; 
 } 
 
 @ k e y f r a m e s   f l o a t U p   { 
         0 %   { 
                 t r a n s f o r m :   t r a n s l a t e Y ( 0 )   r o t a t e ( 0 d e g ) ; 
                 o p a c i t y :   0 ; 
         } 
         1 0 %   { 
                 o p a c i t y :   1 ; 
         } 
         9 0 %   { 
                 o p a c i t y :   1 ; 
         } 
         1 0 0 %   { 
                 t r a n s f o r m :   t r a n s l a t e Y ( - 1 1 0 v h )   r o t a t e ( 3 6 0 d e g ) ; 
                 o p a c i t y :   0 ; 
         } 
 } 
  
 
/* Light Mode Variables */
:root.light-mode {
    --bg-dark: #f8f9fa;
    --bg-mid: #e9ecef;
    --bg-light: #dee2e6;
    --text-main: #212529;
    --text-muted: #495057;
    --accent: #007bff;
    --accent-hover: #0056b3;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.1);
    --glass-shadow: 0 4px 15px 0 rgba(0, 0, 0, 0.1);
}

/* Light mode specific overrides */
:root.light-mode body {
    background: linear-gradient(-45deg, #fdfbfb, #ebedee, #f5f7fa, #c3cfe2);
    background-size: 400% 400%;
}
:root.light-mode .glass-card {
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}
:root.light-mode .nav-btn.active {
    color: var(--accent);
    background: rgba(0, 123, 255, 0.1);
}

/* Boarding Pass Ticket UI */
.ticket-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
}
.ticket-card::before, .ticket-card::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 20px;
    height: 20px;
    background: var(--bg-dark); /* Matches app background to look like a cutout */
    border-radius: 50%;
    transform: translateY(-50%);
    box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
}
.ticket-card::before { left: -10px; }
.ticket-card::after { right: -10px; }
.ticket-header {
    padding: 12px 15px;
    background: rgba(0,0,0,0.1);
    border-bottom: 1px dashed var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
}
:root.light-mode .ticket-header { background: rgba(0,0,0,0.05); }
.ticket-body {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}
.ticket-airport {
    text-align: center;
}
.ticket-airport h2 {
    margin: 0;
    font-size: 2.2rem;
    color: var(--accent);
    letter-spacing: 2px;
}
.ticket-airport span {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.ticket-plane-icon {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0 15px;
}
.ticket-plane-icon::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background: repeating-linear-gradient(90deg, var(--text-muted) 0, var(--text-muted) 5px, transparent 5px, transparent 10px);
    z-index: 0;
}
.ticket-plane-icon i {
    font-size: 1.8rem;
    color: var(--text-main);
    background: var(--glass-bg);
    padding: 0 10px;
    z-index: 1;
}
.ticket-footer {
    padding: 10px 15px;
    background: rgba(0,0,0,0.1);
    border-top: 1px dashed var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}
:root.light-mode .ticket-footer { background: rgba(0,0,0,0.05); }
.ticket-barcode {
    font-family: 'Libre Barcode 39 Text', monospace, sans-serif;
    font-size: 1.5rem;
    letter-spacing: 1px;
    color: var(--text-main);
    transform: scaleY(1.5);
    margin-top: 5px;
}

/* Packing List Progress Bar */
.progress-container {
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    height: 12px;
    width: 100%;
    margin-bottom: 15px;
    overflow: hidden;
}
:root.light-mode .progress-container { background: rgba(0,0,0,0.1); }
.progress-bar {
    background: var(--success);
    height: 100%;
    width: 0%;
    transition: width 0.4s ease;
    border-radius: 20px;
}
.packing-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: rgba(0,0,0,0.1);
    margin-bottom: 5px;
    border-radius: 8px;
    transition: all 0.2s;
}
:root.light-mode .packing-item { background: rgba(0,0,0,0.05); }
.packing-item.completed {
    opacity: 0.5;
    text-decoration: line-through;
}
.packing-item input[type="checkbox"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    accent-color: var(--success);
}
.packing-category {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: var(--accent);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 5px;
}
:root.light-mode .packing-category { border-bottom-color: rgba(0,0,0,0.1); }
/* --- Utazó UI Enhancements --- */
#utazo-toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.utazo-toast {
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 15px 25px;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toast-slide-down 0.4s ease, toast-fade-out 0.4s ease 3s forwards;
    pointer-events: auto;
}

.light-mode .utazo-toast {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.utazo-toast.success i { color: var(--success); }
.utazo-toast.error i { color: var(--danger); }
.utazo-toast.info i { color: var(--accent); }

@keyframes toast-slide-down {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes toast-fade-out {
    from { opacity: 1; }
    to { opacity: 0; transform: translateY(-20px); }
}

/* Custom Confirm Modal */
#utazo-confirm-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    z-index: 10001;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#utazo-confirm-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.utazo-confirm-box {
    background: var(--bg-card);
    padding: 25px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    width: 90%;
    max-width: 400px;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.light-mode .utazo-confirm-box { border-color: rgba(0,0,0,0.1); }
#utazo-confirm-overlay.active .utazo-confirm-box { transform: scale(1); }



/* Light Theme Variables */
:root[data-theme="light"] {
    --bg: #f5f6fa;
    --bg-card: #ffffff;
    --text: #2d3436;
    --text-muted: #636e72;
    --border: rgba(0, 0, 0, 0.1);
}

:root[data-theme="light"] .glass-card {
    background: var(--bg-card);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--border);
}

:root[data-theme="light"] .app-header, 
:root[data-theme="light"] .bottom-nav {
    background: var(--bg-card);
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

:root[data-theme="light"] .bottom-nav-item,
:root[data-theme="light"] .header-actions button,
:root[data-theme="light"] #page-title {
    color: var(--text);
}

:root[data-theme="light"] .tab-btn {
    color: var(--text);
    background: rgba(0,0,0,0.05);
}

:root[data-theme="light"] input, 
:root[data-theme="light"] select, 
:root[data-theme="light"] textarea,
:root[data-theme="light"] .wysiwyg-toolbar,
:root[data-theme="light"] #guide-content {
    background: #f1f2f6 !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
}

:root[data-theme="light"] 

:root[data-theme="light"] .icon-btn {
    color: var(--text);
}

:root[data-theme="light"] .modal-content,
:root[data-theme="light"] .menu-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
}

/* GUEST MODE - HIDE EDIT CONTROLS */
body.guest-mode .btn:not(#btn-back):not(.tab-btn), 
body.guest-mode .icon-btn:not(#btn-theme-toggle),
body.guest-mode .input-group,
body.guest-mode input,
body.guest-mode select,
body.guest-mode textarea,
body.guest-mode .header-actions button:not(#btn-theme-toggle) {
    display: none !important;
}

body.guest-mode .tab-btn {
    pointer-events: auto; /* allow switching tabs */
}

/* Specific buttons we want to keep in guest mode */
body.guest-mode #btn-back,
body.guest-mode .btn.secondary, /* like Download PDF / View Image */
body.guest-mode .icon-btn.ph-moon,
body.guest-mode .icon-btn.ph-sun {
    display: inline-block !important;
}
@keyframes storyProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* MODAL DRAG AND RESIZE */
.menu-content.glass-card {
    resize: both;
    overflow: auto;
    position: relative; /* Base positioning for drag */
    max-width: 95vw;
    max-height: 95vh;
}

.menu-content .flex-between.mb-3 {
    cursor: grab;
    user-select: none;
}

.menu-content .flex-between.mb-3:active {
    cursor: grabbing;
}

/* CUSTOM SCROLLBAR STYLING */
::-webkit-scrollbar {
    width: 8px;
    height: 8px; /* For horizontal scrollbars */
}

::-webkit-scrollbar-track {
    background: var(--bg); 
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary); 
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent); 
}

/* For Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg);
}

/* Ensure OS elements follow theme (Select, Scrollbars) */
:root {
    color-scheme: dark;
}
:root[data-theme="light"] {
    color-scheme: light;
}

/* Force dark background on select options universally */
select {
    background-color: var(--bg-card);
    color: var(--text);
}

:root[data-theme="light"] 

/* Fix Scrollbar specificity */
html::-webkit-scrollbar, body::-webkit-scrollbar, *::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
html::-webkit-scrollbar-track, body::-webkit-scrollbar-track, *::-webkit-scrollbar-track {
    background: var(--bg) !important; 
    border-radius: 4px;
}
html::-webkit-scrollbar-thumb, body::-webkit-scrollbar-thumb, *::-webkit-scrollbar-thumb {
    background: var(--primary) !important; 
    border-radius: 4px;
}
html::-webkit-scrollbar-thumb:hover, body::-webkit-scrollbar-thumb:hover, *::-webkit-scrollbar-thumb:hover {
    background: var(--accent) !important; 
}



:root[data-theme="light"] 

/* FOOLPROOF FIX FOR WINDOWS SELECT OPTIONS */
select option {
    color: #000000 !important;
    background-color: #ffffff !important;
}

/* FIX FOR CONTENTEDITABLE (RICH TEXT) ON MOBILE AND DESKTOP */
[contenteditable="true"] {
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    cursor: text !important;
    pointer-events: auto !important;
    -webkit-user-modify: read-write !important;
}