/* Variables */
:root {
    /* Base Colors */
    --primary-color: #64B5F6;    /* Lighter Blue - Primary */
    --secondary-color: #1E88E5;   /* Slightly darker blue */
    --accent-color: #42A5F5;      /* Mid-tone blue */
    --text-color: #212121;        /* Gray 900 */
    --light-text: #FFFFFF;
    --dark-text: #212121;         /* Gray 900 */
    --border-color: #E0E0E0;      /* Light gray borders */
    
    /* Land Type Colors */
    --national-park-color: #FF6B6B;      /* Lighter Red */
    --national-monument-color: #FFB74D;   /* Lighter Amber */
    --national-forest-color: #64B5F6;     /* Lighter Blue */
    --wildlife-refuge-color: #81C784;     /* Lighter Green */
    --wilderness-color: #BA68C8;          /* Lighter Purple */
    --proposed-wilderness-color: #4DB6AC;  /* Lighter Teal */
    
    /* Map Colors */
    --map-background: #FAFAFA;    /* Clean light background */
    --map-water: #E1F5FE;         /* Light cyan */
    --map-borders: #E0E0E0;       /* Light gray borders */
    
    /* Status Colors */
    --status-ongoing: #FF6B6B;    /* Lighter Red */
    --status-proposed: #FFB74D;   /* Lighter Amber */
    --status-resolved: #81C784;   /* Lighter Green */
    
    /* Threat Colors */
    --threat-color: #2E7D32;             /* Green 800 - Serious but not urgent */
    --threat-border: #A5D6A7;            /* Green 200 - Subtle outline */
    
    /* UI Colors */
    --header-background: #2C3E50;  /* Dark slate grey */
    --footer-background: #34495E;  /* Slightly lighter slate grey */
    --footer-text: #E0E0E0;       /* Light grey text */
    --footer-link: #90CAF9;       /* Blue 200 - Footer links */
    --footer-link-hover: #BBDEFB; /* Very Light Blue hover */
    --tooltip-background: rgba(33, 33, 33, 0.95);
    --tooltip-text: #FFFFFF;
    --tooltip-border: rgba(255, 255, 255, 0.1);
    --tooltip-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    
    /* Button Colors */
    --button-primary: #2962FF;           /* Blue A700 - CTA blue */
    --button-primary-hover: #0039CB;     /* Blue A900 - Hover state */
    
    /* Core Colors */
    --primary: #64B5F6;        /* Lighter Blue */
    --primary-dark: #1E88E5;   /* Darker Blue */
    --background: #FAFAFA;     /* Clean light background */
    --white: #FFFFFF;
    --text: #212121;          /* Gray 900 */
    --border: #CFD8DC;        /* Blue-gray divider */
    
    /* Land Type Colors - Repeated for consistency */
    --national-park: #FF6B6B;      /* Lighter Red */
    --national-monument: #FFB74D;   /* Lighter Amber */
    --national-forest: #64B5F6;     /* Lighter Blue */
    --wildlife-refuge: #81C784;     /* Lighter Green */
    --wilderness: #BA68C8;          /* Lighter Purple */
    --proposed-wilderness: #4DB6AC;  /* Lighter Teal */
    
    /* Status Colors */
    --status-ongoing: #FF6B6B;   /* Lighter Red */
    --status-planned: #FFB74D;   /* Lighter Amber */
    --status-completed: #81C784; /* Lighter Green */

    /* RGB versions for opacity */
    --primary-rgb: 100, 181, 246;    /* Lighter Blue RGB */
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(42, 40, 38, 0.1);
    --shadow-md: 0 4px 8px rgba(42, 40, 38, 0.1);
    --shadow-lg: 0 8px 16px rgba(42, 40, 38, 0.1);
    
    /* Google Greys for Structure & Layout */
    --text-primary: #212121;              /* Gray 900 - Main UI text */
    --text-secondary: #757575;            /* Gray 600 - Status, metadata */
    --background-light: #FAFAFA;          /* Gray 50 - Map base UI */
    
    /* Threat Tag Colors */
    --threat-color: #2E7D32;             /* Green 800 - Serious but not urgent */
    --threat-border: #A5D6A7;            /* Green 200 - Subtle outline */
    
    /* Button Colors */
    --button-primary: #2962FF;           /* Blue A700 - CTA blue */
    --button-primary-hover: #0039CB;     /* Blue A900 - Hover state */
    
    /* Footer Link Colors */
    --footer-text: #E0E0E0;              /* Gray 300 - Footer text */
    --footer-link: #90CAF9;              /* Blue 200 - Footer links */
    
    /* Tooltip Text Colors */
    --tooltip-text: #FFFFFF;             /* White text */
    --tooltip-subtext: #BDBDBD;          /* Gray 400 - Secondary info */

    /* Footer Height */
    --footer-height: 36px;
    --legend-spacing: 24px;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-primary);
    line-height: 1.5;
    background: var(--background-light);
    overflow: hidden;
}

/* Layout */
.app-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Header */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--header-background);
    color: var(--tooltip-text);
    padding: var(--spacing-md);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    width: 100%;
}

.logo-container {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    height: 64px;
}

.logo {
    height: 64px;
    width: auto;
    filter: brightness(0) invert(1);
    transition: opacity 0.2s ease;
}

.logo:hover {
    opacity: 0.9;
}

.header-text {
    flex: 1;
    min-width: 0; /* Prevent flex item from overflowing */
}

.header-text h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--white);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-text p {
    font-size: 0.875rem;
    opacity: 0.9;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.share-buttons {
    display: flex;
    align-items: center;
}

.share-button {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--light-text);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.share-button:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--primary-color);
}

.info-button {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--light-text);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.2s ease;
}

.info-button:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--primary-color);
}

/* Common Modal Styles */
.modal-overlay,
.map-overlay,
.share-modal-overlay,
.submit-modal-overlay,
.take-action-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: none;
}

.modal-overlay.active,
.map-overlay.active,
.share-modal-overlay.active,
.submit-modal-overlay.active,
.take-action-modal-overlay.active {
    opacity: 1;
}

/* Info Modal */
.info-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    background: var(--white);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    z-index: 2001;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.info-modal.active {
    opacity: 1;
    display: block;
}

.info-modal-header {
    position: sticky;
    top: 0;
    background: var(--primary);
    color: var(--white);
    padding: var(--spacing-lg);
    border-radius: 24px 24px 0 0;
    z-index: 2;
}

.info-modal-content {
    padding: var(--spacing-lg);
    background: var(--white);
}

.info-modal-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: var(--white);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 3;
}

.info-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

#infoModalOverlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: none;
}

