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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #e0e0e0;
    background-color: #1a1a1a;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: hidden;
    height: 100vh;
    width: 100vw;
}

/* Import Google Fonts for modern typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@300;400;500;600;700&display=swap');

/* Header Styles */
.header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 0.3rem 0;
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
    border-bottom: 1px solid #34495e;
    position: relative;
    z-index: 10000;
}

.header-content {
    text-align: center;
    margin-bottom: 0.5rem;
}

.site-title {
    font-family: 'Poppins', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Toolbar Toggle Button */
.toolbar-toggle {
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    z-index: 1001;
}

/* Hide toolbar toggle button on Firefox */
@-moz-document url-prefix() {
    .toolbar-toggle {
        display: none !important;
    }
    
    /* Firefox-specific AdSense fixes */
    .toolbar-adsense {
        width: 280px !important;
        height: 60px !important;
        max-width: 280px !important;
        max-height: 60px !important;
        min-width: 280px !important;
        min-height: 60px !important;
        overflow: hidden !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .toolbar-adsense .adsbygoogle {
        width: 280px !important;
        height: 60px !important;
        max-width: 280px !important;
        max-height: 60px !important;
        min-width: 280px !important;
        min-height: 60px !important;
        overflow: hidden !important;
        display: block !important;
    }
    
    .toolbar-adsense .ad-placeholder {
        width: 280px !important;
        height: 60px !important;
        max-width: 280px !important;
        max-height: 60px !important;
        min-width: 280px !important;
        min-height: 60px !important;
        overflow: hidden !important;
    }
}

.toolbar-toggle-btn {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.2) 0%, rgba(155, 89, 182, 0.2) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    /* User select and appearance */
    -moz-user-select: none;
    -webkit-user-select: none;
    user-select: none;
    -moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;
    /* Position and layering */
    position: relative;
    z-index: 1002;
    outline: none;
    -moz-outline: none;
    /* Mobile Safari fixes */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.toolbar-toggle-btn:hover {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.3) 0%, rgba(155, 89, 182, 0.3) 100%);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toolbar-toggle-btn.active {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.6) 0%, rgba(192, 57, 43, 0.5) 100%);
    border-color: rgba(231, 76, 60, 1);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.6), inset 0 1px 3px rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.toolbar-toggle-btn.active:hover {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.7) 0%, rgba(192, 57, 43, 0.6) 100%);
    border-color: rgba(231, 76, 60, 1);
    transform: translateY(-1px);
    box-shadow: 0 0 25px rgba(231, 76, 60, 0.7), inset 0 1px 3px rgba(255, 255, 255, 0.3);
}

/* Toolbar Styles */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    padding: 0.3rem 0.8rem;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(155, 89, 182, 0.1) 50%, rgba(46, 204, 113, 0.1) 100%);
    border-radius: 8px;
    margin: 0 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    max-width: calc(100vw - 2rem);
    overflow: visible; /* Changed from hidden to allow dropdown to show */
    transition: all 0.3s ease;
    position: relative;
    z-index: 10001;
    /* Firefox-specific fixes */
    -moz-transition: all 0.3s ease;
    -webkit-transition: all 0.3s ease;
}

