/* layout.css — Grid, panels, monitor frame, bottom bar, mobile layout */

/* --- CRT OVERLAYS (position only — visual in theme) --- */
.crt-aberration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9998;
}

.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
}

/* --- MONITOR FRAME (structural wrapper — visual in theme) --- */
.monitor-frame {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
}

.monitor-header,
.monitor-footer {
    display: none;
}

.monitor-screen {
    flex: 1;
    overflow: hidden;
    position: relative;

    @media (max-width: 768px) {
        display: flex;
        flex-direction: column;
    }
}

/* --- LAYOUT GRID --- */
.main-grid {
    display: grid;
    grid-template-columns: 1fr minmax(400px, 33.33vw);
    height: 100%;
    width: 100%;

    @media (max-width: 768px) {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }
}

/* --- LEFT PANEL --- */
.left-panel {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--accent-primary);
    position: relative;

    @media (max-width: 768px) {
        border-right: none;
        height: auto;
        flex-shrink: 0;
        transition: none;
    }
}

/* --- RIGHT PANEL --- */
.right-panel {
    display: flex;
    flex-direction: column;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
    min-width: 0;
    position: relative;

    @media (max-width: 768px) {
        border-left: none;
        flex-grow: 1;
        max-height: none;
        padding-bottom: var(--mobile-footer-h);
        min-height: 0;
        transition: padding-bottom 0.35s ease;
    }
}

/* --- PANEL HEADER (diagnostics readout) --- */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    font-size: 0.6rem;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--accent-primary-dim);

    @media (max-width: 768px) {
        display: none;
    }
}

/* --- CONTENT AREA --- */
.content-area {
    flex-grow: 1;
    width: 100%;
    padding: 20px;
    scrollbar-width: thin;
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 0;

    @media (max-width: 768px) {
        -webkit-overflow-scrolling: touch;
    }
}

/* --- BOTTOM BAR & ID --- */
.bottom-bar {
    height: 160px;
    max-height: 400px;
    border-top: 1px solid var(--accent-primary);
    display: flex;

    @media (min-width: 769px) and (max-width: 1200px) {
        height: auto;
        flex-direction: column;
    }

    @media (max-width: 768px) {
        display: none;
    }
}

.system-col {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid var(--accent-primary);

    @media (min-width: 769px) and (max-width: 1200px) {
        border-right: none;
        border-bottom: 1px solid var(--accent-primary);
        height: auto;
        padding: 15px;
    }

    & .sys-title {
        font-size: 1.2rem;
        font-weight: 700;
        margin-bottom: 5px;
        letter-spacing: 1px;
    }

    & .sys-subtitle {
        font-size: 0.9rem;
        opacity: 0.8;
    }
}

.id-col,
.mobile-id-container {
    flex: 1;
    display: flex;
    padding: 0;
    overflow: visible !important;

    @media (min-width: 769px) and (max-width: 1200px) {
        height: 140px;
        width: 100%;
    }
}

.id-inner-container {
    width: 100%;
    display: flex;
    position: relative;
    overflow: hidden;

    & .id-bg-accent {
        position: absolute;
        height: 100%;
        width: auto;
        top: 30px;
        right: -30px;
        z-index: 0;
        pointer-events: none;
    }

    & .id-photo-box {
        z-index: 1;
        height: 100%;
        aspect-ratio: 3/4;
        overflow: hidden;
        display: flex;
        align-items: flex-end;
        justify-content: center;

        & .floating-head {
            width: auto;
            height: auto;
            max-width: 100%;
            max-height: 100%;
            aspect-ratio: 3/5;
            object-fit: contain;
            margin-bottom: 0;
        }
    }

    & .id-data {
        z-index: 1;
        flex: 1;
        padding: 15px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        font-size: 0.8rem;
        line-height: 1.5;

        & .dna-seq {
            font-size: 0.6rem;
            opacity: 0.5;
            margin-top: 5px;
            letter-spacing: 1px;
            word-break: break-all;
        }
    }
}

/* --- MOBILE SPECIFIC BLOCKS --- */
.mobile-header {
    display: none;

    @media (max-width: 768px) {
        display: block;
        padding: 10px 15px;
        border-bottom: 1px solid var(--accent-primary);
        flex-shrink: 0;
    }
}

.mobile-header-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-led {
    @media (min-width: 769px) {
        display: none;
    }
}

.mobile-id-container {
    display: none;

    @media (max-width: 768px) {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: var(--mobile-footer-h);
        border-top: 1px solid var(--accent-primary);
        z-index: 500;
        display: flex;
        padding: 0;
    }
}
