:root {
    --bg-color: #050505;
    --card-bg: #0a0a0a;
    --text-primary: #e0e0e0;
    --text-secondary: #888888;
    --accent-color: #60a5fa;
    /* Soft Blue */
    --border-color: #222222;
    --hover-border: #444444;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-weight: 300;
    min-height: 100vh;
}

/* Navigation */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    height: 70px;
    position: relative;
    z-index: 10000;
}

.nav-brand {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 2px;
}

.nav-menu {
    display: flex;
    height: 100%;
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0 1.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.02);
}

/* Hamburger Menu Default Hidden */
.hamburger-menu {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 10001;
}

@media (max-width: 900px) {
    .hamburger-menu {
        display: block;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        height: auto;
        background: var(--bg-color);
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        border-bottom: 1px solid var(--border-color);
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    }

    .nav-menu.mobile-active {
        display: flex;
        max-height: 800px;
        padding: 1rem 0;
    }

    .nav-menu a {
        padding: 1.5rem 0.5rem !important;
        flex: 1 1 40% !important;
        height: auto !important;
        font-size: 1.15rem !important;
        justify-content: center !important;
        border-bottom: none !important;
        text-align: center;
    }

    .nav-controls {
        width: 100%;
        padding-top: 1rem;
    }

    .nav-controls a {
        flex: 0 1 auto !important;
        width: auto !important;
        padding: 1rem 0.5rem !important;
    }

    .nav-controls .nav-pipe {
        font-size: 1.8rem !important;
        margin: 0 !important;
    }

    .nav-separator {
        width: 80% !important;
        height: 1px !important;
        margin: 10px 0 !important;
    }
}


/* Layout */
.container {
    max-width: 100%;
    /* Use full width to ensure room for 3 cols */
    margin: 0 auto;
    padding: 1rem;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* Force 3 columns */
    gap: 1rem;
}

@media (max-width: 1400px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* Video Card */
.video-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.video-header {
    padding: 1rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    /* Separator line above title now */
    border-bottom: none;
    /* Removed bottom border */
    background: #080808;
    /* Ensure it stays below if flex is used, though HTML order changed */
}

.video-header h2 {
    font-size: 0.9rem;
    /* Smaller */
    font-weight: 400;
    /* Regular weight */
    margin: 0;
    color: var(--text-primary);
    line-height: 1.3;
    letter-spacing: 0.5px;
    font-family: 'Roboto', sans-serif;
    /* Limit to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-transform: none;
    /* Keep original case or uppercase? User said professional. Mixed case is often better for readability. */
}

/* Agenda Layout Updates */
.agenda-layout-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
    align-items: stretch;
    /* Cards will be equal height */
}

@media (max-width: 900px) {
    .agenda-layout-bottom {
        grid-template-columns: 1fr;
    }
}



.planet.probe {
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    z-index: 20;
}

.news-summary {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.3rem;
    line-height: 1.4;
}


/* Video Wrapper (16:9 Aspect Ratio) */
.video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 */
    height: 0;
    overflow: hidden;
    background: #000;
}

.thumbnail-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 10;
}

.video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-button-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s, transform 0.2s;
}

.thumbnail-container:hover .play-button-overlay {
    background-color: rgba(0, 0, 0, 0.8);
    transform: translate(-50%, -50%) scale(1.1);
}

.play-icon {
    width: 30px;
    height: 30px;
    margin-left: 5px;
    /* Visual center adjustment for play triangle */
}

.video-wrapper iframe,
.video-wrapper video,
.video-wrapper .youtube-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    pointer-events: none;
    /* Disable interaction (pause/hover title) */
}

/* Enable interaction specifically for APOD and certain wrappers */
.apod-media .video-wrapper iframe,
.apod-media .video-wrapper video,
.video-wrapper.active iframe,
.video-wrapper.active video {
    pointer-events: auto;
}

/* Fullscreen Override */
.video-wrapper.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    padding-bottom: 0;
    z-index: 1000;
}

/* APOD Section */
.apod-section {
    margin-top: 1rem;
    padding-top: 0;
}

.apod-container {
    display: flex;
    gap: 3rem;
    align-items: start;
}

.apod-media {
    flex: 2;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.apod-media img {
    width: 100%;
    display: block;
}

.apod-info {
    flex: 1;
}

.apod-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}

.apod-info h3 {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 0.5rem;
}

.apod-date {
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    display: block;
}

.apod-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #aaa;
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}


