/* 
    =========================================================================
    OPERATOR CONSOLE — TEENAGE ENGINEERING / ANALOGUE EDITION
    =========================================================================
    A "Simulation Device" aesthetic with high-end industrial finish.
    Philosophy: "Tactile, Precision, No Fluff."
*/

:root {
    --op-bg: #F4F4F4;
    /* Vitsoe Off-White */
    --op-surface: #EAEAEA;
    /* Analogue Aluminum */
    --op-border: #D1D1D1;
    /* Precision Cut */
    --op-text: #111111;
    /* Ink Black */
    --op-text-dim: #999999;
    /* Laser Etched */
    --op-accent: #FF3300;
    /* Teenage Engineering Orange */
    --op-bezel: #E0E0E0;
    /* Screen recess */
    --op-font-mono: 'Berkeley Mono', 'SF Mono', 'Fira Code', monospace;
}

/* 
    LAYOUT CONTAINER 
    =========================================================================
    BALANCED SIZING: The console is sized to complement the hero text,
    not overpower it. Using max-width and controlled height to ensure
    the animation feels like a supporting visual, not the main focus.
*/
.op-console {
    display: grid;
    /* 
        BALANCED PANELS:
        The activity panel needs enough room for readable think-aloud
        text. A 1.2:1 ratio keeps both panels usable.
    */
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    background: var(--op-bg);
    border: 1px solid var(--op-border);
    border-radius: 6px;
    overflow: hidden;
    font-family: var(--op-font-mono);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.02),
        /* Micro-border */
        0 1px 2px rgba(0, 0, 0, 0.05),
        0 12px 48px rgba(0, 0, 0, 0.12);
    /* Deeper lift */
    /* 
        READABLE SIZE:
        Tall and wide for full content visibility.
    */
    height: 600px;
    /* 
        MAX-WIDTH CONSTRAINT: Very wide to fill the animation column
        and make all content clearly readable.
    */
    max-width: 1200px;
    letter-spacing: -0.02em;
    position: relative;
}

/* Noise Texture Overlay */
.op-console::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.03;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    z-index: 999;
    mix-blend-mode: multiply;
}

/* 
    LEFT MODULE: VIEWPORT (The Screen)
*/
.op-viewport {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--op-border);
    background: var(--op-surface);
    position: relative;
}

.op-viewport__header {
    height: 36px;
    border-bottom: 1px solid var(--op-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: #FAFAFA;
}

.op-badge {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.15em;
    /* Tracked out labels */
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--op-text);
    text-transform: uppercase;
}

.op-badge--live .op-dot {
    width: 6px;
    height: 6px;
    background: var(--op-accent);
    border-radius: 50%;
    animation: blink 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    /* Breathier blink */
}

.op-timer {
    font-variant-numeric: tabular-nums;
    font-size: 10px;
    color: var(--op-text-dim);
    letter-spacing: 0.05em;
    font-weight: 500;
}

.op-screen-content {
    flex: 1;
    position: relative;
    margin: 8px;
    /* Physical bezel */
    background: #FFF;
    border: 1px solid #DDD;
    border-radius: 4px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    display: flex;
    /* 
        LIVE FEED FIT:
        Scale the simulated UI down so the full page can be seen
        inside the live feed viewport without cropping.
    */
    /* 
        FULL-PAGE VISIBILITY:
        With the wider console, we can use a larger scale for
        better readability.
    */
    --op-ui-scale: 0.85;
}

/* 
    HIGH FIDELITY SIMULATED UI 
*/
.op-ui-layout {
    display: flex;
    /* 
        SCALE-AWARE LAYOUT:
        We expand the layout's logical size to compensate for the
        transform scale so the full UI remains visible.
    */
    width: calc(100% / var(--op-ui-scale));
    height: calc(100% / var(--op-ui-scale));
    transform: scale(var(--op-ui-scale));
    transform-origin: top left;
}

/* Sidebar */
.op-ui-sidebar {
    width: 60px;
    background: #F9F9F9;
    border-right: 1px solid #EEE;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    gap: 24px;
}

.op-ui-logo {
    width: 24px;
    height: 24px;
    background: #333;
    border-radius: 6px;
}

.op-ui-nav {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    padding: 0 12px;
}

.op-ui-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.op-ui-nav-item.active {
    opacity: 1;
}

.op-ui-nav-item .op-icon {
    width: 18px;
    height: 18px;
    background: #AAA;
    border-radius: 4px;
}

.op-ui-nav-item.active .op-icon {
    background: #333;
}

