:root {
    --bg-color: #0b0c10;
    --panel-bg: rgba(20, 24, 32, 0.65);
    --panel-border: rgba(69, 252, 255, 0.15);
    --text-primary: #e0e6ed;
    --text-secondary: #8b9bb4;
    --accent-cyan: #45fcff;
    --accent-blue: #0077ff;
    --accent-gold: #ffd700;
    --accent-red: #ff3366;
}

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}

h2, h3, h4 {
    font-family: 'Outfit', sans-serif;
    margin-top: 0;
    font-weight: 700;
}

/* Glassmorphism Panel Base */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    color: var(--text-primary);
}

/* Password Gate Overlay */
.overlay-gate {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #1a1e29 0%, #0b0c10 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

.login-box {
    width: 350px;
    text-align: center;
}

.login-box input {
    width: 90%;
    padding: 10px;
    margin: 15px 0;
    border: 1px solid var(--panel-border);
    background: rgba(0, 0, 0, 0.5);
    color: var(--accent-cyan);
    border-radius: 6px;
    font-size: 16px;
    outline: none;
}

.login-box input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(69, 252, 255, 0.2);
}

button {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-cyan) 100%);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(69, 252, 255, 0.4);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 15px;
    width: 100%;
}
.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

/* UI Layout */
#app-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through to canvas */
    z-index: 10;
}

#app-ui.hidden {
    display: none;
}

.glass-panel {
    pointer-events: auto; /* Enable clicks on panels */
    position: absolute;
}

.top-left-panel {
    top: 20px;
    left: 20px;
    width: 320px;
}

.top-right-panel {
    top: 20px;
    right: 20px;
    width: 280px;
}

.bottom-panel {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 30px;
}

/* Inspector Metrics */
.metric {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.metric .label {
    color: var(--text-secondary);
}

.metric span:not(.label) {
    font-family: 'Outfit', sans-serif;
    color: var(--accent-cyan);
    font-weight: 600;
}

.divider {
    height: 1px;
    background: var(--panel-border);
    margin: 15px 0;
}

/* Toggles */
.toggle {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 14px;
}

.toggle input {
    margin-right: 10px;
    accent-color: var(--accent-cyan);
    width: 16px;
    height: 16px;
}

/* Time Controls */
.time-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.time-controls select, .time-controls input[type="number"] {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--panel-border);
    color: var(--accent-cyan);
    padding: 8px;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
}

.year-input-container {
    display: flex;
    align-items: center;
    gap: 5px;
}

.year-input-container input {
    width: 80px;
    text-align: right;
}

.slider-container {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 15px;
}

.slider-label {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 60px;
}

input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: var(--accent-cyan);
    cursor: pointer;
    margin-top: -8px;
    box-shadow: 0 0 10px rgba(69, 252, 255, 0.5);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    pointer-events: auto;
}

.modal.hidden {
    display: none;
}

.modal-content {
    max-width: 500px;
    position: relative;
    padding: 30px;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

.close-btn:hover {
    color: var(--accent-red);
}

#webgl-container {
    width: 100vw;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

/* 3D Label Styles */
.label-3d {
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    text-shadow: 0 0 5px rgba(0,0,0,0.8);
    pointer-events: none;
    opacity: 0.8;
}

.star-label {
    color: var(--accent-gold);
    font-weight: 600;
    font-size: 14px;
}

.location-label {
    color: var(--accent-cyan);
    font-size: 12px;
    font-weight: 600;
}

.popup-coord {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1000;
    min-width: 250px;
}

#search-results li {
    padding: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    font-size: 13px;
    color: #e0e0e0;
}

#search-results li:hover {
    background: rgba(69, 252, 255, 0.2);
    color: white;
}

/* Panel auto-hide system */
.glass-panel {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    /* width removed to allow auto-sizing */
}

.bottom-panel {
    width: 80%; /* Bottom panel override */
}

/* Base states for hiding */
.top-left-panel.hide-panel {
    transform: translateX(calc(-100% - 40px));
    opacity: 0;
    pointer-events: none;
}
.top-right-panel.hide-panel {
    transform: translateX(calc(100% + 40px));
    opacity: 0;
    pointer-events: none;
}
.bottom-panel.hide-panel {
    transform: translate(-50%, calc(100% + 40px));
    opacity: 0;
    pointer-events: none;
}

/* Edge Clips */
.edge-clip {
    position: absolute;
    background: var(--panel-bg);
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    padding: 8px 12px;
    cursor: pointer;
    z-index: 5;
    pointer-events: auto;
    font-family: 'Outfit', sans-serif;
    font-weight: bold;
    backdrop-filter: blur(5px);
    transition: 0.2s;
    opacity: 0; /* Hidden when panels are shown */
    pointer-events: none;
}

.edge-clip.show-clip {
    opacity: 1;
    pointer-events: auto;
}

.edge-clip:hover {
    background: var(--accent-cyan);
    color: #000;
}
.clip-tl { top: 20px; left: -5px; border-radius: 0 6px 6px 0; padding-left: 15px; }
.clip-tr { top: 20px; right: -5px; border-radius: 6px 0 0 6px; padding-right: 15px; }
.clip-b { bottom: -5px; left: 50%; transform: translateX(-50%); border-radius: 6px 6px 0 0; padding-bottom: 10px; }

/* Pin icon inside panel */
.pin-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.4;
    padding: 0;
    transition: 0.2s;
    box-shadow: none;
    width: auto;
}
.pin-btn:hover {
    transform: none;
    box-shadow: none;
    opacity: 0.8;
}
.pin-btn.active {
    opacity: 1;
    color: var(--accent-cyan);
}

.top-left-panel, .top-right-panel {
    width: 280px;
}

.close-pin-btn {
    position: absolute;
    top: 2px;
    right: 5px;
    background: transparent;
    border: none;
    color: var(--accent-red);
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    box-shadow: none;
    font-weight: bold;
}
.close-pin-btn:hover {
    color: white;
    transform: none;
}

.close-pin-btn {
    pointer-events: auto;
}
.location-label {
    pointer-events: auto;
}