/* Updated Video Controls in Header */
.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.icon-btn:hover {
    color: var(--text-primary);
}

.icon-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* Agenda Layout */
.agenda-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 3rem;
}

@media (max-width: 900px) {
    .agenda-layout {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.card h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Solar System Viz */
.solar-system-viz {
    width: 100%;
    /* height: 1200px;  Removed to allow aspect-ratio control */
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    background: radial-gradient(circle, #0b0b0b 0%, #000 80%);
    overflow: hidden;
    cursor: crosshair;
}

.solar-system-viz.large-viz {
    max-width: 100%;
    margin: 0 auto;
    aspect-ratio: 1 / 1 !important;
    /* Force Square */
}

.planet-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(24px, -50%);
    /* Offset to right not to be covered by icon */
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.85rem;
    font-weight: 700;
    font-family: 'Roboto', sans-serif;
    white-space: nowrap;
    pointer-events: none;
    text-shadow: 0 0 4px #000, 0 0 8px #000;
    /* Strong shadow */
    z-index: 500;
    /* High z-index to stay on top */
    opacity: 0.8;
}

/* Tooltip (Replaces Modal) */
.planet-tooltip {
    position: fixed;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 6px;
    z-index: 1000;
    max-width: 250px;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    /* Allows mouse to not get stuck on tooltip */
    opacity: 0;
    transition: opacity 0.2s;
}

.planet-tooltip h4 {
    margin: 0 0 0.3rem 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tooltip-type {
    color: var(--accent-color);
    font-size: 0.7rem;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.5rem;
}

.planet-tooltip p {
    color: #ccc;
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0;
}

/* Voyager Section Styles */
.voyager-card {
    margin-top: 1rem;
}

.voyager-container {
    padding: 1rem 0;
}

.voyager-viz {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 0 2rem;
    position: relative;
    height: 80px;
}

.v-line {
    flex-grow: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--accent-color) 0%, #444 100%);
    margin: 0 1rem;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.v-distance-label {
    margin-top: -25px;
    /* Above line */
    background: #111;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #888;
    border: 1px solid #333;
}

.v-earth,
.v-probe {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.earth-dot {
    background: #00aeef;
    box-shadow: 0 0 10px rgba(0, 174, 239, 0.5);
}

.probe-dot {
    background: #fff;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    width: 8px;
    height: 8px;
    border: 1px solid #aaa;
}

.voyager-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
    flex: 1;
    min-width: 200px;
}

.stat-box.wide {
    flex: 2;
    min-width: 300px;
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    color: #666;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 400;
}

.stat-value.small {
    font-size: 0.95rem;
    line-height: 1.4;
    color: #aaa;
}

.sun {
    width: 24px;
    /* Slightly larger */
    height: 24px;
    background: radial-gradient(circle, #ffeb3b 0%, #ff9800 100%);
    border-radius: 50%;
    position: absolute;
    box-shadow: 0 0 30px rgba(255, 204, 0, 0.6);
    z-index: 10;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

/* White Dwarf Style */
.sun.white-dwarf {
    background: #fff !important;
    box-shadow: 0 0 20px #fff, 0 0 40px rgba(0, 188, 212, 0.9) !important;
    transform: scale(0.8) !important;
    /* Visible remnant */
    transition: transform 2s ease-in-out, background 0.5s, box-shadow 0.5s !important;
}

.sun:hover {
    transform: scale(1.5);
    box-shadow: 0 0 50px rgba(255, 204, 0, 0.9);
    z-index: 500;
}

/* Leyenda - Forced to corner */
.viz-legend {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    /* Darker bg */
    padding: 0.8rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 1000;
    /* Max z-index */
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Orbitas más gruesas */
.orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    /* Thicker and slightly brighter */
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;
    /* Ensure behind planets */
}

/* --- Right Controls Panel --- */
.right-controls-panel {
    position: absolute;
    right: 20px;
    top: 55%;
    /* Below visibility controls (approx 24%) */
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    z-index: 50;
    pointer-events: none;
    /* Container pass-through */
}

.right-controls-panel>* {
    pointer-events: auto;
    /* Children interactive */
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px;
}

.year-display-container-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.date-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#year-display {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-color);
    line-height: 1;
}

#date-display {
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 2px;
}

.today-btn-right {
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid #0f0;
    color: #0f0;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.today-btn-right:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.4);
}

/* Play/Pause Button */
.control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
    margin-bottom: 5px;
    /* Spacing from slider */
}

.control-btn:hover {
    background: rgba(var(--accent-rgb), 0.3);
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(var(--accent-rgb), 0.5);
    transform: scale(1.1);
}

.control-btn i {
    pointer-events: none;
    /* Prevent icon from blocking click */
    margin-left: 2px;
    /* Visual center adjustment for play icon */
}

.control-btn i.fa-pause {
    margin-left: 0;
    /* Pause icon is usually centered */
}

.slider-container-right {
    height: 50vh;
    /* Increased from 300px to dynamic 50vh */
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 10px 5px;
}

.slider-container-right input[type=range] {
    writing-mode: bt-lr;
    /* IE/Edge */
    -webkit-appearance: slider-vertical;
    /* Webkit */
    width: 25px;
    /* Increased from 15px */
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    /* Slightly brighter */
    outline: none;
    border-radius: 12px;
    /* More rounded */
    cursor: ns-resize;
}

.slider-label-top,
.slider-label-bottom {
    font-size: 0.7rem;
    color: #888;
}

/* --- Left Time Controls (Visual Only) --- */
.time-controls-vertical {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 50;
    pointer-events: none;
    height: auto;
    /* Fit content */
    max-height: 85vh;
    /* Limit max height */
    justify-content: center;
}

.time-markers {
    display: flex;
    flex-direction: column;
    gap: 5px;
    /* Tighter gap for visual list */
    pointer-events: auto;
    max-height: 100%;
    overflow-y: auto;
    /* Scroll if too many years */
    padding-right: 5px;
    /* Hide scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.time-markers::-webkit-scrollbar {
    display: none;
}

.marker-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #aaa;
    font-size: 0.85rem;
    cursor: pointer;
    text-align: center;
    padding: 5px 10px;
    transition: all 0.2s;
    white-space: nowrap;
    position: relative;
    border-radius: 4px;
    width: 100%;
}

.marker-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateX(5px);
}

.marker-btn::before {
    content: '';
    display: none;
}

/* Highlight important years */
.marker-btn:not(.small) {
    font-weight: bold;
    color: #fff;
    font-size: 0.95rem;
    background: rgba(var(--accent-rgb), 0.2);
    border-color: var(--accent-color);
}

.marker-btn:not(.small):hover {
    background: rgba(var(--accent-rgb), 0.3);
    box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.4);
}

.marker-btn:not(.small)::before {
    content: '';
    display: none;
}

/* Hide unused old classes if they interfere */
.year-display-container,
.slider-container {
    display: none;
}

/* Planet Positioning Wrapper */
.planet-wrapper {
    position: absolute;
    /* Center it first so transforms work from center */
    top: 50%;
    left: 50%;
    pointer-events: none;
    /* Let clicks pass through if not on the planet itself */
    z-index: 100;
}

/* Visual Planet Circle */

/* Mobile Optimizations (Max Width 768px) */
@media (max-width: 768px) {

    /* Fix Horizontal Scroll & Body Overflow */
    html,
    body {
        overflow-x: hidden;
        width: 100%;
    }

    .container {
        padding: 10px;
        overflow-x: hidden;
    }

    /* Navigation - Tighten up to prevent overflow */
    .navbar {
        flex-direction: column;
        height: auto;
        padding: 10px;
        gap: 10px;
    }

    .nav-brand {
        margin-bottom: 5px;
    }

    .nav-menu {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        /* Allow wrapping if needed, but prefer single line fit */
        gap: 0;
    }

    .nav-menu a {
        padding: 8px 10px;
        font-size: 0.8rem;
        /* Smaller font */
        flex: 1;
        /* Distribute space evenly */
        justify-content: center;
        text-align: center;
        white-space: nowrap;
    }

    /* Dashboard Grid - Force Single Column */
    .dashboard-grid {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .dash-card {
        width: 100%;
        margin-bottom: 10px;
    }

    /* ISS Card Specifics */
    .iss-card .dash-info {
        font-size: 0.9rem;
    }

    /* Agenda Layout - Stack vertical */
    .agenda-layout,
    .agenda-layout-bottom {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Adjust Video Grid if not already covered */
    .video-grid {
        grid-template-columns: 1fr;
    }

    /* Earth Model Container (Tierra.html) adjustments via CSS if possible */
    .earth-header {
        height: auto !important;
        flex-direction: column;
        padding-bottom: 0;
    }

    #earth-3d-container {
        width: 100% !important;
        height: 60vh !important;
        /* Use VH for mobile height */
        min-height: 400px;
    }

    .earth-info-panel {
        width: 100% !important;
        height: auto !important;
        border-left: none !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding: 20px !important;
        background: rgba(0, 0, 0, 0.8) !important;
    }

    .info-grid {
        grid-template-columns: 1fr !important;
    }

    .info-card .card-img {
        height: 250px !important;
    }

    /* Geoid Section Stack */
    div[style*="display: flex; gap: 30px; margin-top: 40px;"] {
        flex-direction: column;
        gap: 20px !important;
    }
}

/* Visual Planet Circle (Restored) */
.planet {
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    pointer-events: auto;
    z-index: 20;
    position: absolute;
    /* Essential for positioning */
    transform: translate(-50%, -50%);
}

/* --- Fixes for Home Layout (Feb 2026) --- */

/* APOD Banner - Restoration */
.apod-banner {
    position: relative;
    width: 100%;
    height: 400px;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    margin-top: 3rem;
    margin-bottom: 2rem;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-end;
}

.apod-content {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0.5), transparent);
    width: 100%;
    padding: 2rem;
    color: white;
}

.apod-content h2 {
    font-size: 2rem;
    margin: 0.5rem 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    font-weight: 700;
}

.apod-content p {
    font-size: 1rem;
    color: #e0e0e0;
    max-width: 800px;
    line-height: 1.6;
}

.highlight-badge {
    background: var(--accent-color);
    color: #000;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Increase clickable area for small planets */
/* Increase clickable area for small planets */
.planet::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    /* Minimum clickable size */
    height: 30px;
    border-radius: 50%;
    background: transparent;
    z-index: 101;
}

.planet:hover {
    transform: translate(-50%, -50%) scale(2);
    /* Keep centering + scale */
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.9);
    z-index: 200;
}

