/* ══════════════════════════════════════════════════════════
   Terminal Shell — Overlay, header, navigation, body,
   section view, footer, scrollbar, responsive
   ══════════════════════════════════════════════════════════ */

/* ── Terminal Overlay ─────────────────────────────────── */
.terminal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Semi-transparent border/backdrop — 30% opacity */
.terminal-border {
    position: absolute;
    inset: 0;
    background: rgba(15, 12, 8, 0.70);
    cursor: pointer;
}

/* Main terminal frame — 90% of viewport */
.terminal-frame {
    position: relative;
    width: 90vw;
    height: 90vh;
    display: flex;
    flex-direction: column;
    background: #f4edd8;
    border: 3px solid #8b7355;
    border-radius: 4px;
    box-shadow:
        0 0 60px rgba(0, 0, 0, 0.5),
        inset 0 0 80px rgba(139, 115, 85, 0.15);
    overflow: hidden;
}

/* ── Header ──────────────────────────────────────────── */
.terminal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: #3d2b1f;
    border-bottom: 2px solid #8b7355;
    flex-shrink: 0;
}
.terminal-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.terminal-seal {
    font-size: 1.2rem;
    color: #d4a853;
}
.terminal-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #d4a853;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.terminal-header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.terminal-delv-badge {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: #d4a853;
    letter-spacing: 0.5px;
    background: rgba(212, 168, 83, 0.1);
    border: 1px solid rgba(212, 168, 83, 0.3);
    border-radius: 4px;
    padding: 3px 10px;
}

.terminal-close {
    background: none;
    border: 1px solid rgba(212, 168, 83, 0.3);
    color: #d4a853;
    font-size: 1.4rem;
    line-height: 1;
    padding: 2px 10px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
}
.terminal-close:hover {
    background: rgba(212, 168, 83, 0.15);
    border-color: #d4a853;
}

/* ── Body / Parchment ────────────────────────────────── */
.terminal-body {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
}
.terminal-parchment {
    max-width: 70%;
    margin: 0 auto;
}

/* ── Welcome Text ────────────────────────────────────── */
.terminal-welcome {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #3d2b1f;
}
.terminal-address {
    font-size: 1.1rem;
    margin-bottom: 20px;
}
.terminal-welcome p {
    margin-bottom: 16px;
    text-indent: 2em;
}
.terminal-welcome p.terminal-address {
    text-indent: 0;
}
.terminal-signature {
    margin-top: 30px;
    font-style: italic;
    color: #6b5740;
    text-indent: 0 !important;
}

/* ── Navigation Sections ───────────────────────────────── */
.terminal-nav-section {
    margin-top: 28px;
    border: 1px solid #c9b99a;
    border-radius: 4px;
    padding: 20px 20px 24px;
    background: rgba(237, 228, 204, 0.3);
}
.terminal-nav-section-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.8rem;
    color: #8b7355;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 16px;
}

/* ── Navigation Buttons ──────────────────────────────── */
.terminal-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.terminal-nav-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 12px 16px;
    background: #ede4cc;
    border: 1px solid #c9b99a;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Georgia', 'Times New Roman', serif;
}

.terminal-nav-btn:hover,
.terminal-nav-btn.active {
    background: #3d2b1f;
    border-color: #8b7355;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(42, 31, 20, 0.25);
}

.terminal-nav-btn.active {
    border-color: #d4a853;
    box-shadow: 0 4px 12px rgba(42, 31, 20, 0.25), 0 0 0 1px #d4a853;
}

.terminal-nav-icon {
    font-size: 1.5rem;
    color: #5a3d28;
    line-height: 1;
    transition: color 0.2s;
}

.terminal-nav-btn:hover .terminal-nav-icon,
.terminal-nav-btn.active .terminal-nav-icon {
    color: #d4a853;
}

.terminal-nav-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #3d2b1f;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: color 0.2s;
}

