/* Verwijder bullet-puntjes bij footer-list */
.sidebar-footer-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}
/* Sidebar route-item: unified style for footer and nav */
.sidebar-route-item {
    color: rgba(255,255,255,0.7);
    background: none;
    border: none;
    font-size: 0.95rem;
    cursor: pointer;
    padding: var(--spacing-sm) var(--spacing-md);
    transition: color 0.2s ease, background 0.15s ease, border-color 0.15s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    border-left: 3px solid transparent;
    border-bottom: 1px solid transparent;
    border-radius: 4px;
}

.sidebar-route-item:hover {
    color: rgba(255,255,255,1);
    background: rgba(255,255,255,0.02);
    border-left-color: var(--primary);
    border-bottom-color: var(--primary);
}
.sidebar-footer-links .left-align {
    text-align: left;
    align-self: flex-start;
    width: 100%;
    justify-content: flex-start;
}
.whatsnew-footer-link {
    color: rgba(255,255,255,0.7);
    background: none;
    border: none;
    font-size: 0.95rem;
    cursor: pointer;
    padding: var(--spacing-sm) var(--spacing-md); /* match nav items */
    transition: color 0.2s ease, background 0.15s ease, border-color 0.15s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    border-left: 3px solid transparent; /* enable left-border hover */
    border-bottom: 1px solid transparent; /* enable bottom-border hover */
}
.add-route-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 0.95rem;
    cursor: pointer;
    padding: 4px 0 4px 0;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    font-weight: 400;
    width: 100%;
    justify-content: flex-start; /* left-align contents */
    text-align: left;
    padding-left: 0;
}     
.add-route-btn:hover {
    color: #e65100;
}
.plus-icon {
    display: inline-flex;
    align-items: center;
    color: var(--primary);
    margin-right: 0;
    font-family: inherit;
    font-size: 0.95rem; /* match footer links */
    font-weight: 400;    /* don't appear bolder than the label */
    line-height: 1;
    vertical-align: middle;
} 
.add-route-label {
    font-weight: 400; /* match whatsnew */
    color: rgba(255,255,255,0.7); /* match whatsnew */
} 
.hide-mobile { display: block; }
.show-mobile { display: none; }
@media (max-width: 700px) {
    .hide-mobile { display: none !important; }
    .show-mobile { display: inline-block !important; }
}
/* ===== ROOT & VARIABLES ===== */
:root {
    --primary: #d32f2f;
    --secondary: #1976d2;
    --accent: #f57c00;
    --dark: #212121;
    --dark-light: #424242;
    --light: #f5f5f5;
    --border: #e0e0e0;
    --success: #388e3c;
    
    --sidebar-width: 280px;
    --sidebar-width-mobile: 250px;
    --header-height: 60px;
    
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
    
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--dark);
    background: var(--light);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light);
}

::-webkit-scrollbar-thumb {
    background: #bbb;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.sidebar ::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}

.sidebar ::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
}

.sidebar ::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

/* Toast notifications */
@keyframes slideUp {
    from {
        transform: translateY(120%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(120%);
        opacity: 0;
    }
}

.toast {
    font-weight: 500;
    max-width: 400px;
}

/* ===== LAYOUT ===== */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ===== MOBILE HEADER ===== */
.mobile-header {
    display: none;
    background: var(--dark);
    color: white;
    border-bottom: 2px solid var(--primary);
    padding: var(--spacing-md) var(--spacing-lg);
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    z-index: 200;
    gap: var(--spacing-lg);
}

.mobile-title {
    flex: 1;
    text-align: center;
    font-size: 1.3rem;
    font-weight: bold;
}

.mobile-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark);
    color: white;
    overflow-y: auto;
    border-right: 3px solid var(--primary);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
}

.user-bar {
    color: rgba(255,255,255,0.8);
    font-size: 0.8rem;
    padding: 8px var(--spacing-md);
    background: rgba(0,0,0,0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header {
    padding: var(--spacing-lg) var(--spacing-md) var(--spacing-lg) 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-sm);
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
    white-space: nowrap;
    padding-left: var(--spacing-md);
}

.menu-toggle {
    display: none !important;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--spacing-sm);
    transition: all 0.2s ease;
    border-radius: 4px;
}

.menu-toggle:active {
    background: rgba(255,255,255,0.15);
}
    transform: scale(0.95);
}

.nav-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
}

.sidebar-footer {
    padding: var(--spacing-md);
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start; /* left-align all footer children */
    margin-top: auto;       /* keep footer pinned to bottom */
} 

.subscribe-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.subscribe-btn:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.whatsnew-btn {
    color: rgba(255,255,255,0.7);
    background: none;
    border: 1px solid rgba(255,255,255,0.3);
    font-size: 0.85rem;
    display: inline-block;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
    font-weight: 500;
    margin: var(--spacing-md) auto;
    white-space: nowrap;
}

.whatsnew-btn:hover {
    color: rgba(255,255,255,1);
    border-color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.05);
}

.whatsnew-btn:active {
    background: rgba(255,255,255,0.1);
}