/* Asteroid Distinct Style */
.planet.asteroid {
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    /* Irregular "potato" shape */
    box-shadow: inset -2px -2px 4px rgba(0, 0, 0, 0.5);
    /* Rock texture feel */
}

.planet.asteroid::after {
    border-radius: 0;
    /* Match irregular shape somewhat or just square area */
}

/* Cinturones de Asteroides - Enhanced Visibility */
/* Cinturones SVG (Robust) */
.belts-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    /* Above bg, below planets */
}

.belt-circle {
    fill: none;
    opacity: 0.9;
    /* High visibility */
}

.main-belt-circle {
    stroke: rgba(222, 184, 135, 0.9);
    /* Burlywood - vibrant tan */
    stroke-width: 40;
    stroke-dasharray: 4, 6;
    /* Distinct dots */
}

.kuiper-belt-circle {
    stroke: rgba(135, 206, 250, 0.7);
    /* Light Sky Blue */
    stroke-width: 80;
    stroke-dasharray: 10, 10;
}

/* Leyenda - Tiny Version */
.viz-legend {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.85);
    padding: 0.5rem 0.8rem;
    /* Compact padding */
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 1000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.2rem;
    font-size: 0.65rem;
    /* Tiny font */
    color: #bbb;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}



.legend-item:last-child {
    margin-bottom: 0;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    display: block;
}

