/* ═══ DESKTOP RESPONSIVE FIXES ═══ */
/* Fixes for agent deployment, investigation board, and WL form at all screen sizes */

/* ═══ AGENT SECTION — Height Overflow Fix ═══ */
/* The agent layout (rack + panels) overflows on laptops (height < 900px) */
.section-agent .agent-bg {
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Make rack grid shrink to fit available space */
.rack-grid {
    max-height: 35vh;
    overflow: hidden;
}

/* Scale layout for typical laptop viewports */
@media (max-height: 800px) {
    .agent-bg {
        padding: 20px 40px 30px !important;
    }
    
    .agent-subtitle {
        margin: 6px 0 16px !important;
    }
    
    .agent-layout {
        gap: 16px !important;
    }
    
    .agent-left {
        gap: 12px !important;
    }
    
    .agent-right {
        gap: 10px !important;
    }
    
    .rack-grid {
        max-height: 28vh;
    }
    
    .server-rack {
        padding: 10px 14px !important;
    }
    
    .rack-header {
        padding-bottom: 6px !important;
        margin-bottom: 8px !important;
    }
    
    .agent-terminals {
        gap: 10px !important;
    }
    
    .crt-screen {
        height: 60px !important;
        font-size: 13px !important;
    }
    
    .ctrl-panel {
        padding: 10px 14px !important;
    }
    
    .panel-header {
        padding-bottom: 6px !important;
        margin-bottom: 8px !important;
    }
    
    .panel-row {
        padding: 2px 0 !important;
    }
    
    .panel-btn {
        padding: 8px 12px !important;
        margin-top: 4px !important;
    }
    
    .track-card {
        padding: 8px 12px !important;
    }
}

@media (max-height: 700px) {
    .agent-bg {
        padding: 14px 30px 20px !important;
    }
    
    .agent-subtitle {
        margin: 4px 0 10px !important;
        font-size: 8px !important;
    }
    
    .rack-grid {
        max-height: 22vh;
    }
    
    .crt-screen {
        height: 48px !important;
    }
}

/* ═══ AGENT SECTION — Width Scaling ═══ */
@media (max-width: 1200px) and (min-width: 769px) {
    .agent-layout {
        max-width: 95% !important;
        gap: 20px !important;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .agent-layout {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        max-width: 600px !important;
    }
    
    .agent-terminals {
        grid-template-columns: 1fr 1fr !important;
    }
}

/* ═══ INVESTIGATION BOARD — Desktop Scaling ═══ */
@media (max-width: 1400px) and (min-width: 769px) {
    .inv-board {
        transform: scale(0.85);
        transform-origin: center center;
    }
}

@media (max-width: 1200px) and (min-width: 769px) {
    .inv-board {
        transform: scale(0.72);
        transform-origin: center center;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .inv-board {
        transform: scale(0.6);
        transform-origin: center center;
    }
}

/* Height-based inv-board scaling */
@media (max-height: 800px) and (min-width: 769px) {
    .inv-board {
        transform: scale(0.75);
        transform-origin: center center;
    }
}

@media (max-height: 700px) and (min-width: 769px) {
    .inv-board {
        transform: scale(0.65);
        transform-origin: center center;
    }
}

/* ═══ WHITELIST FORM — Desktop Width ═══ */
@media (max-width: 1024px) and (min-width: 769px) {
    .wl-container {
        padding: 40px 20px !important;
    }
    
    .wl-panel {
        width: 100% !important;
        max-width: 500px !important;
    }
}
