/*
 * Star Trek: Continuum - LCARS Interface CSS
 * Authentic LCARS styling for the opening sequence
 * File: css/lcars.css
 */

/* ===== LCARS COLOR PALETTE ===== */
:root {
    --lcars-orange: #ff9900;
    --lcars-red: #cc6666;
    --lcars-yellow: #ffcc99;
    --lcars-blue: #9999cc;
    --lcars-purple: #cc99cc;
    --lcars-cyan: #99ccff;
    --lcars-green: #99cc99;
    --lcars-bg: #000000;
    --lcars-text: #ffffff;
    --lcars-text-dim: #cccccc;
    --lcars-panel-bg: #000033;

    /* Typography */
    --font-family-lcars: 'Courier Prime', 'Courier New', monospace;
}

/* ===== GLOBAL RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-lcars);
    background: var(--lcars-bg);
    overflow: hidden;
    height: 100vh;
    color: var(--lcars-text);
}

/* ===== MAIN LCARS INTERFACE ===== */
.lcars-interface {
    position: fixed;
    inset: 0;
    background: var(--lcars-bg);
    color: var(--lcars-text);
    display: flex;
    flex-direction: column;
}

.lcars-interface.hidden {
    display: none;
}

/* ===== STARFIELD BACKGROUND ===== */
#starfield-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.6;
    z-index: 1;
}

/* ===== LCARS FRAME STRUCTURE ===== */
.lcars-frame {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: grid;
    grid-template-rows: 60px 1fr 60px;
    z-index: 10;
}

/* ===== TOP & BOTTOM BARS ===== */
.lcars-bar {
    display: grid;
    grid-template-columns: 100px 1fr auto 100px;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
}

.lcars-bar-top {
    background: linear-gradient(to right, transparent, var(--lcars-orange), transparent);
}

.lcars-bar-bottom {
    background: linear-gradient(to right, transparent, var(--lcars-purple), transparent);
}

/* ===== LCARS ELEMENTS ===== */
.lcars-element {
    height: 40px;
    position: relative;
}

.lcars-elbow {
    border-radius: 20px;
}

.lcars-elbow-left {
    border-radius: 20px 0 0 20px;
}

.lcars-elbow-right {
    border-radius: 0 20px 20px 0;
}

.lcars-elbow-bottom-left {
    border-radius: 0 0 0 20px;
}

.lcars-elbow-bottom-right {
    border-radius: 0 0 20px 0;
}

.lcars-bar-fill {
    height: 100%;
    border-radius: 0;
}

.lcars-button-group {
    display: flex;
    gap: 10px;
    height: 100%;
    align-items: center;
}

/* ===== LCARS COLORS ===== */
.lcars-orange { background-color: var(--lcars-orange); }
.lcars-red { background-color: var(--lcars-red); }
.lcars-yellow { background-color: var(--lcars-yellow); }
.lcars-blue { background-color: var(--lcars-blue); }
.lcars-purple { background-color: var(--lcars-purple); }
.lcars-cyan { background-color: var(--lcars-cyan); }
.lcars-green { background-color: var(--lcars-green); }

/* ===== LCARS BUTTONS ===== */
.lcars-button {
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    color: #000;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    user-select: none;
    border: none;
    outline: none;
    font-family: var(--font-family-lcars);
}

.lcars-button:hover {
    filter: brightness(1.2);
    transform: scale(1.05);
    box-shadow: 0 0 15px currentColor;
}

.lcars-button:active {
    transform: scale(0.95);
}

.lcars-button.active {
    animation: lcarsButtonFlash 1s infinite;
}

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

/* ===== MAIN CONTENT LAYOUT ===== */
.lcars-content {
    display: grid;
    grid-template-columns: 150px 1fr 150px;
    gap: 20px;
    padding: 20px;
    height: 100%;
    overflow: hidden;
}