#infoModalOverlay.active {
    opacity: 1;
    display: block;
}

/* Z-index hierarchy */
.map-container { z-index: 1; }
.map-tooltip { z-index: 900; }
.map-controls { z-index: 1000; }
.app-header { z-index: 1000; }
.floating-action-menu { z-index: 1000; }
.map-overlay { z-index: 1100; }
.modal-overlay { z-index: 1200; }
.filter-sidebar { z-index: 1500; }
#infoModalOverlay { z-index: 2000; }
.info-modal { z-index: 2001; }
.share-modal { z-index: 2002; }
.submit-modal { z-index: 2003; }
.take-action-modal { z-index: 2004; }

@media (max-width: 768px) {
    .info-modal {
        width: 95%;
        max-width: none;
        margin: 0;
        max-height: 85vh;
    }

    .info-modal-header {
        padding: var(--spacing-md);
    }

    .info-modal-content {
        padding: var(--spacing-md);
    }

    .logo-container {
        height: 40px;
        justify-content: center;
    }

    .logo {
        height: 32px;
    }
}

.info-modal-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

.info-modal-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin: var(--spacing-xs) 0 0;
}

.info-modal-section {
    padding: var(--spacing-lg) var(--spacing-xl);
    border-bottom: 1px solid var(--border);
}

.info-modal-section:last-child {
    border-bottom: none;
}

.info-modal-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 var(--spacing-md);
    color: var(--text);
}

.info-modal-section p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    margin: 0;
    opacity: 0.9;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-top: var(--spacing-sm);
}

.feature-item {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--background);
    border-radius: 12px;
    transition: transform 0.2s ease;
}

.feature-item:hover {
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.feature-text h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 var(--spacing-xs);
    color: var(--text);
}

.feature-text p {
    font-size: 0.875rem;
    margin: 0;
    opacity: 0.8;
}

.color-guide {
    margin-top: var(--spacing-sm);
}

.color-category h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0 var(--spacing-sm);
    color: var(--text);
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.color-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
}

.color-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.9375rem;
    color: var(--text);
}

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.color-dot.national-park { background: var(--national-park-color); }
.color-dot.national-monument { background: var(--national-monument-color); }
.color-dot.national-forest { background: var(--national-forest-color); }
.color-dot.wildlife-refuge { background: var(--wildlife-refuge-color); }
.color-dot.proposed-wilderness { background: var(--proposed-wilderness-color); }

.modal-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--button-primary);
    color: var(--tooltip-text);
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: var(--spacing-md);
}

.modal-cta-button:hover {
    background: var(--button-primary-hover);
}

/* Mobile Optimizations for Modal */
@media (max-width: 768px) {
    .info-modal {
        width: 95%;
        max-width: none;
        padding: 1.5rem;
        margin: 0;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        max-height: 85vh;
    }

    .info-modal-header {
        padding: var(--spacing-md);
    }

    .info-modal-header h2 {
        font-size: 1.25rem;
    }

    .info-modal-subtitle {
        font-size: 0.875rem;
    }

    .info-modal-section {
        padding: var(--spacing-md);
    }

    .info-modal-section h3 {
        font-size: 1.125rem;
    }

    .feature-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .feature-item {
        padding: var(--spacing-sm);
    }

    .color-items {
        grid-template-columns: 1fr;
    }

    .color-item {
        font-size: 0.875rem;
    }
}

/* Tablet Optimizations for Modal */
@media (min-width: 769px) and (max-width: 1024px) {
    .info-modal {
        max-width: 500px;
    }
}

/* Map */
.map-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--background);
    z-index: 1;
}

/* Map Controls */
.map-controls {
    position: fixed;
    top: calc(var(--spacing-md) + var(--spacing-lg) + 80px);
    left: var(--spacing-lg);
    z-index: 1000;
    display: flex;
    gap: var(--spacing-md);
}

@media (max-width: 768px) {
    .map-controls {
        top: 120px; /* Reduced from 220px */
        left: 0;
        right: 0;
        padding: 0;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .search-container {
        width: calc(100% - 32px);
        max-width: none;
        margin: 0 16px;
        gap: 8px;
    }

    .map-container {
        padding-top: 160px; /* Reduced from 260px */
    }

    /* Adjust header for better mobile spacing */
    .app-header {
        padding: var(--spacing-sm);
    }

    .header-content {
        flex-direction: column;
        gap: var(--spacing-xs); /* Reduced from spacing-sm */
        align-items: center;
        padding: var(--spacing-xs) 0;
    }

    .header-text {
        text-align: center;
        padding: 0;
    }

    .header-text h1 {
        font-size: 1.125rem;
        margin-bottom: 4px; /* Reduced spacing */
    }

    .header-text p {
        font-size: 0.875rem;
        margin: 0;
        -webkit-line-clamp: 2;
    }
}

/* Search Container */
.search-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.filter-toggle {
    background: white;
    border: none;
    border-radius: 8px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
    z-index: 1000;
}

.filter-toggle:hover {
    background: var(--background);
    color: var(--primary);
    transform: translateY(-1px);
}

.filter-toggle:active {
    transform: translateY(0);
}

.search-input {
    width: 100%;
    height: 48px;
    padding: 0 48px 0 16px;
    border: none;
    border-radius: 8px;
    font-size: 16px; /* Minimum font size to prevent zoom on iOS */
    background: white;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
    color: var(--text);
    -webkit-appearance: none; /* Prevent default iOS styling */
    appearance: none;
    outline: none;
}

@media screen and (max-width: 768px) {
    .search-input {
        font-size: 16px; /* Ensure consistent font size on mobile */
        line-height: normal;
        -webkit-text-size-adjust: 100%; /* Prevent text size adjustment */
    }
    
    .search-container {
        padding: 8px;
        max-width: 100%;
        box-sizing: border-box;
    }
}

.search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    pointer-events: none;
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.search-result {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: background-color 0.2s ease;
}

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

.search-result:hover,
.search-result.selected {
    background-color: #f8f9fa;
}

.search-result-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.search-result-region {
    font-size: 13px;
    color: #666;
    margin-bottom: 2px;
}

.search-result-threats {
    font-size: 13px;
    color: #666;
}

.search-no-results {
    padding: 16px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

.highlight {
    background-color: rgba(66, 133, 244, 0.15);
    padding: 0 2px;
    border-radius: 2px;
}

/* Scrollbar styles for search results */
.search-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track {
    background: transparent;
}

.search-results::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .search-container {
        width: calc(100% - 32px);
        margin: 0 16px;
    }

    .search-input {
        height: 44px;
        font-size: 14px;
    }

    .search-results {
        max-height: 50vh;
    }
}

/* Zoom Controls - Fixed Position */
.leaflet-control-zoom {
    position: fixed !important;
    top: calc(120px + var(--spacing-md)) !important;
    right: var(--spacing-lg) !important;
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.leaflet-control-zoom a {
    width: 40px !important;
    height: 40px !important;
    line-height: 40px !important;
    background: var(--white) !important;
    color: var(--text) !important;
    border: none !important;
    font-size: 16px !important;
    box-shadow: var(--shadow-md) !important;
    text-align: center;
    text-decoration: none;
    margin: 0 !important;
}

.leaflet-control-zoom a:hover {
    background: var(--background) !important;
    color: var(--primary) !important;
}

/* Info Panel */
.info-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    pointer-events: none;
}

.info-panel > * {
    pointer-events: auto;
}

/* Preview Card */
.preview-card {
    position: absolute;
    bottom: var(--spacing-lg);
    left: 50%;
    transform: translateX(-50%);
    background: var(--white);
    border-radius: 8px;
    padding: var(--spacing-md);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 400px;
    display: none;
}

.preview-card.active {
    display: block;
    animation: slideUp 0.3s ease;
}

/* Detail Panel */
.detail-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: 16px 16px 0 0;
    padding: var(--spacing-lg);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
}

