﻿/* style.css - KodlaGezi Premium Stylesheet */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    /* Dark Theme Default variables */
    --bg-primary: #0b0f19;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.65);
    --bg-input: rgba(15, 23, 42, 0.8);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --border-color: rgba(255, 255, 255, 0.08);
    
    --accent-color: #8b5cf6;
    --accent-glow: rgba(139, 92, 246, 0.4);
    --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glass-blur: blur(12px);
    
    --historical-color: #f59e0b;
    --dining-color: #10b981;
    --entertainment-color: #ec4899;
}

body.light-theme {
    /* Light Theme variables */
    --bg-primary: #f1f5f9;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-input: rgba(241, 245, 249, 0.9);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border-color: rgba(15, 23, 42, 0.08);
    
    --accent-color: #0284c7;
    --accent-glow: rgba(2, 132, 199, 0.3);
    --accent-gradient: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
    
    --card-shadow: 0 8px 24px 0 rgba(148, 163, 184, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

html {
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background blob animations for premium vibe */
body::before, body::after {
    content: '';
    position: fixed;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
}
body::before {
    top: 10%;
    left: 10%;
    background: #8b5cf6;
}
body::after {
    bottom: 10%;
    right: 10%;
    background: #3b82f6;
}

body.light-theme::before {
    background: #0284c7;
    opacity: 0.1;
}
body.light-theme::after {
    background: #38bdf8;
    opacity: 0.1;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

/* Glassmorphism Classes */
.glass {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}

/* Layout and Navigation */
nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    cursor: pointer;
}

.nav-links {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    background: var(--bg-secondary) !important;
    backdrop-filter: var(--glass-blur) !important;
    -webkit-backdrop-filter: var(--glass-blur) !important;
    border-top: 1px solid var(--border-color) !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    border-radius: 0 !important;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.3) !important;
    margin: 0 !important;
    padding: 0.5rem 0.2rem !important;
    display: flex !important;
    justify-content: space-around !important;
    align-items: center !important;
    z-index: 1000 !important;
    list-style: none !important;
}

.nav-links li {
    flex: 1 !important;
    text-align: center !important;
    list-style: none !important;
}

.nav-links a {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    color: var(--text-secondary) !important;
    text-decoration: none !important;
    padding: 0.4rem 0 !important;
    gap: 4px !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    transition: color 0.2s ease !important;
    border-radius: 0 !important;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--accent-color) !important;
    background: none !important;
}

.nav-links a i {
    width: 20px !important;
    height: 20px !important;
    margin-right: 0 !important;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white !important;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

body.light-theme .btn-secondary {
    background: rgba(0, 0, 0, 0.02);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Grid & Layout Containers */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem 6.5rem 1.5rem;
}

.view {
    display: none;
    animation: fadeIn 0.4s ease-out forwards;
}

.view.active {
    display: block;
}

.view.active.auth-wrapper {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Auth Cards styling */
.auth-wrapper {
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    padding: 2.5rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 8px var(--accent-glow);
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
}

.form-footer a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* Dashboard & Trips list */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.trips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.trip-card {
    padding: 1.5rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.trip-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.trip-card-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.trip-route {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.trip-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
}

body.light-theme .trip-badge {
    background: rgba(0, 0, 0, 0.04);
}

.trip-details {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.trip-details i {
    width: 20px;
}

.trip-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    margin-top: auto;
}

body.light-theme .trip-progress-bar {
    background: rgba(0, 0, 0, 0.08);
}

.trip-progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 10px;
}

/* Trip Creation Wizard */
.wizard-card {
    max-width: 600px;
    margin: 0 auto;
    padding: 2.5rem;
}

/* Trip Timeline Details */
.trip-info-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.day-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.day-tab {
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.day-tab.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 10px var(--accent-glow);
}

.timeline {
    position: relative;
    padding-left: 2.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-dot {
    position: absolute;
    left: -37px;
    top: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: 3px solid var(--border-color);
    z-index: 2;
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-dot {
    border-color: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color);
}

.timeline-time {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timeline-card {
    padding: 1.5rem;
    position: relative;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 30px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.8rem;
}

.category-badge.historical {
    background: rgba(245, 158, 11, 0.12);
    color: var(--historical-color);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.category-badge.dining {
    background: rgba(16, 185, 129, 0.12);
    color: var(--dining-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.category-badge.entertainment {
    background: rgba(236, 72, 153, 0.12);
    color: var(--entertainment-color);
    border: 1px solid rgba(236, 72, 153, 0.2);
}

.timeline-title {
    font-size: 1.2rem;
    margin-bottom: 0.6rem;
    font-weight: 700;
}

.timeline-desc {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.5;
    margin-bottom: 1.2rem;
}

.reviews-section {
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.reviews-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.review-item {
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 0.8rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

body.light-theme .review-item {
    background: rgba(0, 0, 0, 0.02);
}

.review-author {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
}

.review-text {
    color: var(--text-secondary);
    font-style: italic;
}

.user-visit-box {
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: 10px;
    padding: 1rem;
}

.user-visit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--success-color);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.user-visit-photo {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 0.8rem;
    border: 1px solid var(--border-color);
}

/* Map page and Container */
.map-view-wrapper {
    height: 75vh;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
}

#map-container {
    height: 100%;
    width: 100%;
    z-index: 10;
}

/* Leaflet Customizations to fit premium dark theme */
.leaflet-popup-content-wrapper {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color);
    border-radius: 12px !important;
    font-family: 'Inter', sans-serif;
    box-shadow: var(--card-shadow) !important;
}

.leaflet-popup-tip {
    background: var(--bg-secondary) !important;
}

.map-popup-photo {
    width: 100%;
    max-height: 140px;
    object-fit: cover;
    border-radius: 6px;
    margin-top: 0.5rem;
    border: 1px solid var(--border-color);
}

.map-popup-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.map-popup-comment {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 0.4rem;
}

/* Modals */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    position: relative;
    animation: modalSlide 0.3s ease-out forwards;
}

@keyframes modalSlide {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.4rem;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-title {
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
}

/* Admin Dashboard CSS */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-color);
}

body.light-theme .stat-icon {
    background: rgba(0, 0, 0, 0.03);
}

.stat-info h4 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-info p {
    font-size: 1.8rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
}

.admin-tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.admin-tab {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
}

.admin-tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.admin-table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--text-secondary);
}

td {
    color: var(--text-primary);
    font-size: 0.92rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-admin {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

.badge-user {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

/* Loading animations */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(11, 15, 25, 0.85);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 1.5rem;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(139, 92, 246, 0.2);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s linear infinite;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

/* Notifications toasts */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 4000;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.toast {
    padding: 1rem 1.5rem;
    border-radius: 10px;
    min-width: 300px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    animation: toastSlide 0.3s ease-out forwards;
}

@keyframes toastSlide {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

.toast.success {
    background: #064e3b;
    border: 1px solid #059669;
    color: #d1fae5;
}

.toast.error {
    background: #7f1d1d;
    border: 1px solid #dc2626;
    color: #fee2e2;
}

.toast.info {
    background: #1e3a8a;
    border: 1px solid #2563eb;
    color: #dbeafe;
}

/* Responsive grid layouts and premium mobile styling */
@media (max-width: 768px) {
    /* Keep top nav minimal and compact */
    nav {
        padding: 0.8rem 0 !important;
        margin-bottom: 1rem !important;
    }
    
    .nav-container {
        padding: 0 1rem !important;
    }
    
    .logo {
        font-size: 1.3rem !important;
    }
    
    /* Convert logout button to circular icon button matching theme toggle */
    #logout-btn {
        padding: 0.5rem !important;
        font-size: 0 !important; /* Hides text by reducing font size to 0 */
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 50% !important;
        min-width: auto !important;
    }
    
    #logout-btn i {
        margin-right: 0 !important;
        font-size: 1.2rem !important;
        width: 18px;
        height: 18px;
    }
    


    /* Prevent bottom bar overlapping page contents and equalize padding on mobile */
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        padding-bottom: 5.5rem !important;
    }

    /* Compact padding for cards on mobile */
    .wizard-card, .auth-card {
        padding: 1.5rem !important;
    }

    /* Stack headers and let CTA buttons stretch full-width for easy tapping */
    .dashboard-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1rem !important;
        width: 100% !important;
    }
    
    .dashboard-header h2 {
        font-size: 1.5rem !important;
    }
    
    .dashboard-header p {
        font-size: 0.85rem !important;
    }
    
    .dashboard-header .btn,
    .dashboard-header div[style*="display:flex"] {
        width: 100% !important;
        align-items: stretch !important;
    }
    
    .dashboard-header div[style*="display:flex"] .btn {
        margin-bottom: 0.5rem;
    }
    
    .dashboard-header div[style*="display:flex"] {
        flex-direction: column !important;
    }

    /* Adjust map wrapper height on mobile */
    .map-view-wrapper {
        height: 60vh !important;
    }
}

@media (max-width: 576px) {
    /* Stack elements in grid forms and lists */
    .trips-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    #route-cards-list {
        grid-template-columns: 1fr !important;
    }

    /* Generic selectors to stack 2-column inline-grid layouts on mobile */
    div[style*="grid-template-columns: 1fr 1fr"],
    div[style*="grid-template-columns:1fr 1fr"],
    div[style*="grid-template-columns: 1fr 1fr 1fr"],
    div[style*="grid-template-columns:1fr 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    
    form div[style*="display: grid"],
    form div[style*="display:grid"] {
        grid-template-columns: 1fr !important;
        gap: 0.8rem !important;
    }

    /* Premium touch scroll for day tabs */
    .day-tabs {
        overflow-x: auto !important;
        white-space: nowrap !important;
        padding-bottom: 0.4rem !important;
        margin-bottom: 1rem !important;
        -webkit-overflow-scrolling: touch;
    }
    
    .day-tabs::-webkit-scrollbar {
        display: none;
    }
    
    /* Horizontal scroll for admin and wizard tabs */
    .admin-tabs, .wizard-tabs {
        overflow-x: auto !important;
        white-space: nowrap !important;
        gap: 0.5rem !important;
        width: 100% !important;
        padding-bottom: 0.4rem !important;
    }
    
    .admin-tabs::-webkit-scrollbar,
    .wizard-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .admin-tab, .tab-btn {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.85rem !important;
    }

    /* Stack summary cards in Trip Details */
    .trip-info-summary {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 1.2rem !important;
        padding: 1rem !important;
    }
    
    .trip-info-summary div[style*="display:flex"] {
        flex-direction: row !important;
        justify-content: space-between !important;
        width: 100% !important;
        gap: 1rem !important;
    }
    
    #trip-countdown {
        text-align: center;
        font-size: 0.85rem;
    }

    /* Optimize timeline spaces on small screens */
    .timeline {
        padding-left: 1.8rem !important;
    }
    
    .timeline-dot {
        left: -30px !important;
        width: 14px !important;
        height: 14px !important;
        top: 5px !important;
    }
    
    .timeline-time {
        font-size: 0.9rem !important;
    }
    
    .timeline-card {
        padding: 1rem !important;
    }
    
    /* Ensure modal overlays are fully tap-friendly and content fits in screen heights */
    .modal-overlay {
        padding: 1rem !important;
    }

    .modal-content {
        padding: 1.25rem !important;
        width: 95% !important;
        max-height: 85vh !important;
        overflow-y: auto !important;
    }
    
    .modal-title {
        font-size: 1.2rem !important;
        margin-bottom: 1rem !important;
    }

    /* Mobile toast notification styling to prevent horizontal overflow */
    .toast-container {
        bottom: 5.5rem !important;
        right: 5% !important;
        left: 5% !important;
        width: 90% !important;
    }
    
    .toast {
        min-width: auto !important;
        max-width: 100% !important;
        width: 100% !important;
        animation: toastSlideMobile 0.3s ease-out forwards !important;
    }
}

@keyframes toastSlideMobile {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Leaflet Dark Mode CSS Filter - Inverts standard OpenStreetMap tiles to Dark theme */
.dark-theme .leaflet-tile {
    filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%) !important;
}

.dark-theme .leaflet-container {
    background: #111116 !important;
}