.legend-color.main-belt-color {
    background: rgba(150, 150, 150, 0.3);
    border: 1px dotted rgba(150, 150, 150, 0.5);
}

.legend-color.kuiper-belt-color {
    background: rgba(100, 100, 100, 0.2);
    border: 1px dashed rgba(100, 100, 100, 0.4);
}

/* News List */
.news-card {
    display: flex;
    flex-direction: column;
    max-height: 100%;
    overflow: hidden;
}

.news-list {
    list-style: none;
    flex: 1;
    overflow-y: auto;
    max-height: 100%;
    /* Ensure it doesn't push parent */
    padding-right: 0.5rem;
    /* Space for scrollbar if functional, though hidden */
    margin-bottom: 0;
    scrollbar-width: none;
    /* Firefox */
}

.news-list::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.news-list li {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 1rem;
}

.news-list li:last-child {
    border: none;
}

.news-list a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    display: block;
    margin-bottom: 0.3rem;
    transition: color 0.2s;
}

.news-list a:hover {
    color: var(--accent-color);
}

.news-date {
    font-size: 0.75rem;
    color: #555;
    text-transform: uppercase;
}

/* Events List (Alternative View) */
.events-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.event-row {
    display: flex;
    gap: 2rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-left: 3px solid var(--border-color);
    transition: all 0.2s;
}

.event-row:hover {
    background: #111;
}

