/* ============================================
   THEÓS - Google Earth Divino
   Estilos futuristas - Centro de Control Divino
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700;900&family=Rajdhani:wght@300;400;500;600;700&family=Share+Tech+Mono&display=swap');

/* === VARIABLES === */
:root {
    --divine-gold: #d4a843;
    --divine-gold-bright: #f5d17a;
    --divine-blue: #00b4d8;
    --divine-blue-dark: #0077b6;
    --divine-cyan: #48cae4;
    --divine-purple: #7b2cbf;
    --bg-dark: #0a0a0f;
    --bg-panel: rgba(10, 10, 20, 0.92);
    --bg-card: rgba(20, 20, 40, 0.85);
    --text-primary: #e8e8f0;
    --text-secondary: #8888aa;
    --text-dim: #555577;
    --border-glow: rgba(212, 168, 67, 0.3);
    --danger: #e63946;
    --success: #2ec4b6;
    --warning: #f48c06;
}

/* === RESET & BASE === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
}

/* === LOADING SCREEN === */
#loading-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 1s ease, visibility 1s ease;
}

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

#loading-screen .logo-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 4rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--divine-gold), var(--divine-gold-bright), var(--divine-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.3em;
    animation: pulse-glow 2s ease-in-out infinite;
}

#loading-screen .subtitle {
    font-family: 'Share Tech Mono', monospace;
    color: var(--text-secondary);
    margin-top: 1rem;
    font-size: 0.9rem;
    letter-spacing: 0.2em;
}

#loading-screen .progress-bar {
    width: 300px;
    height: 2px;
    background: rgba(255,255,255,0.1);
    margin-top: 2rem;
    border-radius: 1px;
    overflow: hidden;
}

#loading-screen .progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--divine-gold), var(--divine-blue));
    transition: width 0.3s ease;
    border-radius: 1px;
}

@keyframes pulse-glow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

/* === MAIN LAYOUT === */
#app-container {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 320px 1fr;
    grid-template-rows: 56px 1fr 180px;
    grid-template-areas:
        "header header"
        "sidebar globe"
        "sidebar timeline";
    position: relative;
}

/* === HEADER === */
#header {
    grid-area: header;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-glow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 100;
    backdrop-filter: blur(20px);
}

#header .logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

#header .logo-icon {
    width: 32px;
    height: 32px;
    background: radial-gradient(circle, var(--divine-gold-bright), var(--divine-gold));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(212, 168, 67, 0.4);
    animation: eye-pulse 3s ease-in-out infinite;
}

@keyframes eye-pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(212, 168, 67, 0.4); }
    50% { box-shadow: 0 0 40px rgba(212, 168, 67, 0.7); }
}

#header .logo-icon svg {
    width: 18px;
    height: 18px;
}

#header .logo h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--divine-gold), var(--divine-gold-bright));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.15em;
}

#header .status-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

#header .divine-mode {
    display: flex;
    gap: 0.5rem;
}

.mode-btn {
    padding: 0.35rem 0.8rem;
    border: 1px solid var(--border-glow);
    border-radius: 4px;
    background: transparent;
    color: var(--text-secondary);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.mode-btn:hover {
    border-color: var(--divine-gold);
    color: var(--divine-gold);
    box-shadow: 0 0 15px rgba(212, 168, 67, 0.2);
}

.mode-btn.active {
    background: linear-gradient(135deg, rgba(212, 168, 67, 0.2), rgba(0, 180, 216, 0.1));
    border-color: var(--divine-gold);
    color: var(--divine-gold-bright);
    box-shadow: 0 0 20px rgba(212, 168, 67, 0.3);
}

/* === SIDEBAR === */
#sidebar {
    grid-area: sidebar;
    background: var(--bg-panel);
    border-right: 1px solid var(--border-glow);
    overflow-y: auto;
    padding: 1rem;
    backdrop-filter: blur(20px);
    z-index: 50;
}

#sidebar::-webkit-scrollbar {
    width: 4px;
}

#sidebar::-webkit-scrollbar-track {
    background: transparent;
}