.op-ui-nav-item .op-line {
    width: 24px;
    height: 2px;
    background: #CCC;
    border-radius: 1px;
}

.op-ui-user {
    margin-top: auto;
    width: 28px;
    height: 28px;
    background: #EEE;
    border-radius: 50%;
    border: 1px solid #DDD;
}

/* Main Content */
.op-ui-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #FFF;
}

.op-ui-header {
    height: 56px;
    border-bottom: 1px solid #F0F0F0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
}

.op-ui-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.op-text-block {
    background: #EEE;
    height: 10px;
    border-radius: 2px;
}

.op-divider {
    color: #CCC;
    font-size: 12px;
}

.op-ui-actions {
    display: flex;
    gap: 12px;
}

.op-btn {
    height: 28px;
    padding: 0 12px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.op-btn--secondary {
    background: #F5F5F5;
    color: #666;
}

.op-btn--primary {
    background: #111;
    color: #FFF;
}

.op-ui-body {
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.op-ui-hero-card {
    height: 80px;
    background: #FAFAFA;
    border-radius: 8px;
    border: 1px solid #EEE;
    display: flex;
    align-items: center;
    padding: 0 24px;
}

.op-ui-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.op-icon-lg {
    width: 32px;
    height: 32px;
    background: #DDD;
    border-radius: 8px;
}

.op-text-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.op-text-line {
    height: 8px;
    background: #EEE;
    border-radius: 2px;
    display: block;
}

.op-text-line.lg {
    height: 12px;
    background: #DDD;
}

.op-text-line.xs {
    height: 6px;
    background: #F0F0F0;
}

.op-ui-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.op-ui-card {
    background: #FFF;
    border: 1px solid #EAEAEA;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    /* FIXED: List properties explicitly instead of 'all' for better performance */
    transition: transform, box-shadow, border-color 0.3s ease;
}

.op-ui-card.active {
    border-color: #CCC;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.op-card-icon {
    width: 24px;
    height: 24px;
    background: #EEE;
    border-radius: 6px;
}

.op-card-icon.highlight {
    background: #FFDDAA;
}

/* Subtle Orange Tint */

.op-text-block-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}


/* CURSOR - Pixel Perfect */
.op-cursor {
    position: absolute;
    top: 50%;
    left: 50%;
    pointer-events: none;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    /* Elegant easing */
    z-index: 100;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

/* 
    RIGHT MODULE: AGENT MIND (The Process) 
    Pattern: Dot Matrix Background
*/
.op-mind {
    display: flex;
    flex-direction: column;
    background: #FAFAFA;
    /* subtle dot matrix */
    background-image: radial-gradient(#DDD 1px, transparent 1px);
    background-size: 20px 20px;
}

.op-mind__header {
    height: 36px;
    border-bottom: 1px solid var(--op-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: var(--op-bg);
}

/* 
    ACTIVITY HEADER: Persona identification
    Matches the reference "First-Time Visitor's Activity" style.
*/
.op-activity-header {
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--op-border);
    background: #FFF;
}

.op-activity-persona {
    font-size: 13px;
    font-weight: 700;
    color: var(--op-text);
    display: block;
    margin-bottom: 4px;
}

.op-activity-desc {
    font-size: 11px;
    color: var(--op-text-dim);
    line-height: 1.4;
    margin: 0;
}

.op-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--op-text-dim);
}

.op-id {
    font-size: 9px;
    color: var(--op-text);
    font-weight: 600;
    background: #EAEAEA;
    padding: 2px 6px;
    border-radius: 2px;
}

.op-loop-container {
    flex: 1;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: hidden;
}

/* STEPS: Printed Receipt Style */
.op-step {
    position: relative;
    padding: 16px;
    background: #FFF;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    border-radius: 2px;
    opacity: 0.4;
    /* FIXED: List properties explicitly instead of 'all' for better performance */
    transition: opacity, transform, border, box-shadow 0.4s ease;
    transform: scale(0.98);
}

.op-step.active {
    opacity: 1;
    border: 1px solid var(--op-text);
    box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.08);
    /* Sharp Shadow */
    transform: scale(1);
    z-index: 10;
}

.op-step-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    border-bottom: 1px solid #F0F0F0;
    padding-bottom: 8px;
}

.op-step-icon {
    font-size: 14px;
    opacity: 0.7;
}

.op-step-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--op-text-dim);
    letter-spacing: 0.02em;
    /* 
        NATURAL LABELS: Not uppercase to feel more human.
        Only the active step gets colored.
    */
}