.whatsnew-link {
    color: rgba(255,255,255,0.8);
    background: none;
    border: none;
    font-size: 0.9rem;
    display: block;
    padding: 12px var(--spacing-md);
    border-radius: 0;
    transition: all 0.2s ease;
    cursor: pointer;
    font-weight: 400;
    margin: 0;
    width: 100%;
    text-align: left;
}

.whatsnew-link:hover {
    color: rgba(255,255,255,1);
    background: rgba(255,255,255,0.08);
}

.whatsnew-link:active {
    background: rgba(255,255,255,0.05);
}

/* What's New footer link */

/* Header icon button (bell in header) */
.header-icon-btn {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.header-icon-btn:hover {
    opacity: 1;
    transform: scale(1.15);
}

/* Subscribe button attention animation */
.header-icon-btn.attention {
    animation: pulse-subscribe 2s ease-in-out infinite;
}

@keyframes pulse-subscribe {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

.whatsnew-btn-small {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.whatsnew-btn-small:hover {
    color: rgba(255,255,255,1);
    transform: scale(1.1);
}

.user-info {
    display: none; /* replaced by .user-bar */
}

.logout-link {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 0.8rem;
    margin-left: 6px;
}

.logout-link:hover {
    color: #ff8a80;
    text-decoration: underline;
}

.admin-link {
    color: rgba(255,255,255,0.7); /* match footer links */
    text-decoration: none;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md); /* match nav items */
    border-radius: 4px;
    transition: all 0.2s ease;
    justify-content: flex-start;
    border-left: 3px solid transparent; /* enable left-border hover */
    border-bottom: 1px solid transparent; /* enable bottom-border hover */
}

.admin-link:hover {
    color: rgba(255,255,255,1);
    background: rgba(255,255,255,0.02);
    border-left-color: var(--primary);
    border-bottom-color: var(--primary);
}

.admin-email {
    color: rgba(255,255,255,0.7); /* match footer links */
    text-decoration: none;
    font-size: 0.95rem; /* unify footer font-size */
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: var(--spacing-sm) 0;
    border-radius: 4px;
    transition: all 0.2s ease;
} 

.admin-email:hover {
    background: rgba(255,255,255,0.1);
    text-decoration: none; /* keep footer links consistent — no underline */
    color: rgba(255,255,255,1);
}

/* Add Route button in sidebar */



.search-box {
    margin-bottom: var(--spacing-lg);
}

.search-input {
    width: 100%;
    box-sizing: border-box;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 4px;
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.95);
    font-size: 0.95rem;
}

.search-input::placeholder {

/* Footer hover parity for buttons/links (match nav-item left + bottom border) */
.sidebar-footer .whatsnew-footer-link:hover {
    background: rgba(255,255,255,0.06);
    border-left-color: var(--primary);
    border-bottom-color: var(--primary);
    color: rgba(255,255,255,1);
}


    color: rgba(255,255,255,0.6);
}

.search-input:focus {
    outline: none;
    background: rgba(255,255,255,0.15);
    border-color: var(--primary);
}

/* Navigation Tree */
.nav-section {
    margin-bottom: var(--spacing-lg);
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    margin-bottom: var(--spacing-sm);
    padding: 0 var(--spacing-md);
}

.nav-item {
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    display: block;
    text-decoration: none;
    color: rgba(255,255,255,0.8);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    border-left-color: var(--primary);
}

.nav-item.active {
    background: var(--primary);
    border-left-color: white;
    font-weight: 600;
    color: white;
}

/* Recent gewijzigde routes - highlight met accent kleur */
.nav-item.recent {
    color: #ffd700; /* goud/geel */
    font-weight: 500;
}

.nav-item.recent::after {
    content: '✨';
    margin-left: 6px;
    font-size: 0.75em;
}

.nav-item.recent:hover {
    color: #fff;
}

.nav-subitem {
    padding: var(--spacing-xs) var(--spacing-md) var(--spacing-xs) calc(var(--spacing-md) + 12px);
    font-size: 0.85rem;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-xl);
    background: white;
}

.page-content {
    max-width: 900px;
    margin: 0 auto;
}

.loading {
    text-align: center;
    padding: var(--spacing-xl);
    color: #999;
    font-size: 1.1rem;
}

/* ===== CONTENT BLOCKS ===== */
.content-block {
    margin-bottom: var(--spacing-xl);
}

/* Side-by-side layout: map on left, daily breakdown on right */
.content-block:has(.map-container) {
    /* Reset flex - maps should be full width */
    display: block;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-md);
    color: var(--dark);
    border-bottom: 3px solid var(--primary);
    padding-bottom: var(--spacing-md);
}

h2 {
    font-size: 1.8rem;
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
    color: var(--dark);
}

h3 {
    font-size: 1.3rem;
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    color: var(--dark-light);
}

p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
    color: #555;
}

/* ===== IMAGES ===== */
.image-container {
    margin: var(--spacing-lg) 0;
    text-align: center;
}

.image-container img {
    max-width: 70%;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.image-container img:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    cursor: zoom-in;
}

.image-caption {
    font-size: 0.85rem;
    color: #999;
    margin-top: var(--spacing-sm);
    font-style: italic;
}