.detail-panel.active {
    transform: translateY(0);
}

/* Legend Styles - Single Source of Truth */
.legend {
    position: fixed;
    bottom: calc(var(--footer-height) + var(--spacing-lg));
    right: var(--spacing-lg);
    background: rgba(255, 255, 255, 0.98);
    border-radius: 12px;
    padding: var(--spacing-md) var(--spacing-lg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 900;
    font-size: 0.875rem;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    min-width: 220px;
    max-width: 320px;
    pointer-events: auto;
}

.legend h3 {
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.75px;
    color: var(--text);
    opacity: 0.9;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8125rem;
    color: var(--text);
}

.legend-item:hover {
    background-color: rgba(0, 0, 0, 0.04);
    transform: translateX(2px);
}

.legend-marker {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Legend marker colors */
.legend-marker.national-park { background-color: var(--national-park-color); }
.legend-marker.national-monument { background-color: var(--national-monument-color); }
.legend-marker.wildlife-refuge { background-color: var(--wildlife-refuge-color); }
.legend-marker.national-forest { background-color: var(--national-forest-color); }
.legend-marker.proposed-wilderness { background-color: var(--proposed-wilderness-color); }
.legend-marker.wilderness { background-color: var(--wilderness-color); }

/* Mobile adjustments */
@media (max-width: 768px) {
    .legend {
        bottom: calc(var(--footer-height) + var(--spacing-md));
        right: var(--spacing-md);
        left: var(--spacing-md);
        padding: var(--spacing-md);
        max-width: none;
    }
}

/* Map Markers */
.map-marker {
    transition: transform 0.3s ease;
}

.map-marker svg {
    transition: transform 0.3s ease;
}

.leaflet-marker-icon {
    transition: transform 0.3s ease !important;
}

.marker-highlighted svg {
    transform: scale(1.2);
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.2));
}

.map-marker:hover {
    transform: scale(1.2);
    z-index: 1000 !important;
}

.map-marker.national-park { background: var(--national-park-color); }
.map-marker.national-monument { background: var(--national-monument-color); }
.map-marker.national-forest { background: var(--national-forest-color); }
.map-marker.wildlife-refuge { background: var(--wildlife-refuge-color); }
.map-marker.proposed-wilderness { background: var(--proposed-wilderness-color); }
.map-marker.wilderness,
.map-marker.Wilderness,
.map-marker[data-type="Wilderness"],
.map-marker[data-type="Boundary Waters Canoe Area Wilderness"] { 
    background: var(--wilderness-color); 
}

/* Threat Tags */
.threat-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin: var(--spacing-sm) 0;
}

.threat-tag {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--white);
}

.threat-tag.logging { background: var(--logging); }
.threat-tag.mining { background: var(--mining); }
.threat-tag.drilling { background: var(--drilling); }
.threat-tag.grazing { background: var(--grazing); }
.threat-tag.development { background: var(--development); }

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Media Queries */
@media (max-width: 768px) {
    /* Header Improvements */
    .app-header {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .header-content {
        flex-direction: column;
        gap: var(--spacing-sm);
        padding: var(--spacing-xs) 0;
    }

    .logo-container {
        height: 32px;
        justify-content: center;
    }

    .logo {
        height: 32px;
    }

    .header-text {
        text-align: center;
    }

    .header-text h1 {
        font-size: 1.125rem;
        white-space: normal;
        line-height: 1.3;
        margin-bottom: var(--spacing-xs);
    }

    .header-text p {
        font-size: 0.8125rem;
        -webkit-line-clamp: 2;
        margin-top: 0;
        padding: 0 var(--spacing-sm);
    }

    /* Search Optimization */
    .map-controls {
        top: calc(var(--spacing-md) + var(--spacing-lg) + 100px); /* Slightly more space on mobile */
        left: var(--spacing-md);
        right: var(--spacing-md);
    }

    .search-container {
        width: 100%;
        max-width: none;
    }

    .search-input {
        height: 40px;
        font-size: 0.9375rem;
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .search-results {
        max-height: 40vh;
        margin-top: var(--spacing-xs);
    }

    /* Map Container */
    .map-container {
        padding-top: 220px;
    }

    /* Popup Improvements */
    .leaflet-popup-content-wrapper {
        width: calc(100vw - 32px);
        max-width: none;
        margin: 0 16px;
    border-radius: 12px;
    }

    .leaflet-popup-content {
        max-height: 60vh;
        overflow-y: auto;
    }

    .popup-header {
        padding: var(--spacing-md);
    }

    .popup-content {
        padding: var(--spacing-md);
    }

    /* Zoom Controls */
    .leaflet-control-zoom {
        top: auto !important;
        bottom: calc(var(--spacing-lg) + 60px) !important;
        right: var(--spacing-md) !important;
    }

    .leaflet-control-zoom a {
        width: 36px !important;
        height: 36px !important;
        line-height: 36px !important;
    }

    /* Tooltip Adjustments */
    .location-tooltip {
        max-width: calc(100vw - 48px) !important;
        min-width: 0;
    }

    /* Mobile Optimizations for Modal */
    .info-modal {
        padding: var(--spacing-lg);
        width: calc(100% - var(--spacing-lg));
    max-height: 90vh;
    overflow-y: auto;
}

    .info-modal h2 {
        font-size: 1.25rem;
        padding-right: var(--spacing-xl);
    }

    .info-modal h3 {
        font-size: 1rem;
    }

    .info-modal p,
    .info-modal li {
        font-size: 0.875rem;
    }
}

/* Tablet Optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    .header-content {
        max-width: 900px;
        padding: 0 var(--spacing-md);
    }

    .map-controls {
        max-width: 600px;
    left: 50%;
    transform: translateX(-50%);
    }

    .search-container {
    width: 100%;
    }

    .legend {
        max-width: 280px;
    }
}

/* Landscape Mode Optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    .app-header {
        padding: var(--spacing-xs) var(--spacing-md);
    }

    .header-text p {
        -webkit-line-clamp: 1;
    }

    .map-container {
        padding-top: 180px;
    }

    .map-controls {
        top: calc(var(--spacing-md) + var(--spacing-lg) + 100px); /* Slightly more space on mobile */
    }

    .legend {
        max-height: calc(100vh - 280px);
        overflow-y: auto;
        bottom: var(--spacing-md);
    }

    .legend-items {
        grid-template-columns: repeat(3, 1fr);
    }

    .leaflet-popup-content {
        max-height: 80vh;
    }
}

