/* ============================================
   Apple-Style Cycling Terminal
   TuneAI - Refined Engineer Aesthetic
   ============================================ */

:root {
    --terminal-bg: rgba(15, 15, 15, 0.82);
    --terminal-text: #e0e0e0;
    --terminal-header: rgba(30, 30, 30, 0.9);
    --terminal-accent: #a855f7;
    --terminal-border: rgba(255, 255, 255, 0.12);
    --terminal-font: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    --mac-red: #ff5f56;
    --mac-yellow: #ffbd2e;
    --mac-green: #27c93f;
    --green: #00ff88;
}

/* Dashboard Section Header */
.dashboard-terminal {
    padding: 120px 0;
    position: relative;
    overflow: hidden;
}

.terminal-section-header {
    text-align: center;
    max-width: 1000px;
    margin: 0 auto 40px auto;
    z-index: 10;
    position: relative;
}

.terminal-section-header h2 {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 800;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    Letter-spacing: -1px;
}

.terminal-section-header p {
    font-size: 18px;
    color: #94a3b8;
    line-height: 1.6;
}

/* Terminal Container */
.terminal-container {
    background: var(--terminal-bg);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--terminal-border);
    border-radius: 14px;
    font-family: var(--terminal-font);
    color: var(--terminal-text);
    overflow: hidden;
    box-shadow: 0 50px 120px rgba(0, 0, 0, 0.6);
    width: 100%;
    max-width: 950px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(40px);
    transition: all 1.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.terminal-container.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Header */
.terminal-header {
    background: var(--terminal-header);
    border-bottom: 1px solid var(--terminal-border);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.terminal-controls {
    display: flex;
    gap: 10px;
}

.control-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot-red {
    background: var(--mac-red);
}

.dot-yellow {
    background: var(--mac-yellow);
}

.dot-green {
    background: var(--mac-green);
}

.terminal-title {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 500;
}

/* Cycling Viewport */
.terminal-viewport {
    position: relative;
    height: 620px;
    overflow: hidden;
}

.terminal-module {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 40px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.terminal-module.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Graphics Area */
.module-graphic {
    height: 240px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* High-Fidelity Animations */

/* 1. Literal Pipeline (Enhance) */
.pipeline-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-around;
    position: relative;
}

.pipeline-track {
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 1;
}

.pipeline-station {
    width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 2;
}

.station-node {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #333;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.station-label {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.active-station .station-node {
    background: var(--terminal-accent);
    box-shadow: 0 0 15px var(--terminal-accent);
    border-color: #fff;
}

.active-station .station-label {
    color: var(--terminal-accent);
}

/* 2. Live Log & Metric (Analytics) */
.analytics-grid {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 150px;
    gap: 20px;
}

.log-stream {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 10px;
    font-size: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.log-entry {
    color: var(--green);
    opacity: 0.6;
    white-space: nowrap;
}

.metric-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.circle-outer {
    width: 80px;
    height: 80px;
    border: 4px solid #222;
    border-top-color: var(--terminal-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: spin 4s linear infinite;
}

.circle-inner {
    font-size: 14px;
    color: var(--terminal-accent);
    font-weight: 700;
}

/* 3. Secure Vault Index (Storage) */
.vault-grid {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    perspective: 1000px;
}

.prompt-card {
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(20px) rotateX(-10deg);
}

.prompt-card.revealed {
    opacity: 1;
    transform: translateY(0) rotateX(0);
}

.card-header {
    height: 4px;
    width: 30px;
    background: var(--terminal-accent);
    border-radius: 2px;
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-line {
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    width: 100%;
    border-radius: 1px;
}

.card-line:nth-child(2) {
    width: 80%;
}

.card-line:nth-child(3) {
    width: 60%;
}

.card-status {
    position: absolute;
    bottom: 6px;
    right: 6px;
    font-size: 7px;
    color: var(--terminal-accent);
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes layerFill {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes scanMove {
    0% {
        top: 0;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

/* Content Area */
.module-content {
    max-width: 650px;
}

.terminal-line {
    margin-bottom: 14px;
    display: flex;
    gap: 12px;
    opacity: 0;
}

.terminal-line.revealed {
    opacity: 1;
    animation: slideIn 0.5s ease forwards;
}

@keyframes slideIn {
    from {
        transform: translateY(10px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.line-prompt {
    color: var(--green);
    margin-right: 8px;
    font-weight: bold;
}

.section-tag {
    font-size: 11px;
    color: var(--terminal-accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
    display: block;
}

.section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
}

.section-desc {
    font-size: 15px;
    color: #94a3b8;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    .terminal-viewport {
        height: 650px;
    }

    .terminal-module {
        padding: 24px;
    }

    .terminal-section-header {
        margin-bottom: 40px;
    }
}