/* ===== LEFT/RIGHT COLUMNS ===== */
.lcars-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.lcars-bracket {
    height: 100px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.lcars-bracket-left {
    border-radius: 20px 0 0 20px;
}

.lcars-bracket-right {
    border-radius: 0 20px 20px 0;
}

.lcars-text {
    text-align: center;
    color: #000;
    font-weight: bold;
}

.lcars-title {
    font-size: 16px;
    letter-spacing: 2px;
}

.lcars-subtitle {
    font-size: 12px;
    letter-spacing: 3px;
    margin-top: 5px;
}

.lcars-stardate,
.lcars-time {
    font-size: 11px;
    letter-spacing: 1px;
    margin: 2px 0;
}

/* ===== BUTTON STACKS ===== */
.lcars-button-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.lcars-button-stack .lcars-button {
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px 0 0 20px;
}

.lcars-column-right .lcars-button {
    border-radius: 0 20px 20px 0;
}

.lcars-gap {
    height: 20px;
}

/* ===== CENTER DISPLAY PANELS ===== */
.lcars-display-center {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
}

.lcars-panel {
    background: var(--lcars-panel-bg);
    border: 2px solid var(--lcars-blue);
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.lcars-panel-header {
    padding: 8px 15px;
    font-size: 11px;
    font-weight: bold;
    color: #000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.lcars-panel-id {
    font-size: 10px;
    opacity: 0.8;
}

.lcars-panel-content {
    padding: 15px;
    color: var(--lcars-text);
    line-height: 1.4;
}

/* ===== STATUS GRID ===== */
.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.status-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.status-label {
    font-size: 10px;
    color: var(--lcars-text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-value {
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
}

/* ===== TEXT CONTENT STYLING ===== */
#text-content {
    font-size: 13px;
    line-height: 1.6;
    min-height: 200px;
}

.text-line {
    margin: 8px 0;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease;
}

.text-line.visible {
    opacity: 1;
    transform: translateY(0);
}

.text-line.highlight {
    color: var(--lcars-cyan);
    font-weight: bold;
}

/* ===== ENTERPRISE SCHEMATIC ===== */
.schematic-content {
    padding: 10px;
    background: #000011;
    border-radius: 5px;
}

.enterprise-schematic {
    width: 100%;
    height: 120px;
}

/* ===== CONTROL OVERLAY ===== */
.control-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    backdrop-filter: blur(2px);
}

.control-overlay.hidden {
    display: none;
}

.control-message {
    text-align: center;
    color: var(--lcars-cyan);
    font-size: 18px;
}

.control-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.control-subtitle {
    font-size: 16px;
    margin-bottom: 20px;
    opacity: 0.8;
}

.control-blink {
    font-size: 20px;
    animation: blink 1.5s infinite;
}

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

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1200px) {
    .lcars-content {
        grid-template-columns: 120px 1fr 120px;
        gap: 15px;
        padding: 15px;
    }

    .lcars-button {
        font-size: 10px;
        padding: 6px 10px;
    }
}

@media (max-width: 768px) {
    .lcars-content {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .lcars-column {
        display: none;
    }

    .lcars-bar {
        grid-template-columns: 60px 1fr 60px;
    }

    .lcars-button-group {
        gap: 5px;
    }

    .lcars-button {
        font-size: 9px;
        padding: 4px 8px;
    }
}

@media (max-width: 480px) {
    .lcars-panel-header {
        font-size: 10px;
        padding: 6px 12px;
    }

    .lcars-panel-content {
        padding: 12px;
        font-size: 12px;
    }

    .status-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

@media (prefers-contrast: high) {
    :root {
        --lcars-text: #ffffff;
        --lcars-bg: #000000;
        --lcars-panel-bg: #000033;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .lcars-interface {
        display: none;
    }
}

/* ===== UTILITY CLASSES ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for accessibility */
.lcars-button:focus {
    outline: 2px solid var(--lcars-cyan);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (forced-colors: active) {
    .lcars-button {
        border: 1px solid ButtonText;
    }

    .lcars-panel {
        border: 1px solid ButtonText;
    }
}