#sidebar::-webkit-scrollbar-thumb {
    background: var(--border-glow);
    border-radius: 2px;
}

.sidebar-section {
    margin-bottom: 1.5rem;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(212, 168, 67, 0.15);
}

.section-header .icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--divine-gold);
}

.section-header h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--divine-gold);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* Data Layers */
.layer-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0.3rem;
}

.layer-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.layer-item.active {
    background: rgba(212, 168, 67, 0.08);
}

.layer-toggle {
    width: 32px;
    height: 18px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    cursor: pointer;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.layer-toggle.on {
    background: linear-gradient(90deg, var(--divine-gold), var(--divine-blue));
}

.layer-toggle::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
}

.layer-toggle.on::after {
    transform: translateX(14px);
}

.layer-info {
    flex: 1;
}

.layer-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.layer-tech {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-family: 'Share Tech Mono', monospace;
}

.layer-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Tech Info Panel */
.tech-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 0.8rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.tech-card:hover {
    border-color: var(--border-glow);
}

.tech-card .tech-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--divine-gold);
    margin-bottom: 0.3rem;
}

.tech-card .tech-desc {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.tech-maturity {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.65rem;
    font-family: 'Share Tech Mono', monospace;
}

.maturity-badge {
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.maturity-badge.existing {
    background: rgba(46, 196, 182, 0.15);
    color: var(--success);
    border: 1px solid rgba(46, 196, 182, 0.3);
}

.maturity-badge.developing {
    background: rgba(244, 140, 6, 0.15);
    color: var(--warning);
    border: 1px solid rgba(244, 140, 6, 0.3);
}

.maturity-badge.theoretical {
    background: rgba(123, 44, 191, 0.15);
    color: var(--divine-purple);
    border: 1px solid rgba(123, 44, 191, 0.3);
}

/* Omniscience meter */
.omniscience-meter {
    background: var(--bg-card);
    border: 1px solid rgba(212, 168, 67, 0.2);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
}

.meter-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    color: var(--divine-gold);
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.meter-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--divine-gold), var(--divine-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.meter-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--divine-gold), var(--divine-blue));
    border-radius: 2px;
    transition: width 1s ease;
}

.meter-note {
    font-size: 0.6rem;
    color: var(--text-dim);
    margin-top: 0.4rem;
    font-family: 'Share Tech Mono', monospace;
}

/* === GLOBE CONTAINER === */
#globe-container {
    grid-area: globe;
    position: relative;
    overflow: hidden;
    background: #000;
}

#cesiumContainer {
    width: 100%;
    height: 100%;
}

/* Zoom level indicator */
#zoom-indicator {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-panel);
    border: 1px solid var(--border-glow);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    z-index: 10;
    min-width: 200px;
}

#zoom-indicator .zoom-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.6rem;
    color: var(--divine-gold);
    letter-spacing: 0.1em;
    margin-bottom: 0.3rem;
}

#zoom-indicator .zoom-level {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-primary);
}

#zoom-indicator .zoom-tech {
    font-size: 0.65rem;
    color: var(--divine-cyan);
    margin-top: 0.3rem;
    font-family: 'Share Tech Mono', monospace;
}

/* Coordinate display */
#coord-display {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: var(--bg-panel);
    border: 1px solid var(--border-glow);
    border-radius: 6px;
    padding: 0.5rem 0.8rem;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-secondary);
    z-index: 10;
}

/* X-Ray overlay */
#xray-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#xray-overlay.active {
    opacity: 1;
}

#xray-overlay::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 180, 216, 0.03) 2px,
        rgba(0, 180, 216, 0.03) 4px
    );
    animation: scan-lines 4s linear infinite;
}

@keyframes scan-lines {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* Data visualization overlay */
.data-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 4;
}