/* 
    COLORED LABELS: Match reference where "I THINK..." is orange/gold
    and "I'M DOING..." is blue/teal.
*/
.op-step--think.active .op-step-label {
    color: #D97706;
    /* Warm amber for thinking */
}

.op-step--do.active .op-step-label {
    color: #0891B2;
    /* Teal for action */
}

.op-step-text {
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    font-weight: 400;
    /* 
        READABLE BODY TEXT:
        Natural paragraph style for think-aloud content.
    */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.op-step.active .op-step-text {
    color: #111;
    font-weight: 400;
    /* 
        NATURAL READING:
        Keep text weight normal for easy reading of longer content.
    */
}

/* STATS AREA - Technical Readout */
.op-stats {
    padding: 20px;
    border-top: 1px solid var(--op-border);
    background: #FAFAFA;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.op-stat-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.op-stat-label {
    font-size: 8px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--op-text-dim);
    letter-spacing: 0.1em;
}

.op-meter-box {
    height: 12px;
    background: #EEE;
    border: 1px solid #DDD;
    position: relative;
    overflow: hidden;
    border-radius: 1px;
}

.op-meter-fill {
    height: 100%;
    background: repeating-linear-gradient(45deg,
            #333,
            #333 2px,
            #444 2px,
            #444 4px);
    /* Hatched pattern */
    transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.op-meter-fill--accent {
    background: repeating-linear-gradient(45deg,
            var(--op-accent),
            var(--op-accent) 2px,
            #FF6633 2px,
            #FF6633 4px);
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* 
    RESPONSIVE — BALANCED SIZING
    =========================================================================
    The console scales down gracefully at smaller viewports to maintain
    proper text-to-animation balance across all screen sizes.
*/

/* 
    MEDIUM SCREENS (Laptops): Slightly smaller console for better balance.
    At this size, we want the text content to clearly dominate.
*/
@media (max-width: 1200px) {
    .op-console {
        /* 
            MEDIUM SCREEN SCALE-UP:
            Keep the console visually substantial on laptops so the
            two-panel layout doesn't feel undersized.
        */
        /* 
            LAPTOP SIZE:
            Wide and readable.
        */
        height: 520px;
        max-width: 1000px;
        /* 
            LAPTOP PROPORTIONS:
            Same balanced ratio for consistency.
        */
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    }
}

/* 
    TABLETS: Stack the console layout and reduce height.
    The console becomes more compact to fit below hero text.
*/
@media (max-width: 768px) {
    .op-console {
        grid-template-columns: 1fr;
        height: auto;
        max-width: 100%;
    }

    .op-screen-content {
        height: 280px;
    }
    
    /* 
        Agent Mind panel becomes a compact horizontal strip on mobile.
        This keeps the animation visible but unobtrusive.
    */
    .op-mind {
        max-height: 260px;
    }
    
    .op-loop-container {
        padding: 16px;
        gap: 12px;
    }
    
    .op-step {
        padding: 12px;
    }
}

/* ULTRA-FIDELITY ADDITIONS (Step 196+) */
.op-label-tiny {
    font-size: 8px;
    font-weight: 700;
    color: #666;
    letter-spacing: 0.05em;
}

.op-text-real {
    font-size: 11px;
    color: #333;
    font-weight: 400;
    line-height: 1.4;
    display: block;
}

.op-text-bold {
    font-weight: 600;
    color: #111;
}

.op-text-lg {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.op-text-sm {
    font-size: 10px;
}

.op-text-md {
    font-size: 11px;
    font-weight: 600;
    color: #222;
    margin-bottom: 4px;
    display: block;
}

.op-text-dim {
    color: #888;
}

.op-text-para {
    font-size: 9px;
    line-height: 1.5;
    color: #555;
    margin: 4px 0 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.op-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.op-badge-tiny {
    font-size: 8px;
    font-weight: 700;
    background: #E0E0E0;
    padding: 2px 4px;
    border-radius: 2px;
    color: #555;
}

.op-btn-tiny {
    font-size: 9px;
    color: var(--op-accent);
    font-weight: 600;
    margin-top: auto;
    padding-top: 8px;
    cursor: pointer;
}

/* Click Ripple */
.op-click-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 87, 34, 0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 90;
}

.op-cursor.clicking .op-click-effect {
    animation: ripple 0.4s ease-out forwards;
}

@keyframes ripple {
    0% {
        width: 0;
        height: 0;
        opacity: 0.6;
    }

    100% {
        width: 40px;
        height: 40px;
        opacity: 0;
    }
}