/* =========================================================
   VHF SRC Radio Simulator – Styles
   SkipperCheck.net
   ========================================================= */

:root {
    --radio-bg: #1e2329;
    --radio-panel: #252b33;
    --display-bg: #0a160a;
    --display-green: #00e676;
    --display-dim: #004d22;
    --btn-dark: #2e343c;
    --btn-hover: #3e444c;
    --ptt-red: #c0392b;
    --ptt-active: #e74c3c;
    --accent-blue: #0d6efd;
}

/* ── Page wrapper ── */
.vhf-page-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a3a5c;
    margin-bottom: 4px;
}

.vhf-page-subtitle {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 28px;
}

/* ── Scenario selector ── */
.scenario-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    margin-bottom: 32px;
}

.scenario-card {
    border: 2px solid #e0e8f0;
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.18s ease;
    background: #fff;
    position: relative;
}

.scenario-card:hover {
    border-color: var(--accent-blue);
    background: #f0f6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(13,110,253,0.12);
}

.scenario-card.active {
    border-color: var(--accent-blue);
    background: #e8f0ff;
}

.scenario-card .badge-type {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.badge-distress  { background: #fde8e8; color: #c0392b; }
.badge-urgency   { background: #fef3cd; color: #a05000; }
.badge-safety    { background: #d4edda; color: #155724; }
.badge-routine   { background: #d1ecf1; color: #0c5460; }
.badge-dsc       { background: #ede0ff; color: #5b0070; }
.badge-receive   { background: #d6eaff; color: #004085; }
.badge-explore   { background: #e8e0ff; color: #3a006f; }

.scenario-card h6 {
    margin: 0 0 5px;
    font-size: 14px;
    font-weight: 700;
    color: #1a2a3a;
}

.scenario-card p {
    margin: 0;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

/* ── Simulator layout ── */
.simulator-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 768px) {
    .simulator-layout {
        grid-template-columns: 1fr;
    }


    .scenario-panel-header {
        padding: 12px 16px;
    }

    .scenario-panel-body {
        padding: 14px 16px;
    }

    .action-btn-row {
        margin-top: 8px;
    }

    .action-btn-row .btn,
    .action-btn-row button {
        font-size: 1.1rem !important;
        padding: 13px 20px !important;
        width: 100% !important;
    }

    .rbtn.small {
        width: 44px !important;
        height: 44px !important;
        font-size: 22px !important;
    }

    .vol-sql-value {
        font-size: 16px !important;
        min-width: 20px;
    }
}

/* ============================================================
   VHF Radio Device
   ============================================================ */
.vhf-radio-device {
    background: linear-gradient(160deg, #23292f 0%, #171c22 100%);
    border-radius: 18px;
    padding: 22px 18px 18px;
    box-shadow:
        0 16px 48px rgba(0,0,0,0.55),
        inset 0 1px 0 rgba(255,255,255,0.06),
        inset 0 -1px 0 rgba(0,0,0,0.4);
    border: 1px solid #333;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

/* Brand strip */
.radio-brand-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.radio-brand-name {
    font-size: 8px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #555;
    font-family: 'Courier New', monospace;
}

.radio-model {
    font-size: 9px;
    color: #444;
    font-family: 'Courier New', monospace;
}

/* Power indicator LED */
.power-led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #222;
    border: 1px solid #333;
    box-shadow: none;
    transition: all 0.3s;
}

.power-led.on {
    background: #00e676;
    box-shadow: 0 0 6px #00e676, 0 0 12px rgba(0,230,118,0.4);
}

/* ── LCD Display ── */
.radio-display {
    background: var(--display-bg);
    border-radius: 8px;
    padding: 12px 14px 10px;
    margin-bottom: 16px;
    border: 1px solid #1a3a1a;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.9);
    position: relative;
}

.display-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.display-ch-label {
    font-family: 'Courier New', monospace;
    font-size: 9px;
    color: var(--display-dim);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.display-tx-rx {
    display: flex;
    gap: 6px;
}

.display-tx-rx span {
    font-family: 'Courier New', monospace;
    font-size: 9px;
    color: var(--display-dim);
    letter-spacing: 1px;
}

.display-tx-rx span.lit {
    color: var(--display-green);
    text-shadow: 0 0 6px rgba(0,230,118,0.6);
}

.display-tx-rx span.tx-lit {
    color: #ff6b35;
    text-shadow: 0 0 6px rgba(255,107,53,0.6);
}

.display-channel-number {
    font-family: 'Courier New', monospace;
    font-size: 52px;
    font-weight: bold;
    color: var(--display-green);
    text-align: center;
    line-height: 1;
    letter-spacing: 4px;
    text-shadow: 0 0 12px rgba(0,230,118,0.5), 0 0 24px rgba(0,230,118,0.2);
    transition: color 0.2s;
}

.display-channel-number.off {
    color: var(--display-dim);
    text-shadow: none;
}

.display-channel-number.scan-active {
    animation: scan-flash 0.4s steps(1) infinite;
}

@keyframes scan-flash {
    0%   { opacity: 1; }
    50%  { opacity: 0.35; }
    100% { opacity: 1; }
}

/* Channel name row */
.display-ch-name {
    font-family: 'Courier New', monospace;
    font-size: 9px;
    color: rgba(0,230,118,0.5);
    text-align: center;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    min-height: 12px;
    margin-top: 2px;
}

/* SCAN label in display top-left */
.display-scan-lbl {
    font-family: 'Courier New', monospace;
    font-size: 8px;
    color: var(--display-dim);
    letter-spacing: 1px;
    margin-left: 2px;
    display: none;
}

.display-scan-lbl.visible {
    display: inline;
    color: var(--display-green);
    animation: scan-blink 0.8s step-end infinite;
}

@keyframes scan-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.2; }
}

/* DW (Dualwatch) indicator */
.display-dw {
    font-family: 'Courier New', monospace;
    font-size: 8px;
    color: var(--display-dim);
    letter-spacing: 1px;
    display: none;
}

.display-dw.visible {
    display: inline;
    color: #4fc3f7;
    text-shadow: 0 0 5px rgba(79,195,247,0.6);
}

.display-bottom-row {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
}

.display-info {
    font-family: 'Courier New', monospace;
    font-size: 9px;
    color: var(--display-dim);
    letter-spacing: 1px;
}

.display-info.active-info {
    color: rgba(0,230,118,0.6);
}

/* Power level indicator — always bright, 1W amber */
#display-power {
    color: var(--display-green) !important;
    text-shadow: 0 0 5px rgba(0,230,118,0.5);
}

#display-power.lo-power {
    color: #e0b030 !important;
    text-shadow: 0 0 5px rgba(224,176,48,0.5);
}

/* ── Softkey labels (inside LCD) ── */
.softkey-label-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
    margin-top: 7px;
    padding-top: 5px;
    border-top: 1px solid #0f2a0f;
    min-height: 18px;
}

.sk-label {
    font-family: 'Courier New', monospace;
    font-size: 7px;
    color: var(--display-dim);
    text-align: center;
    white-space: pre-line;
    line-height: 1.2;
    transition: color 0.15s;
}

.sk-label.active {
    color: var(--display-green);
    text-shadow: 0 0 4px rgba(0,230,118,0.5);
}

/* ── Softkey buttons (below display) ── */
.softkey-btn-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-bottom: 12px;
}

.sk-btn {
    height: 20px;
    font-size: 7px;
    padding: 2px 1px;
    border-radius: 4px;
    min-width: 0;
    letter-spacing: 0.3px;
    opacity: 0.2;
}

.sk-btn.armed {
    opacity: 1;
    border-color: rgba(0,230,118,0.4);
    color: var(--display-green);
}

/* ── Knobs row ── */
.vol-sql-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 14px;
}

.vol-sql-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.vol-sql-label {
    font-size: 8px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-family: 'Courier New', monospace;
}

.vol-sql-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.vol-sql-value {
    font-size: 13px;
    font-family: 'Courier New', monospace;
    color: #4fc3f7;
    min-width: 16px;
    text-align: center;
}

.rbtn.small {
    width: 38px !important;
    height: 38px !important;
    font-size: 20px !important;
    line-height: 1;
    padding: 0 !important;
}

/* ── Channel buttons ── */
.channel-nav-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 10px;
}

.radio-btn-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    margin-bottom: 14px;
}

.rbtn {
    background: var(--btn-dark);
    border: 1px solid #3a4048;
    border-radius: 6px;
    color: #aaa;
    font-size: 9px;
    padding: 8px 3px 7px;
    cursor: pointer;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.1s;
    font-family: 'Courier New', monospace;
    line-height: 1.2;
    outline: none;
}

.rbtn:hover {
    background: var(--btn-hover);
    color: #ddd;
    border-color: #555;
}

.rbtn:active, .rbtn.pressed {
    transform: translateY(1px);
    background: #444;
}

.rbtn.large {
    font-size: 11px;
    padding: 10px 3px;
}

.rbtn.ch16 {
    background: #0d2a4a;
    border-color: #1a5a99;
    color: #5ba3e0;
    font-weight: 700;
}

.rbtn.ch16:hover {
    background: #1a3a6a;
    color: #88c3f0;
}

.rbtn.dsc {
    background: #c0392b;
    border-color: #922b21;
    color: #fff;
    border-radius: 50% !important;
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    font-size: 9px !important;
    font-weight: 800;
}

.rbtn.dsc:hover {
    background: #e74c3c;
    border-color: #c0392b;
    color: #fff;
}

.rbtn.power {
    background: #0a2010;
    border-color: #1a6030;
    color: #44cc66;
}

.rbtn.power.off {
    background: var(--btn-dark);
    border-color: #3a4048;
    color: #ff6a00;
}

.rbtn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── PTT ── */
.ptt-wrapper {
    padding: 4px 0 2px;
}

.ptt-btn {
    width: 100%;
    height: 58px;
    background: linear-gradient(165deg, #a93226, #7b241c);
    border: 2px solid #c0392b;
    border-bottom-color: #7b241c;
    border-right-color: #7b241c;
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 3px;
    cursor: pointer;
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
    box-shadow: 0 4px 12px rgba(169,50,38,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
    transition: all 0.06s;
    outline: none;
    position: relative;
    overflow: hidden;
}

.ptt-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(255,255,255,0.08) 0%, transparent 50%);
    pointer-events: none;
}

.ptt-btn:hover:not(:disabled) {
    background: linear-gradient(165deg, #c0392b, #96281b);
    box-shadow: 0 5px 16px rgba(192,57,43,0.5);
}

.ptt-btn.active {
    background: linear-gradient(165deg, #e74c3c, #c0392b) !important;
    border-color: #ff5a4a;
    box-shadow: 0 0 20px rgba(231,76,60,0.6), 0 2px 4px rgba(0,0,0,0.4) !important;
    transform: translateY(2px);
}

.ptt-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Transmit indicator strip */
.tx-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    height: 18px;
    opacity: 0;
    transition: opacity 0.1s;
}

.tx-bar.active {
    opacity: 1;
}

.tx-dot {
    width: 7px;
    height: 7px;
    background: #ff5a4a;
    border-radius: 50%;
    animation: txblink 0.5s step-end infinite;
}

.tx-bar span {
    font-size: 9px;
    color: #ff5a4a;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 700;
}

@keyframes txblink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.1; }
}