.toolbar.hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.toolbar-adsense {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 280px;
    min-height: 60px;
    max-width: 280px;
    max-height: 60px;
    width: 280px;
    height: 60px;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.toolbar-adsense .adsbygoogle {
    display: block !important;
    width: 280px !important;
    height: 60px !important;
    max-width: 280px !important;
    max-height: 60px !important;
    overflow: hidden !important;
}

/* Layout adjustments when ad is hidden/blocked - flexbox handles automatically */

/* Fallback: Hide ad container if it has no content (for testing) */
.toolbar-adsense:empty {
    display: none !important;
}

/* Fallback: Hide ad container if ad element is empty */
.toolbar-adsense .adsbygoogle:empty {
    display: none !important;
}

.toolbar-adsense .adsbygoogle:empty + * {
    /* Hide the container if the ad is empty */
    display: none !important;
}

/* More aggressive CSS-only ad blocker detection */
.toolbar-adsense .adsbygoogle {
    min-height: 60px;
    min-width: 280px;
}

/* If ad element has no height, hide the container */
.toolbar-adsense .adsbygoogle[style*="height: 0"],
.toolbar-adsense .adsbygoogle[style*="height:0px"],
.toolbar-adsense .adsbygoogle[style*="height: 0px"] {
    display: none !important;
}

.toolbar-adsense .adsbygoogle[style*="height: 0"] ~ *,
.toolbar-adsense .adsbygoogle[style*="height:0px"] ~ *,
.toolbar-adsense .adsbygoogle[style*="height: 0px"] ~ * {
    display: none !important;
}

/* Hide container if ad has no meaningful content */
.toolbar-adsense:has(.adsbygoogle:empty) {
    display: none !important;
}

/* Alternative: Use a more direct approach - hide if no iframe or img inside */
.toolbar-adsense .adsbygoogle:not(:has(iframe)):not(:has(img)):not(:has(div)) {
    display: none !important;
}

/* Most direct approach: Hide the entire ad container if it doesn't contain actual ad content */
.toolbar-adsense:not(:has(iframe)):not(:has(img)):not(:has(div[style*="background"])) {
    display: none !important;
}

/* Force hide ad container if it's empty or has no visible content */
.toolbar-adsense {
    transition: all 0.3s ease;
}

.toolbar-adsense:empty,
.toolbar-adsense .adsbygoogle:empty {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
}

/* More aggressive CSS for when ad is hidden */
.toolbar.ad-hidden .toolbar-adsense {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

.main-content.ad-hidden {
    height: calc(100vh - 120px) !important;
    max-height: calc(100vh - 120px) !important;
}

.main-content.ad-hidden.toolbar-hidden {
    height: calc(100vh - 60px) !important;
    max-height: calc(100vh - 60px) !important;
}


.toolbar-btn {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8);
    padding: 0.4rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
    overflow: hidden;
    /* Mobile Safari compatibility */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

.toolbar-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.toolbar-btn.active::before {
    left: 100%;
}

.toolbar-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.toolbar-btn:active {
    transform: translateY(0);
}

/* Toolbar links styled as buttons */
.toolbar-link {
    text-decoration: none;
    display: inline-flex;
}

.toolbar-link:visited {
    color: inherit;
}

/* General active state for toggle buttons */
.toolbar-btn.active {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.4) 0%, rgba(39, 174, 96, 0.3) 100%);
    border-color: rgba(46, 204, 113, 0.8);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.4), inset 0 1px 3px rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.toolbar-btn.active:hover {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.5) 0%, rgba(39, 174, 96, 0.4) 100%);
    border-color: rgba(46, 204, 113, 1);
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.5), inset 0 1px 3px rgba(255, 255, 255, 0.3);
}

/* Active indicator dot */
.toolbar-btn.active::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #2ecc71;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 0 6px rgba(46, 204, 113, 0.8);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 6px rgba(46, 204, 113, 0.8);
    }
    50% {
        box-shadow: 0 0 12px rgba(46, 204, 113, 1);
    }
    100% {
        box-shadow: 0 0 6px rgba(46, 204, 113, 0.8);
    }
}

/* Search Container */
.search-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-input {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 6px 0 0 6px;
    font-size: 0.85rem;
    min-width: 180px;
    outline: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    background: rgba(255,255,255,0.08);
    color: white;
    backdrop-filter: blur(10px);
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 32px;
    box-sizing: border-box;
}

.search-input::placeholder {
    color: rgba(255,255,255,0.7);
}

.search-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 32px;
    box-sizing: border-box;
    /* Mobile Safari compatibility */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.search-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1f5f8b 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* Dropdown Menu Styles */
.dropdown-container {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: fixed;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    min-width: 220px;
    z-index: 100000;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
    overflow: hidden;
}

