@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@300;400;500;600;700&display=swap');

:root {
    /* Color Palette - Deep Space Astronomical Theme */
    --bg-dark: #07060e;
    --bg-space: radial-gradient(circle at 50% 50%, #110e29 0%, #07060e 100%);
    --card-bg: rgba(14, 12, 30, 0.65);
    --card-border: rgba(255, 255, 255, 0.08);
    --card-border-focus: rgba(255, 255, 255, 0.18);
    
    --text-primary: #f0f0f7;
    --text-muted: #a0a0c0;
    --text-dark: #626280;
    
    /* Glowing Accent Colors */
    --color-sun: #ffd000;
    --color-sun-glow: rgba(255, 208, 0, 0.25);
    --color-earth: #00d2ff;
    --color-earth-glow: rgba(0, 210, 255, 0.25);
    
    --color-ecc: #00f0ff;      /* Cyan - Eccentricity */
    --color-obl: #f000ff;      /* Magenta - Obliquity */
    --color-eot: #ffaa00;      /* Gold/Amber - Combined */
    --color-grid: rgba(255, 255, 255, 0.04);
    
    --color-plus: #00ff88;     /* Green for positive values */
    --color-minus: #ff3366;    /* Red for negative values */
    
    /* Layout Variables */
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --border-radius: 20px;
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

html, body {
    width: 100%;
    min-height: 100vh;
    background: var(--bg-dark);
    background-image: var(--bg-space);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    overflow-x: hidden;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(7, 6, 14, 0.5);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Main Container Layout */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Header Section */
header {
    text-align: center;
    padding: 1.5rem 0 1rem;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.header-title-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    margin-bottom: 0.2rem;
    flex-wrap: wrap;
}

.header-logo {
    height: 60px;
    width: auto;
    filter: drop-shadow(0 0 8px rgba(0, 210, 255, 0.25));
    border-radius: 8px;
    transition: var(--transition-smooth);
}

.header-logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 15px rgba(0, 210, 255, 0.45));
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 40%, var(--color-earth) 70%, var(--color-eot) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 40px rgba(0, 210, 255, 0.1);
}

header p {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 300;
    max-width: 800px;
    margin: 0 auto;
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    gap: 0.6rem;
    margin-right: 0.8rem;
    z-index: 100;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1.8rem;
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px) scale(1.08);
}

.lang-btn.active {
    background: rgba(0, 210, 255, 0.2);
    border-color: var(--color-earth);
    box-shadow: 0 0 12px rgba(0, 210, 255, 0.35);
}

@media (max-width: 768px) {
    .header-title-container {
        flex-direction: column;
        gap: 0.8rem;
    }
    .lang-switcher {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    h1 {
        font-size: 2.2rem;
    }
    .header-logo {
        height: 45px;
    }
}

/* Control Panel Section */
.control-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--border-radius);
    padding: 1.5rem 2rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: var(--transition-smooth);
}

.control-panel:hover {
    border-color: var(--card-border-focus);
}

/* Slider Customization */
.slider-group {
    flex: 1 1 350px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.slider-val {
    font-family: var(--font-mono);
    color: var(--color-eot);
    font-size: 1.1rem;
}

.slider-container {
    position: relative;
    display: flex;
    align-items: center;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    transition: var(--transition-smooth);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-eot);
    box-shadow: 0 0 12px var(--color-eot);
    cursor: pointer;
    transition: transform 0.1s ease, background-color 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

input[type="range"]::-webkit-slider-thumb:active {
    transform: scale(1.3);
}

/* Control Buttons & Inputs */
.actions-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.btn-play {
    background: linear-gradient(135deg, var(--color-earth), #00aaff);
    color: #030206;
    border: none;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.8rem 1.6rem;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-smooth);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.2);
}

.btn-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(0, 210, 255, 0.4);
}

.btn-play:active {
    transform: translateY(0);
}

.btn-play.playing {
    background: linear-gradient(135deg, #ffaa00, #ff8800);
}

.btn-play.playing:hover {
    box-shadow: 0 0 25px rgba(255, 170, 0, 0.4);
}

.date-input-group {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.4rem 0.8rem;
    gap: 0.5rem;
}

.date-input-group label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
}

input[type="date"] {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    outline: none;
    cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.6;
    cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Speed / Mode Toggles */
.toggle-group {
    display: flex;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 0.25rem;
}

.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: 9px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.toggle-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.toggle-btn:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

/* Simulation Speed Control */
.speed-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.speed-select {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    padding: 0.4rem 0.8rem;
    border-radius: 10px;
    outline: none;
    cursor: pointer;
    font-family: var(--font-sans);
}

.speed-select option {
    background-color: #0e0c1e;
    color: var(--text-primary);
}

/* Dashboard Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

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

/* Card Styling */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.card:hover {
    border-color: var(--card-border-focus);
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.35);
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 0.8rem;
}

.card-title {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.card-title h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-title span {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    color: var(--text-muted);
}

/* Interactive Badge / Metric readout inside cards */
.badge-readout {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: var(--font-mono);
}

.badge-label {
    font-size: 0.7rem;
    font-family: var(--font-sans);
    color: var(--text-muted);
    text-transform: uppercase;
}

.badge-value {
    font-size: 1.2rem;
    font-weight: 700;
}

.badge-value.plus {
    color: var(--color-plus);
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.2);
}

.badge-value.minus {
    color: var(--color-minus);
    text-shadow: 0 0 10px rgba(255, 51, 102, 0.2);
}

/* Canvas Container */
.canvas-container {
    width: 100%;
    aspect-ratio: 16 / 10;
    position: relative;
    background: radial-gradient(circle at 50% 50%, rgba(20, 16, 48, 0.3) 0%, rgba(7, 6, 14, 0.4) 100%);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    overflow: hidden;
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
}

/* Card Explainer Footer */
.card-explainer {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.8rem;
    margin-top: auto;
}

.highlight-text {
    font-weight: 600;
    color: var(--text-primary);
}

/* Summary Cards / Mini Readouts underneath dashboard grid */
.summary-panel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .summary-panel {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 500px) {
    .summary-panel {
        grid-template-columns: 1fr;
    }
}

.summary-card {
    background: rgba(14, 12, 30, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 16px;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    backdrop-filter: blur(8px);
}

.summary-card:hover {
    border-color: rgba(255, 255, 255, 0.08);
}

.summary-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.summary-value {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 700;
}

/* Science Explainer Section */
.educational-section {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    padding: 2.5rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

.educational-section h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg, #ffffff, var(--color-earth));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.edu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
}

@media (max-width: 900px) {
    .edu-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.edu-col {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.edu-col p {
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.7;
    text-align: justify;
}

.edu-formula {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--color-eot);
    text-align: center;
    margin: 0.5rem 0;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
}

.edu-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.edu-list-item {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
}

.edu-bullet {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--color-earth);
    margin-top: 0.6rem;
    flex-shrink: 0;
}

.edu-list-item-content strong {
    color: var(--text-primary);
}

.edu-list-item-content p {
    font-size: 0.9rem;
    margin-top: 0.1rem;
}

/* Footer Credits */
footer {
    text-align: center;
    padding: 1rem 0 3rem;
    color: var(--text-dark);
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition-smooth);
}

footer a:hover {
    color: var(--color-earth);
}

/* Tooltip style custom graphics */
.canvas-hint {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(7, 6, 14, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.7rem;
    color: var(--text-muted);
    pointer-events: none;
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
}