/* ============================================================
   Scenario Panel (right column)
   ============================================================ */
.scenario-panel {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    overflow: hidden;
    min-height: 480px;
    display: flex;
    flex-direction: column;
}

.scenario-panel-header {
    background: linear-gradient(135deg, #1a4a8a, #0d3060);
    color: #fff;
    padding: 18px 22px;
}

.header-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.scenario-panel-header .step-label {
    font-size: 10px;
    opacity: 0.6;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.scenario-panel-header h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.btn-header-continue {
    flex-shrink: 0;
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.6);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: 6px;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}
.btn-header-continue:hover,
.btn-header-continue:focus {
    background: rgba(255,255,255,0.28);
    border-color: #fff;
    color: #fff;
}

/* Step progress bar */
.step-progress-bar {
    display: flex;
    gap: 4px;
    margin-top: 12px;
}

.step-pip {
    flex: 1;
    height: 3px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    transition: background 0.3s;
}

.step-pip.done  { background: #28a745; }
.step-pip.now   { background: #fff; }

/* Panel body */
.scenario-panel-body {
    padding: 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Instruction box */
.instr-box {
    border-left: 4px solid #0d6efd;
    background: #f0f6ff;
    border-radius: 0 8px 8px 0;
    padding: 13px 16px;
    font-size: 14px;
    line-height: 1.55;
    color: #1a2a3a;
}

.instr-box.warn  { border-color: #f39c12; background: #fffbf0; }
.instr-box.ok    { border-color: #27ae60; background: #f0fff6; }
.instr-box.err   { border-color: #e74c3c; background: #fff5f5; }

/* Script box */
.script-box {
    background: #0f1523;
    border-radius: 8px;
    padding: 14px 16px;
    font-family: 'Courier New', monospace;
    font-size: 12.5px;
    color: #d0e8ff;
    line-height: 1.75;
    white-space: pre-line;
    border: 1px solid #1e2d44;
}

.script-box-label {
    font-size: 9px;
    color: #6a8aaa;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
    display: block;
}

/* Feedback */
.feedback-box {
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 13px;
    display: none;
    line-height: 1.5;
}

.feedback-box.show { display: block; }
.feedback-box.correct   { background: #f0fff6; border: 1px solid #27ae60; color: #155724; }
.feedback-box.incorrect { background: #fff5f5; border: 1px solid #e74c3c; color: #7a1010; }
.feedback-box .fb-icon  { font-weight: 700; margin-right: 6px; }

/* Action buttons */
.action-btn-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.action-btn-row .btn,
.action-btn-row button {
    font-size: 1.05rem !important;
    padding: 11px 24px !important;
    min-height: 48px !important;
}

/* Completed / Score */
.completion-box {
    text-align: center;
    padding: 16px 8px 8px;
}

.score-ring {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: conic-gradient(#27ae60 var(--pct), #e0e0e0 var(--pct));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    position: relative;
}

.score-ring-inner {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.score-ring-inner .pct-num {
    font-size: 22px;
    font-weight: 700;
    color: #1a2a3a;
    line-height: 1;
}

.score-ring-inner .pct-label {
    font-size: 8px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Hint tooltip */
.hint-text {
    font-size: 12px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hint-text i { color: #aaa; }

/* ── Multiple-choice question ── */
.choices-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.choice-btn {
    width: 100%;
    padding: 10px 14px;
    background: #f8fafd;
    border: 2px solid #c8d8ea;
    border-radius: 7px;
    color: #1a2a3a;
    text-align: left;
    cursor: pointer;
    font-size: 0.88rem;
    line-height: 1.4;
    transition: background 0.15s, border-color 0.15s;
}

.choice-btn:hover:not(:disabled) {
    background: #e8f0fb;
    border-color: #4a7fba;
}

.choice-btn.correct {
    background: #efffef;
    border-color: #27ae60;
    color: #155724;
    font-weight: 600;
}

.choice-btn.incorrect {
    background: #fff5f5;
    border-color: #e74c3c;
    color: #7a1010;
}

.choice-btn:disabled {
    cursor: default;
    opacity: 0.75;
}

/* ── DSC Distress Guard (cover + hold) ── */
.dsc-guard-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    perspective: 400px;
    width: 44px;
    height: 44px;
}
.dsc-guard {
    position: absolute;
    inset: 0;
    background: #c0392b;
    color: #fff;
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.3px;
    line-height: 1.3;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 4px;
    cursor: pointer;
    transform-origin: top center;
    transform: rotateX(0deg);
    transition: transform 0.4s ease, opacity 0.3s;
    z-index: 5;
    user-select: none;
    border: 1px solid #922b21;
}
.dsc-guard.open {
    transform: rotateX(-120deg);
    opacity: 0.15;
    pointer-events: none;
}
#btn-dsc {
    position: relative;
    overflow: hidden;
}
.dsc-hold-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: #fff;
    border-radius: 0 0 3px 3px;
    pointer-events: none;
}

/* ── DSC countdown ── */
.dsc-label, .dsc-countdown {
    position: absolute;
    left: 0; right: 0;
    text-align: center;
    pointer-events: none;
    line-height: 1;
}
.dsc-label {
    font-size: 9px;
    font-weight: 800;
}
.dsc-countdown {
    font-size: 18px;
    font-weight: 900;
    color: #fff;
    display: none;
}