/* Popup Styles */
.leaflet-popup {
    margin-bottom: 0;
}

.leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: 6px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    width: 280px !important;
}

.leaflet-popup-content {
    margin: 0;
    width: 280px !important;
    max-width: 90vw;
    max-height: 50vh;
    overflow-y: auto;
}

.leaflet-popup-close-button {
    position: absolute;
    top: 6px !important;
    right: 6px !important;
    width: 20px !important;
    height: 20px !important;
    font-size: 16px !important;
    font-weight: 300 !important;
    color: rgba(255, 255, 255, 0.9) !important;
    background: rgba(255, 255, 255, 0.15) !important;
    border-radius: 50% !important;
    backdrop-filter: blur(4px);
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    transition: all 0.2s ease;
    z-index: 1;
}

.leaflet-popup-close-button:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.25) !important;
    transform: scale(1.05);
}

.leaflet-popup-tip-container {
    margin-top: -1px;
}

.leaflet-popup-tip {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    background: var(--primary);
}

.popup-header {
    padding: 10px 12px;
    background: var(--primary);
    position: relative;
}

.popup-header h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    padding-right: 16px;
    line-height: 1.3;
    color: #fff;
}

.location-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 3px;
}

.popup-content {
    padding: 10px 12px;
    font-size: 12px;
}

.popup-section {
    margin-bottom: 10px;
}

.popup-section:last-child {
    margin-bottom: 0;
}

.popup-section h4 {
    font-size: 12px;
    font-weight: 600;
    margin: 0 0 4px;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}

.threat-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-bottom: 6px;
}

.threat-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-dark);
}

.popup-section p {
    font-size: 11px;
    line-height: 1.4;
    margin: 0;
    color: var(--text-dark);
}

.action-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.action-list li {
    position: relative;
    padding-left: 14px;
    margin-bottom: 3px;
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-dark);
}

.action-list li:last-child {
    margin-bottom: 0;
}

.action-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary);
}

.notes {
    font-size: 11px;
    line-height: 1.4;
    padding: 5px 8px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 3px;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 6px;
}

@media screen and (max-width: 480px) {
    .leaflet-popup-content {
        width: calc(100vw - 32px) !important;
    }
    
    .popup-header {
        padding: 8px 10px;
    }
    
    .popup-content {
        padding: 8px 10px;
    }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .leaflet-popup-content-wrapper {
        max-height: 70vh;
        width: 90vw;
        margin: 0 auto;
    }
    
    .leaflet-popup-content {
        width: 100% !important;
        padding: 15px;
    }
}

/* Tooltip Styles */
.location-tooltip {
    font-size: 12px;
    padding: 12px 16px !important;
    border-radius: 8px !important;
    border: none !important;
    background: rgba(33, 33, 33, 0.95) !important; /* Gray 900 with opacity */
    color: #FFFFFF !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
    min-width: 200px !important;
    max-width: 300px !important;
    width: auto !important;
    white-space: normal !important;
    line-height: 1.4 !important;
    backdrop-filter: blur(4px);
    pointer-events: none;
}

.location-tooltip .location-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    display: block;
    color: #FFFFFF;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    width: 100%;
}

.tooltip-threats {
    display: block;
    font-size: 12px;
    margin-top: 8px;
    width: 100%;
}

.tooltip-threats-label {
    text-transform: uppercase;
    font-size: 10px;
    color: #BDBDBD; /* Gray 400 */
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.tooltip-threat-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    width: 100%;
}

.tooltip-threat-tag {
    background: rgba(46, 125, 50, 0.2); /* Green 800 with opacity */
    border: 1px solid rgba(165, 214, 167, 0.3); /* Green 200 with opacity */
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    color: #FFFFFF;
    font-weight: 500;
    white-space: nowrap;
}

/* Ensure tooltip arrow aligns with background */
.leaflet-tooltip-left.location-tooltip::before {
    right: -11px !important;
    margin-top: -8px;
    border-left-color: rgba(33, 33, 33, 0.95) !important; /* Gray 900 with opacity */
}

.leaflet-tooltip-right.location-tooltip::before {
    left: -11px !important;
    margin-top: -8px;
    border-right-color: rgba(33, 33, 33, 0.95) !important; /* Gray 900 with opacity */
}

/* Map tooltip dark theme */
.map-tooltip.dark {
    background: var(--header-background) !important;  /* Dark slate grey from header */
    color: var(--light-text) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 12px 16px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.map-tooltip.dark::before {
    border-color: transparent !important;
    border-right-color: var(--header-background) !important;
}

.map-tooltip.dark strong {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--light-text);
}

.map-tooltip.dark .tooltip-threats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.map-tooltip.dark .tooltip-threat-tag {
    background: var(--primary-color) !important;  /* Light blue accent */
    color: var(--header-background) !important;  /* Dark background color for contrast */
    font-size: 12px !important;
    padding: 3px 8px !important;
    border-radius: 4px !important;
    font-weight: 500 !important;
    display: inline-block !important;
    white-space: nowrap !important;
    border: none !important;
}

/* Leaflet default tooltip override */
.leaflet-tooltip {
    width: auto !important;
    white-space: nowrap !important;
    min-width: fit-content !important;
    max-width: none !important;
    padding: 12px 16px !important;
    border: none !important;
    background: rgba(33, 33, 33, 0.95) !important; /* Gray 900 with opacity */
    color: #FFFFFF !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    border-radius: 8px !important;
    backdrop-filter: blur(4px) !important;
}

.leaflet-tooltip .tooltip-content strong {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 16px;
    color: #FFFFFF;
}

