/* Space Weather Enhanced Dashboard Styles */

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

/* Variables CSS */
:root {
    --primary-blue: #00D9FF;
    --warning-red: #FF6B6B;
    --success-green: #00FF88;
    --purple-accent: #9D4EDD;
    --bg-dark: #0a0a0f;
    --bg-glass: rgba(255, 255, 255, 0.05);
    --text-primary: #FFFFFF;
    --text-secondary: #AAA;
}

/* Global styles */
.space-weather-enhanced {
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 100%);
    min-height: 100vh;
    color: var(--text-primary);
    font-family: 'Rajdhani', sans-serif;
    overflow-x: hidden;
}

/* Glass morphism effect */
.glass-morph {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

/* Header styles */
.enhanced-header {
    position: relative;
    padding: 60px 20px;
    background: radial-gradient(ellipse at center, rgba(0, 217, 255, 0.1) 0%, transparent 70%);
    overflow: hidden;
}

.particles-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-image: 
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent);
    background-size: 200px 200px;
    animation: moveParticles 20s linear infinite;
}

@keyframes moveParticles {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-100px, -100px); }
}

.main-title {
    font-family: 'Orbitron', monospace;
    font-size: 4rem;
    text-align: center;
    margin: 0;
    letter-spacing: 0.3rem;
}

.title-space {
    color: var(--primary-blue);
    font-weight: 300;
}

.title-weather {
    color: var(--text-primary);
    font-weight: 700;
}

.title-now {
    color: var(--warning-red);
    font-weight: 300;
}

.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.subtitle {
    text-align: center;
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-top: 10px;
}

/* Status bar */
.status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 30px;
    padding: 20px 40px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    gap: 15px;
}

.live-indicator {
    width: 12px;
    height: 12px;
    background: var(--success-green);
    border-radius: 50%;
    animation: blink 1s ease-in-out infinite;
}

.live-text {
    font-size: 1.2rem;
    font-weight: 600;
}

.separator {
    font-size: 1.2rem;
    opacity: 0.5;
}

.last-update {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-blue);
}

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

/* Alert section */
.alert-section {
    padding: 40px 20px;
}

.alert-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

/* Status rings */
.status-rings {
    position: relative;
    width: 200px;
    height: 200px;
    flex-shrink: 0;
}

.status-ring-outer,
.status-ring-middle,
.status-ring-inner {
    position: absolute;
    border-radius: 50%;
    border: 2px solid;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.status-ring-outer {
    width: 100%;
    height: 100%;
    border-color: var(--primary-blue);
    opacity: 0.3;
}

.rotating {
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.status-ring-middle {
    width: 70%;
    height: 70%;
    border-color: var(--purple-accent);
    opacity: 0.5;
}

.status-ring-inner {
    width: 40%;
    height: 40%;
    border-color: var(--warning-red);
    opacity: 0.7;
}

.pulsing {
    animation: pulseRing 2s ease-in-out infinite;
}

@keyframes pulseRing {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
}

.status-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.threat-level {
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    margin: 0;
    font-weight: 700;
}

.threat-text {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Threat bars */
.threat-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.threat-bar-container {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.threat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
}

.threat-label {
    font-size: 1.1rem;
}

.threat-info {
    font-size: 0.9rem;
    color: var(--primary-blue);
    cursor: help;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.threat-info:hover {
    opacity: 1;
}

/* Tooltip dynamique pour les barres de risque */
.threat-bar-container {
    position: relative;
}

.threat-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 15px 20px;
    min-width: 300px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.threat-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: rgba(255, 255, 255, 0.2);
}

.threat-bar-container:hover .threat-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-15px);
}

.threat-tooltip-title {
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 8px;
}

.threat-tooltip-content {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Tooltips pour les impacts */
.impact-tile {
    position: relative;
}

.impact-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 10px 15px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.5);
}

.impact-tile:hover .impact-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px);
}

