/* Artemis II Mission Dashboard - Styles */

:root {
    /* Color palette - Space themed with NASA accents */
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.05);

    --accent-blue: #3b82f6;
    --accent-orange: #f97316;
    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border-color: rgba(255, 255, 255, 0.1);
    --glow-blue: 0 0 20px rgba(59, 130, 246, 0.5);
    --glow-orange: 0 0 20px rgba(249, 115, 22, 0.5);

    /* Criticality colors */
    --critical: #ef4444;
    --high: #f97316;
    --medium: #eab308;
    --routine: #22c55e;

    /* Spacing */
    --radius: 12px;
    --radius-lg: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Starfield background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(6, 182, 212, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* Header */
.header {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-images {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nasa-logo {
    height: 45px;
    width: auto;
}

.artemis-logo {
    height: 55px !important;
    max-height: 55px !important;
    width: 55px !important;
    max-width: 55px !important;
    object-fit: contain !important;
    border-radius: 8px;
    flex-shrink: 0;
}

.logo-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-text span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Countdown Timer */
.countdown-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.countdown-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.countdown {
    display: flex;
    gap: 0.5rem;
}

.countdown-unit {
    text-align: center;
}

.countdown-value {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    min-width: 50px;
}

.countdown-value.highlight {
    background: linear-gradient(135deg, var(--accent-orange), var(--critical));
    border-color: var(--accent-orange);
    box-shadow: var(--glow-orange);
}

.countdown-unit span:last-child {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Main Container */
.main-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
}

/* Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-title .icon {
    font-size: 1.5rem;
}

/* Filter Controls */
.filter-controls {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

/* Schedule Table */
.schedule-table-container {
    max-height: 600px;
    overflow-y: auto;
    border-radius: var(--radius);
}

.schedule-table-container::-webkit-scrollbar {
    width: 8px;
}

.schedule-table-container::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.schedule-table-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.schedule-table-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.schedule-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.schedule-table th {
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    z-index: 10;
}

.schedule-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
    vertical-align: middle;
}

.schedule-table tbody tr {
    transition: background 0.2s ease;
}

.schedule-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.1);
}

.event-name {
    font-weight: 500;
    max-width: 300px;
}

.event-phase {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.time-cell {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Criticality badges */
.criticality-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.criticality-badge.critical {
    background: rgba(239, 68, 68, 0.2);
    color: var(--critical);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.criticality-badge.high {
    background: rgba(249, 115, 22, 0.2);
    color: var(--high);
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.criticality-badge.medium {
    background: rgba(234, 179, 8, 0.2);
    color: var(--medium);
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.criticality-badge.routine {
    background: rgba(34, 197, 94, 0.2);
    color: var(--routine);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Timeline Panel */
.timeline-panel {
    position: sticky;
    top: 100px;
    height: calc(100vh - 140px);
    overflow-y: auto;
}

.timeline-panel::-webkit-scrollbar {
    width: 6px;
}

.timeline-panel::-webkit-scrollbar-track {
    background: transparent;
}

.timeline-panel::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* Interactive Timeline */
.timeline {
    position: relative;
    padding: 1rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom,
            var(--accent-blue),
            var(--accent-purple),
            var(--accent-orange),
            var(--accent-cyan));
    border-radius: 3px;
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    padding-bottom: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.timeline-item:hover {
    transform: translateX(5px);
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: 12px;
    top: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 3px solid var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    z-index: 2;
}

.timeline-item:hover .timeline-marker {
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.timeline-item.active .timeline-marker {
    background: var(--accent-blue);
    animation: pulse 2s infinite;
}

.timeline-item.completed .timeline-marker {
    background: var(--routine);
    border-color: var(--routine);
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }
}

.timeline-content {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1rem;
    transition: all 0.3s ease;
}

.timeline-item:hover .timeline-content {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-blue);
}

.timeline-phase {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-cyan);
    margin-bottom: 0.25rem;
}

.timeline-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.timeline-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.timeline-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.timeline-item.expanded .timeline-details {
    max-height: 200px;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.timeline-notes {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Phase separator in timeline */
.phase-separator {
    padding: 1rem 0 1rem 60px;
    margin-bottom: 0.5rem;
}

.phase-separator-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    border-radius: var(--radius);
    border-left: 3px solid var(--accent-blue);
}

.phase-icon {
    font-size: 1.25rem;
}

.phase-name {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Crew Info */
.crew-section {
    grid-column: 1 / -1;
    margin-top: 1rem;
}

.crew-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.crew-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    transition: all 0.3s ease;
}

.crew-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-blue);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.2);
}

.crew-avatar {
    width: 80px;
    height: 80px;
    min-width: 80px;
    min-height: 80px;
    max-width: 80px;
    max-height: 80px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    overflow: hidden;
    position: relative;
    border: 3px solid var(--accent-blue);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.crew-avatar img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.crew-avatar.initials {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
}

.crew-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.crew-role {
    font-size: 0.85rem;
    color: var(--accent-cyan);
    margin-bottom: 0.25rem;
}

.crew-agency {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Timezone tabs */
.timezone-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tz-tab {
    flex: 1;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tz-tab:hover {
    border-color: var(--accent-blue);
}

.tz-tab.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.tz-tab .tz-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.tz-tab .tz-offset {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.tz-tab.active .tz-offset {
    color: rgba(255, 255, 255, 0.8);
}

/* Mission Status Banner */
.mission-status {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    border: 1px solid var(--accent-blue);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.status-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    background: var(--routine);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-indicator.pre-launch {
    background: var(--accent-orange);
}

.status-text h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.status-text p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.status-stats {
    display: flex;
    gap: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-cyan);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Responsive */
@media (max-width: 1200px) {
    .main-container {
        grid-template-columns: 1fr;
    }

    .timeline-panel {
        position: static;
        height: auto;
        max-height: 500px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .countdown {
        flex-wrap: wrap;
        justify-content: center;
    }

    .main-container {
        padding: 1rem;
    }

    .schedule-table th,
    .schedule-table td {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
}

/* Loading animation */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Telemetry Section */
.telemetry-section {
    grid-column: 1 / -1;
    margin-bottom: 0rem;
    margin-top: 1rem;
}

.telemetry-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.telemetry-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-glass);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.telemetry-item:hover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.05);
}

.telemetry-gauge {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gauge-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.gauge-track {
    fill: none;
    stroke: var(--bg-secondary);
    stroke-width: 6;
}

.gauge-fill {
    fill: none;
    stroke: var(--accent-blue);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.gauge-content {
    text-align: center;
    z-index: 2;
}

.gauge-value {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
    line-height: 1.2;
}

.gauge-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.25rem;
}

.telemetry-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: center;
}

/* MET special gauge */
.met-gauge {
    width: 200px;
}

.met-gauge .gauge-value {
    font-size: 1.4rem;
    color: var(--accent-cyan);
    letter-spacing: -0.02em;
}

/* Live indicator */
.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent-orange);
    letter-spacing: 0.1em;
    padding: 0.4rem 0.8rem;
    background: rgba(249, 115, 22, 0.1);
    border-radius: 999px;
    border: 1px solid rgba(249, 115, 22, 0.2);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-orange);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-orange);
    animation: live-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes live-pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(1.2);
    }
}

/* Responsive Telemetry */
@media (max-width: 1000px) {
    .telemetry-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .telemetry-grid {
        grid-template-columns: 1fr;
    }

    .met-gauge {
        width: 100%;
    }
}

/* Live Feed Section */
.live-feed-section {
    grid-column: 1 / -1;
    margin-top: 1rem;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: var(--radius);
    background: #000;
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    object-fit: cover;
}

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');
/* Mission Resources Section */
.resource-links-section {
    width: 100%;
    margin-top: 1rem;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    width: 100%;
}

.resource-card {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
    background: #000;
}

.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 150, 255, 0.2);
    border-color: var(--highlight-color);
}

.resource-image {
    width: 100%;
    height: 100%;
}

.resource-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    opacity: 0.7;
}

.resource-card:hover .resource-image img {
    transform: scale(1.05);
    opacity: 0.4;
}

.resource-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    pointer-events: none;
    height: 100%;
    box-sizing: border-box;
}

.resource-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.resource-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    font-family: 'Space Grotesk', sans-serif;
}

.resource-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* Make grid responsive on smaller screens */
@media (max-width: 768px) {
    .resource-grid {
        grid-template-columns: 1fr;
    }
}

/* Refinement: Larger Crew Avatars */
.crew-avatar {
    width: 110px;
    height: 110px;
    min-width: 110px;
    min-height: 110px;
    max-width: 110px;
    max-height: 110px;
}