.leaflet-tooltip .tooltip-threats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.leaflet-tooltip .tooltip-threat-tag {
    background: var(--primary-color) !important;
    color: var(--header-background) !important;
    font-size: 12px !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    font-weight: 500 !important;
    display: inline-block !important;
    white-space: nowrap !important;
    border: none !important;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .leaflet-tooltip {
        max-width: calc(100vw - 48px) !important;
        min-width: 200px !important;
        font-size: 13px !important;
        padding: 10px 14px !important;
    }

    .leaflet-tooltip .tooltip-content strong {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .leaflet-tooltip .tooltip-threat-tag {
        font-size: 11px !important;
        padding: 3px 6px !important;
    }
}

/* Control Button */
.control-button {
    display: none;
}

/* Filter Sidebar */
.filter-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 380px;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    z-index: 1500;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: none;
}

.filter-sidebar.active {
    transform: translateX(0);
    display: block;
}

.filter-sidebar__header {
    background: var(--primary);
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 2;
}

.filter-sidebar__header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--white);
}

.filter-sidebar__close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
    font-size: 20px;
}

.filter-sidebar__close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.filter-sidebar__content {
    padding: 2rem;
    overflow-y: auto;
    height: calc(100vh - 80px);
}

.filter-sidebar__group {
    margin-bottom: 2rem;
}

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

.filter-sidebar__group h4 {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.filter-sidebar__options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.filter-sidebar__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: var(--background);
}

.filter-sidebar__option:hover {
    background: var(--background-hover);
    transform: translateY(-1px);
}

.filter-sidebar__label {
    font-size: 0.9375rem;
    color: var(--text);
    font-weight: 500;
}

.filter-sidebar__toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.filter-sidebar__toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.filter-sidebar__toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: .3s ease-in-out;
    border-radius: 34px;
}

.filter-sidebar__toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s ease-in-out;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.filter-sidebar__toggle input:checked + .filter-sidebar__toggle-slider {
    background-color: var(--primary);
}

.filter-sidebar__toggle input:checked + .filter-sidebar__toggle-slider:before {
    transform: translateX(20px);
}

@media (max-width: 768px) {
    .filter-sidebar {
        width: 100%;
    }

    .filter-sidebar__header {
        padding: 1.25rem 1.5rem;
    }

    .filter-sidebar__content {
        padding: 1.5rem;
    }

    .filter-sidebar__option {
        padding: 0.625rem 0.875rem;
    }
}

/* Submit Location Modal */
.submit-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: var(--white);
    border-radius: 24px;
    width: 90%;
    max-width: 560px;
    z-index: 2003;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.submit-modal.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
    display: block;
}

.submit-modal-content {
    padding: 0;
}

.submit-modal h3 {
    margin: 0;
    padding: 28px 32px;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--white);
    background: var(--primary);
    border-radius: 24px 24px 0 0;
    position: relative;
}

.submit-modal form {
    padding: 32px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group:last-child {
    margin-bottom: 32px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text);
    font-size: 0.9375rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--white);
    color: var(--text);
    font-family: inherit;
    line-height: 1.5;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-group input:hover,
.form-group textarea:hover {
    border-color: var(--primary);
    background: var(--background);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
}

.submit-form-button {
    width: 100%;
    padding: 16px;
    background: var(--button-primary);
    color: var(--tooltip-text);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit-form-button:hover {
    background: var(--button-primary-hover);
    transform: translateY(-2px);
}

.submit-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
    z-index: 10;
}

.submit-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.submit-modal-close:active {
    transform: scale(0.95);
}

.submit-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.submit-modal-overlay.active {
    opacity: 1;
}

/* Loading States and Feedback */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--background);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

.loading-text {
    position: absolute;
    bottom: calc(50% - 60px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.875rem;
    color: var(--text);
    font-weight: 500;
}

/* Search Loading State */
.search-container.loading .search-input {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%232C5530" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 6v6l4 2"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.search-container.loading .search-input:focus {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%232C5530" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 6v6l4 2"/></svg>');
}

/* Map Loading Feedback */
.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.875rem;
    color: var(--text);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.map-loading.active {
    opacity: 1;
}

.map-loading .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--background);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
}

/* Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Loading Skeleton Styles */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--background) 0%,
        rgba(255, 255, 255, 0.5) 50%,
        var(--background) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    to {
        background-position: -200% 0;
    }
}

/* Search Result Loading State */
.search-result.loading {
    pointer-events: none;
}

.search-result.loading .search-result-name,
.search-result.loading .search-result-region,
.search-result.loading .search-result-threats {
    height: 12px;
    margin: 6px 0;
    background: var(--background);
    border-radius: 4px;
    animation: pulse 1.5s infinite;
}

.search-result.loading .search-result-name {
    width: 70%;
    height: 16px;
}

.search-result.loading .search-result-region {
    width: 50%;
}

.search-result.loading .search-result-threats {
    width: 80%;
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        opacity: 0.6;
    }
}

/* Share Button Styles */
.share-buttons {
    display: inline-flex;
    margin-right: 12px;
}

.share-button {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.2s ease;
    padding: 0;
}

.share-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.share-button svg {
    width: 18px;
    height: 18px;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .share-modal-content {
        width: calc(100% - 32px);
        padding: 20px;
    }

    .share-option {
        padding: 10px;
        font-size: 14px;
    }

    .share-option svg {
        width: 20px;
        height: 20px;
    }

    .share-link-container {
        flex-direction: column;
    }

    #copyLink {
        width: 100%;
    }
}

/* Popup Share Button */
.popup-share-button {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 6px;
    color: rgba(255, 255, 255, 0.9);
    transition: all 0.2s ease;
}

.popup-share-button:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    transform: scale(1.05);
}

.location-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Share Modal Styles */
.share-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 480px;
    max-width: 90vw;
    background: white;
    border-radius: 24px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.share-modal-content {
    position: relative;
}

.share-modal-header {
    background: var(--primary);
    color: white;
    padding: 24px;
    border-radius: 24px 24px 0 0;
    margin: -1px;
    width: calc(100% + 2px);
}

.share-modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.share-options {
    padding: 24px;
}

.share-link-container {
    display: flex;
    gap: 12px;
    background: var(--light-gray);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 32px;
    border: 1px solid var(--border);
}

.share-link-container input {
    flex: 1;
    border: none;
    background: white;
    font-size: 15px;
    color: var(--text);
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px var(--border);
}

.share-link-container button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.share-link-container button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.social-share-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-option:hover {
    background: var(--light-gray);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.share-option svg {
    width: 32px;
    height: 32px;
    color: var(--primary);
    margin-bottom: 12px;
}

.share-option-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.share-option-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
}