/* ===== LINKS ===== */
a {
    color: var(--secondary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Footer-specific: only suppress underline/bottom-border for the email address (keep Admin/footer-buttons able to show hover border) */
.sidebar-footer a.admin-email,
.sidebar-footer a.admin-email:hover {
    border-bottom-color: transparent !important;
    text-decoration: none !important;
}

.link-block {
    display: inline-block;
    margin: var(--spacing-sm) var(--spacing-md) var(--spacing-sm) 0;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--light);
    border-left: 3px solid var(--secondary);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.link-block:hover {
    background: #e8f5e9;
    border-left-color: var(--success);
}

.link-block a {
    border: none;
}

/* ===== VIDEO EMBEDS ===== */
.video-block {
    margin: var(--spacing-lg) 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.video-block iframe {
    display: block;
    border: none;
    border-radius: 8px;
}

/* Responsive video embed container voor Dailymotion/Vimeo */
.video-embed-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    border-radius: 8px;
}

.video-embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

/* Local/self-hosted video container */
.local-video-container {
    max-width: 800px;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
}

.local-video-container video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    background: #000;
}

.youtube-thumb-container {
    position: relative;
    display: block;
    max-width: 640px;
    width: 100%;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

.youtube-thumb-container a {
    display: block;
    text-decoration: none;
}

.youtube-thumb-img {
    width: 100%;
    display: block;
    transition: filter 0.2s ease;
}

.youtube-thumb-container:hover .youtube-thumb-img {
    filter: brightness(0.8);
}

.youtube-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    background: rgba(255, 0, 0, 0.85);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    transition: background 0.2s ease;
}

.youtube-thumb-container:hover .youtube-play-btn {
    background: rgba(255, 0, 0, 1);
}

/* ===== PHOTO MARKERS ===== */
.photo-marker-popup {
    text-align: center;
}

.photo-marker-thumb {
    width: 200px;
    max-height: 150px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    margin: 0 auto 6px;
}

.photo-marker-caption {
    font-size: 12px;
    color: #555;
    line-height: 1.3;
}

/* ===== LISTS ===== */
ul, ol {
    margin-left: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

li {
    margin-bottom: var(--spacing-sm);
    line-height: 1.6;
}

/* ===== MAPS ===== */
.map-container {
    margin: var(--spacing-lg) 0;
    border-radius: 8px;
    overflow: visible;
    box-shadow: var(--shadow);
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
}

/* Map canvas div - MUST be visible and properly sized for Leaflet */
.map-canvas {
    height: 500px;
    width: 100%;
    display: block;
    position: relative;
    background: #f0f0f0;
    margin-bottom: 0;
}

#map {
    height: 500px;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Leaflet polyline hover */
.leaflet-interactive {
    cursor: pointer;
    transition: all 0.2s ease;
}

.leaflet-interactive:hover {
    filter: brightness(1.1);
}

/* Leaflet markers styling */
.leaflet-marker-pane .leaflet-marker-icon {
    transition: transform 0.2s ease;
}

.leaflet-marker-pane .leaflet-marker-icon:hover {
    transform: scale(1.2);
    z-index: 1000;
}

/* Weather emoji in popups */
.leaflet-popup-content {
    font-family: 'Segoe UI', Tahoma, Geneva, sans-serif;
}

.leaflet-popup-content a {
    text-decoration: none;
    font-weight: 500;
}

.leaflet-popup-content a:hover {
    text-decoration: underline;
}

/* Custom Leaflet tooltip */
.custom-tooltip {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content-img {
    max-width: 95vw;
    max-height: 95vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    animation: slideInCenter 0.3s ease;
    backface-visibility: hidden;
    object-fit: contain;
}

.modal-content-img.rotated-90 {
    transform: rotate(90deg);
}

.modal-content-img.rotated-180 {
    transform: rotate(180deg);
}

.modal-content-img.rotated-270 {
    transform: rotate(270deg);
}

@keyframes slideInCenter {
    from { 
        opacity: 0;
        transform: scale(0.95);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

.modal-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: 4px;
    max-width: 80%;
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--primary);
}

.modal-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    background: rgba(0,0,0,0.7);
    padding: 12px 20px;
    border-radius: 6px;
    z-index: 1001;
}

.modal-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.modal-btn:hover {
    background: var(--secondary);
    transform: scale(1.05);
}

.modal-fullscreen-btn {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    z-index: 1001;
}

.modal-fullscreen-btn:hover {
    background: var(--primary);
    transform: translateX(-50%) scale(1.05);
}

/* Embed hover effects */
.embed-container {
    position: relative;
    display: inline-block;
    width: 100%;
    transition: all 0.3s ease;
}

.embed-container:hover {
    filter: brightness(1.05);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.embed-container iframe {
    display: block;
    border-radius: 4px;
    transition: border 0.3s ease;
}

.embed-fullscreen-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 100;
}

.embed-container:hover .embed-fullscreen-btn {
    opacity: 1;
}

.embed-fullscreen-btn:hover {
    background: rgba(0,0,0,0.8);
    transform: scale(1.1);
}

/* Back-to-top button */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    font-size: 1.2rem;
    box-shadow: var(--shadow-lg);
}

#backToTop.show {
    opacity: 1;
    visibility: visible;
    bottom: 50px;
}