.threat-bar-bg {
    flex: 1;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.threat-fill {
    height: 100%;
    transition: width 0.5s ease-out;
    border-radius: 10px;
}

.solar-fill {
    background: linear-gradient(90deg, #FFD700, #FFA500);
}

.magnetic-fill {
    background: linear-gradient(90deg, #9D4EDD, #D946EF);
}

.particle-fill {
    background: linear-gradient(90deg, #00D9FF, #0099CC);
}

.radio-fill {
    background: linear-gradient(90deg, #FF6B6B, #FF4444);
}

/* Top content panels */
.top-content {
    padding: 20px;
    margin-top: 20px;
}

.metrics-panel,
.impacts-panel {
    padding: 0 10px;
}

.full-height {
    min-height: 500px;
    padding: 30px;
}

/* Cesium section fullwidth */
.cesium-section-fullwidth {
    margin: 2rem 0;
    width: 100%;
}

.cesium-panel-fullwidth {
    padding: 2rem;
    margin: 0 1rem;
}

.cesium-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.cesium-header .section-title {
    margin-bottom: 0;
}

.cesium-controls {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.cesium-wrapper-fullwidth {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.cesium-legend-horizontal {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cesium-legend-horizontal .legend-items {
    display: flex;
    gap: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Metrics cards */
.panel-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    margin-bottom: 30px;
    text-align: center;
}

.metrics-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.metric-card {
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.metric-card:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 217, 255, 0.2);
}

.metric-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.metric-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.metric-value {
    font-family: 'Orbitron', monospace;
    font-size: 1.6rem;
    font-weight: 700;
}

.metric-timestamp {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: 'Rajdhani', sans-serif;
    opacity: 0.7;
}

/* Indicateurs de couleur pour les métriques */
.metric-indicator-value {
    display: flex;
    align-items: center;
    gap: 10px;
}

.metric-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.metric-status-dot.good {
    background: var(--success-green);
    box-shadow: 0 0 10px var(--success-green);
}

.metric-status-dot.moderate {
    background: #FFD700;
    box-shadow: 0 0 10px #FFD700;
}

.metric-status-dot.high {
    background: #FFA500;
    box-shadow: 0 0 10px #FFA500;
}

.metric-status-dot.severe {
    background: var(--warning-red);
    box-shadow: 0 0 10px var(--warning-red);
}

.metric-status-dot.extreme {
    background: #FF1493;
    box-shadow: 0 0 10px #FF1493;
}

.metric-gauge {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: conic-gradient(var(--primary-blue) 0deg, transparent 120deg);
    position: relative;
}

.metric-indicator {
    height: 4px;
    margin-top: 10px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
}

/* Cesium panel */
.cesium-section-fullwidth {
    margin: 40px 0;
    padding: 0 20px;
}

.cesium-panel-fullwidth {
    width: 100%;
    max-width: 100%;
}

.cesium-header {
    margin-bottom: 20px;
}

.cesium-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    flex-wrap: wrap;
    gap: 20px;
}

.view-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.overlay-controls {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.cesium-wrapper-fullwidth {
    position: relative;
    width: 100%;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

#cesium-container {
    width: 100%;
    height: 700px;
    background: #000;
    position: relative;
    display: block;
}

.cesium-legend-horizontal {
    margin-top: 20px;
}

/* Forcer la visibilité du Cesium viewer */
.cesium-viewer {
    width: 100% !important;
    height: 100% !important;
}

.info-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 10px;
    min-width: 200px;
}

/* Impacts visualization */
.impacts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .impacts-grid {
        grid-template-columns: 1fr;
    }
}

.impact-tile {
    padding: 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.impact-tile:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-5px);
}

.impact-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: block;
}

.impact-label {
    font-size: 0.9rem;
    margin: 5px 0;
}

.impact-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Educational section */
.education-section {
    padding: 60px 20px;
    background: rgba(0, 0, 0, 0.3);
}

.section-title {
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 40px;
}

.info-card {
    padding: 30px;
    height: 100%;
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 217, 255, 0.3);
}

.info-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.info-icon {
    font-size: 2.5rem;
}

.info-icon.info { color: var(--primary-blue); }
.info-icon.warning { color: var(--warning-red); }
.info-icon.success { color: var(--success-green); }

.info-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.3rem;
    margin: 0;
}

.info-content {
    color: var(--text-secondary);
    line-height: 1.6;
}

.learn-more-btn {
    margin-top: 20px;
    padding: 10px 25px;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.learn-more-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

/* Timeline section */
.timeline-section {
    padding: 60px 20px;
}

.timeline-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px;
}

.timeline-viz {
    height: 150px;
    margin-bottom: 30px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    position: relative;
}

/* Timeline visualization */
.timeline-visual {
    width: 100%;
    position: relative;
    margin: 20px 0;
}

.timeline-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-blue);
    transform: translateY(-50%);
}