.terminal-nav-btn:hover .terminal-nav-label,
.terminal-nav-btn.active .terminal-nav-label {
    color: #e8dcc4;
}

.terminal-nav-key {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(90, 61, 40, 0.1);
    border: 1px solid #c9b99a;
    border-radius: 3px;
    padding: 0px 5px;
    font-size: 0.6rem;
    color: #8b7355;
    font-family: inherit;
    transition: all 0.2s;
}

.terminal-admin-chip {
    display: inline-block;
    font-size: 0.55rem;
    background: rgba(180, 85, 85, 0.15);
    color: #b05555;
    border: 1px solid rgba(180, 85, 85, 0.3);
    border-radius: 3px;
    padding: 1px 5px;
    margin-left: 4px;
    text-transform: lowercase;
    letter-spacing: 0;
    font-weight: 400;
    vertical-align: middle;
}

.terminal-nav-btn:hover .terminal-admin-chip {
    background: rgba(180, 85, 85, 0.25);
    color: #e8c4c4;
    border-color: rgba(180, 85, 85, 0.4);
}

.terminal-nav-btn:hover .terminal-nav-key,
.terminal-nav-btn.active .terminal-nav-key {
    background: rgba(212, 168, 83, 0.15);
    border-color: #8b7355;
    color: #d4a853;
}

/* ── Section View ────────────────────────────────────── */
.terminal-section {
    max-width: 70%;
    margin: 0 auto;
}

.terminal-section-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.terminal-back-btn {
    background: none;
    border: 1px solid #c9b99a;
    color: #5a3d28;
    font-size: 1.2rem;
    line-height: 1;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    font-family: 'Georgia', 'Times New Roman', serif;
}

.terminal-back-btn:hover {
    background: #3d2b1f;
    border-color: #8b7355;
    color: #d4a853;
}

.terminal-section-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.terminal-section-icon {
    font-size: 1.6rem;
    color: #8b6914;
    line-height: 1;
}

.terminal-section-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: #3d2b1f;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0;
}

.terminal-section-divider {
    height: 2px;
    background: linear-gradient(to right, #8b7355, #c9b99a, transparent);
    margin: 16px 0 28px;
}

.terminal-section-content {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1rem;
    line-height: 1.7;
    color: #3d2b1f;
    min-height: 200px;
}

.terminal-section-desc {
    font-size: 1.05rem;
    color: #6b5740;
    font-style: italic;
    margin: 0;
}

/* ── Footer ──────────────────────────────────────────── */
.terminal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    background: #3d2b1f;
    border-top: 2px solid #8b7355;
    flex-shrink: 0;
}
.terminal-footer-left {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.75rem;
    color: #8b7355;
    letter-spacing: 2px;
}
.terminal-footer-right {
    font-size: 0.75rem;
    color: #8b7355;
}
.terminal-footer kbd {
    background: rgba(212, 168, 83, 0.15);
    border: 1px solid #8b7355;
    border-radius: 3px;
    padding: 1px 6px;
    font-size: 0.7rem;
    color: #d4a853;
}

/* ── Scrollbar styling ───────────────────────────────── */
.terminal-body::-webkit-scrollbar {
    width: 8px;
}
.terminal-body::-webkit-scrollbar-track {
    background: #e8dcc4;
}
.terminal-body::-webkit-scrollbar-thumb {
    background: #8b7355;
    border-radius: 4px;
}
.terminal-body::-webkit-scrollbar-thumb:hover {
    background: #6b5740;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
    .terminal-frame {
        width: 96vw;
        height: 96vh;
    }
    .terminal-body {
        padding: 24px 20px;
    }
    .terminal-title {
        font-size: 0.75rem;
        letter-spacing: 1px;
    }
    .terminal-nav {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .terminal-nav-btn {
        padding: 14px 8px 12px;
    }
    .terminal-nav-icon {
        font-size: 1.2rem;
    }
}