.share-option-description {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.4;
}

@media (max-width: 768px) {
    .share-link-container {
        flex-direction: column;
        padding: 12px;
    }

    .share-link-container input {
        width: 100%;
        font-size: 14px;
    }

    .share-link-container button {
        width: 100%;
        padding: 12px;
    }

    .social-share-buttons {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .share-option {
        flex-direction: row;
        align-items: center;
        text-align: left;
        padding: 16px;
        gap: 16px;
    }

    .share-option svg {
        margin-bottom: 0;
        width: 28px;
        height: 28px;
    }
}

.share-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 1;
}

.share-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

@media (max-width: 768px) {
    .share-modal {
        width: calc(100% - 32px);
        margin: 16px;
    }

    .share-modal-header {
        padding: 20px;
    }

    .share-modal-header h3 {
        font-size: 20px;
    }

    .share-options {
        padding: 20px;
    }

    .share-link-container {
        flex-direction: column;
    }

    .share-link-container button {
        width: 100%;
        justify-content: center;
    }

    .share-option {
        padding: 14px;
    }

    .share-option-title {
        font-size: 15px;
    }

    .share-option-description {
        font-size: 13px;
    }
}

/* Floating Action Button */
.floating-action-menu {
    position: fixed;
    bottom: 60px;
    left: 24px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.floating-action-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    color: var(--white);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-action-button:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.floating-action-button svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-action-menu:hover .floating-action-button svg {
    transform: rotate(45deg);
}

.floating-action-submenu {
    position: absolute;
    left: 72px;
    bottom: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-sm);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-20px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-action-menu:hover .floating-action-submenu,
.floating-action-menu:focus-within .floating-action-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.floating-submenu-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 12px var(--spacing-lg);
    background: var(--primary);
    border: none;
    border-radius: 28px;
    color: var(--white);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.floating-submenu-item:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.submenu-icon {
    font-size: 20px;
    opacity: 0.9;
}

.submenu-text {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.2px;
}

@media (max-width: 768px) {
    .floating-action-menu {
        bottom: 52px;
        left: 16px;
    }

    .floating-action-button {
        width: 48px;
        height: 48px;
    }
    
    .floating-action-submenu {
        flex-direction: column-reverse;
        left: 0;
        bottom: 60px;
        gap: var(--spacing-sm);
    }

    .floating-submenu-item {
        padding: 10px var(--spacing-md);
        font-size: 14px;
    }
}

.take-action-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: var(--white);
    border-radius: 16px;
    padding: var(--spacing-xl);
    max-width: 600px;
    width: 90%;
    z-index: 2004;
    opacity: 0;
    transition: all 0.3s ease;
}

.take-action-modal.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.take-action-modal h3 {
    color: var(--text);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 var(--spacing-lg);
}

.take-action-section {
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md);
    background: rgba(0, 0, 0, 0.02);
    border-radius: 12px;
}

.take-action-section:last-child {
    margin-bottom: 0;
}

.take-action-section h4 {
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 var(--spacing-sm);
}

.take-action-section p {
    color: var(--text-light);
    margin: 0 0 var(--spacing-md);
    font-size: 0.95rem;
    line-height: 1.5;
}

.action-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.action-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.action-button svg {
    width: 16px;
    height: 16px;
}

.take-action-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: #666;
    font-size: 24px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
    padding: 0;
    z-index: 1000;
}

.take-action-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.take-action-modal-close:active {
    background: rgba(0, 0, 0, 0.2);
    transform: scale(0.95);
}

.take-action-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.take-action-modal-overlay.active {
    opacity: 1;
}

.map-tooltip.dark {
    background: rgba(0, 0, 0, 0.85);
    color: white;
    border: none;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    max-width: 300px;
}

.map-tooltip.dark::before {
    border-right-color: rgba(0, 0, 0, 0.85);
}

.map-tooltip.dark strong {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
}

.map-tooltip.dark .tooltip-threats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.map-tooltip.dark .tooltip-threat-tag {
    background: rgba(60, 141, 47, 0.3);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    display: inline-block;
    line-height: 1.4;
    border: 1px solid rgba(60, 141, 47, 0.4);
}

.share-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    color: #333;
    font-size: 28px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    z-index: 1000;
}

.share-modal-close:hover {
    background: rgba(0, 0, 0, 0.15);
    transform: scale(1.05);
}

.share-modal-close:active {
    transform: scale(0.95);
}

.hidden-field {
    display: none;
    position: absolute;
    left: -9999px;
}

/* Premium Modal Base Styles */
.modal-base {
    --modal-radius: 24px;
    --modal-padding: 32px;
    --modal-header-height: 72px;
}

.map-overlay {
    z-index: 1100;
}

.modal-overlay {
    z-index: 1300;
}

.info-modal,
.share-modal,
.submit-modal,
.take-action-modal {
    z-index: 2000;
}

.filter-sidebar.active {
    transform: translateX(0);
}

.filter-sidebar__header {
    z-index: 2;
}

.filter-sidebar__content {
    z-index: 1;
    background: var(--white);
}

.map-tooltip {
    z-index: 900;
}

#infoModalOverlay {
    z-index: 2000;
}

/* Footer */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: rgba(44, 56, 66, 0.95);
    backdrop-filter: blur(8px);
    color: white;
    z-index: 1000;
    display: flex;
    align-items: center;
}

.footer-content {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;  /* Reduced from 0.875rem */
    color: var(--light-text);
    opacity: 0.8;
}

