/* ============================================================
   ISRO FSOC Mission Control Console - Aerospace CSS Theme
   ============================================================ */

:root {
    --bg-primary: #080d1a;
    --bg-secondary: #0d1527;
    --bg-card: rgba(16, 26, 48, 0.75);
    --bg-glass: rgba(13, 23, 44, 0.65);
    --border-glass: rgba(0, 229, 255, 0.18);
    --border-active: #00e5ff;
    --accent-orange: #ff7700;
    --accent-cyan: #00e5ff;
    --accent-green: #00e676;
    --accent-red: #ff3d71;
    --accent-amber: #ffaa00;
    --text-primary: #e6f1ff;
    --text-secondary: #8899b7;
    --text-muted: #536b8e;
    --font-display: 'Orbitron', -apple-system, sans-serif;
    --font-ui: 'Rajdhani', -apple-system, sans-serif;
    --shadow-neon: 0 0 15px rgba(0, 229, 255, 0.25);
    --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.45);
}

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

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(0, 229, 255, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(255, 119, 0, 0.04) 0%, transparent 40%),
        linear-gradient(rgba(255, 255, 255, 0.01) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.01) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 16px 24px;
    gap: 16px;
    max-width: 1680px;
    margin: 0 auto;
}

/* --- Header Section --- */
.mission-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 12px 24px;
    box-shadow: var(--shadow-card);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 18px;
}

.logo-badge {
    background: linear-gradient(135deg, #ff7700 0%, #ff3d00 100%);
    color: #ffffff;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 20px;
    padding: 8px 16px;
    border-radius: 6px;
    letter-spacing: 2px;
    box-shadow: 0 0 14px rgba(255, 119, 0, 0.4);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.title-block h1 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--accent-cyan);
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.4);
}

.title-block .subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    letter-spacing: 0.8px;
    font-weight: 500;
}

.system-status-badges {
    display: flex;
    align-items: center;
    gap: 14px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.live-beacon {
    color: var(--accent-green);
    border-color: rgba(0, 230, 118, 0.3);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.7; }
    50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px var(--accent-green); }
    100% { transform: scale(0.9); opacity: 0.7; }
}

.isro-badge {
    color: var(--accent-cyan);
    border-color: rgba(0, 229, 255, 0.4);
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.2);
}

.isro-badge.non-compliant {
    color: var(--accent-red);
    border-color: rgba(255, 61, 113, 0.5);
    box-shadow: 0 0 8px rgba(255, 61, 113, 0.2);
}

/* --- Main Grid Layout --- */
.console-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 20px;
    flex: 1;
}

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

.glass-panel {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    padding-bottom: 12px;
}

.panel-header h2 {
    font-family: var(--font-display);
    font-size: 15px;
    color: var(--text-primary);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-header h2 .icon {
    color: var(--accent-orange);
    animation: blink 2s infinite;
}

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

/* --- Stream Viewport --- */
.stream-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #02050b;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(0, 229, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
}

#live-stream {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.reticle-info-overlay {
    position: absolute;
    bottom: 12px;
    right: 12px;
    font-family: var(--font-display);
    font-size: 10px;
    color: rgba(0, 229, 255, 0.75);
    background: rgba(8, 13, 26, 0.85);
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid rgba(0, 229, 255, 0.2);
    display: flex;
    flex-direction: column;
    gap: 2px;
    pointer-events: none;
}

/* --- Telemetry Bar --- */
.telemetry-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.telemetry-card {
    background: rgba(16, 26, 48, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}

.telemetry-card:hover {
    border-color: rgba(0, 229, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.telemetry-card .label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: 0.8px;
    margin-bottom: 4px;
}

.telemetry-card .value {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-cyan);
    letter-spacing: 0.5px;
}

.telemetry-card .sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

.telemetry-card.compliant .value {
    color: var(--accent-green);
}

.telemetry-card.warning .value {
    color: var(--accent-amber);
}

.telemetry-card.alert .value {
    color: var(--accent-red);
}

/* --- Control Tabs Navigation --- */
.tabs-nav {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 10px;
    margin-bottom: 16px;
    overflow-x: auto;
}

.tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.25) 0%, rgba(0, 119, 255, 0.2) 100%);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