/* Info tooltip */
.info-tooltip {
    position: absolute;
    background: var(--bg-panel);
    border: 1px solid var(--divine-gold);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    max-width: 280px;
    z-index: 20;
    box-shadow: 0 0 30px rgba(212, 168, 67, 0.2);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.info-tooltip.visible {
    opacity: 1;
}

/* === TIMELINE === */
#timeline {
    grid-area: timeline;
    background: var(--bg-panel);
    border-top: 1px solid var(--border-glow);
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    z-index: 50;
    backdrop-filter: blur(20px);
}

.timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}

.timeline-header h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    color: var(--divine-gold);
    letter-spacing: 0.15em;
}

.timeline-date {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--divine-gold-bright);
}

.timeline-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.timeline-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-glow);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 0.8rem;
}

.timeline-btn:hover {
    border-color: var(--divine-gold);
    color: var(--divine-gold);
    box-shadow: 0 0 15px rgba(212, 168, 67, 0.2);
}

.timeline-btn.active {
    background: rgba(212, 168, 67, 0.2);
    border-color: var(--divine-gold);
    color: var(--divine-gold-bright);
}

/* Timeline slider */
.timeline-slider-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.timeline-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    position: relative;
}

.timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--divine-gold-bright), var(--divine-gold));
    cursor: pointer;
    box-shadow: 0 0 15px rgba(212, 168, 67, 0.5);
    border: 2px solid var(--bg-dark);
}

.timeline-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--divine-gold-bright), var(--divine-gold));
    cursor: pointer;
    box-shadow: 0 0 15px rgba(212, 168, 67, 0.5);
    border: 2px solid var(--bg-dark);
}

.timeline-epochs {
    display: flex;
    justify-content: space-between;
    font-size: 0.55rem;
    font-family: 'Share Tech Mono', monospace;
    color: var(--text-dim);
}

/* Timeline data sources */
.timeline-sources {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.source-tag {
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.6rem;
    font-family: 'Share Tech Mono', monospace;
    border: 1px solid;
    transition: all 0.3s ease;
}

.source-tag.available {
    border-color: rgba(46, 196, 182, 0.4);
    color: var(--success);
    background: rgba(46, 196, 182, 0.1);
}

.source-tag.limited {
    border-color: rgba(244, 140, 6, 0.4);
    color: var(--warning);
    background: rgba(244, 140, 6, 0.1);
}

.source-tag.unavailable {
    border-color: rgba(230, 57, 70, 0.3);
    color: var(--danger);
    background: rgba(230, 57, 70, 0.05);
    opacity: 0.5;
}

/* === PARTICLES CANVAS === */
#particles-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.3;
}

/* === RESPONSIVE === */
@media (max-width: 1200px) {
    #app-container {
        grid-template-columns: 280px 1fr;
    }
}

@media (max-width: 900px) {
    #app-container {
        grid-template-columns: 1fr;
        grid-template-rows: 56px 1fr 60px 180px;
        grid-template-areas:
            "header"
            "globe"
            "sidebar-toggle"
            "timeline";
    }

    #sidebar {
        position: fixed;
        left: -320px;
        top: 56px;
        width: 320px;
        height: calc(100% - 56px);
        z-index: 200;
        transition: left 0.3s ease;
    }

    #sidebar.open {
        left: 0;
    }
}

/* === CESIUM OVERRIDES === */
.cesium-viewer-bottom,
.cesium-viewer-animationContainer,
.cesium-viewer-timelineContainer,
.cesium-viewer-fullscreenContainer {
    display: none !important;
}

.cesium-widget-credits {
    display: none !important;
}

.cesium-viewer {
    font-family: 'Rajdhani', sans-serif !important;
}

/* === SCAN ANIMATION (X-Ray mode) === */
.scan-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--divine-cyan), transparent);
    z-index: 6;
    animation: scan-vertical 3s linear infinite;
    pointer-events: none;
}

@keyframes scan-vertical {
    0% { top: 0; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* === GLOW EFFECTS === */
.glow-gold {
    box-shadow: 0 0 20px rgba(212, 168, 67, 0.3);
}

.glow-blue {
    box-shadow: 0 0 20px rgba(0, 180, 216, 0.3);
}

.glow-text {
    text-shadow: 0 0 10px rgba(212, 168, 67, 0.5);
}