.timeline-markers {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
}

.timeline-marker {
    position: absolute;
    top: 50%;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.timeline-marker.marker-1 {
    background: #FFA500;
}

.timeline-marker.marker-2 {
    background: #00FF88;
}

.timeline-marker.marker-3 {
    background: #FF6B6B;
}

/* Timeline events */
.timeline-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.timeline-time {
    font-weight: 600;
    color: var(--primary-blue);
    min-width: 60px;
}

.timeline-time.active {
    color: var(--success-green);
}

.timeline-event {
    flex: 1;
    color: var(--text-secondary);
}

/* Footer actions */
.footer-actions {
    padding: 60px 20px;
    text-align: center;
}

.action-btn {
    padding: 15px 40px;
    font-size: 1.2rem;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 217, 255, 0.4);
}

/* Legend */
.cesium-legend {
    margin-top: 20px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.legend-title {
    font-family: 'Orbitron', monospace;
    margin-bottom: 15px;
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.legend-toggle {
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.legend-toggle:hover {
    opacity: 1;
}

/* Responsive design */
@media (max-width: 992px) {
    .main-title {
        font-size: 2.5rem;
    }
    
    .alert-container {
        flex-direction: column;
    }
    
    .status-rings {
        margin-bottom: 30px;
    }
    
    .metrics-panel,
    .cesium-panel,
    .impacts-panel {
        margin-bottom: 30px;
    }
}

@media (max-width: 576px) {
    .main-title {
        font-size: 1.8rem;
        letter-spacing: 0.1rem;
    }
    
    .threat-label {
        min-width: 100px;
        font-size: 0.9rem;
    }
    
    .view-controls {
        flex-wrap: wrap;
    }
}

/* New layout styles for reorganized dashboard */
.top-content {
    margin: 2rem 0;
    padding: 0 1rem;
}

.top-content > div[class*="col-"] {
    margin-bottom: 1.5rem;
}

.impacts-column, .forecast-column, .alerts-column {
    min-height: 400px;
}

/* Metrics section styles */
.metrics-section {
    margin: 2rem 1rem;
}

.metrics-section .section-title {
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    color: var(--primary-blue);
    margin-bottom: 2rem;
}

.metrics-grid {
    display: flex;
    gap: 2rem;
}

.metrics-column-1, .metrics-column-2 {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Updated metric card styles */
.metric-card {
    width: 100%;
    margin-bottom: 0;
}

.metric-card-inner {
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.metric-card:hover .metric-card-inner {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 5px 20px rgba(0, 217, 255, 0.3);
}

/* Responsive adjustments for new layout */
@media (max-width: 992px) {
    .top-content .col-lg-4 {
        margin-bottom: 1rem;
    }
    
    .metrics-grid {
        flex-direction: column;
    }
    
    .impacts-column, .forecast-column, .alerts-column {
        min-height: 300px;
    }
}

/* Panel content styles */
.impacts-column .glass-morph,
.forecast-column .glass-morph,
.alerts-column .glass-morph {
    height: 100%;
    padding: 1.5rem;
}

/* Full height utility */
.full-height {
    height: 100%;
}