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

:root {
    --primary-color: #1a1a1a;
    --secondary-color: #2d2d2d;
    --accent-color: #e8a87c;  /* Warm orange/salmon like reference */
    --accent-secondary: #5a9fd4;  /* Cool blue accent */
    --dark-bg: #000000;
    --light-text: #ffffff;
    --text-secondary: #a0a0a0;
    --shadow: rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    overflow: hidden;
    background: #2c3e50;  /* Match scene background */
    color: var(--light-text);
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #2c3e50;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    text-align: center;
}

.loader-inner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

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

.loader p {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Navigation - Minimal Style */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 30px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: transparent;
    pointer-events: none;
}

.main-nav > * {
    pointer-events: auto;
}

.logo h1 {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 2px;
    color: var(--light-text);
    text-transform: uppercase;
    text-shadow: none;
    margin: 0;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 40px;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    position: relative;
    padding: 8px 0;
    text-transform: uppercase;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--light-text);
}

.nav-links a::after {
    display: none;
}

/* UI Controls - Minimal Style */
.ui-controls {
    position: fixed;
    right: 50px;
    bottom: 50px;
    z-index: 900;
    display: none;  /* Hidden */
    flex-direction: row;
    gap: 15px;
}

.control-panel {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    border-radius: 50px;
    padding: 8px;
    display: flex;
    flex-direction: row;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.control-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.6);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--light-text);
    transform: scale(1.05);
}

.control-btn svg {
    stroke-width: 2;
}

/* Info Panel - Minimal Style */
.info-panel {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(30px);
    border-radius: 16px;
    padding: 30px;
    max-width: 350px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.info-panel.active {
    opacity: 1;
    transform: translateY(0);
}

.info-panel h3 {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--light-text);
    letter-spacing: 0.5px;
}

.info-panel p {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-weight: 300;
}

.btn-primary {
    padding: 14px 28px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: var(--light-text);
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-transform: uppercase;
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Canvas Container */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Location Image Display */
#location-image-container {
    position: fixed;
    left: 50px;
    bottom: 270px;
    width: 280px;
    height: auto;
    z-index: 3000;
    pointer-events: none;
}

#location-image {
    width: 100%;
    height: auto;
    display: block;
    max-height: 150px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

/* Street View Container */
#streetview-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.95);
    pointer-events: all;
}

#streetview-viewer {
    width: 100%;
    height: 100%;
}

.close-btn {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2001;
    transition: all 0.3s ease;
    color: white;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Markers */
.location-marker {
    position: absolute;
    width: 30px;
    height: 30px;
    background: var(--accent-color);
    border: 3px solid white;
    border-radius: 50%;
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.5);
    animation: pulse 2s infinite;
    z-index: 100;
}

.location-marker:hover {
    transform: translate(-50%, -50%) scale(1.3);
    animation: none;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(0, 212, 255, 0.5);
    }
    50% {
        box-shadow: 0 4px 25px rgba(0, 212, 255, 0.8), 0 0 0 10px rgba(0, 212, 255, 0.1);
    }
}

.marker-label {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(26, 26, 26, 0.9);
    padding: 5px 10px;
    border-radius: 5px;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.location-marker:hover .marker-label {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-nav {
        padding: 15px 20px;
    }

    .logo h1 {
        font-size: 20px;
        letter-spacing: 2px;
    }

    .nav-links {
        gap: 15px;
    }

    .nav-links a {
        font-size: 14px;
    }

    .ui-controls {
        right: 20px;
        top: 80px;
    }

    .info-panel {
        max-width: calc(100% - 120px);
    }

    .control-btn {
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .main-nav {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .ui-controls {
        right: 10px;
        top: 120px;
    }

    .info-panel {
        max-width: calc(100% - 90px);
        padding: 15px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

/* Singapore Noise Map - Additional Styles */

/* Logo subtitle */
.logo .subtitle {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 3px;
    margin-top: 2px;
    opacity: 0.7;
}

/* Noise Meter - Minimal Style */
.noise-meter {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin: 20px 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.noise-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 500;
}

.noise-value {
    font-size: 32px;
    font-weight: 300;
    color: var(--accent-color);
    text-shadow: none;
    letter-spacing: -1px;
}

/* Location Sidebar - Minimal Style */
.location-sidebar {
    position: fixed;
    left: 50px;
    top: 120px;
    bottom: 50px;
    width: 280px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(30px);
    border-radius: 16px;
    padding: 30px 25px;
    z-index: 900;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow-y: auto;
    display: none;  /* Hidden */
}

.location-sidebar h3 {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 20px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    border: none;
    padding: 0;
}

.location-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.location-item {
    display: flex;
    align-items: center;
    padding: 15px 12px;
    background: transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    border-left: 2px solid transparent;
}

.location-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--accent-color);
    transform: translateX(3px);
}

.location-item-color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 15px;
    flex-shrink: 0;
}

.location-item-info h4 {
    font-size: 14px;
    font-weight: 400;
    margin-bottom: 4px;
    color: var(--light-text);
    letter-spacing: 0.3px;
}

.location-item-info p {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 300;
}

/* About Panel */
.about-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-content {
    max-width: 600px;
    background: rgba(26, 26, 26, 0.95);
    padding: 40px;
    border-radius: 12px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.about-content h2 {
    color: var(--accent-color);
    margin-bottom: 20px;
    font-size: 28px;
}

.about-content h3 {
    color: var(--accent-color);
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 18px;
}

.about-content p {
    line-height: 1.6;
    margin-bottom: 15px;
    color: rgba(255, 255, 255, 0.8);
}

.about-content ul {
    list-style: none;
    padding-left: 0;
}

.about-content li {
    padding: 8px 0 8px 20px;
    position: relative;
    color: rgba(255, 255, 255, 0.8);
}

.about-content li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

.about-content .close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
}

/* Panorama Info Overlay */
.panorama-info {
    position: absolute;
    bottom: 40px;
    left: 40px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    padding: 24px 32px;
    border-radius: 12px;
    z-index: 2001;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.panorama-location-name {
    font-size: 28px;
    font-weight: 600;
    color: white;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.panorama-location-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 12px;
    max-width: 400px;
    line-height: 1.6;
}

.panorama-noise-level {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent-color);
    display: inline-block;
    padding: 6px 16px;
    background: rgba(232, 168, 124, 0.2);
    border-radius: 6px;
    border: 1px solid var(--accent-color);
}

/* Scrollbar Styling */
.location-sidebar::-webkit-scrollbar,
.about-content::-webkit-scrollbar {
    width: 6px;
}

.location-sidebar::-webkit-scrollbar-track,
.about-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.location-sidebar::-webkit-scrollbar-thumb,
.about-content::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 10px;
}

/* Location Labels on 3D Map */
.location-label {
    color: white;
    font-size: 12px;
    font-weight: 400;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* Region Labels on 3D Map */
.region-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 4px;
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

/* Responsive Updates */
@media (max-width: 768px) {
    .location-sidebar {
        width: 200px;
        left: 10px;
        top: 100px;
    }

    .ui-controls {
        right: 10px;
    }

    .logo h1 {
        font-size: 16px;
    }

    .logo .subtitle {
        font-size: 8px;
    }

    #spectrum-container {
        width: calc(100% - 40px);
        height: 100px;
        bottom: 20px;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .location-sidebar {
        display: none;
    }

    .logo h1 {
        font-size: 14px;
        letter-spacing: 1px;
    }

    .main-nav {
        padding: 10px 15px;
    }
}
