/* SEGFAULT AVIONICS DESIGN SYSTEM - LIGHT THEME (PROJECTOR OPTIMIZED) */

:root {
    --bg-base: #ffffff;
    --bg-panel: rgba(240, 244, 248, 0.9);
    --border-color: rgba(0, 0, 0, 0.12);
    --border-highlight: rgba(0, 94, 196, 0.25);
    
    --text-primary: #12141d;
    --text-secondary: #484f5e;
    --text-muted: #747b8c;
    
    /* Projector-Optimized High Contrast Accents */
    --accent-blue: #005ec4;
    --accent-purple: #8600b8;
    --accent-red: #cc1100;
    --accent-green: #0f8230;
    --accent-yellow: #a67000;
    
    /* Font stacks */
    --font-ui: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-data: 'Share Tech Mono', monospace;
}

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

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-ui);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

#app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* HEADER STYLE - Customized for FF00A1 theme */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background-color: #ff00a1 !important; /* Brand FF00A1 */
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    z-index: 10;
    color: #ffffff;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-text h1 {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #ffffff;
}

.logo-text p {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 2px;
}

.header-stats {
    display: flex;
    gap: 24px;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.stat-value {
    font-family: var(--font-data);
    font-size: 16px;
    font-weight: 600;
    color: #ffffff; /* High contrast white text for stats on pink */
}

.header-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.status-label {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

/* Badges for states - Contrast tuned for pink header */
.status-badge#flight-state-badge {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.status-badge.state-armed {
    background-color: rgba(255, 255, 255, 0.22) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.45) !important;
}

.status-badge.state-flight {
    background-color: rgba(255, 255, 255, 0.28) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.65) !important;
    animation: flash-border-white 1.5s infinite;
}

.status-badge.state-chute {
    background-color: rgba(255, 255, 255, 0.22) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.45) !important;
}

.status-badge.state-landed {
    background-color: rgba(255, 255, 255, 0.22) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.45) !important;
}

/* MAIN SECTION LAYOUT */
main {
    display: grid;
    grid-template-columns: 1fr 360px;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* GLASS PANEL */
.glass-panel {
    background-color: var(--bg-panel);
    border-left: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 5;
}

#charts-panel {
    grid-column: 2;
    border-left: 1px solid var(--border-color);
}

.panel-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-title i {
    color: var(--accent-blue);
}

/* CENTER COLUMN */
#center-panel {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: hidden;
}

#viewport-container {
    position: relative;
    flex: 1;
    width: 100%;
}

#tribo-panel {
    background-color: var(--bg-panel);
    border-top: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    padding: 12px 16px;
    height: 220px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chart-container-large {
    width: 100%;
    height: calc(100% - 24px);
    background-color: rgba(0, 0, 0, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
}

#canvas3d {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.viewport-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px;
}

.camera-controls {
    display: flex;
    gap: 8px;
    pointer-events: auto;
}

.cam-btn {
    background-color: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 12px;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.cam-btn:hover {
    color: var(--text-primary);
    background-color: #ffffff;
    border-color: rgba(0, 0, 0, 0.25);
}

.cam-btn.active {
    color: #ffffff;
    background-color: var(--accent-blue);
    border-color: var(--accent-blue);
    box-shadow: 0 2px 8px rgba(0, 94, 196, 0.3);
}

.altitude-tape {
    align-self: flex-end;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background-color: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--border-color);
    padding: 8px;
    border-radius: 6px;
    height: 200px;
    width: 48px;
    backdrop-filter: blur(8px);
    pointer-events: auto;
    margin-bottom: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.altitude-marker {
    font-family: var(--font-data);
    font-size: 11px;
    color: var(--accent-blue);
    font-weight: 600;
}

.altitude-track {
    flex: 1;
    width: 6px;
    background-color: rgba(0, 0, 0, 0.08);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column-reverse;
}

.altitude-fill {
    width: 100%;
    height: 0%;
    background: linear-gradient(to top, var(--accent-blue), var(--accent-purple));
    border-radius: 3px;
    transition: height 0.05s linear;
}

/* CHARTS PANEL */
.chart-container {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px;
    height: calc((100% - 32px) / 3);
    min-height: 180px;
}

/* PLAYBACK CONTROLS (FOOTER) */
footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background-color: rgba(255, 255, 255, 0.95);
    border-top: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    z-index: 10;
    gap: 20px;
}

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

.play-btn {
    background-color: rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
}

.play-btn:hover {
    background-color: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

.play-btn:active {
    transform: scale(0.95);
}

.play-btn#play-pause-btn {
    background-color: rgba(0, 94, 196, 0.08);
    color: var(--accent-blue);
    border-color: rgba(0, 94, 196, 0.25);
}

.play-btn#play-pause-btn:hover {
    background-color: rgba(0, 94, 196, 0.15);
    border-color: rgba(0, 94, 196, 0.4);
    color: var(--accent-blue);
}

.timeline-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.time-label {
    font-family: var(--font-data);
    font-size: 13px;
    color: var(--text-secondary);
    min-width: 60px;
}

#total-time {
    text-align: right;
}

#timeline-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background-color: rgba(0, 0, 0, 0.08);
    outline: none;
    cursor: pointer;
    transition: background 0.15s ease-in-out;
}

#timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--accent-blue);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 1px 6px rgba(0, 94, 196, 0.4);
    transition: transform 0.1s ease;
}

#timeline-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.speed-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.speed-label {
    font-size: 10px;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.speed-btn {
    background-color: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s ease;
}

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

.speed-btn.active {
    color: var(--accent-blue);
    background-color: rgba(0, 94, 196, 0.08);
    border-color: rgba(0, 94, 196, 0.25);
}

/* SCROLLBARS */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* ANIMATIONS */
@keyframes flash-border-white {
    0%, 100% {
        border-color: rgba(255, 255, 255, 0.4);
        box-shadow: 0 0 2px rgba(255, 255, 255, 0.2);
    }
    50% {
        border-color: rgba(255, 255, 255, 0.9);
        box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
    }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    main {
        grid-template-columns: 1fr;
    }
    #charts-panel {
        display: none;
    }
}