.footer-brand a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.footer-brand a:hover {
    opacity: 0.8;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.footer-links a {
    color: var(--light-text);
    text-decoration: none;
    font-size: 0.75rem;  /* Reduced from 0.875rem */
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.footer-links a:hover {
    color: white;
}

@media (max-width: 768px) {
    .app-footer {
        height: 40px;
    }

    .footer-content {
        padding: 0 20px;
    }

    .footer-brand {
        font-size: 0.75rem;
    }

    .footer-links {
        gap: 20px;
    }

    .footer-links a {
        font-size: 0.75rem;
    }
}

/* Adjust spacing for elements above footer */
.legend {
    bottom: calc(var(--spacing-lg) + 44px);
}

.floating-action-menu {
    bottom: calc(var(--spacing-lg) + 44px);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .map-controls {
        top: calc(var(--spacing-lg) + 120px);
        left: 0;
        right: 0;
        padding: 0 var(--spacing-md);
        width: 100%;
    }

    .search-container {
        width: 100%;
        max-width: none;
        margin: 0;
        gap: var(--spacing-xs);
    }

    .filter-toggle {
        width: 40px;
        height: 40px;
    }

    .search-input {
        height: 40px;
        font-size: 14px;
        padding: 0 40px 0 12px;
    }

    .search-icon {
        right: 12px;
        width: 16px;
        height: 16px;
    }
}

/* Tablet Optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    .map-controls {
        max-width: 600px;
        left: 50%;
        transform: translateX(-50%);
    }

    .search-container {
        width: 100%;
    }
}

/* Header Mobile Optimizations */
@media (max-width: 768px) {
    .app-header {
        padding: var(--spacing-sm);
    }

    .header-content {
        flex-direction: column;
        gap: var(--spacing-sm);
        align-items: center;
    }

    .header-text {
        text-align: center;
        padding: 0 var(--spacing-sm);
    }

    .header-text h1 {
        font-size: 1.25rem;
        margin-bottom: var(--spacing-xs);
    }

    .header-text p {
        font-size: 0.875rem;
        -webkit-line-clamp: 2;
    }

    /* Map Controls Mobile Optimization */
    .map-controls {
        top: calc(var(--spacing-lg) + 140px); /* Increased spacing from header */
        left: 0;
        right: 0;
        padding: 0 var(--spacing-sm);
        width: 100%;
    }

    .search-container {
        margin: 0 var(--spacing-sm);
        width: calc(100% - var(--spacing-md));
        gap: var(--spacing-xs);
    }

    .filter-toggle {
        width: 40px;
        height: 40px;
        min-width: 40px; /* Prevent shrinking */
        border-radius: 8px;
    }

    .search-input {
        height: 40px;
        font-size: 14px;
        padding: 0 40px 0 12px;
        border-radius: 8px;
    }

    .search-icon {
        right: 12px;
        width: 16px;
        height: 16px;
    }

    /* Adjust logo size */
    .logo-container {
        height: 40px;
    }

    .logo {
        height: 40px;
        width: auto;
    }
}

/* Ensure proper spacing for the map container */
@media (max-width: 768px) {
    .map-container {
        padding-top: 180px; /* Adjust based on header height */
    }
}

/* Search Container Base Styles */
.search-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    display: flex;
    align-items: center;
        gap: var(--spacing-sm);
    }

/* Mobile Search Container */
@media (max-width: 768px) {
    .map-controls {
        position: fixed;
        top: calc(var(--spacing-lg) + 140px);
        left: 0;
        right: 0;
        padding: 0;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .search-container {
        width: calc(100% - 32px);
        max-width: none;
        margin: 0 16px;
        gap: 8px;
    }

    .filter-toggle {
        width: 40px;
        height: 40px;
        min-width: 40px;
        border-radius: 8px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .search-input {
        height: 40px;
        border-radius: 8px;
        font-size: 14px;
        padding: 0 40px 0 12px;
        flex: 1;
    }

    .search-icon {
        position: absolute;
        right: 12px;
        top: 50%;
        transform: translateY(-50%);
        width: 16px;
        height: 16px;
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .map-controls {
        position: fixed;
        top: 180px;
        left: 0;
        right: 0;
        padding: 0;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .search-container {
        width: calc(100% - 32px);
        max-width: none;
        margin: 0 16px;
        gap: 8px;
    }
}

/* Ensure proper spacing for the map container */
@media (max-width: 768px) {
    .map-container {
        padding-top: 260px;
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .legend {
        display: none; /* Hide legend on mobile */
    }
}

/* Intro Screen */
.intro-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--header-background);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.intro-content {
    position: relative;
    max-width: 800px;
    width: 90%;
    padding: 40px;
    text-align: center;
    color: var(--light-text);
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin: auto;
    transform: translateY(0);
    transition: transform 0.5s ease;
}

.intro-background {
    position: fixed;
    inset: 0;
    background: linear-gradient(145deg, #1a2634 0%, #2C3E50 100%);
    z-index: -2;
}

.intro-gradient-overlay {
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(circle at 70% 20%, rgba(76, 175, 80, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 30% 80%, rgba(33, 150, 243, 0.08) 0%, transparent 50%);
    z-index: -1;
}

.intro-pattern {
    position: fixed;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M54.627 0l.83.828-1.415 1.415L51.8 0h2.827zM5.373 0l-.83.828L5.96 2.243 8.2 0H5.374zM48.97 0l3.657 3.657-1.414 1.414L46.143 0h2.828zM11.03 0L7.372 3.657 8.787 5.07 13.857 0H11.03zm32.284 0L49.8 6.485 48.384 7.9l-7.9-7.9h2.83zM16.686 0L10.2 6.485 11.616 7.9l7.9-7.9h-2.83zM22.344 0L13.858 8.485 15.272 9.9l7.9-7.9h-.828zm13.312 0l8.485 8.485-1.414 1.414-7.9-7.9h.828zm-9.9 0l7.9 7.9-1.415 1.415-7.9-7.9h1.414zm6.486 0l7.9 7.9-1.414 1.415-7.9-7.9h1.414zM34.97 0l3.657 3.657-1.414 1.414L33.143 0h1.828zm-9.9 0l3.657 3.657-1.414 1.414L23.243 0h1.828zm6.486 0l3.657 3.657-1.414 1.414L26.8 0h4.757zm-6.485 0L28.8 3.828 27.384 5.242 24.97 2.828 19.8 0h5.272zm-3.657 0l3.657 3.657-1.414 1.414L13.372 0h2.828zm10.142 0L36.8 3.828 35.384 5.242 33.97 2.828V0h1.414zm-6.485 0L29.8 3.828 28.384 5.242 26.97 2.828V0h1.414zM22.97 0L25.8 2.828 24.384 4.242 22.97 2.828V0zm13.313 0L39.8 3.828 38.384 5.242 36.97 2.828V0h-.687z' fill='%23ffffff' fill-opacity='0.4' fill-rule='evenodd'/%3E%3C/svg%3E");
    z-index: -1;
}

.intro-screen.visible {
    opacity: 1;
    visibility: visible;
}

.intro-content {
    position: relative;
    max-width: 800px;
    width: 90%;
    padding: 40px;
    text-align: center;
    color: var(--light-text);
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin: auto;
    transform: translateY(0);
    transition: transform 0.5s ease;
}

.intro-screen.visible .intro-content {
    opacity: 1;
    transform: translateY(0);
}

.intro-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.intro-logo {
    height: 64px;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.2));
    animation: floatAnimation 4s ease-in-out infinite;
}

.intro-title-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 800px;
}

.intro-title-group h1 {
    font-size: 3rem;
    margin: 0;
    line-height: 1.1;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 60%, rgba(255, 255, 255, 0.8));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.intro-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-weight: 400;
    line-height: 1.5;
}

.intro-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin: 0;
    width: 100%;
}

.intro-feature {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.intro-feature:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.1);
}

.feature-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
}