.dropdown-menu.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    display: none;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    /* Mobile Safari compatibility */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

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

.dropdown-item:hover {
    background: rgba(52, 152, 219, 0.2);
    padding-left: 20px;
}

.dropdown-item:active {
    background: rgba(52, 152, 219, 0.3);
}

.dropdown-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropdown-icon-img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.dropdown-text {
    flex: 1;
    white-space: nowrap;
}

/* Main Content */
.main-content {
    position: relative;
    height: calc(100vh - 80px);
    min-height: 0;
    max-height: calc(100vh - 80px);
    overflow: hidden;
    transition: height 0.3s ease;
}

.main-content.toolbar-hidden {
    height: calc(100vh - 50px);
    max-height: calc(100vh - 50px);
}

/* AdSense styling is now in toolbar */

/* Map Container */
.map-container {
    width: calc(100% - 1rem);
    height: calc(100% - 1rem);
    background: #2c3e50;
    border-radius: 8px;
    margin: 0.5rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    overflow: hidden;
    border: 1px solid #34495e;
}

/* Legend Panel */
.legend-panel {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(44, 62, 80, 0.95);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    min-width: 250px;
    z-index: 1000;
    animation: slideIn 0.3s ease;
    border: 1px solid #34495e;
    backdrop-filter: blur(10px);
}

.legend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #34495e;
    background: rgba(52, 73, 94, 0.8);
    border-radius: 8px 8px 0 0;
}

.legend-header h3 {
    margin: 0;
    color: #e0e0e0;
    font-size: 1rem;
    font-weight: 500;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #bdc3c7;
    padding: 0;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    /* Mobile touch support */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

.close-btn:hover,
.close-btn:active {
    background: rgba(255,255,255,0.1);
    color: #e0e0e0;
}

.legend-content {
    padding: 0.75rem 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.2s ease;
    color: #e0e0e0;
}

.legend-item:hover {
    background: rgba(255,255,255,0.05);
}

.legend-item.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.legend-item.clickable:hover {
    background: rgba(52, 152, 219, 0.1);
    transform: translateX(5px);
}

.legend-item.clickable.selected {
    background: rgba(52, 152, 219, 0.2);
    border-left: 3px solid #3498db;
    padding-left: 0.75rem;
}

.legend-item.clickable.selected .legend-color {
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
    transform: scale(1.1);
}

/* Non-clickable legend items should not have hover effects */
.legend-item:not(.clickable) {
    cursor: default;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

/* Search Results */
.search-results {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(44, 62, 80, 0.95);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    max-width: 300px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    animation: slideIn 0.3s ease;
    border: 1px solid #34495e;
    backdrop-filter: blur(10px);
}

.search-result-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #34495e;
    cursor: pointer;
    transition: background 0.2s ease;
    color: #e0e0e0;
}

.search-result-item:hover {
    background: rgba(255,255,255,0.05);
}

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

/* Footer */
.footer {
    background: #2c3e50;
    color: #bdc3c7;
    text-align: center;
    padding: 0.5rem;
    margin-top: auto;
    border-top: 1px solid #34495e;
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
}

.footer a {
    color: #3498db;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
    color: #5dade2;
}

/* Utility Classes */
.hidden {
    display: none;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Print Button Specific Styles */
.toolbar-btn[title="Print Map"] {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.2) 0%, rgba(52, 152, 219, 0.1) 100%);
    border-color: rgba(52, 152, 219, 0.4);
}

.toolbar-btn[title="Print Map"]:hover {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.3) 0%, rgba(52, 152, 219, 0.2) 100%);
    border-color: rgba(52, 152, 219, 0.6);
}

/* My Location Button Specific Styles */
.toolbar-btn[title="My Location"] {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.2) 0%, rgba(46, 204, 113, 0.1) 100%);
    border-color: rgba(46, 204, 113, 0.4);
}

