body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #000;
}

#map {
    width: 100vw;
    height: 100vh;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#overlay-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1000;
}

.leaflet-tile-container {
    image-rendering: pixelated;
}

/* Move Leaflet zoom controls to bottom left */
.leaflet-top.leaflet-left {
    top: auto;
    bottom: 20px;
    left: 20px;
}

/* Adjust controls styling */
.leaflet-control-zoom {
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    overflow: hidden;
}

.leaflet-control-zoom a {
    width: 40px;
    height: 40px;
    line-height: 40px;
    font-size: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
}

.leaflet-control-zoom a:hover {
    background: rgba(255, 255, 255, 1);
}

/* Hide attribution always */
.leaflet-control-attribution {
    display: none !important;
}

/* Header */
#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    padding: 0 20px;
    z-index: 1100;
}

#logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-self: start;
}

#logo-icon {
    flex-shrink: 0;
}

#logo {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
    white-space: nowrap;
}

/* Search Bar - absolutely centered */
#search-container {
    position: relative;
    max-width: 400px;
    width: 100%;
    justify-self: center;
}

#search-input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 16px; /* Increased from 14px to prevent zoom on mobile */
    outline: none;
    box-sizing: border-box;
}

#search-input:focus {
    background: rgba(255, 255, 255, 1);
}

#search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(100, 100, 100, 0.8);
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: background 0.2s;
}

#search-btn:hover {
    background: rgba(80, 80, 80, 0.9);
}

#search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 2000;
}

#search-results.show {
    display: block;
}

.search-result-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

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

.search-result-name {
    font-weight: 600;
    color: #000;
    margin-bottom: 4px;
    font-size: 14px;
}

.search-result-detail {
    font-size: 12px;
    color: #666;
}

/* Hamburger Menu Button */
#menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-self: end;
}

#menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    transition: all 0.3s ease;
}

#menu-btn:hover span {
    background: #ccc;
}

#menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

#menu-btn.active span:nth-child(2) {
    opacity: 0;
}

#menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Menu Panel */
#menu-panel {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100vh;
    background: rgba(20, 20, 20, 0.98);
    backdrop-filter: blur(20px);
    z-index: 1200;
    transition: right 0.3s ease;
    overflow-y: auto;
    padding: 80px 25px 25px 25px;
    box-sizing: border-box;
}

#menu-panel.open {
    right: 0;
}

#menu-panel h2 {
    color: #fff;
    font-size: 20px;
    margin: 0 0 20px 0;
    font-weight: 700;
}

#menu-panel h3 {
    color: #aaa;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 20px 0 10px 0;
    font-weight: 600;
}

.menu-section {
    margin-bottom: 25px;
}

.menu-text {
    color: #ccc;
    font-size: 13px;
    line-height: 1.5;
}

.menu-credit {
    color: #999;
    font-size: 12px;
    text-align: center;
    margin: 0;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-credit a {
    color: #4a9eff;
    text-decoration: none;
    transition: color 0.2s;
}

.menu-credit a:hover {
    color: #6bb0ff;
    text-decoration: underline;
}

.action-btn {
    width: 100%;
    padding: 12px;
    background: rgba(100, 100, 100, 0.8);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.action-btn:hover {
    background: rgba(80, 80, 80, 0.9);
}

/* Menu Overlay */
#menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1150;
    display: none;
}

#menu-overlay.show {
    display: block;
}

/* Scrollbar for menu */
#menu-panel::-webkit-scrollbar {
    width: 6px;
}

#menu-panel::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

#menu-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Responsive */
@media (max-width: 768px) {
    #header {
        padding: 0 15px;
        grid-template-columns: auto 1fr auto;
    }
    
    #logo {
        font-size: 14px;
    }

    #logo-icon {
        width: 20px;
        height: 20px;
    }
    
    #search-container {
        max-width: 300px;
    }
    
    #menu-panel {
        width: 280px;
        right: -280px;
    }
}

/* Move search bar below header at 530px */
@media (max-width: 530px) {
    #header {
        height: auto;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        padding: 10px 15px;
        gap: 10px;
    }
    
    #logo-container {
        grid-column: 1;
        grid-row: 1;
    }
    
    #menu-btn {
        grid-column: 2;
        grid-row: 1;
    }
    
    #search-container {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-self: stretch;
        max-width: none;
        margin: 0;
    }
    
    #logo {
        font-size: 14px;
    }

    #logo-icon {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    #logo {
        font-size: 12px;
    }

    #logo-icon {
        width: 18px;
        height: 18px;
    }
    
    #search-input {
        font-size: 16px;
        padding: 8px 35px 8px 12px;
    }
    
    #search-btn {
        width: 28px;
        height: 28px;
    }
}