/* Põhiline paigutus */
body {
    font-family: 'Segoe UI', sans-serif;

    text-align: center;
    margin: 0;
    padding: 20px;
}

.fm-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}
.fm-tab {
    background: #34495e;
    color: #fff;
    border: 1px solid #7f8c8d;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-weight: bold;
}
.fm-tab.active { background: #5eb3ff; color: #000; }

/* =========================================
   AIRBUS A320 ECAM EWD DISPLAY
   ========================================= */
.ecam-display {
    background-color: #222524; /* Autentne tumehall/must LCD taust */
    border: 2px solid #000;
    border-radius: 4px;
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    font-family: Consolas, "Courier New", monospace;
    font-weight: bold;
    text-align: left;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.9) inset, 0 10px 30px rgba(0,0,0,0.5);
    padding: 10px 20px 20px 20px;
    box-sizing: border-box;
}

/* Värvid */
.ecam-white { color: #ffffff; }
.ecam-green { color: #00ff00; }
.ecam-cyan  { color: #00ffff; }
.ecam-amber { color: #ffb300; }
.ecam-red   { color: #ff0000; }
.ecam-small { font-size: 0.8em; }

/* Thrust Mode (Top Right) */
.ecam-thrust-mode {
    position: absolute;
    top: 15px;
    right: 20px;
    text-align: right;
    font-size: 18px;
    line-height: 1.1;
}

/* Mootorite sektsioon (Grid) */
.ecam-engines {
    display: grid;
    grid-template-columns: 1fr 100px 1fr;
    align-items: center;
    padding-top: 10px;
}
.ecam-eng-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}
.ecam-eng-labels {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    font-size: 16px;
    color: #fff;
    text-align: center;
    padding-top: 30px;
}
.label-block {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.label-unit { font-size: 14px; color: #00ffff; }

/* Mõõdikud ja Numbrid */
.ecam-gauge {
    position: relative;
    width: 90px;
    height: 90px;
}
.ecam-gauge svg {
    width: 100%;
    height: 100%;
}
.ecam-digital-box {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    border: 2px solid #fff;
    padding: 1px 6px;
    font-size: 18px;
    background-color: #222524;
}
.ecam-digital-box.amber {
    border-color: #ffb300;
    color: #ffb300;
}
.ecam-digital-box.green {
    border-color: #fff;
    color: #00ff00;
}
.ecam-raw-number {
    font-size: 20px;
    margin-top: 25px;
}
.ecam-raw-number.amber { color: #ffb300; }
.ecam-raw-number.green { color: #00ff00; }

/* Keskriba */
.ecam-middle-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 20px;
    padding: 0 10px;
}
.flap-svg { width: 60px; height: 20px; }

/* Eraldusjoon */
.ecam-divider {
    height: 2px;
    background-color: #ffffff;
    width: 100%;
    margin: 15px 0;
}

/* Alumine pool (ECAM teated) */
.ecam-lower {
    display: flex;
    height: 220px;
}
.ecam-left {
    flex: 0 0 65%;
    padding-right: 10px;
}
.ecam-right {
    flex: 1;
    border-left: 2px solid #aaa; /* Vertikaaljoon nagu pildil */
    padding-left: 15px;
    position: relative;
}
/* Vihreä nuoli — näkyy vain kun alla on lisää sisältöä */
.ecam-right::after {
    content: '↓';
    position: absolute;
    bottom: -5px;
    left: -9px;
    color: #00ff00;
    font-size: 20px;
    background: #222524;
    display: none;
}
.ecam-right.has-more::after {
    display: block;
}

/* Kiinnitetty vikotsikko */
.ecam-pinned-title {
    margin-bottom: 6px;
}

/* Teadete stiilid */
.ecam-msg-title {
    display: inline-block;
    color: #ffb300;
    font-size: 18px;
    border: 2px solid #ffb300; /* Kast pealkirja ümber */
    padding: 0 5px;
    margin-bottom: 5px;
}
.ecam-msg-title.warn { color: #ff0000; border-color: #ff0000; }

.ecam-msg-line {
    font-size: 18px;
    display: flex;
    align-items: center;
    margin-bottom: 2px;
}
.ecam-msg-line.info { color: #ffffff; padding-left: 25px; } /* Valge tekst (.IF NO DAMAGE) */
.ecam-msg-line.action { color: #00ffff; } /* Tsüaan tegevus */

.ecam-msg-line.action .label { margin-right: 5px; }
.ecam-msg-line.action .value { margin-left: auto; }
.ecam-msg-line.action .dots {
    flex-grow: 1;
    border-bottom: 3px dotted #00ffff;
    margin: 0 8px;
    position: relative;
    top: -5px;
}

/* Nupuga edasi liikumine (Pulseeriv tsüaan ja roheline tehtud) */
.ecam-msg-line.action.active {
    background-color: rgba(0, 255, 255, 0.15);
    animation: pulse 1s infinite alternate;
}
.ecam-msg-line.action.done { color: #00ff00; }
.ecam-msg-line.action.done .dots { border-bottom-color: #00ff00; }

/* Parempoolsed memod */
.ecam-secondary-line {
    font-size: 18px;
    margin-bottom: 2px;
}
.ecam-secondary-line.amber { color: #ffb300; }
.ecam-secondary-line.cyan { color: #00ffff; }
.ecam-secondary-line.green { color: #00ff00; }

/* Controls */
.fm-controls { margin-top: 20px; }
.fm-btn {
    padding: 10px 20px;
    font-size: 16px;
    background: #7f8c8d;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.fm-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.fm-btn.primary { background: #5eb3ff; color: #000; font-weight: bold; }
.fm-counter { font-size: 18px; font-weight: bold; margin: 0 15px; }

@keyframes pulse {
    0% { opacity: 1; }
    100% { opacity: 0.5; }
}

.ecam-lower {
    display: flex;
    height: 220px;           /* kiinteä korkeus */
    overflow: hidden;        /* ei kasva yli */
}
.ecam-left {
    flex: 0 0 65%;
    padding-right: 10px;
    overflow: hidden;        /* rullaus ei näy */
}
.ecam-messages {
    display: flex;
    flex-direction: column;
    gap: 2px;
}


/* Status-viesti (vihreä memo, esim. AVOID ICING CONDITIONS) */
.ecam-msg-line.status {
    color: #00ff00 !important;
    font-size: 18px;
    padding-left: 0;
    margin-top: 8px;
    letter-spacing: 0.5px;
    display: block;
}

/* Konteiner mõlema ekraani (EWD ja SD) hoidmiseks */
.dual-ecam-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    margin-top: 20px;
}

/* System Display (SD) põhikonteiner */
.ecam-sd-display {
    background-color: #050505;
    border: 15px solid #222;
    border-radius: 12px;
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    font-family: Consolas, "Courier New", monospace;
    font-weight: bold;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.8) inset, 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* BLEED pealkiri */
.sd-header {
    font-size: 24px;
    text-decoration: underline;
    color: #fff;
    text-align: left;
    padding: 15px 20px 0 20px;
}

/* SVG graafika konteiner */
.sd-schematic {
    width: 100%;
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}
.sd-schematic svg {
    width: 100%;
    height: auto;
    max-height: 450px;
}

/* Alumine info-riba (TAT, SAT, TIME, GW) */
.sd-bottom-bar {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    border-top: 2px solid #fff;
    padding: 15px 20px;
    font-size: 18px;
    align-items: center;
}
.sd-col-center {
    text-align: center;
    border-left: 2px solid #fff;
    border-right: 2px solid #fff;
    padding: 0 10px;
}
.sd-col-right {
    text-align: right;
}