#backToTop:hover {
    background: var(--secondary);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 768px) {
    #backToTop {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }
    
    #backToTop.show {
        bottom: 30px;
    }
    
    .modal-controls {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 12px;
    }
    
    .modal-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}

/* ===== TRACK STATS ===== */
.track-stats {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border-top: none;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #555;
    box-sizing: border-box;
}

.track-stats > div:first-child {
    font-size: 0.9em;
    font-weight: 500;
    color: #555;
    padding: 10px 12px;
    background: #f0f0f0;
    border-radius: 6px;
    margin: 0 0 12px 0;
}

/* ===== DAILY BREAKDOWN TABLE ===== */
.daily-breakdown-table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.9em;
    margin: 0;
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    line-height: 1.4;
}

.daily-breakdown-header-row {
    background: linear-gradient(135deg, #f5f5f5 0%, #fff 100%);
}

.daily-breakdown-table thead {
    font-weight: 600;
}

.daily-breakdown-table th {
    padding: 10px 12px;
    text-align: left;
    color: #333;
    font-size: 0.80em;
    background: #f9f9f9;
    border-bottom: 2px solid #d32f2f;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.daily-breakdown-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.daily-breakdown-table tbody tr:hover {
    background-color: #fafafa;
}

.daily-breakdown-table td {
    padding: 8px 10px;
    color: #555;
}

.daily-table-date {
    font-weight: 600;
    color: #d32f2f;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

.daily-table-date:hover {
    background-color: #fff3e0;
    color: #c41c3b;
}

.daily-table-distance {
    font-weight: 500;
    color: #1976d2;
}

.daily-table-time {
    font-size: 0.85em;
    color: #666;
}

.daily-breakdown-table td.daily-table-elevation {
    color: #FFD700;
    font-weight: bold;
    text-align: center;
    cursor: help;
    font-size: 1.1em;
}

.daily-table-weather {
    font-size: 0.9em;
    text-align: center;
}

.weather-badge {
    display: inline-block;
    background: #f0f3f7;
    border: 1px solid #d0dce6;
    border-radius: 3px;
    padding: 3px 4px;
    font-size: 0.7em;
    color: #333;
    cursor: help;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.weather-badge:hover {
    background: #e8eef7;
    border-color: #b8c7d9;
}

/* ===== MARKER ANIMATION ===== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.pulsing-end-marker {
    animation: pulse 2s ease-in-out infinite;
}

/* Text and Caption Styling */
.page-description {
    font-size: 1.1rem;
    color: #666;
    font-style: italic;
}

.video-caption,
.embed-caption {
    font-size: 0.9rem;
    color: #666;
    margin-top: 8px;
    text-align: center;
}

.embed-container {
    width: 100%;
    margin-bottom: 20px;
}

.embed-iframe {
    border: 1px solid #ddd;
    border-radius: 4px;
}

.leaflet-popup {
    font-size: 12px;
    min-width: 140px;
}

.maps-link {
    color: #4285F4;
}

.weather-loading {
    color: #999;
    font-style: italic;
}

/* Daily Breakdown Table Wrapper */
.daily-breakdown-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
}

.daily-breakdown-header-cell {
    text-align: center;
    border-bottom: 2px solid #d32f2f;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f5f5f5 0%, #fff 100%);
    font-size: 0.95em;
    font-weight: 600;
    color: #333;
}

/* Single Day Track Info */
.track-info-single-wrapper {
    width: 100%;
    padding: 12px;
    box-sizing: border-box;
}

.track-info-single-header {
    font-size: 0.9em;
    font-weight: 600;
    color: #333;
    padding: 10px 12px;
    margin: 0;
    background: #f0f0f0;
    border-radius: 6px;
}

/* ===== EDITOR STYLES ===== */
.header-actions {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.new-route-btn {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.new-route-btn:hover {
    background: var(--primary);
    color: white;
}

.editor-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--light);
}

.editor-header {
    background: white;
    padding: 8px var(--spacing-lg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.title-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.load-route-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.title-section label,
.load-route-section label {
    font-weight: bold;
    color: var(--dark);
}

.route-title-input,
.load-route-select {
    padding: var(--spacing-md);
    border: 2px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.route-title-input {
    font-size: 1.2rem;
    font-weight: bold;
}

.route-title-input:focus,
.load-route-select:focus {
    outline: none;
    border-color: var(--primary);
}

.editor-main {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 8px;
    overflow-y: auto;
    flex: 1;
}

.blocks-section,
.preview-section {
    background: white;
    border-radius: 6px;
    padding: 8px 10px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    display: none;
}

.blocks-section h3,
.preview-section h3 {
    margin-bottom: 4px;
    color: var(--dark);
    border-bottom: 1px solid var(--primary);
    padding-bottom: 3px;
    font-size: 0.95rem;
    font-weight: 600;
}

.blocks-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 0;
    min-height: 200px;
}

.block-editor {
    background: var(--light);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 6px 8px;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.block-editor:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    padding-bottom: 2px;
    border-bottom: 1px solid var(--border);
}

.block-header-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.block-icon {
    font-size: 1.2rem;
}

.block-type-label {
    font-weight: bold;
    color: var(--primary);
    font-size: 0.75rem;
}

.block-actions {
    display: flex;
    gap: 2px;
}

.block-up-btn,
.block-down-btn,
.block-delete-btn {
    background: #c62828;
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.block-up-btn,
.block-down-btn {
    background: var(--secondary);
}

.block-up-btn:hover,
.block-down-btn:hover {
    background: #1565c0;
    transform: scale(1.1);
}

.block-delete-btn:hover {
    background: #b71c1c;
    transform: scale(1.1);
}

.block-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.block-input,
.block-textarea,
.block-select {
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: 3px;
    font-family: inherit;
    font-size: 0.85rem;
    transition: border-color 0.2s ease;
    line-height: 1.2;
}

.block-input:focus,
.block-textarea:focus,
.block-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(211,47,47,0.1);
}

.block-textarea {
    min-height: 100px;
    resize: vertical;
    flex: 1;
}

.block-content label {
    font-weight: 600;
    color: var(--dark-light);
    margin-top: 2px;
    font-size: 0.8rem;
    line-height: 1;
}

.btn-expand-text {
    background: #9c27b0;
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
}

.btn-expand-text:hover {
    background: #7b1fa2;
    transform: scale(1.1);
}

/* Text Modal */
.text-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.text-modal {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.text-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
}

.text-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.text-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0 8px;
}

.text-modal-close:hover {
    color: #c00;
}

.text-modal-textarea {
    flex: 1;
    margin: 16px;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    resize: none;
}

.text-modal-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.text-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid #e0e0e0;
}

.text-modal-cancel {
    background: #f0f0f0;
    color: #333;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.text-modal-cancel:hover {
    background: #e0e0e0;
}

.text-modal-save {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
}

.text-modal-save:hover {
    background: #b71c1c;
}

.help-text {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-top: 4px;
    font-style: italic;
}

.add-block-section {
    background: white;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px dashed var(--border);
    margin-bottom: 6px;
    box-shadow: var(--shadow);
    display: none;
}

.block-with-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 6px;
    background: transparent;
    min-height: 250px;
    align-items: stretch;
}

.block-editor-wrapper {
    display: flex;
    flex-direction: column;
}

.block-editor-wrapper .block-editor {
    flex: 1;
}

.block-preview-wrapper {
    background: white;
    border-radius: 4px;
    padding: 8px;
    border: 1px solid var(--border);
    overflow-y: auto;
    flex: 1;
    box-shadow: var(--shadow);
}

.block-preview {
    font-size: 0.9rem;
    line-height: 1.3;
}

.block-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}