.event-row.type-solar {
    border-left-color: #ffcc00;
}

.event-row.type-eclipse {
    border-left-color: #555;
}

.event-row.type-meteor {
    border-left-color: #00d2ff;
}

.event-date-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding-right: 1rem;
}

.event-year {
    font-size: 0.8rem;
    color: #555;
}

.event-day {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-primary);
    text-align: center;
}

.event-info h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.event-tag {
    font-size: 0.6rem;
    padding: 2px 6px;
    border: 1px solid #333;
    border-radius: 4px;
    color: #777;
}

.event-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.event-location {
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-style: italic;
}

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

/* Responsive Grid */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.dash-card {
    background: rgba(20, 20, 25, 0.6);
    /* Glass effect base */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.dash-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
    border-color: var(--accent-color);
    background: rgba(30, 30, 40, 0.7);
}

.dash-card h4 {
    margin-bottom: 1rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--accent-light);
    letter-spacing: 2px;
    z-index: 2;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.8rem;
    font-weight: 600;
}

/* Moon Card */
.moon-visual {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0;
}

.moon-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(90deg, #dddddd 50%, #222 50%);
    /* Placeholder */
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.15);
}

.dash-info .big-data {
    font-size: 2.2rem;
    font-weight: 700;
    display: block;
    line-height: 1;
    margin-bottom: 0.2rem;
    background: linear-gradient(to right, #fff, #aaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dash-info .label {
    font-size: 0.9rem;
    color: #ccc;
    display: block;
}

.dash-info .sub-label {
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.2rem;
    display: block;
}

/* ISS Card */
.iss-map-placeholder {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    color: var(--accent-color);
    margin-bottom: 1rem;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.data-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.2rem;
}

.data-row span {
    color: #888;
}

.data-row b {
    color: #eee;
    font-family: monospace;
}

/* Launches Card */
.launches-card {
    position: relative;
}

.launch-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.2;
    z-index: 0;
    transition: opacity 0.3s;
}

.dash-card:hover .launch-bg {
    opacity: 0.3;
}

.launch-highlight {
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    height: 100%;
}

.launch-mission {
    font-weight: 700;
    color: #fff;
    font-size: 1.1rem;
    line-height: 1.3;
}

.launch-rocket {
    font-size: 0.9rem;
    color: var(--accent-light);
}

.launch-provider {
    font-size: 0.8rem;
    color: #aaa;
    margin-bottom: auto;
}

.launch-date {
    font-family: monospace;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 8px;
    border-radius: 6px;
    align-self: flex-start;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Mars Card */
.mars-card {
    padding: 0;
    border: 0;
    grid-column: span 2;
}

@media (max-width: 1200px) {
    .mars-card {
        grid-column: span 1;
        /* Reset on smaller screens */
    }
}

.mars-card h4 {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    padding: 6px 12px;
    border-radius: 8px;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
    z-index: 5;
    pointer-events: none;
}

.mars-photo {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 0.5s ease;
    z-index: 1;
}

.dash-card:hover .mars-photo {
    transform: scale(1.05);
}

.cam-badge,
.date-badge {
    position: absolute;
    bottom: 1rem;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #ddd;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 2;
}

.cam-badge {
    left: 1rem;
}

.date-badge {
    right: 1rem;
}

/* NEOs Card */
.neos-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.neos-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

.neos-list li:last-child {
    border-bottom: none;
}

.neos-list li.danger {
    color: #f87171;
}

.neo-name {
    flex-grow: 1;
    font-weight: 500;
}

/* --- Mars Maximize Overlay --- */
.mars-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 2px;
    gap: 10px;
}

.mars-photo:hover .mars-overlay {
    opacity: 1;
}

/* --- Mars Modal (Fullscreen) --- */
.mars-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* Prevent native scrollbars, we use transform */
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.mars-modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    animation: zoomIn 0.3s;
    cursor: grab;
    transform-origin: center center;
    will-change: transform;
}

@keyframes zoomIn {
    from {
        transform: scale(0)
    }

    to {
        transform: scale(1)
    }
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 2001;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--accent-color);
    text-decoration: none;
    cursor: pointer;
}

/* --- Compact Top Row Cards --- */
.moon-card,
.iss-card,
.launches-card {
    min-height: 180px;
    /* Reduced from 220px */
    padding: 1.2rem;
}

.iss-map-placeholder {
    width: 60px !important;
    height: 60px !important;
    margin-bottom: 0.5rem;
}