.feature-icon svg {
    width: 24px;
        height: 24px;
    color: rgba(255, 255, 255, 0.9);
}

.feature-content h3 {
    font-size: 1.125rem;
    margin: 0 0 8px;
    color: #fff;
    font-weight: 600;
}

.feature-content p {
    font-size: 0.9375rem;
    margin: 0;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.7);
}

.intro-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
}

.intro-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    font-size: 1.125rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.intro-button:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 24px rgba(76, 175, 80, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.2);
}

.intro-button:active {
    transform: translateY(1px);
}

.intro-button svg {
    transition: transform 0.3s ease;
}

.intro-button:hover svg {
    transform: translateX(4px);
}

@keyframes floatAnimation {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .intro-feature {
        padding: 20px;
        gap: 12px;
        flex-direction: row;
        align-items: center;
    }

    .intro-feature:hover {
        transform: translateY(-2px);
    }

    .intro-button {
        width: 100%;
        padding: 14px 24px;
        font-size: 1rem;
        justify-content: center;
    }

    .intro-logo {
        height: 40px;
        animation: floatAnimation 3s ease-in-out infinite;
    }
}

/* Portrait-specific adjustments */
@media (max-width: 768px) and (max-height: 700px) {
    .intro-logo {
        height: 32px;
        animation: floatAnimation 3s ease-in-out infinite;
    }

    .intro-feature:hover {
        transform: translateY(-1px);
    }
}

/* Tutorial Overlay */
.tutorial-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 38, 52, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1900;
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.tutorial-overlay.visible {
    display: flex;
    opacity: 1;
}

.tutorial-content {
    max-width: 600px;
    width: 100%;
    margin: auto;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    color: white;
}

.tutorial-progress {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
}

.progress-dots {
    display: flex;
    gap: 8px;
}

.progress-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.progress-dots .dot.active {
    background: #4CAF50;
    transform: scale(1.2);
}

.skip-tutorial {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 16px;
    transition: all 0.3s ease;
}

.skip-tutorial:hover {
    color: white;
}

.tutorial-slides {
    position: relative;
    height: 300px;
}

.tutorial-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.tutorial-slide.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.slide-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    max-width: 400px;
    padding: 0 16px;
}

.slide-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(46, 125, 50, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4CAF50;
    box-shadow: 
        0 8px 24px rgba(76, 175, 80, 0.2),
        inset 0 0 0 1px rgba(76, 175, 80, 0.1);
}

.slide-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #ffffff 60%, rgba(255, 255, 255, 0.8));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.slide-content p {
    font-size: 1.125rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.tutorial-nav {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
}

.nav-button {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.nav-button span {
    display: none;
}

/* Special styling for the Start Exploring button */
.nav-button.start-exploring {
    width: auto;
    min-width: 160px;
    padding: 0 24px;
    background: linear-gradient(135deg, var(--button-primary) 0%, var(--button-primary-hover) 100%);
    border: none;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.5px;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(41, 98, 255, 0.3);
}

.nav-button.start-exploring span {
    display: inline;
}

.nav-button.start-exploring:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 6px 16px rgba(41, 98, 255, 0.4);
}

.nav-button:hover:not(:disabled):not(.start-exploring) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.nav-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .nav-button {
        width: 40px;
        height: 40px;
    }

    .nav-button.start-exploring {
        min-width: 140px;
        padding: 0 16px;
        font-size: 0.9375rem;
    }
}

/* Portrait-specific adjustments */
@media (max-width: 768px) and (max-height: 700px) {
    .tutorial-slides {
        height: 240px;
    }

    .slide-icon {
        width: 48px;
        height: 48px;
    }

    .slide-content {
        gap: 16px;
    }

    .slide-content p {
        font-size: 0.9375rem;
    }
}

.tutorial-nav {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.nav-button {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.nav-button:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.nav-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .tutorial-content {
        padding: 24px 16px;
        gap: 24px;
    }

    .tutorial-slides {
        height: 280px;
    }

    .slide-icon {
        width: 56px;
        height: 56px;
    }

    .slide-content h3 {
        font-size: 1.25rem;
    }

    .slide-content p {
        font-size: 1rem;
    }

    .nav-button {
        width: 40px;
        height: 40px;
    }
}

/* Portrait-specific adjustments */
@media (max-width: 768px) and (max-height: 700px) {
    .tutorial-slides {
        height: 240px;
    }

    .slide-icon {
        width: 48px;
        height: 48px;
    }

    .slide-content {
        gap: 16px;
    }

    .slide-content p {
        font-size: 0.9375rem;
    }
}

.form-feedback {
  margin: 15px 0;
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-10px);
    transition: all 0.3s ease;
}

.form-feedback:not(:empty) {
  opacity: 1;
  transform: translateY(0);
}

.form-feedback[style*="var(--success)"] {
  background-color: rgba(0, 200, 83, 0.1);
  border: 1px solid rgba(0, 200, 83, 0.2);
}

.form-feedback[style*="var(--error)"] {
  background-color: rgba(255, 0, 0, 0.1);
  border: 1px solid rgba(255, 0, 0, 0.2);
}

.about-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2001;
}

.about-modal-overlay.active {
    opacity: 1;
}

.about-modal {
    position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    background-color: white;
        padding: 0;
    border-radius: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 90vw;
    width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    display: none;
    opacity: 0;
    transform: translate(-50%, -45%);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 2002;
}

.about-modal.active {
    opacity: 1;
    transform: translate(-50%, -50%);
}

.about-modal-header {
    background-color: var(--primary);
    color: white;
    padding: 20px 24px;
    margin: -1px;
    width: calc(100% + 2px);
}

.about-modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.about-modal-content {
    padding: 24px;
}

.about-modal-content p {
    margin: 0 0 16px;
    line-height: 1.6;
    color: #333;
}

.about-modal-content p:last-child {
    margin-bottom: 0;
}

#closeAboutModal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    font-size: 24px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

#closeAboutModal:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .about-modal {
        width: 95vw;
    }
    
    .about-modal-header {
        padding: 16px 20px;
    }
    
    .about-modal-content {
        padding: 20px;
    }
}

@media (max-height: 600px) {
    .intro-screen {
        align-items: flex-start;
        overflow-y: auto;
    }
    
    .intro-content {
        margin: 40px auto;
    }
}

.popup-section .agency-text {
    font-size: 11px;
    line-height: 1.4;
    margin: 0;
    color: var(--text-dark);
    font-weight: 500;
} 