/* assets/css/enhanced-styles.css - Enhanced styles for rich data display */
/*
   ========================================
   TABLE OF CONTENTS
   ========================================
   1) API Loading & Error Notifications
   2) Map Markers & Clusters
   3) Mountain Slider (Enhanced)
   4) Popup Card & Popup Stats
   5) Forms & Modals
   6) Filters & Multi-Select
   7) Header & Map Container
   8) Magazine-Editorial Design Sections
   9) Mobile FABs & Floating Action Buttons
   10) Desktop Layout & Responsive Controls
   11) Authentication & User Interface
   12) Mobile Filter Components
   13) Utilities, Charts & Responsiveness
*/

/* API Loading States */
.api-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(2px);
}

.api-loading.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e3f2fd;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    color: #666;
    font-weight: 500;
}

/* Error Notifications */
.api-error-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10001;
    max-width: 400px;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.error-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
    padding: 1rem;
    color: #c53030;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.error-icon {
    font-size: 1.2rem;
}

.error-message {
    flex: 1;
    font-weight: 500;
}

.error-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #c53030;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-close:hover {
    background: rgba(197, 48, 48, 0.1);
}

/* Enhanced Map Markers */
.mountain-marker-custom {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mountain-marker {
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-radius: 50%;
    color: white;
    font-weight: bold;
    font-size: 10px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 2px solid white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.mountain-marker:hover {
    transform: scale(1.1);
    z-index: 1000;
}

.mountain-marker-medium {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.mountain-marker-high {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.mountain-elevation {
    font-size: 8px;
    line-height: 1;
    opacity: 0.9;
}

.mountain-incidents {
    font-size: 10px;
    font-weight: bold;
    line-height: 1;
}

/* Enhanced Cluster Markers */
.marker-cluster-custom {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cluster-marker {
    background: radial-gradient(circle, rgba(52, 152, 219, 0.8), rgba(52, 152, 219, 1));
    border-radius: 50%;
    color: white;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
    border: 3px solid white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.cluster-marker:hover {
    transform: scale(1.05);
}

.cluster-medium {
    background: radial-gradient(circle, rgba(243, 156, 18, 0.8), rgba(243, 156, 18, 1));
}

.cluster-large {
    background: radial-gradient(circle, rgba(231, 76, 60, 0.8), rgba(231, 76, 60, 1));
}

.cluster-count {
    font-size: 14px;
    line-height: 1;
}

.cluster-fatalities {
    font-size: 10px;
    line-height: 1;
    opacity: 0.9;
    margin-top: 2px;
}


/* Legacy Mountain Slider removed in favor of Enhanced version below */

/* Mountain Hero Section */
.mountain-hero {
    position: relative;
    min-height: 300px;
}

.mountain-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.mountain-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mountain-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 2rem 1.5rem 1.5rem;
}

.mountain-overlay h1 {
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    font-weight: 700;
}

.mountain-meta {
    display: flex;
    gap: 1rem;
    font-size: 1rem;
    opacity: 0.9;
}

.mountain-info {
    padding: 1.5rem;
    background: white;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.info-card {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.info-label {
    display: block;
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.info-value {
    display: block;
    font-size: 1.3rem;
    font-weight: bold;
    color: #2c3e50;
}

.info-value.danger {
    color: #e74c3c;
}

/* Content Tabs (legacy variant removed; see Enhanced Mountain Slider section for active styles) */

/* No Data (legacy variant removed; unified version later) */

/* Incidents List (legacy variant removed; see Enhanced sections later) */

/* Statistics Tab (legacy variant removed; see Enhanced sections later) */

/* Yearly Chart */
#yearlyChart {
    display: flex;
    align-items: end;
    gap: 0.5rem;
    height: 120px;
    padding: 0.5rem 0;
}

.year-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.bar-fill {
    background: #3498db;
    width: 100%;
    max-width: 30px;
    border-radius: 3px 3px 0 0;
    transition: height 0.5s ease;
    margin-bottom: auto;
}

.bar-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

.year {
    color: #666;
}

.count {
    font-weight: bold;
    color: #2c3e50;
}

/* Demographics */
.demographics {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e9ecef;
}

.demographics h4 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
}

.demographics-grid, .demo-grid {
    display: grid;
    gap: 1rem;
}

.demo-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    margin-bottom: 1.5rem;
}

.demo-card {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.demo-number {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #3498db;
    margin-bottom: 0.25rem;
}

.demo-label {
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.demo-section {
    margin-bottom: 1.5rem;
}

.demo-section h5 {
    margin: 0 0 0.75rem 0;
    font-size: 0.95rem;
    color: #2c3e50;
    font-weight: 600;
}

.demo-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

.demo-item:last-child {
    border-bottom: none;
}

.demo-name {
    color: #2c3e50;
}

.demo-count {
    font-weight: 500;
    color: #666;
}

/* Routes Tab (legacy variant removed; see Enhanced sections later) */

@media (max-width: 480px) {
    .popup-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mountain-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .incident-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
}

/* Enhanced styles additions - ADD TO enhanced-styles.css */

/* Form Modal Enhancements - Move inline styles here */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    background: white;
    margin: 2rem auto;
    border-radius: 8px;
    max-width: 450px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 900px;
}

.modal-auth {
    max-width: 400px;
    padding: 1.5rem;
}

.modal-auth .form-group {
    margin-bottom: 1rem;
}

.modal-auth .form-group input {
    width: 100%;
    max-width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.modal-auth .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.modal-auth .form-actions {
    margin-top: 1.5rem;
}

.modal-auth .form-footer {
    margin-top: 1rem;
    text-align: center;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h2 {
    margin: 0;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* Enhanced Form Styles */
.enhanced-incident-form {
    padding: 1.5rem;
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    margin-bottom: 1rem;
    color: #333;
    font-size: 1.1rem;
    font-weight: 600;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.input-container {
    position: relative;
}

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.suggestion-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.person-entry {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    position: relative;
}

.remove-person {
    margin-top: 0.5rem;
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    color: #6c757d;
    font-size: 0.8rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
    margin-top: 1rem;
}

/* Control Panel Enhancements */
.controls-panel {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 1rem;
    overflow: hidden;
}

.controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.controls-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
}

.controls-toggle:hover {
    background: rgba(0,0,0,0.1);
}

.controls-panel.collapsed .controls-content {
    display: none;
}

.controls-panel.collapsed .toggle-icon:before {
    content: '+';
}

.controls-content {
    padding: 1rem;
}

.filter-group {
    margin-bottom: 1rem;
}

/* Filter basic controls (replaced by Enhanced Filter styling later) */

/* Statistics Dashboard (legacy variant removed; component is hidden later) */

/* Button Styles (legacy variant removed; unified button system at file end) */

/* Loading State (duplicate removed; see initial API Loading block) */

/* Timeline Loading Fix */
.timeline-stats.loading::before {
    content: "Loading...";
    color: #6c757d;
    font-style: italic;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .modal-content {
        margin: 1rem;
        width: calc(100% - 2rem);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .enhanced-incident-form {
        padding: 1rem;
    }
    
    .main-content {
        flex-direction: column;
        height: calc(100vh - 160px);
    }
    
    .map-container {
        height: 60vh;
        min-height: 400px;
    }
}

/* Multi-Select Filter Styles - ADD TO enhanced-styles.css */

/* Filter Dropdown */
.filters-toggle {
    white-space: nowrap;
}

.filter-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 300px;
    max-width: 400px;
    margin-top: 0.5rem;
}

.filter-content {
    padding: 1.5rem;
}

.filters-section {
    position: relative;
}

/* Multi-Select Components */
.multi-select-container {
    position: relative;
    width: 100%;
}

.multi-select-trigger {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.multi-select-trigger:hover {
    border-color: #3498db;
}

.multi-select-trigger:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.multi-select-trigger .arrow {
    font-size: 0.8rem;
    color: #666;
    transition: transform 0.2s;
}

.multi-select-trigger.active .arrow {
    transform: rotate(180deg);
}

.multi-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ccd0d5;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1001;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    font-size: 0.9rem;
    color: #495057;
}

.clear-all-btn {
    background: none;
    border: 1px solid #dee2e6;
    color: #6c757d;
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-all-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    font-size: 0.9rem;
    transition: background-color 0.2s;
    margin: 0;
}

.checkbox-item:hover {
    background-color: #f8f9fa;
}

.checkbox-item:last-child {
    border-bottom: none;
}

/* Basic checkbox inputs (removed; enhanced checkbox styling is defined later) */

/* Enhanced filter styling */
.filters-body { display: flex; flex-direction: column; gap: 20px; }
.filter-row { display: grid; grid-template-columns: 140px 1fr; align-items: center; gap: 12px; }
.filter-label { font-size: 1rem; font-weight: 600; color: #4b4f56; }
.filter-group { margin-bottom: 0; }

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.year-range { display: flex; align-items: center; gap: 8px; }

.year-range input {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
}

.year-range span {
    color: #6c757d;
    font-weight: 500;
}

.filter-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid #e9ecef; justify-content: flex-end; }
.dropdown { position: relative; }
.main-button { display:flex; align-items:center; width:100%; background:#fff; color:#1c1e21; padding:8px 12px; font-size:1rem; border:1px solid #ccd0d5; border-radius:6px; cursor:pointer; transition: background-color .2s, border-color .2s; }
.main-button .arrow { margin-left:auto; color:#606770; transition: transform .2s; }
.main-button.open .arrow { transform: rotate(180deg); }
.selected-text, .clear-btn { display:none; }
.has-selection .main-button { background:#e7f3ff; border-color:#1877f2; }
.has-selection .default-text { display:none; }
.has-selection .selected-text, .has-selection .clear-btn { display:inline-flex; align-items:center; }
.has-selection .selected-text { flex-grow:1; }
.has-selection .clear-btn { cursor:pointer; color:#606770; font-weight:bold; font-size:16px; padding:0 4px; margin:0 8px; }
.dropdown-content { display:none; flex-direction:column; position:absolute; background:#fff; width:100%; box-shadow:0 8px 16px rgba(0,0,0,.2); z-index:10; border-radius:6px; margin-top:5px; max-height:260px; border:1px solid #ddd; overflow:hidden; }
.dropdown-content.show { display:flex; }
.dropdown-list { padding:10px; overflow-y:auto; flex-grow:1; }
.dropdown-footer { padding:8px 12px; border-top:1px solid #e0e0e0; background:#f9f9f9; }
.clear-all-button { display:inline-flex; align-items:center; gap:6px; background:none; border:none; padding:4px; color:#8a8d91; cursor:pointer; font-size:.9rem; font-weight:500; transition: color .2s; }
.clear-all-button:hover { color:#343a40; }
.reset-all-btn { width:100%; background:#4b4f56; color:#fff; border:none; padding:12px; font-size:1rem; font-weight:600; border-radius:6px; cursor:pointer; margin-top:8px; }

.filter-actions .btn {
    flex: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .filter-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: none;
        border-radius: 8px 8px 0 0;
        margin: 0;
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .controls-container {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .timeline-section {
        order: 1;
        width: 100%;
    }
    
    .filters-section {
        order: 2;
        width: 100%;
        text-align: center;
    }
    
    .filter-content {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .filter-actions {
        flex-direction: column;
    }
    
    .year-range {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .year-range input {
        width: 100%;
    }
}

/* Animation for dropdowns */
.multi-select-dropdown {
    animation: slideDown 0.2s ease-out;
}

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

.filter-dropdown {
    animation: slideDown 0.2s ease-out;
}

/* Enhanced checkbox styling */
.checkbox-item input[type="checkbox"],
.dropdown-content input[type="checkbox"] {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1.5px solid #ccd0d5;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    box-sizing: border-box;
    vertical-align: middle;
    flex-shrink: 0;
}

.dropdown-content input[type="checkbox"],
.dropdown-content input[type="checkbox"]:hover,
.dropdown-content input[type="checkbox"]:checked {
    border-color: #8a8d91;
}

.checkbox-item input[type="checkbox"]:checked,
.dropdown-content input[type="checkbox"]:checked {
    background: #1877f2;
    border-color: #1877f2;
}

.checkbox-item input[type="checkbox"]:checked::after,
.dropdown-content input[type="checkbox"]:checked::after {
    content: "✓";
    position: absolute;
    top: -2px;
    left: 2px;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-item input[type="checkbox"]:hover {
    border-color: #8a8d91;
}

/* Loading overlay fix */
.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none; /* Hidden by default */
}

.map-loading.show {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #e3f2fd;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Compact stats */
.stats-compact {
    display: none;
}

.stat-compact span {
    font-weight: bold;
    color: #2c3e50;
}

/* Fix map height to prevent scrolling */
.main-container {
    height: calc(100vh - 84px) !important; /* accommodate new header */
    min-height: 400px;
}

/* Header styles from Option 2 white design */
.main-header {
    background-color: #ffffff;
    color: #1a202c;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.logo { font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 8px; color: #1a202c; }
.logo svg path { fill: #1a202c; }

/* Default single-row logo text for larger screens */
.logo-text {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    line-height: 1.2;
}

.stats-group { 
    display: flex; 
    gap: 24px; 
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    padding: 0 32px; 
    margin-left: 32px; 
}
.stat-item p { margin: 0; text-align: center; }
.stat-item .value { font-family: 'Playfair Display', serif; font-size: 26px; color: #1a202c; }
.stat-item .label { font-size: 11px; color: #718096; letter-spacing: 0.5px; }

.timeline-group { display: flex; align-items: center; gap: 8px; flex-grow: 1; margin: 0 16px 0 0; }
.timeline-group label { font-size: 13px; color: #718096; }
.timeline-group .timeline-slider { flex-grow: 1; }

.actions-group { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    flex-shrink: 0; /* Prevent actions from shrinking */
    margin-left: auto; /* Push buttons to the right */
    margin-right: 0.5rem; /* Minimal spacing from the edge */
}

/* Base styles for desktop-controls */
.desktop-controls {
    display: none; /* Hidden by default, shown in media queries */
}
.main-header .btn.header-primary,
.main-header .btn-primary { 
    background-color: #475569 !important; /* Dark blue-gray */
    color: white !important;
    border: none !important;
    padding: 0.5rem 1rem !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    line-height: 1.4 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: inline-block !important;
    text-align: center !important;
}
.main-header .btn.header-primary:hover,
.main-header .btn-primary:hover { 
    background-color: #334155 !important; /* Darker blue-gray on hover */
    transform: none !important; /* Remove any transform from other styles */
}
.profile-link { color: #4a5568; text-decoration: none; margin-left: 16px; font-size: 14px; border-bottom: 1px dotted #a0aec0; }

/* Log In button - very dark gray/black solid */
.main-header .btn-secondary {
    background-color: #1f2937 !important; /* Very dark gray */
    color: white !important;
    border: none !important;
    padding: 0.5rem 1rem !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    line-height: 1.4 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: inline-block !important;
    text-align: center !important;
}
.main-header .btn-secondary:hover {
    background-color: #111827 !important; /* Even darker on hover */
    transform: none !important; /* Remove any transform from other styles */
}

.stat-item .value[style*="color: #f56565;"] { color: #c53030 !important; }

/* Production-style button designs - Override all conflicting styles */
.main-header .btn.filters-toggle,
.main-header .filters-toggle {
    background: white !important;
    border: 1px solid #d1d5db !important; /* Light gray border */
    color: #374151 !important; /* Dark gray text */
    padding: 0.5rem 1rem !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    line-height: 1.4 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: inline-block !important;
    text-align: center !important;
}
.main-header .btn.filters-toggle:hover,
.main-header .filters-toggle:hover {
    background: #f9fafb !important; /* Very light gray hover */
    border-color: #9ca3af !important;
    transform: none !important; /* Remove any transform from other styles */
}

/* Make All years look like a chip button */
.timeline-stats {
    border: 1px solid #eef2f7;
    background: #f8fafc;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    color: #6c757d;
}
.timeline-stats:focus { outline: none; }

/* Fix timeline slider */
.timeline-handle {
    cursor: grab;
    z-index: 10;
}

.timeline-handle:active {
    cursor: grabbing;
}

.timeline-track {
    cursor: pointer;
}

/* Remove large stats dashboard */
.stats-dashboard {
    display: none;
}

/* Compact Popup Design - NEW IMPROVED VERSION */
.enhanced-popup {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-width: 280px;
    max-width: 320px;
}

.popup-header .mountain-name {
    margin: 0 0 0.5rem 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
}

.popup-header .mountain-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #666;
}

.climbing-info {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: #666;
}

.climbing-info .season,
.climbing-info .grade {
    background: #f8f9fa;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
}

/* Compact 4-column stats - UPDATED */
.popup-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Popup stat item base (removed; see enhanced color-coded stats below) */

.popup-stats .stat-item.danger {
    background: #fef5f5;
    border-color: #fed7d7;
}

.popup-stats .stat-item.danger .stat-number {
    color: #c53030;
}

/* Add spacing after View Details button */
/* Popup actions (duplicate removed; unified below) */

/* Update these sections in your enhanced-styles.css */

/* Add spacing after View Details button */
.popup-actions {
    margin-top: 1rem;
    margin-bottom: 0.75rem; /* Add bottom spacing */
}

/* Color-coded stats - make them more distinct */
.popup-stats .stat-item {
    text-align: center;
    padding: 0.75rem 0.5rem;
    border-radius: 6px;
    border: 1px solid #e0f2fe;
    transition: transform 0.2s ease;
}

/* Incidents - Blue */
.popup-stats .stat-item:nth-child(1) {
    background: #f0f9ff;
    border-color: #bfdbfe;
}

.popup-stats .stat-item:nth-child(1) .stat-number {
    color: #2563eb;
}

/* Fatalities - Red */
.popup-stats .stat-item:nth-child(2) {
    background: #fef5f5;
    border-color: #fed7d7;
}

.popup-stats .stat-item:nth-child(2) .stat-number {
    color: #dc2626;
}

/* Injuries - Orange */
.popup-stats .stat-item:nth-child(3) {
    background: #fffbf5;
    border-color: #fed7aa;
}

.popup-stats .stat-item:nth-child(3) .stat-number {
    color: #ea580c;
}

/* People - Green */
.popup-stats .stat-item:nth-child(4) {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.popup-stats .stat-item:nth-child(4) .stat-number {
    color: #16a34a;
}

/* Hover effect for stats */
.popup-stats .stat-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.popup-stats .stat-item.warning {
    background: #fffbf5;
    border-color: #fed7aa;
}

.popup-stats .stat-item.warning .stat-number {
    color: #d69e2e;
}

.popup-stats .stat-number {
    display: block;
    font-weight: bold;
    font-size: 1.2rem;
    color: #2b6cb0;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.popup-stats .stat-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    font-weight: 500;
}

/* Recent incidents - UPDATED */
.recent-incidents h4 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    color: #2c3e50;
    font-weight: 600;
}

.incident-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
}

.incident-year {
    font-weight: 600;
    color: #2c3e50;
    min-width: 40px;
}

.incident-type-badge {
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.incident-type-badge.type-fall {
    background: #fef5f5;
    color: #c53030;
}

.incident-type-badge.type-avalanche {
    background: #f0fff4;
    color: #38a169;
}

.incident-type-badge.type-weather {
    background: #f0f9ff;
    color: #2b6cb0;
}

.incident-type-badge.type-medical {
    background: #faf5ff;
    color: #805ad5;
}

.incident-type-badge.type-equipment {
    background: #fffbf5;
    color: #d69e2e;
}

.incident-people {
    color: #666;
    font-size: 0.8rem;
}

.sources-info {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f0f0f0;
}

.btn-details {
    width: 100%;
    background: #3498db;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-details:hover {
    background: #2980b9;
}

/* Leaflet popup adjustments */
.leaflet-popup-content-wrapper {
    border-radius: 4px;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.leaflet-popup-content {
    margin: 0;
    line-height: 1.4;
    width: 320px !important;
}

/* New Popup Design - Magazine Editorial Style */
.popup-card {
    width: 320px;
    background: #ffffff;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
    font-family: 'Lato', sans-serif;
}

.popup-header {
    padding: 20px 20px 16px 20px;
}

.popup-header h3 {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    margin: 0 0 4px 0;
    color: #1a202c;
}

.popup-header p {
    font-size: 14px;
    margin: 0;
    color: #4a5568;
}

.popup-body {
    padding: 0 20px;
}

.stat-block {
    display: flex;
    justify-content: space-between;
    text-align: center;
    padding: 16px 0;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.stat-item .number {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
}

.stat-item .label {
    font-size: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #718096;
    margin-top: 4px;
}

.details-section {
    padding: 16px 0;
    font-size: 14px;
}

.detail-group {
    margin-bottom: 16px;
}

.detail-group:last-child {
    margin-bottom: 0;
}

.detail-group .label {
    font-size: 12px;
    font-weight: 700;
    color: #718096;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.detail-group p {
    margin: 0 0 4px 0;
    color: #4a5568;
}

.detail-group strong {
    color: #1a202c;
}

.popup-footer {
    padding: 16px 20px;
    background-color: #f8fafc;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.popup-card .btn-primary {
    display: inline-block;
    text-align: center;
    background-color: #1a202c !important;
    color: white !important;
    padding: 12px 70px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.popup-card .btn-primary:hover {
    background-color: #2d3748 !important;
    color: white !important;
    text-decoration: none;
}

/* More specific targeting for popup spacing */
.leaflet-popup-content .popup-actions {
    margin-top: 1rem;
    margin-bottom: 1rem !important;
    padding-bottom: 0.5rem;
}

/* ========================================
   ENHANCED MOUNTAIN SLIDER STYLES
   ======================================== */

/* Enhanced Mountain Slider Container */
.mountain-slider {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 800px;
    height: 100vh;
    background: white;
    z-index: 1000;
    transition: right 0.3s ease;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.mountain-slider.active {
    right: 0;
}

.slider-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mountain-slider.active + .slider-overlay {
    opacity: 1;
    visibility: visible;
}

.slider-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Slider header styles removed - close button now integrated into hero section */

.slider-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Mountain Hero Section */
.mountain-hero {
    height: 220px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 60%), 
                url('https://images.unsplash.com/photo-1542224562-e2a2212204a2?q=80&w=1770&auto=format&fit=crop') 
                no-repeat center center;
    background-size: cover;
    color: white;
    padding: 0 24px 24px 24px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    position: relative;
    margin-top: 0;
}

.mountain-hero .close-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    z-index: 10;
}

.mountain-hero .close-btn:hover {
    background: rgba(0, 0, 0, 0.6);
}

.mountain-image {
    position: relative;
    margin: 0;
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.mountain-region {
    position: absolute;
    bottom: 60px;
    left: 0;
    margin: 0 0 4px;
    padding: 0;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 1px;
    opacity: 0.9;
}

.mountain-image h1 {
    position: absolute;
    bottom: 0;
    left: 0;
    font-family: 'Playfair Display', serif;
    margin: 0;
    padding: 0;
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
}

/* Content Tabs */
.mountain-content {
    padding: 0;
}

.content-tabs {
    display: flex;
    padding: 0 32px;
    border-bottom: 1px solid #e2e8f0;
    gap: 24px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.content-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    background: none;
    border: none;
    padding: 16px 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #718096;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: 'Lato', sans-serif;
}

.tab-btn:hover {
    color: #4a5568;
}

.tab-btn.active {
    color: #1a202c;
    border-bottom-color: #1a202c;
    font-weight: 700;
}

.tab-content {
    display: none;
    padding: 32px;
    min-height: 400px;
    background-color: #fdfdfd;
}

.tab-content.active {
    display: block;
}

/* Overview Tab Styles */
.overview-container {
    max-width: 100%;
}

.overview-hero {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.hero-stat {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.risk-assessment {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    border-left: 4px solid #28a745;
}

.risk-indicator {
    padding: 1rem;
    border-radius: 8px;
    background: #f8f9fa;
}

.risk-level {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.risk-message {
    color: #6c757d;
    margin-bottom: 1rem;
}

.risk-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.overview-sections {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.overview-section h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.recent-incidents-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recent-incident {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    border-left: 4px solid #3498db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.incident-date {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.incident-type {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.incident-summary {
    color: #495057;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.incident-outcomes {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
}

.outcome-fatal {
    color: #dc3545;
    font-weight: 500;
}

.outcome-injury {
    color: #fd7e14;
    font-weight: 500;
}

.safety-highlights {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.safety-highlight {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 0.75rem;
    font-size: 0.9rem;
    color: #856404;
}

/* Incidents Tab Styles */
.incidents-container {
    max-width: 100%;
}

.incidents-header {
    margin-bottom: 2rem;
}

.incidents-header h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.incidents-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.search-box input {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 200px;
}

.filter-controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-controls select {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
}

.incidents-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.incident-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #dee2e6;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.incident-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.incident-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.incident-date {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

.incident-type {
    background: #e3f2fd;
    color: #1976d2;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.incident-route {
    background: #f3e5f5;
    color: #7b1fa2;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.incident-summary {
    margin-bottom: 1rem;
    color: #495057;
    line-height: 1.5;
}

.incident-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.stat-fatal {
    color: #dc3545;
    font-weight: 500;
    font-size: 0.9rem;
}

.stat-injury {
    color: #fd7e14;
    font-weight: 500;
    font-size: 0.9rem;
}

.stat-people {
    color: #6c757d;
    font-size: 0.9rem;
}

.incident-people,
.incident-sources {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
}

.incident-people h5,
.incident-sources h5 {
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.person-summary {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    flex-wrap: wrap;
}

.person-name {
    font-weight: 500;
    color: #2c3e50;
}

.person-age {
    color: #6c757d;
}

.person-country {
    color: #6c757d;
}

.person-outcome {
    padding: 0.125rem 0.5rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
}

.outcome-fatal {
    background: #f8d7da;
    color: #721c24;
}

.outcome-injured {
    background: #fff3cd;
    color: #856404;
}

.outcome-rescued {
    background: #d1ecf1;
    color: #0c5460;
}

.outcome-unharmed {
    background: #d4edda;
    color: #155724;
}

.source-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    align-items: center;
}

.source-name {
    font-weight: 500;
    color: #2c3e50;
}

.source-type {
    color: #6c757d;
}

.source-link {
    color: #3498db;
    text-decoration: none;
}

.source-link:hover {
    text-decoration: underline;
}

.more-people,
.more-sources {
    font-size: 0.8rem;
    color: #6c757d;
    font-style: italic;
}

/* Statistics Tab Styles */
.stats-container {
    max-width: 100%;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat-chart {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-chart h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.stat-chart canvas {
    max-height: 300px;
}

.demographics-section,
.route-analysis {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.demographics-section h4,
.route-analysis h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.demographics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.demo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.demo-card {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.demo-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.demo-label {
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.demo-section {
    margin-bottom: 1.5rem;
}

.demo-section h5 {
    color: #495057;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.demo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.demo-name {
    color: #2c3e50;
    font-weight: 500;
}

.demo-count {
    color: #6c757d;
    font-weight: 600;
}

.route-analysis-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.route-analysis-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.route-name {
    font-weight: 600;
    color: #2c3e50;
}

.route-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
}

.route-stat {
    color: #6c757d;
}

.route-stat.danger {
    color: #dc3545;
    font-weight: 500;
}

.route-stat.warning {
    color: #fd7e14;
    font-weight: 500;
}

/* Routes Tab Styles */
.routes-container {
    max-width: 100%;
}

.routes-header {
    margin-bottom: 2rem;
}

.routes-header h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.routes-info p {
    color: #6c757d;
    margin: 0;
}

.routes-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.route-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
}

.route-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.route-name {
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.route-risk {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.route-risk.low {
    background: #d4edda;
    color: #155724;
}

.route-risk.medium {
    background: #fff3cd;
    color: #856404;
}

.route-risk.high {
    background: #f8d7da;
    color: #721c24;
}

.route-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.route-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
}

.stat-value {
    font-weight: 600;
    color: #2c3e50;
}

.stat-value.danger {
    color: #dc3545;
}

.stat-value.warning {
    color: #fd7e14;
}

.route-recommendations {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.route-recommendations h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.recommendations-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recommendation-item {
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 1rem;
    border-radius: 0 6px 6px 0;
    font-size: 0.9rem;
    color: #495057;
}

/* Safety Tab Styles */
.safety-container {
    max-width: 100%;
}

.safety-header {
    margin-bottom: 2rem;
}

.safety-header h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.safety-alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.safety-alert.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.safety-alert.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.safety-alert.danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.safety-sections {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.safety-section {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.safety-section h4 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.risk-factors-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.risk-factor {
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #6c757d;
}

.risk-factor.high {
    background: #f8d7da;
    border-left-color: #dc3545;
}

.risk-factor.medium {
    background: #fff3cd;
    border-left-color: #fd7e14;
}

.risk-factor.low {
    background: #d4edda;
    border-left-color: #28a745;
}

.risk-factor-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.risk-factor-description {
    color: #495057;
    font-size: 0.9rem;
    line-height: 1.4;
}

.emergency-procedures {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.emergency-procedure {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #dc3545;
}

.emergency-procedure h5 {
    color: #dc3545;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.procedure-content {
    color: #495057;
    font-size: 0.9rem;
    line-height: 1.5;
}

.procedure-content ul,
.procedure-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.procedure-content li {
    margin-bottom: 0.25rem;
}

.gear-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.gear-category {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.gear-category h5 {
    color: #2c3e50;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}

.gear-category ul {
    margin: 0;
    padding-left: 1.5rem;
}

.gear-category li {
    color: #495057;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.weather-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.weather-consideration {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #17a2b8;
}

.weather-consideration h5 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.weather-consideration p {
    color: #495057;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* No Data States */
.no-data {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .mountain-slider {
        width: 100%;
        max-width: 100%;
    }
    
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .content-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    
    .tab-btn {
        min-width: 100px;
        padding: 0.75rem 1rem;
        font-size: 0.8rem;
    }
    
    .incidents-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box input {
        min-width: 100%;
    }
    
    .filter-controls {
        justify-content: stretch;
    }
    
    .filter-controls select {
        flex: 1;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .route-stats {
        grid-template-columns: 1fr;
    }
    
    .route-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .demo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .incident-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .person-summary {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .hero-stats {
        grid-template-columns: 1fr;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .demo-grid {
        grid-template-columns: 1fr;
    }
    
    .tab-content {
        padding: 1rem;
    }
    
    .mountain-hero {
        padding: 1rem;
    }
    
    .overview-hero {
        padding: 1rem;
    }
}

/* Map Toggle Button Styles */
.leaflet-control-custom {
    background: white;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 0;
    margin: 0;
    z-index: 1000;
    position: relative;
}

.map-toggle-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    min-width: 80px;
    justify-content: center;
}

.map-toggle-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.map-toggle-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.toggle-icon {
    font-size: 14px;
}

.toggle-text {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Mountain marker text adjustments for names */
.mountain-marker-text {
    font-size: 10px;
    font-weight: bold;
    text-align: center;
    line-height: 1;
    word-break: break-word;
    max-width: 60px; /* Increased from 26px to accommodate full names */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* When showing names, make markers larger */
.mountain-marker-custom .mountain-marker {
    min-width: 60px; /* Increased from 30px */
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* ========================================
   NEW MAGAZINE-EDITORIAL DESIGN STYLES
   ======================================== */

/* Overview Tab Styles */
.overview-main {
    display: flex;
    gap: 32px;
}

.overview-left {
    flex: 2;
}

.overview-right {
    flex: 1;
    border-left: 2px solid #e2e8f0;
    padding-left: 32px;
}

.mountain-description p {
    margin: 0;
    font-size: 15px;
    color: #4a5568;
    line-height: 1.7;
    margin-bottom: 28px;
}

.overview-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 28px;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    padding: 20px 0;
}

.overview-stats .stat-item {
    text-align: center;
}

.overview-stats .stat-number {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 4px;
}

.overview-stats .stat-number.fatalities {
    color: #c53030;
}

.overview-stats .stat-number.injuries {
    color: #b7791f;
}

.overview-stats .stat-label {
    display: block;
    font-size: 12px;
    color: #718096;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.recent-events h3 {
    margin: 0 0 16px;
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 700;
    color: #1a202c;
}

.recent-incident {
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 16px;
}

.recent-incident:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.incident-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.incident-date {
    font-weight: bold;
    color: #1a202c;
}

.incident-description {
    color: #4a5568;
    line-height: 1.6;
    padding-right: 16px;
}

.incident-outcomes {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.outcome-fatal {
    color: #c53030;
    font-weight: bold;
}

.outcome-injury {
    color: #b7791f;
    font-weight: bold;
}

.incident-type {
    font-size: 13px;
    color: #718096;
}

.mountain-details .detail-group {
    margin-bottom: 20px;
}

.detail-label {
    font-size: 12px;
    color: #718096;
    letter-spacing: 0.5px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.detail-value {
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    color: #1a202c;
    margin-bottom: 20px;
}

.detail-info p {
    margin: 0 0 4px 0;
    font-size: 15px;
    color: #4a5568;
}

.detail-info strong {
    color: #1a202c;
}

/* Incidents Tab Styles */
.incidents-container {
    background-color: #f8fafc;
}

.incidents-filters {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 24px;
}

.incidents-filters input,
.incidents-filters select {
    flex-grow: 1;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-family: 'Lato', sans-serif;
    background-color: white;
    color: #4a5568;
}

.incident-card {
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    margin-bottom: 16px;
    padding: 20px;
}

.incident-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.incident-date {
    font-size: 13px;
    font-weight: bold;
    color: #1a202c;
}

.incident-tags {
    display: flex;
    gap: 8px;
}

.incident-type-tag,
.incident-route-tag {
    font-size: 11px;
    color: #4a5568;
    background-color: #e2e8f0;
    padding: 2px 8px;
    border-radius: 10px;
}

.incident-description p {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.6;
    color: #4a5568;
}

.incident-people {
    border-top: 1px solid #f1f5f9;
    padding-top: 12px;
}

.people-label {
    font-size: 12px;
    color: #718096;
    font-weight: bold;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.person-item {
    font-size: 14px;
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.person-flag {
    margin-right: 8px;
}

.person-name {
    margin-right: 4px;
}

.person-age {
    color: #718096;
    margin-right: 4px;
}

.person-outcome {
    margin-left: 6px;
}

.person-outcome.fatality {
    color: #c53030;
    font-weight: bold;
}

.person-outcome.injured {
    color: #b7791f;
    font-weight: bold;
}

.more-people {
    font-size: 12px;
    color: #718096;
    font-style: italic;
}

/* Statistics Tab Styles */
.stats-container {
    background-color: #f8fafc;
}

.stats-overview {
    display: flex;
    justify-content: space-between;
    text-align: center;
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    padding: 20px;
    margin-bottom: 24px;
}

.stats-overview .stat-item {
    flex: 1;
}

.stats-overview .stat-number {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 4px;
}

.stats-overview .stat-label {
    font-size: 12px;
    color: #718096;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.charts-row {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
}

.chart-container {
    flex: 1;
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    padding: 24px;
}

.chart-container h3 {
    margin: 0 0 20px;
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 700;
    color: #1a202c;
}

.pie-chart-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 20px;
}

.pie-chart {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    position: relative;
}

.pie-chart-visual {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
}

.pie-chart-visual::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.chart-legend {
    font-size: 13px;
    color: #4a5568;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-left: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
}

.legend-color {
    height: 12px;
    width: 12px;
    border-radius: 3px;
    margin-right: 8px;
}

.bar-chart-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 150px;
    border-left: 2px solid #e2e8f0;
    border-bottom: 2px solid #e2e8f0;
    padding-left: 12px;
    gap: 8px;
}

.bar-item {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
}

.bar-fill {
    width: 100%;
    background-color: #4a5568;
    transition: height 0.3s ease;
}

.bar-chart-labels {
    display: flex;
    justify-content: space-between;
    border-left: 2px solid transparent;
    padding-left: 12px;
    gap: 8px;
    margin-top: 8px;
    font-size: 11px;
    color: #718096;
}

.bar-label {
    width: 100%;
    text-align: center;
}

.route-analysis-table {
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    padding: 24px;
}

.route-analysis-table h3 {
    margin: 0 0 20px;
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 700;
    color: #1a202c;
}

.route-analysis-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.route-analysis-table thead {
    text-align: left;
    color: #718096;
}

.route-analysis-table th {
    padding: 8px 4px;
    font-size: 12px;
    border-bottom: 2px solid #e2e8f0;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.route-analysis-table tbody {
    color: #4a5568;
}

.route-analysis-table td {
    padding: 12px 4px;
    border-bottom: 1px solid #f1f5f9;
}

.route-name {
    font-weight: bold;
    color: #1a202c;
}

.route-fatalities {
    color: #c53030;
    font-weight: bold;
}

/* Photos Tab Styles */
.photos-container {
    background-color: #f8fafc;
}

.photos-header {
    margin-bottom: 24px;
}

.photos-header h3 {
    margin: 0 0 8px;
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 700;
    color: #1a202c;
}

.photos-header p {
    margin: 0;
    color: #4a5568;
    font-size: 14px;
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.photo-item {
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.photo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.photo-image {
    width: 100%;
    height: 150px;
    overflow: hidden;
}

.photo-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-info {
    padding: 12px;
}

.photo-info h4 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: #1a202c;
}

.photo-info p {
    margin: 0 0 8px;
    font-size: 12px;
    color: #4a5568;
    line-height: 1.4;
}

.photo-date {
    font-size: 11px;
    color: #718096;
}

.photos-upload {
    text-align: center;
    padding: 20px;
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 3px;
}

/* Global button styles - overridden by header-specific styles */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: #1a202c;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn:hover {
    background-color: #2d3748;
}

.btn-primary {
    background-color: #1a202c;
}

.btn-primary:hover {
    background-color: #2d3748;
}

/* ========================================
   MOBILE FABs & FLOATING ACTION BUTTONS
   ======================================== */

/* Mobile FABs */
.fab-container {
    position: fixed;
    right: 2rem; /* 32px */
    bottom: 2rem; /* 32px */
    z-index: 1000;
    display: none;
    flex-direction: column;
    gap: 1rem; /* 16px */
    pointer-events: none;
}

/* Ensure FABs are within viewport on mobile */
@media (max-width: 768px) {
    .fab-container {
        right: 2rem !important;
        bottom: 2rem !important;
    }
}

.fab {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border-radius: 50%;
    position: fixed;
    right: 2rem; /* 32px */
    pointer-events: auto;
}

.fab:hover {
    transform: scale(1.05);
}

/* Primary "Add" button */
.fab-main {
    width: 48px;
    height: 48px;
    background-color: #c53030;
    color: white;
    /* Remove dark shadow/markings for a cleaner look */
    box-shadow: none !important;
    bottom: 60vh;
    border: none;
    outline: none;
}

/* Dark, contained secondary buttons */
.fab-dark {
    background-color: #1a202c;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Standard size for Search */
.fab-standard {
    width: 48px;
    height: 48px;
    bottom: calc(2rem + 48px + 1rem); /* Positioned above the large FAB */
    right: 2rem; /* Aligned with other FABs */
}

/* Large size for Filter */
.fab-large {
    width: 48px;
    height: 48px;
    bottom: 2rem;
}

/* Left FAB container */
.fab-left {
    left: 16px !important;
    right: auto !important;
}

/* ========================================
   DESKTOP LAYOUT & RESPONSIVE CONTROLS
   ======================================== */

/* CRITICAL: Desktop layout preservation - inline styles for highest priority */
@media (min-width: 769px) {
    .main-header {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        padding: 0.75rem 1.5rem !important;
        gap: 1rem !important;
    }
    
    .logo {
        margin-right: 0 !important;
    }
    
    .stats-group {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .desktop-controls {
        display: flex !important;
        align-items: center !important;
        gap: 1rem !important;
        margin-left: 0 !important;
        flex-wrap: nowrap !important;
        flex: 1 1 auto !important; /* Allow desktop controls to grow */
        width: 100% !important; /* Take full width */
        justify-content: space-between !important; /* Distribute space */
    }
    
    .timeline-group {
        margin-left: 0 !important;
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        flex: 1 1 auto !important; /* Allow timeline to grow and fill available space */
        min-width: 200px !important; /* Reduced minimum width */
        max-width: none !important; /* Remove max-width constraint */
    }

    .timeline-range-display { white-space: nowrap !important; }
    .timeline-stats { white-space: nowrap !important; }
    
    /* ensure the slider can grow and is visible */
    .timeline-group .timeline-slider {
        flex: 1 1 auto !important;
        min-width: 120px !important; /* Reduced minimum width */
        max-width: none !important; /* Remove max-width constraint */
        overflow: visible !important;
    }
    
    .fab-container {
        display: none !important;
    }
}

/* Hide mobile elements on desktop */
@media (min-width: 769px) {
    .mobile-right { display: none !important; }
    .mobile-logo-separator { display: none !important; }
}

/* Mobile layout - only for mobile devices */
@media (max-width: 768px) {
    /* Tunable mobile spacing variables */
    :root {
        --mobile-gap-main: 6px;           /* space between logo, separator, stats, login */
        --mobile-sep-sides: 16px;          /* horizontal margin around the separator */
        --mobile-stats-left: -34px;         /* EXTRA space between separator and stats */
    }
    .main-header {
        flex-direction: row !important;
        gap: var(--mobile-gap-main) !important; /* uses variable */
        padding: 12px 16px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    
    .logo {
        margin-right: 0 !important; /* Remove auto margin */
        flex-shrink: 0 !important;
        /* Remove any desktop separators */
        border-right: none !important;
    }
    
    .logo::after,
    .logo::before {
        display: none !important;
    }
    
    /* Mobile separator between logo and stats */
    .mobile-logo-separator {
        width: 1px !important;
        height: 40px !important;
        background: #e5e7eb !important; /* gray-200 */
        margin: 0 var(--mobile-sep-sides) !important; /* tunable */
        flex-shrink: 0 !important;
    }
    /* Direct control over spacing between separator and stats */
    .mobile-logo-separator + .stats-group {
        margin-left: var(--mobile-stats-left) !important;
    }
    
    /* Force mobile stats positioning - override all other rules */
    .main-header .stats-group {
        margin-left: var(--mobile-stats-left) !important;
    }
    
    /* Mobile right group (separator + login button) */
    .mobile-right {
        display: flex !important;
        align-items: center !important;
        margin-left: 6px !important; /* Reduced spacing */
        gap: 4px !important; /* Reduced gap */
        flex-shrink: 0 !important;
    }
    .header-separator {
        width: 1px !important;
        height: 40px !important;
        background: #e5e7eb !important; /* gray-200 */
        margin-right: 2px !important; /* Reduced margin */
    }
    .login-btn {
        color: #4b5563 !important; /* gray-600 */
        padding: 6px !important;
        border-radius: 9999px !important;
        line-height: 0 !important;
        transition: color 0.2s ease !important;
        border: none !important;
        background: transparent !important;
    }
    .login-btn:hover { color: #000000 !important; }
    
    /* Mobile profile button styling */
    .profile-btn {
        color: #4b5563 !important; /* gray-600 */
        padding: 6px !important;
        border-radius: 9999px !important;
        line-height: 0 !important;
        transition: color 0.2s ease !important;
        border: none !important;
        background: transparent !important;
    }
    .profile-btn:hover { color: #000000 !important; }

    .stats-group {
        flex: 1 1 auto !important; /* allow stats to shrink so login stays visible */
        min-width: 0 !important;
        gap: 6px !important; /* Reduced gap between stat items */
        /* margin-left controlled by .mobile-logo-separator + .stats-group rule */
        justify-content: center !important;
        /* Remove any desktop separators */
        border-left: none !important;
        border-right: none !important;
    }
    
    .stats-group::before,
    .stats-group::after {
        display: none !important;
    }
    
    .desktop-controls {
        display: none !important;
    }
    
    .fab-container {
        display: flex !important;
    }
    
    .stat-item {
        text-align: center !important;
    }
    
    .stat-item .value {
        font-size: 1.5rem !important;
        font-weight: 700 !important;
    }
    
    .stat-item .label {
        font-size: 0.75rem !important;
        font-weight: 600 !important;
        letter-spacing: 0.5px !important;
    }
}

/* Fix mobile viewport issues */
@media (max-width: 768px) {
    body {
        overflow-x: hidden !important;
    }
    
    .main-header {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    
    .stats-group {
        flex-shrink: 0 !important;
    }
    
    .stat-item {
        flex-shrink: 0 !important;
        min-width: 0 !important;
    }
    
    .stat-item .value {
        font-size: 1.2rem !important;
    }
    
    .stat-item .label {
        font-size: 0.7rem !important;
    }
}

/* Single-row logo for most screens, two-row only for very small screens */
@media (max-width: 480px) {
    .logo {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 6px !important;
        margin-right: 0 !important;
    }
    
    .logo svg {
        margin-bottom: 0 !important;
        flex-shrink: 0 !important;
        width: 20px !important;
        height: 20px !important;
    }
    
    .logo-text {
        display: flex !important;
        flex-direction: column !important;
        line-height: 1.0 !important;
        font-size: 0.8rem !important;
    }
}

/* Keep single-row logo for medium screens */
@media (min-width: 481px) and (max-width: 768px) {
    .logo {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
        margin-right: 0 !important;
    }
    
    .logo svg {
        margin-bottom: 0 !important;
        flex-shrink: 0 !important;
    }
    
    .logo-text {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 4px !important;
        line-height: 1.2 !important;
        font-size: 0.9rem !important;
    }
}

/* ========================================
   AUTHENTICATION & USER INTERFACE
   ======================================== */

/* Header Actions & Authentication Styles */
.header-actions { 
    display: flex; 
    align-items: center; 
    gap: 0.75rem; 
}

.header-actions .spacer { 
    flex: 1; 
}

.header-actions .quick-add .btn { 
    margin: 0; 
}

.header-actions .user-info { 
    display: flex; 
    align-items: center; 
    gap: 0.5rem; 
}

.header-actions .user-name { 
    color: #e6edf3; 
    opacity: 0.85; 
}

.modal-medium { 
    max-width: 640px; 
}

.profile-content { 
    padding: 1rem; 
    display: grid; 
    gap: 1rem; 
}

.profile-info { 
    display: grid; 
    gap: 0.5rem; 
}

.profile-row { 
    color: #2c3e50; 
}

.profile-actions { 
    display: flex; 
    justify-content: flex-end; 
}

.contrib-list { 
    display: grid; 
    gap: 0.5rem; 
}

.contrib-item { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 0.5rem 0.75rem; 
    border: 1px solid #e9ecef; 
    border-radius: 6px; 
    background: #fff; 
}

.contrib-item .meta { 
    color: #6b7280; 
    font-size: 0.85rem; 
}

.contrib-empty { 
    color: #6b7280; 
    font-style: italic; 
}

/* Authentication Required Content */
.auth-required-content {
    padding: 1.25rem;
}

.auth-main {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.auth-text {
    flex: 1;
}

.auth-text p {
    margin: 0;
    color: #4b5563;
    font-size: 0.9rem;
    line-height: 1.5;
}

.auth-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 0;
}

.auth-icon svg {
    width: 16px;
    height: 16px;
    color: #64748b;
    stroke-width: 1.5;
}

.auth-benefits-compact {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.25rem;
}

.auth-benefits-compact h4 {
    margin: 0 0 0.75rem 0;
    color: #1f2937;
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: #374151;
}

.benefit-item:last-child {
    margin-bottom: 0;
}

.benefit-check {
    width: 16px;
    height: 16px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 600;
    flex-shrink: 0;
}

.auth-benefits {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    margin: 1.5rem 0;
    text-align: left;
}

.auth-benefits h4 {
    margin: 0 0 0.75rem 0;
    color: #2c3e50;
    font-size: 1rem;
}

.auth-benefits ul {
    margin: 0;
    padding-left: 1rem;
    list-style: none;
}

.auth-benefits li {
    margin: 0.5rem 0;
    color: #555;
}

.auth-actions {
    display: flex;
    gap: 0.75rem;
    margin: 0;
}

.auth-actions .btn {
    flex: 1;
    padding: 0.75rem 1rem;
    font-weight: 600;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.auth-actions .btn-primary {
    background: linear-gradient(135deg, #475569 0%, #334155 100%);
    border: none;
    color: white;
}

.auth-actions .btn-primary:hover {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(71, 85, 105, 0.3);
}

.auth-actions .btn-secondary {
    background: white;
    border: 2px solid #e5e7eb;
    color: #374151;
}

.auth-actions .btn-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.auth-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.auth-footer small {
    color: #888;
    font-size: 0.8rem;
    line-height: 1.4;
}

.btn-block {
    display: block;
    width: 100%;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-group input.error {
    border-color: #dc3545;
}

.field-error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-actions {
    margin-top: 1.5rem;
}

.form-footer {
    text-align: center;
    margin-top: 1rem;
}

.form-footer a {
    color: #007bff;
    text-decoration: none;
    font-size: 0.9rem;
}

.form-footer a:hover {
    text-decoration: underline;
}

.form-message {
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.form-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.form-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* CRITICAL: Desktop layout preservation - inline styles for highest priority */
@media (min-width: 769px) {
    .main-header {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        padding: 0.75rem 1.5rem !important;
        gap: 1rem !important;
    }
    
    .logo {
        margin-right: 0 !important;
    }
    
    .stats-group {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .desktop-controls {
        display: flex !important;
        align-items: center !important;
        gap: 1rem !important;
        margin-left: 0 !important;
        flex-wrap: nowrap !important;
        flex: 1 1 auto !important; /* Allow desktop controls to grow */
        width: 100% !important; /* Take full width */
        justify-content: space-between !important; /* Distribute space */
    }
    
    .timeline-group {
        margin-left: 0 !important;
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        flex: 1 1 auto !important; /* Allow timeline to grow and fill available space */
        min-width: 200px !important; /* Reduced minimum width */
        max-width: none !important; /* Remove max-width constraint */
    }

    .timeline-range-display { white-space: nowrap !important; }
    .timeline-stats { white-space: nowrap !important; }
    
    /* ensure the slider can grow and is visible */
    .timeline-group .timeline-slider {
        flex: 1 1 auto !important;
        min-width: 120px !important; /* Reduced minimum width */
        max-width: none !important; /* Remove max-width constraint */
        overflow: visible !important;
    }
    
    .fab-container {
        display: none !important;
    }
}

@media (max-width: 768px) {
    /* Tunable mobile spacing variables */
    :root {
        --mobile-gap-main: 6px;           /* space between logo, separator, stats, login */
        --mobile-sep-sides: 16px;          /* horizontal margin around the separator */
        --mobile-stats-left: -34px;         /* EXTRA space between separator and stats */
    }
    .main-header {
        flex-direction: row !important;
        gap: var(--mobile-gap-main) !important; /* uses variable */
        padding: 12px 16px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    
    .logo {
        margin-right: 0 !important; /* Remove auto margin */
        flex-shrink: 0 !important;
        /* Remove any desktop separators */
        border-right: none !important;
    }
    
    .logo::after,
    .logo::before {
        display: none !important;
    }
    
    /* Mobile separator between logo and stats */
    .mobile-logo-separator {
        width: 1px !important;
        height: 40px !important;
        background: #e5e7eb !important; /* gray-200 */
        margin: 0 var(--mobile-sep-sides) !important; /* tunable */
        flex-shrink: 0 !important;
    }
    /* Direct control over spacing between separator and stats */
    .mobile-logo-separator + .stats-group {
        margin-left: var(--mobile-stats-left) !important;
    }
    
    /* Force mobile stats positioning - override all other rules */
    .main-header .stats-group {
        margin-left: var(--mobile-stats-left) !important;
    }
    
    /* Mobile right group (separator + login button) */
    .mobile-right {
        display: flex !important;
        align-items: center !important;
        margin-left: 6px !important; /* Reduced spacing */
        gap: 4px !important; /* Reduced gap */
        flex-shrink: 0 !important;
    }
    .header-separator {
        width: 1px !important;
        height: 40px !important;
        background: #e5e7eb !important; /* gray-200 */
        margin-right: 2px !important; /* Reduced margin */
    }
    .login-btn {
        color: #4b5563 !important; /* gray-600 */
        padding: 6px !important;
        border-radius: 9999px !important;
        line-height: 0 !important;
        transition: color 0.2s ease !important;
        border: none !important;
        background: transparent !important;
    }
    .login-btn:hover { color: #000000 !important; }
    
    /* Mobile profile button styling */
    .profile-btn {
        color: #4b5563 !important; /* gray-600 */
        padding: 6px !important;
        border-radius: 9999px !important;
        line-height: 0 !important;
        transition: color 0.2s ease !important;
        border: none !important;
        background: transparent !important;
    }
    .profile-btn:hover { color: #000000 !important; }

    .stats-group {
        flex: 1 1 auto !important; /* allow stats to shrink so login stays visible */
        min-width: 0 !important;
        gap: 6px !important; /* Reduced gap between stat items */
        /* margin-left controlled by .mobile-logo-separator + .stats-group rule */
        justify-content: center !important;
        /* Remove any desktop separators */
        border-left: none !important;
        border-right: none !important;
    }
    
    .stats-group::before,
    .stats-group::after {
        display: none !important;
    }
    
    .desktop-controls {
        display: none !important;
    }
    
    .fab-container {
        display: flex !important;
    }
    
    
    .stat-item {
        text-align: center !important;
    }
    
    .stat-item .value {
        font-size: 1.5rem !important;
        font-weight: 700 !important;
    }
    
    .stat-item .label {
        font-size: 0.75rem !important;
        font-weight: 600 !important;
        letter-spacing: 0.5px !important;
    }
}

/* Hide mobile elements on desktop */
@media (min-width: 769px) {
    .mobile-right { display: none !important; }
    .mobile-logo-separator { display: none !important; }
}

/* Mobile FABs */
.fab-container {
    position: fixed;
    right: 2rem; /* 32px */
    bottom: 2rem; /* 32px */
    z-index: 1000;
    display: none;
    flex-direction: column;
    gap: 1rem; /* 16px */
    pointer-events: none;
}

/* Ensure FABs are within viewport on mobile */
@media (max-width: 768px) {
    .fab-container {
        right: 2rem !important;
        bottom: 2rem !important;
    }
}

/* Fix mobile viewport issues */
@media (max-width: 768px) {
    body {
        overflow-x: hidden !important;
    }
    
    .main-header {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    
    .stats-group {
        flex-shrink: 0 !important;
    }
    
    .stat-item {
        flex-shrink: 0 !important;
        min-width: 0 !important;
    }
    
    .stat-item .value {
        font-size: 1.2rem !important;
    }
    
    .stat-item .label {
        font-size: 0.7rem !important;
    }
}

.fab {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border-radius: 50%;
    position: fixed;
    right: 2rem; /* 32px */
    pointer-events: auto;
}

.fab:hover {
    transform: scale(1.05);
}

/* Primary "Add" button */
.fab-main {
    width: 48px;
    height: 48px;
    background-color: #c53030;
    color: white;
    /* Remove dark shadow/markings for a cleaner look */
    box-shadow: none !important;
    bottom: 60vh;
    border: none;
    outline: none;
}

/* Dark, contained secondary buttons */
.fab-dark {
    background-color: #1a202c;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Standard size for Search */
.fab-standard {
    width: 48px;
    height: 48px;
    bottom: calc(2rem + 48px + 1rem); /* Positioned above the large FAB */
    right: 2rem; /* Aligned with other FABs */
}

/* Large size for Filter */
.fab-large {
    width: 48px;
    height: 48px;
    bottom: 2rem;
}

/* Left FAB container */
.fab-left {
    left: 16px !important;
    right: auto !important;
}

/* Two-row logo for mobile */
@media (max-width: 768px) {
    .logo {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
        margin-right: 0 !important;
    }
    
    .logo svg {
        margin-bottom: 0 !important;
        flex-shrink: 0 !important;
    }
    
    .logo-text {
        display: flex !important;
        flex-direction: column !important;
        line-height: 1.1 !important;
        font-size: 0.9rem !important;
    }
}


/* ========================================
   SEARCH MODAL COMPONENTS
   ======================================== */

/* Search Modal Styles - Editorial/Magazine Design */
.search-modal .modal-content,
.modal-search {
    max-width: 480px !important;
    max-height: 70vh !important;
    overflow: hidden !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid #e5e7eb !important;
    background: white !important;
    margin: 2rem auto !important;
    width: 90% !important;
}

.search-modal .modal-header,
.modal-search .modal-header {
    padding: 1.5rem 1.5rem 0.75rem 1.5rem !important;
    border-bottom: 1px solid #f3f4f6 !important;
    background: linear-gradient(135deg, #fafbfc 0%, #f8fafc 100%) !important;
    border-radius: 12px 12px 0 0 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.search-modal .modal-header h2,
.modal-search .modal-header h2 {
    font-family: 'Playfair Display', serif !important;
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    color: #1a202c !important;
    margin: 0 !important;
    letter-spacing: -0.02em !important;
}

.search-modal .modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-modal .modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.search-modal .search-content,
.modal-search .search-content {
    padding: 1.5rem !important;
    background: white !important;
}

.search-input-container {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-input-container input {
    width: 100%;
    padding: 1rem 3rem 1rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 400;
    color: #1f2937;
    background: #fafbfc;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.search-input-container input:focus {
    outline: none;
    border-color: #475569;
    background: white;
    box-shadow: 0 0 0 4px rgba(71, 85, 105, 0.1);
    transform: translateY(-1px);
}

.search-input-container input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
    width: 18px;
    height: 18px;
    transition: color 0.2s ease;
}

.search-input-container input:focus + .search-icon {
    color: #475569;
}

.search-results {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.search-result-item {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.search-result-item.selected {
    background: linear-gradient(135deg, #f0fdfa 0%, #ecfdf5 100%);
    border-left: 4px solid #10b981;
    transform: translateX(4px);
}

.search-result-item .mountain-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    letter-spacing: -0.01em;
}

.search-result-item .mountain-details {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.search-result-item .mountain-stats {
    text-align: right;
    font-size: 0.8rem;
    color: #9ca3af;
}

.search-result-item .incident-count {
    font-weight: 600;
    color: #dc2626;
}

/* Match Type Indicators */
.search-result-item[data-match-type="exact"] {
    border-left: 4px solid #10b981;
}

.search-result-item[data-match-type="prefix"] {
    border-left: 4px solid #3b82f6;
}

.search-result-item[data-match-type="word"] {
    border-left: 4px solid #ffc107;
}

.search-result-item[data-match-type="fuzzy"] {
    border-left: 4px solid #6c757d;
}

.search-result-item[data-match-type="contains"] {
    border-left: 4px solid #007bff;
}

.search-result-item[data-match-type="fallback"] {
    border-left: 4px solid #fd7e14;
}

.search-result-info {
    flex: 1;
}

.search-result-name {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.search-result-details {
    font-size: 0.875rem;
    color: #718096;
    display: flex;
    gap: 1rem;
}

/* Desktop layout - country in details section */
.search-result-name {
    display: block;
}

.search-result-country {
    display: none; /* Hide mobile country on desktop */
}

.search-result-country-desktop {
    display: block; /* Show desktop country */
}

.search-result-stats {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.search-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
}

.search-stat-number {
    font-weight: 600;
    color: #2d3748;
}

.search-stat-label {
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.search-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f3f4f6;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    font-style: italic;
}

.search-no-results {
    padding: 2rem 1.5rem;
    text-align: center;
    color: #9ca3af;
}

.search-no-results .no-results-icon {
    width: 40px;
    height: 40px;
    margin: 0 auto 0.75rem auto;
    color: #d1d5db;
}

.search-no-results h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: #6b7280;
    margin: 0 0 0.5rem 0;
    font-weight: 500;
}

.search-no-results p {
    color: #9ca3af;
    margin: 0;
    font-size: 0.85rem;
}

.search-loading {
    padding: 2rem;
    text-align: center;
    color: #718096;
}

/* Mobile responsiveness for search modal */
@media (max-width: 480px) {
    .search-result-item {
        padding: 0.875rem 1rem;
        gap: 0.5rem;
    }
    
    .search-result-name {
        font-size: 0.95rem;
        gap: 0.5rem;
    }
    
    .search-result-country {
        display: inline-block !important; /* Show mobile country */
        font-size: 0.8rem;
    }
    
    .search-result-stats {
        gap: 0.25rem;
        padding-top: 0.375rem;
    }
    
    .search-stat-number {
        font-size: 0.75rem;
    }
    
    .search-stat-label {
        font-size: 0.6rem;
    }
}

@media (max-width: 768px) {
    .search-modal .modal-content,
    .modal-search {
        margin: 1rem;
        width: calc(100% - 2rem);
        max-width: none;
        max-height: 80vh;
    }
    
    .search-modal .modal-header,
    .modal-search .modal-header {
        padding: 1.25rem 1.25rem 0.75rem 1.25rem;
    }
    
    .search-modal .modal-header h2,
    .modal-search .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .search-modal .search-content,
    .modal-search .search-content {
        padding: 1.25rem;
    }
    
    .search-input-container input {
        padding: 0.875rem 2.5rem 0.875rem 0.875rem;
        font-size: 0.95rem;
    }
    
    .search-results {
        max-height: 250px;
    }
    
    .search-result-item {
        padding: 1rem 1.25rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .search-result-info {
        flex: none;
        width: 100%;
    }
    
    .search-result-name {
        font-size: 1rem;
        line-height: 1.3;
        margin-bottom: 0.25rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        display: flex;
        align-items: baseline;
        gap: 0.75rem;
    }
    
    .search-result-details {
        display: none; /* Hide the separate details section */
    }
    
    .search-result-country {
        display: inline-block !important; /* Show mobile country */
        font-size: 0.85rem;
        color: #6b7280;
        font-weight: 400;
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    .mountain-name-text {
        flex: 1;
        min-width: 0;
    }
    
    .search-result-country-desktop {
        display: none; /* Hide desktop country on mobile */
    }
    
    .search-result-stats {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid #f3f4f6;
        margin-top: 0.25rem;
    }
    
    .search-stat {
        flex: 1;
        text-align: center;
        font-size: 0.7rem;
        min-width: 0;
    }
    
    .search-stat-number {
        font-size: 0.8rem;
        font-weight: 600;
        margin-bottom: 0.1rem;
    }
    
    .search-stat-label {
        font-size: 0.65rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        line-height: 1;
    }
}

.search-loading .loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e3f2fd;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

/* ========================================
   DESKTOP FAB COMPONENTS
   ======================================== */

/* Desktop FAB Container */
.desktop-fab-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 1000;
    display: none; /* Hidden by default, shown only on desktop */
}

.desktop-fab-container .fab {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.desktop-fab-container .fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

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

.desktop-fab-container .fab-dark {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: white;
}

.desktop-fab-container .fab-dark:hover {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

.desktop-fab-container .fab-large {
    width: 48px;
    height: 48px;
}

.desktop-fab-container .fab svg {
    transition: transform 0.2s ease;
}

.desktop-fab-container .fab:hover svg {
    transform: scale(1.1);
}

/* Show desktop FAB only on desktop screens */
@media (min-width: 769px) {
    .desktop-fab-container {
        display: block;
    }
}

/* Hide desktop FAB on mobile */
@media (max-width: 768px) {
    .desktop-fab-container {
        display: none !important;
    }
}

/* ========================================
   MOBILE FILTER COMPONENTS
   ======================================== */

/* Mobile Filter Sheet */
.mobile-filter-sheet {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-filter-sheet.show {
    display: block;
    opacity: 1;
}

.mobile-filter-content {
    background: white;
    width: 100%;
    max-height: 80vh;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    display: block;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.mobile-filter-sheet.show .mobile-filter-content {
    transform: translateY(0);
}

/* Ensure filter sheet appears above everything */
@media (max-width: 768px) {
    .mobile-filter-sheet {
        z-index: 9999 !important;
    }
}

.mobile-filter-close-section {
    padding: 16px 16px 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
}

.mobile-filter-close-section h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

.mobile-filter-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.mobile-filter-close:hover {
    background: #e9ecef;
}

.mobile-filter-content {
    padding: 16px;
    overflow-y: auto;
    flex: none;
    height: auto;
    min-height: auto;
}

.mobile-filter-section {
    margin-bottom: 16px;
}

.mobile-filter-label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.mobile-year-range {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-year-range input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 16px;
    text-align: center;
}

.mobile-year-range span {
    color: #6c757d;
    font-weight: 500;
}

.mobile-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mobile-checkbox-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.mobile-checkbox-item:hover {
    background: #f8f9fa;
    border-color: #3498db;
}

.mobile-checkbox-item input[type="checkbox"] {
    display: none;
}

.mobile-checkbox-item .checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #ced4da;
    border-radius: 4px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.mobile-checkbox-item input[type="checkbox"]:checked + .checkmark {
    background: #3498db;
    border-color: #3498db;
    color: white;
}

.mobile-checkbox-item input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    font-size: 14px;
    font-weight: bold;
}

.mobile-checkbox-item .label-text {
    font-size: 16px;
    color: #2c3e50;
    flex: 1;
}

.mobile-filter-actions {
    padding: 16px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.mobile-filter-actions .btn {
    flex: 0 0 auto;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    height: 36px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    max-width: 120px;
}

/* Mobile Dropdown Styles */
.mobile-dropdown {
    position: relative;
    width: 100%;
}

.mobile-dropdown-button {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #2c3e50;
    transition: border-color 0.2s;
}

.mobile-dropdown-button:hover {
    border-color: #007bff;
}

.mobile-dropdown-button.active {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.mobile-dropdown-arrow {
    transition: transform 0.2s;
}

.mobile-dropdown-button.active .mobile-dropdown-arrow {
    transform: rotate(180deg);
}

.mobile-dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ced4da;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: none;
    max-height: 200px;
    overflow-y: auto;
}

.mobile-dropdown-content.open-upwards {
    top: auto;
    bottom: 100%;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
}

.mobile-dropdown-content.show {
    display: block;
}

.mobile-dropdown-list {
    padding: 8px 0;
}

.mobile-dropdown-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.mobile-dropdown-item:hover {
    background-color: #f8f9fa;
}

.mobile-dropdown-item input[type="checkbox"] {
    margin-right: 8px;
}

.mobile-dropdown-footer {
    padding: 8px 16px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.mobile-clear-button {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.mobile-clear-button:hover {
    background-color: #e9ecef;
}

/* ========================================
   MOUNTAIN LABELS SYSTEM - ALL STYLES
   ======================================== */

/* Base mountain label styling - Editorial/Magazine design */
.mountain-label {
    position: absolute;
    font-family: 'Lora', serif;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    background: rgba(255, 255, 255, 0.95);
    padding: 4px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    white-space: nowrap;
    pointer-events: none;
    z-index: 1000;
    backdrop-filter: blur(2px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    max-width: 120px;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* Alternative label style with text shadow for better readability */
.mountain-label.shadow-style {
    background: transparent;
    border: none;
    box-shadow: none;
    text-shadow: 
        0px 0px 4px #ffffff,
        0px 0px 4px #ffffff,
        0px 0px 4px #ffffff,
        0px 0px 8px rgba(255, 255, 255, 0.8);
    padding: 2px 4px;
}

/* Glass Style - High transparency with subtle border */
.mountain-label.glass-style {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
    color: #1a1a1a;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* Refined Glass Style variations for better marker compatibility */
.mountain-label.glass-refined {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    color: #1a1a1a;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.mountain-label.glass-soft {
    background: rgba(248, 250, 252, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.8);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.25),
        0 2px 4px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    color: #1f2937;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.mountain-label.glass-strong {
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(44, 62, 80, 0.6);
    box-shadow: 
        0 6px 16px rgba(0, 0, 0, 0.35),
        0 3px 8px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    color: #1a202c;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9);
}

/* Minimal Style - Very subtle background with clean typography */
.mountain-label.minimal-style {
    background: rgba(248, 250, 252, 0.8);
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    color: #374151;
    font-weight: 500;
    font-size: 13px;
    padding: 3px 6px;
}

/* Editorial Style - Magazine-inspired with accent border */
.mountain-label.editorial-style {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #2c3e50;
    border-radius: 6px;
    box-shadow: 0 3px 12px rgba(44, 62, 80, 0.15);
    color: #2c3e50;
    font-weight: 600;
    font-size: 13px;
    padding: 5px 10px;
    position: relative;
}

.mountain-label.editorial-style::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #3498db, #2c3e50, #3498db);
    border-radius: 6px;
    z-index: -1;
    opacity: 0.3;
}

/* ========================================
   MOUNTAIN TOOLTIP STYLES (Leaflet Integration)
   ======================================== */

/* Override Leaflet tooltip default styles */
.mountain-tooltip-custom {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: inherit !important;
    line-height: inherit !important;
    max-width: none !important;
    white-space: nowrap !important;
}

.mountain-tooltip-custom .leaflet-tooltip-content {
    margin: 0 !important;
    padding: 0 !important;
}

/* Mountain label tooltip content */
.mountain-label-tooltip {
    font-family: 'Lora', serif;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    background: rgba(255, 255, 255, 0.95);
    padding: 4px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    white-space: nowrap;
    pointer-events: none;
    backdrop-filter: blur(2px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    max-width: 120px;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* Glass Soft style for tooltips */
.mountain-label-tooltip.glass-soft {
    background: rgba(248, 250, 252, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.8);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.25),
        0 2px 4px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    color: #1f2937;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

/* Glass Strong style for tooltips */
.mountain-label-tooltip.glass-strong {
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(44, 62, 80, 0.6);
    box-shadow: 
        0 6px 16px rgba(0, 0, 0, 0.35),
        0 3px 8px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    color: #1a202c;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9);
}

/* Other tooltip styles */
.mountain-label-tooltip.shadow-style {
    background: transparent;
    border: none;
    box-shadow: none;
    text-shadow: 
        0px 0px 4px #ffffff,
        0px 0px 4px #ffffff,
        0px 0px 4px #ffffff,
        0px 0px 8px rgba(255, 255, 255, 0.8);
    padding: 2px 4px;
}

.mountain-label-tooltip.glass-style {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
    color: #1a1a1a;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.mountain-label-tooltip.minimal-style {
    background: rgba(248, 250, 252, 0.8);
    border: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    color: #374151;
    font-weight: 500;
    font-size: 13px;
    padding: 3px 6px;
}

.mountain-label-tooltip.editorial-style {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #2c3e50;
    border-radius: 6px;
    box-shadow: 0 3px 12px rgba(44, 62, 80, 0.15);
    color: #2c3e50;
    font-weight: 600;
    font-size: 13px;
    padding: 5px 10px;
}

/* Mobile responsive tooltips */
@media (max-width: 768px) {
    .mountain-label-tooltip {
        font-size: 12px;
        padding: 3px 6px;
        max-width: 100px;
    }
}