.toolbar-btn[title="My Location"]:hover {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.3) 0%, rgba(46, 204, 113, 0.2) 100%);
    border-color: rgba(46, 204, 113, 0.6);
}

/* Buy Maps Button Specific Styles */
.toolbar-btn[title="Buy Maps for This Area"] {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2) 0%, rgba(255, 152, 0, 0.1) 100%);
    border-color: rgba(255, 193, 7, 0.4);
}

.toolbar-btn[title="Buy Maps for This Area"]:hover {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.3) 0%, rgba(255, 152, 0, 0.2) 100%);
    border-color: rgba(255, 193, 7, 0.6);
}

/* Food Establishments Button Specific Styles */
.toolbar-btn[title="Food Establishments"] {
    background: linear-gradient(135deg, rgba(255, 87, 34, 0.2) 0%, rgba(244, 67, 54, 0.1) 100%);
    border-color: rgba(255, 87, 34, 0.4);
}

.toolbar-btn[title="Food Establishments"]:hover {
    background: linear-gradient(135deg, rgba(255, 87, 34, 0.3) 0%, rgba(244, 67, 54, 0.2) 100%);
    border-color: rgba(255, 87, 34, 0.6);
}

/* Public Transport Button Specific Styles */
.toolbar-btn[title="Show Public Transport"], 
.toolbar-btn[title="Hide Public Transport"] {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.2) 0%, rgba(52, 152, 219, 0.1) 100%);
    border-color: rgba(74, 144, 226, 0.4);
}

.toolbar-btn[title="Show Public Transport"]:hover, 
.toolbar-btn[title="Hide Public Transport"]:hover {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.3) 0%, rgba(52, 152, 219, 0.2) 100%);
    border-color: rgba(74, 144, 226, 0.6);
}

.toolbar-btn[title="Hide Public Transport"].active {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.6) 0%, rgba(52, 152, 219, 0.5) 100%);
    border-color: rgba(74, 144, 226, 1);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(74, 144, 226, 0.6), inset 0 1px 3px rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.toolbar-btn[title="Hide Public Transport"].active:hover {
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.7) 0%, rgba(52, 152, 219, 0.6) 100%);
    border-color: rgba(74, 144, 226, 1);
    transform: translateY(-1px);
    box-shadow: 0 0 25px rgba(74, 144, 226, 0.7), inset 0 1px 3px rgba(255, 255, 255, 0.3);
}

/* Transport button specific indicator dot */
.toolbar-btn[title="Hide Public Transport"].active::after {
    background: #4A90E2;
    box-shadow: 0 0 6px rgba(74, 144, 226, 0.8);
}

/* Toolbar toggle button specific indicator dot */
.toolbar-toggle-btn.active::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #e74c3c;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 0 6px rgba(231, 76, 60, 0.8);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 6px rgba(231, 76, 60, 0.8);
    }
    50% {
        box-shadow: 0 0 12px rgba(231, 76, 60, 1);
    }
    100% {
        box-shadow: 0 0 6px rgba(231, 76, 60, 0.8);
    }
}

/* User Location Marker Styles */
.user-location-marker {
    background: transparent;
    border: none;
}

.user-location-marker div {
    font-size: 24px;
    text-align: center;
    line-height: 32px;
}

/* Info Modal Styles */
.info-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    /* Mobile touch support */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.info-modal.hidden {
    display: none !important;
}

/* About Modal Styles */
.about-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    /* Firefox fallback */
    -moz-backdrop-filter: blur(5px);
    /* Mobile touch support */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.about-modal.hidden {
    display: none !important;
}


.about-content {
    padding: 1rem 1.5rem;
    color: #e0e0e0;
    line-height: 1.6;
}

.about-content ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.about-content li {
    margin-bottom: 0.75rem;
    color: #e0e0e0;
}

.about-content p {
    margin-bottom: 0;
    color: #e0e0e0;
}

.about-content a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.about-content a:hover {
    color: #5dade2;
    text-decoration: underline;
}