.moon-icon {
    width: 60px;
    height: 60px;
}

.launches-list {
    max-height: 450px !important;
    /* Modificado: Ampliado para mostrar más elementos en el panel */
    overflow-y: auto;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

.launches-list::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari/Webkit */
}

/* Maintain larger height for Mars and Asteroids (Bottom Row) */
.mars-card,
.neos-card {
    min-height: 250px;
}

.neo-size {
    width: 70px;
    text-align: right;
    color: #888;
    font-size: 0.8rem;
}

.neo-dist {
    width: 70px;
    text-align: right;
    color: var(--accent-color);
    font-family: monospace;
}

.legend-tiny {
    font-size: 0.7rem;
    color: #555;
    margin-top: 1rem;
    text-align: right;
    font-style: italic;
}

/* Mobile Refinements Round 2 (Re-applied) */
@media (max-width: 768px) {

    /* 1. APOD: Media first, full width */
    .apod-container {
        flex-direction: column !important;
        gap: 2rem;
        align-items: stretch !important;
    }

    .apod-media,
    .apod-info {
        width: 100% !important;
        flex: none !important;
    }

    /* 2. Earth Model: Smaller on mobile */
    #earth-3d-container {
        height: 40vh !important;
        min-height: 250px !important;
        /* Verified override */
    }

    .earth-header {
        height: auto !important;
        min-height: auto !important;
        /* Override internal style */
    }

    /* 3. Space Overlay: Ensure Navbar is visible/clickable */
    .navbar {
        position: relative !important;
        z-index: 21000 !important;
        /* Above overlay (20000) */
        background: var(--bg-color) !important;
        /* Ensure distinct background */
    }

    /* 4. Tierra Reset Button Positioning */
    .reset-view-btn {
        position: relative !important;
        top: auto !important;
        bottom: auto !important;
        left: auto !important;
        margin: 10px auto !important;
        display: block !important;
        width: fit-content !important;
        text-align: center;
        /* Center button */
    }
}

/* Global Page Loader */
#global-loader {
    position: fixed;
    top: 70px;
    /* Below navbar */
    left: 0;
    width: 100vw;
    height: calc(100vh - 70px);
    background-color: #050510;
    background-image: radial-gradient(circle at center, #0b0e14 0%, #000 100%);
    z-index: 9998;
    /* Under navbar */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: opacity 0.5s ease;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

#global-loader.active {
    opacity: 1;
    pointer-events: all;
}

/* Starry background animation */
#global-loader::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 200vw;
    height: 200vh;
    background: transparent url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="400" height="400"><circle cx="20" cy="20" r="1" fill="white" opacity="0.8"/><circle cx="150" cy="80" r="1.5" fill="white" opacity="0.6"/><circle cx="300" cy="40" r="0.8" fill="white" opacity="0.9"/><circle cx="80" cy="250" r="1.2" fill="white" opacity="0.5"/><circle cx="250" cy="300" r="1" fill="white" opacity="0.7"/><circle cx="350" cy="200" r="1.5" fill="white" opacity="0.4"/><circle cx="100" cy="150" r="0.8" fill="white" opacity="0.8"/><circle cx="200" cy="180" r="1.2" fill="white" opacity="0.6"/></svg>') repeat;
    animation: driftStars 60s linear infinite;
    z-index: 0;
    opacity: 0.6;
}

@keyframes driftStars {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(-50vw, -50vh);
    }
}

.loader-text {
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 4px;
    font-size: 1.2rem;
    color: var(--accent-color);
    text-transform: uppercase;
    z-index: 1;
    text-shadow: 0 0 15px rgba(0, 170, 255, 0.6);
    margin-bottom: 25px;
    animation: pulseText 2s infinite alternate;
}

@keyframes pulseText {
    0% {
        opacity: 0.7;
    }

    100% {
        opacity: 1;
        text-shadow: 0 0 25px rgba(0, 170, 255, 1);
    }
}

/* Progress line */
.loader-progress-container {
    width: 300px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
    overflow: hidden;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(0, 170, 255, 0.2);
}

.loader-progress-line {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    animation: loadingBarLine 1.5s ease-in-out infinite;
    box-shadow: 0 0 15px var(--accent-color);
}

@keyframes loadingBarLine {
    0% {
        left: -50%;
    }

    100% {
        left: 100%;
    }
}

.loader-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    letter-spacing: 2px;
    animation: pulse 1.5s infinite;
}

@keyframes spin-loader {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}