.block-preview p {
    margin: 0 0 4px 0;
}

.block-preview h1,
.block-preview h2,
.block-preview h3,
.block-preview h4 {
    margin: 2px 0;
    font-size: 0.95rem;
}

/* File picker row (foto/gpx select) */
.file-picker-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.file-picker-row .block-input {
    flex: 1;
    background: #f5f5f5;
}

.file-picker-btn {
    padding: 6px 12px;
    background: #1976d2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

.file-picker-btn:hover {
    background: #1565c0;
}

/* Preview placeholders (loading/success/error states) */
.preview-placeholder {
    padding: 8px 12px;
    border-radius: 4px;
    text-align: center;
    font-size: 0.9em;
}

.preview-placeholder-loading {
    background: #f0f0f0;
    color: #999;
    padding: 20px;
}

.preview-placeholder-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.preview-placeholder-error {
    background: #f0f0f0;
    color: #666;
    font-size: 0.8rem;
    padding: 6px;
}

.preview-placeholder-warning {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffcc80;
    padding: 12px;
}

.preview-gpx-stats {
    background: #e8f5e9;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #a5d6a7;
}

.preview-gpx-stats .gpx-title {
    color: #2e7d32;
    font-weight: 600;
    margin-bottom: 8px;
}

.preview-gpx-stats .gpx-details {
    font-size: 0.85em;
    color: #558b2f;
    line-height: 1.5;
}

.add-block-section p {
    font-weight: bold;
    margin-bottom: 4px;
    font-size: 0.8rem;
    line-height: 1;
}

.block-type-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 4px;
}

.add-block-btn {
    padding: 4px 6px;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 0.75rem;
    line-height: 1;
}

.add-block-btn:hover {
    background: #1565c0;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.block-insert-btn {
    background: var(--success);
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.block-insert-btn:hover {
    background: #2e7d32;
    transform: scale(1.15);
}

.block-insert-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(2px);
}

.block-insert-menu .menu-content {
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
}

.block-insert-menu strong {
    display: block;
    margin-bottom: 12px;
    font-size: 1rem;
}

.menu-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
}