/* Firefox-specific button fixes */
@-moz-document url-prefix() {
    .toolbar-btn {
        -moz-appearance: none;
        -webkit-appearance: none;
        appearance: none;
        background: rgba(255,255,255,0.08);
        border: 1px solid rgba(255,255,255,0.15);
        color: white;
        padding: 0.6rem;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.3s ease;
        font-size: 1rem;
        font-weight: 500;
        min-width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        backdrop-filter: blur(10px);
        font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        -moz-user-select: none;
        -webkit-user-select: none;
        user-select: none;
        outline: none;
        -moz-outline: none;
    }
    
    .toolbar-btn:hover {
        background: rgba(255,255,255,0.15);
        border-color: rgba(255,255,255,0.3);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }
    
    .toolbar-btn:active {
        transform: translateY(0);
    }
}

.modal-content {
    background: rgba(44, 62, 80, 0.95);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    border: 1px solid #34495e;
    backdrop-filter: blur(15px);
    animation: modalSlideIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #34495e;
    background: rgba(52, 73, 94, 0.8);
}

.modal-header h3 {
    margin: 0;
    color: #e0e0e0;
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-body {
    padding: 0;
    max-height: calc(80vh - 80px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Tab Styles */
.tab-buttons {
    display: flex;
    background: rgba(52, 73, 94, 0.6);
    border-bottom: 1px solid #34495e;
    overflow-x: auto;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.tab-btn {
    background: none;
    border: none;
    color: #bdc3c7;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    flex-shrink: 0;
    min-width: fit-content;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
}

.tab-btn.active {
    color: #3498db;
    border-bottom-color: #3498db;
    background: rgba(52, 152, 219, 0.1);
}

.tab-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.tab-panel {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    display: none;
    min-height: 0;
}

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

.loading {
    text-align: center;
    color: #bdc3c7;
    padding: 2rem;
    font-style: italic;
}

/* Info Table Styles */
.infoTable {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    overflow: hidden;
}

.infoTable td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

.infoTable td:first-child {
    font-weight: 600;
    color: #3498db;
    background: rgba(52, 152, 219, 0.1);
    width: 30%;
}

.infoTable tr:last-child td {
    border-bottom: none;
}

/* Info Table Link Styles */
.infoTable a {
    color: #5dade2 !important;
    text-decoration: underline !important;
    font-weight: 500;
    transition: all 0.3s ease;
}

.infoTable a:hover {
    color: #85c1e9 !important;
    text-decoration: underline !important;
    background: rgba(93, 173, 226, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
}

/* Coordinate Link Styles */
.coordinate-link {
    color: #5dade2 !important;
    text-decoration: underline !important;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 2px 4px;
    border-radius: 3px;
}

.coordinate-link:hover {
    color: #85c1e9 !important;
    background: rgba(93, 173, 226, 0.2);
    text-decoration: underline !important;
}


/* Info Toolbar Styles */
#infoToolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(52, 73, 94, 0.6);
    border-radius: 6px;
    border: 1px solid #34495e;
}

#infoToolbar a {
    display: inline-block;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background 0.2s ease;
}

#infoToolbar a:hover {
    background: rgba(255, 255, 255, 0.1);
}

#infoToolbar img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

#infoToolbar span {
    color: #bdc3c7;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

/* Modal Animation */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Print Styles */
@media print {
    /* Set page orientation to landscape */
    @page {
        size: landscape;
        margin: 0.25in;
    }
    
    /* Hide everything except the map */
    .header,
    .footer,
    .legend-panel,
    .search-results,
    .toolbar {
        display: none !important;
    }
    
    /* Reset body for printing */
    body {
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        width: 100% !important;
        height: 100% !important;
    }
    
    /* Make map take full page */
    .main-content {
        position: static !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    
    .map-container {
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        height: 9in !important;
        width: 11in !important;
        max-width: none !important;
        max-height: none !important;
        overflow: visible !important;
    }
    
    /* Ensure map tiles are visible */
    .leaflet-container {
        height: 9in !important;
        width: 11in !important;
        max-width: none !important;
        max-height: none !important;
    }
    
    /* Hide map controls during print */
    .leaflet-control-container {
        display: none !important;
    }
    
    /* Force single page */
    .main-content,
    .map-container,
    .leaflet-container {
        page-break-after: avoid !important;
        page-break-before: avoid !important;
        page-break-inside: avoid !important;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
        overflow-y: hidden;
        height: 100vh;
        width: 100vw;
        position: fixed;
        /* Mobile Safari viewport fix */
        height: -webkit-fill-available;
    }
    
    .header {
        padding: 0.3rem 0;
        position: relative;
        z-index: 1000;
    }
    
    .site-title {
        font-size: 1.4rem;
    }
    
    .toolbar-toggle {
        top: 0.2rem;
        right: 0.5rem;
        z-index: 1001;
    }
    
    .toolbar-toggle-btn {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
        touch-action: manipulation;
    }
    
    .toolbar {
        flex-direction: column;
        gap: 0.6rem;
        max-width: calc(100vw - 1rem);
        margin: 0 0.5rem;
        justify-content: flex-start;
        padding: 0.4rem 0.8rem;
        position: relative;
        z-index: 999;
    }
    
    .toolbar-adsense {
        order: -1;
        align-self: center;
        overflow: hidden;
        border-radius: 0;
        background: transparent;
        border: none;
        box-shadow: none;
        backdrop-filter: none;
        min-width: 280px;
        min-height: 60px;
        max-width: 280px;
        max-height: 60px;
        width: 280px;
        height: 60px;
    }
    
    /* HIDE AD CONTAINER COMPLETELY ON MOBILE - Simple solution */
    .toolbar-adsense {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        max-height: 0 !important;
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .toolbar-adsense .ad-placeholder {
        display: none !important;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        width: 0 !important;
        height: 0 !important;
        max-width: 0 !important;
        max-height: 0 !important;
        min-width: 0 !important;
        min-height: 0 !important;
    }
    
    .toolbar-adsense .ad-placeholder * {
        display: none !important;
        border-radius: 0 !important;
        overflow: hidden !important;
    }
    
    .toolbar-adsense .adsbygoogle {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
        max-width: 0 !important;
        max-height: 0 !important;
        min-width: 0 !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }
    
    .toolbar-adsense * {
        display: none !important;
        height: 0 !important;
        width: 0 !important;
    }
    
    .search-input {
        min-width: 160px;
        max-width: calc(100vw - 8rem);
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.7rem 1rem;
    }
    
    .search-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
        touch-action: manipulation;
    }
    
    .main-content {
        height: calc(100vh - 80px);
        margin: 0.2rem;
        max-height: calc(100vh - 80px);
        position: relative;
        overflow: hidden;
    }
    
    .main-content.toolbar-hidden {
        height: calc(100vh - 50px);
        max-height: calc(100vh - 50px);
    }
    
    /* Mobile adjustments - flexbox handles everything automatically */
    
    /* Force hide ad container on mobile when ad-hidden class is applied */
    .toolbar.ad-hidden .toolbar-adsense,
    .toolbar-adsense[style*="display: none"],
    .toolbar-adsense[style*="display:none"] {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        max-height: 0 !important;
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
        order: 0 !important;
    }
    
    .map-container {
        margin: 0;
        width: 100%;
        height: 100%;
        border-radius: 6px;
        border: 1px solid #34495e;
    }
    
    .legend-panel {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        max-width: 90vw;
        max-height: 80vh;
        z-index: 2000;
    }
    
    /* Improve touch targets */
    .toolbar-btn {
        min-width: 44px;
        height: 44px;
        font-size: 1rem;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .toolbar-group {
        gap: 0.4rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* Dropdown menu adjustments for mobile */
    .dropdown-menu {
        min-width: 260px;
        max-width: 90vw;
    }
    
    .dropdown-item {
        padding: 14px 18px;
        font-size: 1rem;
        gap: 14px;
    }
    
    .dropdown-icon {
        font-size: 1.3rem;
        width: 28px;
    }
    
    .dropdown-icon-img {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 1.2rem;
    }
    
    .toolbar-toggle {
        top: 0.2rem;
        right: 0.3rem;
    }
    
    .toolbar-toggle-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .toolbar-btn {
        min-width: 40px;
        height: 40px;
        font-size: 0.9rem;
        padding: 0.5rem;
    }
    
    .search-input {
        min-width: 120px;
        max-width: calc(100vw - 6rem);
        font-size: 16px;
        padding: 0.6rem 0.8rem;
    }
    
    .search-btn {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
    }
    
    .toolbar {
        max-width: calc(100vw - 0.5rem);
        margin: 0 0.25rem;
        gap: 0.4rem;
        padding: 0.3rem 0.6rem;
    }
    
    .toolbar-group {
        gap: 0.3rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .main-content {
        height: calc(100vh - 160px);
        max-height: calc(100vh - 160px);
        margin: 0.1rem;
    }
    
    .main-content.toolbar-hidden {
        height: calc(100vh - 70px);
        max-height: calc(100vh - 70px);
    }
    
    .map-container {
        border-radius: 4px;
    }
    
    /* Modal responsive styles */
    .modal-content {
        width: 95%;
        max-height: 90vh;
        margin: 1rem;
    }
    
    .tab-buttons {
        flex-wrap: wrap;
        gap: 0.2rem;
    }
    
    .tab-btn {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
        min-width: fit-content;
        min-height: 44px; /* iOS minimum touch target */
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Ensure close buttons are large enough for mobile */
    .close-btn {
        min-width: 44px;
        min-height: 44px;
        width: 44px;
        height: 44px;
        font-size: 1.5rem;
    }
    
    /* Hide fullscreen button on mobile devices */
    #fullscreenBtn {
        display: none !important;
    }
    
    /* Improve legend panel for small screens */
    .legend-panel {
        max-width: 95vw;
        max-height: 85vh;
        min-width: 280px;
    }
    
    .legend-content {
        padding: 0.5rem 0.75rem;
    }
    
    .legend-item {
        padding: 0.4rem;
        font-size: 0.9rem;
    }
    
    /* AdSense responsive styling moved to toolbar */
}

/* Extra small mobile devices */
@media (max-width: 360px) {
    .toolbar {
        padding: 0.2rem 0.4rem;
        gap: 0.3rem;
    }
    
    .toolbar-btn {
        min-width: 36px;
        height: 36px;
        font-size: 0.8rem;
        padding: 0.4rem;
    }
    
    .search-input {
        min-width: 100px;
        font-size: 16px;
        padding: 0.5rem 0.6rem;
    }
    
    .search-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.75rem;
    }
    
    .main-content {
        height: calc(100vh - 150px);
        max-height: calc(100vh - 150px);
    }
    
    .main-content.toolbar-hidden {
        height: calc(100vh - 60px);
        max-height: calc(100vh - 60px);
    }
    
    .legend-panel {
        max-width: 98vw;
        min-width: 260px;
    }
    
    .modal-content {
        width: 98%;
        margin: 0.5rem;
    }
}

/* Mobile landscape orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .main-content {
        height: calc(100vh - 120px);
        max-height: calc(100vh - 120px);
    }
    
    .main-content.toolbar-hidden {
        height: calc(100vh - 60px);
        max-height: calc(100vh - 60px);
    }
    
    .toolbar {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.4rem;
        padding: 0.3rem 0.6rem;
    }
    
    .toolbar-adsense {
        order: 0;
        min-width: 200px;
        max-width: 200px;
        width: 200px;
    }
    
    .toolbar-group {
        gap: 0.3rem;
    }
}

/* Prevent zoom on input focus for iOS */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .search-input {
        font-size: 16px !important;
    }
}