/* --- Tab Content --- */
.tab-pane {
    display: none;
    flex-direction: column;
    gap: 14px;
    max-height: 520px;
    overflow-y: auto;
    padding-right: 6px;
}

.tab-pane.active {
    display: flex;
}

/* Custom Scrollbar */
.tab-pane::-webkit-scrollbar {
    width: 6px;
}

.tab-pane::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.tab-pane::-webkit-scrollbar-thumb {
    background: rgba(0, 229, 255, 0.2);
    border-radius: 4px;
}

.tab-pane::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 229, 255, 0.4);
}

.tab-pane h3 {
    font-family: var(--font-display);
    font-size: 13px;
    color: var(--accent-orange);
    letter-spacing: 1px;
    margin-top: 4px;
}

.tab-pane .desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    margin: 8px 0;
}

/* --- Form Controls --- */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-group label {
    font-size: 13px;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.val-display {
    font-family: var(--font-display);
    font-size: 12px;
    color: var(--accent-cyan);
}

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

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-cyan);
    box-shadow: 0 0 8px var(--accent-cyan);
    cursor: pointer;
    transition: transform 0.15s ease;
}

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

.form-select {
    width: 100%;
    padding: 8px 12px;
    background: rgba(8, 13, 26, 0.9);
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
}

.form-select:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.3);
}

.form-select option {
    background: #0d1527;
    color: #e6f1ff;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    justify-content: flex-start;
}

.checkbox-group input[type="checkbox"] {
    accent-color: var(--accent-cyan);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.form-input-file {
    background: rgba(8, 13, 26, 0.9);
    border: 1px dashed rgba(0, 229, 255, 0.3);
    border-radius: 6px;
    padding: 10px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
}

.form-input-file::-webkit-file-upload-button {
    background: rgba(0, 229, 255, 0.2);
    border: 1px solid var(--accent-cyan);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 4px;
    font-family: var(--font-ui);
    font-weight: 600;
    cursor: pointer;
    margin-right: 10px;
}

/* --- Buttons --- */
.btn {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.8px;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 11px;
}

.btn-primary {
    background: linear-gradient(135deg, #00e5ff 0%, #0077ff 100%);
    color: #050b17;
    box-shadow: 0 0 12px rgba(0, 229, 255, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 0 18px rgba(0, 229, 255, 0.5);
    transform: translateY(-1px);
}

.btn-secondary {
    background: linear-gradient(135deg, #ff7700 0%, #ff3d00 100%);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(255, 119, 0, 0.3);
}

.btn-secondary:hover {
    box-shadow: 0 0 18px rgba(255, 119, 0, 0.5);
    transform: translateY(-1px);
}

.btn-outline {
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.4);
    color: var(--accent-cyan);
}

.btn-outline:hover {
    background: rgba(0, 229, 255, 0.18);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

.btn-danger {
    background: rgba(255, 61, 113, 0.12);
    border: 1px solid rgba(255, 61, 113, 0.4);
    color: var(--accent-red);
}

.btn-danger:hover {
    background: rgba(255, 61, 113, 0.25);
    box-shadow: 0 0 10px rgba(255, 61, 113, 0.3);
}

.viewport-controls {
    display: flex;
    gap: 8px;
}

.status-msg {
    margin-top: 8px;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 6px;
    display: none;
    line-height: 1.4;
}

.status-msg.info {
    display: block;
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.3);
    color: var(--accent-cyan);
}

.status-msg.success {
    display: block;
    background: rgba(0, 230, 118, 0.1);
    border: 1px solid rgba(0, 230, 118, 0.3);
    color: var(--accent-green);
}

.status-msg.error {
    display: block;
    background: rgba(255, 61, 113, 0.1);
    border: 1px solid rgba(255, 61, 113, 0.3);
    color: var(--accent-red);
}

/* --- Reports List --- */
.reports-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.report-item {
    background: rgba(16, 26, 48, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.report-item:hover {
    border-color: rgba(0, 229, 255, 0.3);
    background: rgba(16, 26, 48, 0.9);
}

.report-item .name {
    font-family: var(--font-display);
    font-size: 12px;
    color: var(--text-primary);
}

.report-actions {
    display: flex;
    gap: 8px;
}

.loading-text {
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
}