.quick-insert-btn {
    padding: 8px 12px;
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.quick-insert-btn:hover {
    background: #1565c0;
    transform: translateY(-2px);
}

.preview-container {
    background: white;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    line-height: 1.4;
    flex: 1;
    overflow-y: auto;
    font-size: 0.9rem;
}

.preview-container h2 {
    color: var(--primary);
    margin-bottom: 6px;
    margin-top: 0;
    font-size: 1.3rem;
}

.preview-container h3,
.preview-container h4 {
    color: var(--dark);
    margin-top: 6px;
    margin-bottom: 3px;
    font-size: 1rem;
}

.preview-container p {
    margin-bottom: 6px;
    color: var(--dark-light);
}

.preview-foto {
    margin: 6px 0;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.preview-foto img {
    width: 100%;
    height: auto;
    display: block;
}

.preview-link {
    display: inline-block;
    margin: var(--spacing-sm) var(--spacing-sm) var(--spacing-sm) 0;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--secondary);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.preview-link:hover {
    background: #1565c0;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.editor-footer {
    background: white;
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-lg);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
}

.editor-status {
    flex: 1;
    min-width: 140px;
}

#statusText {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 4px;
    font-weight: 600;
    color: var(--success);
    opacity: 0;
    transition: opacity 0.4s ease;
}

#statusText.visible {
    opacity: 1;
}

.route-size-indicator {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 4px;
    font-size: 0.85em;
    color: #666;
    background: #f5f5f5;
    margin-left: var(--spacing-sm);
}

.route-size-indicator:empty {
    display: none;
}

.route-size-indicator.warning {
    color: #c62828;
    background: #ffebee;
    font-weight: 600;
}

.editor-actions {
    display: flex;
    gap: var(--spacing-md);
}

.btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    font-size: 0.95rem;
    min-width: 100px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #c62828;
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #1565c0;
    box-shadow: var(--shadow);
}

.btn-local {
    background: #64b5f6;
    color: white;
}

.btn-local:hover {
    background: #42a5f5;
    box-shadow: var(--shadow);
}

.action-group {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.action-group:not(:last-child)::after {
    content: '';
    width: 1px;
    height: 24px;
    background: #ddd;
    margin-left: var(--spacing-md);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    :root {
        --sidebar-width: var(--sidebar-width-mobile);
    }
    
    .app-container {
        flex-direction: column;
        padding-top: 60px;
    }
    
    .mobile-header {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        flex-shrink: 0;
        z-index: 300;
    }
    
    .sidebar {
        position: fixed;
        left: 0;
        top: 60px;
        width: var(--sidebar-width);
        height: calc(100vh - 60px);
        z-index: 250;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .menu-toggle {
        display: flex !important;
        background: none;
        border: none;
        color: white;
        font-size: 1.5rem;
        cursor: pointer;
        padding: var(--spacing-sm);
    }
    
    .main-content {
        width: 100%;
        margin-top: 0;
        position: relative;
        z-index: 1;
    }
    
    .content-wrapper {
        padding: var(--spacing-lg);
        position: relative;
        z-index: 1;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    #map {
        height: 300px;
    }
    
    .weather-badge {
        font-size: 0.65em;
        padding: 2px 3px;
        display: inline-block;
    }
    
    /* Stack vertically on smaller screens */
    .content-block:has(.map-container) {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .map-container {
        min-width: auto;
        max-width: 100%;
        margin: var(--spacing-md) 0;
    }
}

@media (max-width: 480px) {
    :root {
        --spacing-xl: 16px;
        --spacing-lg: 16px;
    }
    
    .sidebar-header {
        padding: var(--spacing-md);
    }
    
    .content-wrapper {
        padding: var(--spacing-md);
    }
    
    .page-content {
        font-size: 0.95rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.1rem;
    }
}

/* Responsive: Split view stacked op mobiel */
@media (max-width: 1200px) {
    .editor-main {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .editor-main {
        padding: var(--spacing-md);
        gap: var(--spacing-md);
    }

    .blocks-section,
    .preview-section {
        padding: var(--spacing-md);
    }

    .editor-footer {
        flex-direction: column;
        padding: var(--spacing-md);
    }

    .editor-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .btn {
        flex: 1;
        min-width: 120px;
    }

    .block-type-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Responsive daily breakdown table */
    .daily-breakdown-table {
        font-size: 0.8em;
        margin: 15px auto;
    }

    .daily-breakdown-table th,
    .daily-breakdown-table td {
        padding: 10px 12px;
    }

    .daily-table-time {
        font-size: 0.75em;
    }
}

@media (max-width: 480px) {
    /* Mobile: hide time column, compress elevation/weather */
    .daily-breakdown-table {
        font-size: 0.75em;
        max-width: 100%;
    }

    .daily-breakdown-table th,
    .daily-breakdown-table td {
        padding: 8px 10px;
    }

    .daily-table-time {
        font-size: 0.7em;
        display: block;
        color: #999;
    }

    .daily-table-elevation {
        font-size: 1em;
    }
}

/* ===== DIALOG ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Editor toast notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    pointer-events: none;
}

.editor-toast {
    padding: 14px 24px;
    border-radius: 8px;
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0;
    transform: translateX(100px);
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    pointer-events: auto;
}
.editor-toast.show {
    opacity: 1;
    transform: translateX(0);
}
.editor-toast-success { background: #4CAF50; }
.editor-toast-error { background: #f44336; }
.editor-toast-info { background: #1976D2; }

.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    animation: fadeIn 0.2s ease;
}

.dialog-box {
    background: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.dialog-title {
    margin: 0 0 16px 0;
    color: #1a1a1a;
    font-size: 1.5rem;
    font-weight: 600;
}

.dialog-message {
    margin: 0 0 24px 0;
    color: #555;
    font-size: 1rem;
    line-height: 1.5;
}

.dialog-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    margin-bottom: 20px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.dialog-input:focus {
    border-color: #d32f2f;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
    outline: none;
}

.dialog-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.dialog-btn {
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.dialog-btn-cancel {
    border: 1px solid #ddd;
    background: white;
    color: #555;
}

.dialog-btn-cancel:hover {
    background: #f5f5f5;
    border-color: #999;
}

.dialog-btn-ok {
    border: none;
    background: #d32f2f;
    color: white;
    font-weight: 600;
}

.dialog-btn-ok:hover {
    background: #c41c3b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.3);
}

/* Error dialog styling */
.dialog-error .dialog-title {
    color: #c62828;
}

.dialog-error .dialog-message {
    margin-bottom: 16px;
}

.dialog-error .dialog-message p {
    margin: 0 0 12px 0;
}

.dialog-error .dialog-message p:last-child {
    margin-bottom: 0;
}

.dialog-stats {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
}

.dialog-stats td {
    padding: 10px 16px;
    border-bottom: 1px solid #e0e0e0;
}

.dialog-stats tr:last-child td {
    border-bottom: none;
}

.dialog-stats td:first-child {
    color: #666;
    white-space: nowrap;
}

.dialog-stats td:last-child {
    text-align: right;
    font-family: monospace;
    color: #333;
}

.dialog-contact {
    margin-top: 16px;
    padding: 12px;
    background: #e3f2fd;
    border-radius: 6px;
    text-align: center;
}

.dialog-contact a {
    color: #1565c0;
    font-weight: 600;
}

/* ===== SUBSCRIBE MODAL ===== */
.subscribe-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.subscribe-modal.show {
    opacity: 1;
    visibility: visible;
}

.subscribe-box {
    background: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s;
}

.subscribe-modal.show .subscribe-box {
    transform: translateY(0);
}

.subscribe-box h2 {
    margin: 0 0 8px;
    font-size: 1.4em;
    color: #333;
}

.subscribe-box p {
    margin: 0 0 20px;
    color: #666;
    font-size: 0.95em;
    line-height: 1.5;
}

.subscribe-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.subscribe-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.2s;
}

.subscribe-input:focus {
    outline: none;
    border-color: #1976D2;
}

.subscribe-submit {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.subscribe-submit:hover {
    background: #43A047;
}

.subscribe-submit:disabled {
    background: #9e9e9e;
    cursor: not-allowed;
}

.subscribe-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #999;
    padding: 4px 8px;
}

.subscribe-close:hover {
    color: #333;
}

.subscribe-message {
    padding: 12px;
    border-radius: 6px;
    margin-top: 12px;
    font-size: 0.9em;
}

.subscribe-message.success {
    background: #e8f5e9;
    color: #2e7d32;
}

.subscribe-message.error {
    background: #ffebee;
    color: #c62828;
}

.subscribe-privacy {
    margin-top: 16px;
    font-size: 0.8em;
    color: #999;
    text-align: center;
}

/* ===== UPLOAD PROGRESS INDICATOR ===== */
.upload-progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.upload-progress-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.upload-progress-box {
    background: white;
    border-radius: 16px;
    padding: 40px 50px;
    text-align: center;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.upload-progress-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #eee;
    border-top-color: var(--primary);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.upload-progress-message {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 20px;
    font-weight: 500;
}

.upload-progress-bar-container {
    width: 100%;
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
}

/* ===== LOGIN PAGE ===== */
body.login-page {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%) !important;
    background-attachment: fixed;
    min-height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: var(--spacing-lg) !important;
    margin: 0 !important;
    position: relative;
    overflow: hidden;
}

body.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 800"><defs><filter id="blur"><feGaussianBlur in="SourceGraphic" stdDeviation="8" /></filter></defs><path d="M0,400 Q300,350 600,380 T1200,400 L1200,800 L0,800 Z" fill="rgba(255,255,255,0.08)" filter="url(%23blur)" /><path d="M0,450 Q300,400 600,430 T1200,450 L1200,800 L0,800 Z" fill="rgba(255,255,255,0.05)" filter="url(%23blur)" /><path d="M100,500 L250,350 L400,500 M350,500 L500,300 L650,500 M600,500 L800,250 L1000,500" stroke="rgba(255,255,255,0.1)" stroke-width="8" fill="none" filter="url(%23blur)" /></svg>');
    background-size: cover;
    background-position: center;
    opacity: 0.6;
    z-index: 0;
    pointer-events: none;
}

body.login-page .login-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 420px;
    padding: var(--spacing-xl);
    animation: slideUp 0.4s ease;
    position: relative;
    z-index: 10;
}

body.login-page h1 {
    color: var(--dark);
    margin-bottom: var(--spacing-xs);
    font-size: 28px;
    font-weight: 700;
    text-align: center;
}

body.login-page .subtitle {
    color: #999;
    margin-bottom: var(--spacing-lg);
    font-size: 14px;
    text-align: center;
}

body.login-page .form-group {
    margin-bottom: var(--spacing-lg);
}

body.login-page label {
    display: block;
    color: var(--dark);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    font-size: 14px;
}

body.login-page input[type="text"],
body.login-page input[type="password"] {
    width: 100%;
    padding: 12px var(--spacing-md);
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

body.login-page input[type="text"]:focus,
body.login-page input[type="password"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

body.login-page button {
    width: 100%;
    padding: 12px var(--spacing-lg);
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

body.login-page button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(211, 47, 47, 0.3);
}

body.login-page button:active {
    transform: translateY(0);
}

body.login-page .error {
    background: rgba(211, 47, 47, 0.08);
    color: #c62828;
    padding: var(--spacing-md);
    border-radius: 8px;
    margin-bottom: var(--spacing-lg);
    font-size: 14px;
    border-left: 4px solid #c62828;
}

body.login-page .error pre {
    background: rgba(0, 0, 0, 0.05);
    padding: var(--spacing-md);
    border-radius: 6px;
    margin-top: var(--spacing-sm);
    font-size: 12px;
    overflow-x: auto;
    color: #666;
}

body.login-page .info {
    background: rgba(25, 118, 210, 0.08);
    color: #1565c0;
    padding: var(--spacing-md);
    border-radius: 8px;
    margin-bottom: var(--spacing-lg);
    font-size: 14px;
    border-left: 4px solid #1565c0;
}

body.login-page .contact-info {
    text-align: center;
    margin-top: var(--spacing-lg);
    color: #666;
    font-size: 13px;
}

body.login-page .contact-info a {
    color: #1565c0;
    text-decoration: none;
}

body.login-page .contact-info a:hover {
    text-decoration: underline;
}

body.login-page .footer {
    text-align: center;
    margin-top: var(--spacing-lg);
    color: #999;
    font-size: 12px;
}

/* ========================================
   WHAT'S NEW MODAL
   ======================================== */
.whatsnew-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    animation: fadeIn 0.2s ease;
}

.whatsnew-dialog {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.whatsnew-header {
    background: linear-gradient(135deg, #d32f2f 0%, #f57c00 100%);
    color: white;
    padding: 32px;
    border-radius: 12px 12px 0 0;
}

.whatsnew-header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.whatsnew-content {
    padding: 32px;
}

.whatsnew-section {
    margin-bottom: 32px;
}

.whatsnew-section h2 {
    margin: 0 0 16px 0;
    font-size: 18px;
    color: #333;
}

.whatsnew-item {
    padding: 12px;
    margin-bottom: 12px;
    background: #f5f5f5;
    border-radius: 8px;
    border-left: 4px solid #2196F3;
}

.whatsnew-item-row {
    display: flex;
    align-items: flex-start;
}

.whatsnew-item-icon {
    font-size: 24px;
    margin-right: 12px;
}

.whatsnew-item-body {
    flex: 1;
}

.whatsnew-item-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.whatsnew-item-desc {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.whatsnew-item-clickable {
    border-left-color: #d32f2f;
    cursor: pointer;
    transition: all 0.2s;
}

.whatsnew-item-clickable:hover {
    background: #eeeeee;
}

.whatsnew-item-link {
    color: #d32f2f;
    font-size: 13px;
    font-weight: 500;
}

.whatsnew-item-date {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.whatsnew-footer {
    padding: 20px 32px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f5f5f5;
    border-radius: 0 0 12px 12px;
}

.whatsnew-footer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.whatsnew-checkbox {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.whatsnew-checkbox input {
    cursor: pointer;
}

.whatsnew-checkbox label {
    cursor: pointer;
    font-size: 13px;
    color: #666;
    margin: 0;
}

.whatsnew-close-btn {
    padding: 8px 20px;
    background: #d32f2f;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
}

.whatsnew-version {
    font-size: 10px;
    color: #999;
    text-align: center;
}

/* ========================================
   TRACK TABLE STYLES
   ======================================== */
.daily-breakdown-table td.elev-stars {
    color: #FFD700;
    font-weight: bold;
}

.daily-table-date[data-end-lat] {
    cursor: pointer;
}

.daily-table-date[data-end-lat]:hover {
    background-color: #e3f2fd;
    text-decoration: underline;
}

.weather-loading {
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.weather-loaded {
    opacity: 1;
}

.leaflet-popup-content .popup-info {
    font-size: 13px;
    line-height: 1.6;
}

.leaflet-popup-content .popup-maps-link {
    display: inline-block;
    margin-top: 8px;
    background: var(--primary);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}

/* ========================================
   EMBED MODAL (fullscreen video/embed)
   ======================================== */
.embed-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.embed-modal-container {
    width: 95vw;
    height: 95vh;
    position: relative;
}

.embed-modal-container iframe {
    width: 100%;
    height: 100%;
}

.embed-modal-close {
    position: absolute;
    top: 20px; right: 20px;
    background: white;
    color: black;
    border: none;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 24px;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.2s ease;
}

.embed-modal-close:hover {
    background: #f0f0f0;
}
