@media (max-width: 768px) {
    [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

/* === MOBILE OVERRIDE: force 1 column (added by ops) === */
@media (max-width: 768px) {

    .ideas-grid,
    .prompt-ideas-grid,
    .cards-grid,
    .grid-ideas,
    #ideasGrid,
    #promptIdeasGrid,
    #prompt-ideas-grid,
    [data-ideas-grid],
    .prompt-ideas {
        grid-template-columns: 1fr !important;
        width: 100% !important;
    }

    /* Si alguna parte usa flex en vez de grid */
    .ideas-grid>*,
    .prompt-ideas-grid>*,
    .cards-grid>* {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ALGPT OS LAYOUT - v1.0 
   Constraint: height 100vh, overflow hidden.
*/

:root {
    --bg-os: #0f172a;
    --bg-panel: #1e293b;
    --border-col: #334155;
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-os);
    color: var(--text-primary);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    /* Rigid container */

    /* v2.0 RULE 3: SPATIAL UI */
    perspective: 1200px;
    background: radial-gradient(circle at 50% 50%, #1e293b 0%, #0f172a 100%);
}

/* --- GRID STRUCTURE (Task 1.1) --- */
.os-container {
    display: grid;
    /* 15% - 70% - 15% */
    grid-template-columns: 15% 70% 15%;
    grid-template-areas: "left browser right";
    height: 100%;
    width: 100%;

    /* Spatial Plane */
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

/* --- COLUMNS --- */
#sidebar-left {
    grid-area: left;
    background: rgba(15, 23, 42, 0.95);
    /* Glass-like */
    border-right: 1px solid var(--border-col);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 10;

}

#browser-panel {
    grid-area: browser;
    background: var(--bg-panel);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Internal scrolling only */

    /* Depth */
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    z-index: 5;
    transform: translateZ(0);
    /* HW accel */
}

#sidebar-right {
    grid-area: right;
    background: rgba(15, 23, 42, 0.95);
    border-left: 1px solid var(--border-col);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 10;

}

/* --- COMPONENTS --- */
.panel-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-col);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    flex-shrink: 0;
}

/* Browser Header (Address Bar etc) */
.browser-header {
    height: 52px;
    background: var(--bg-os);
    border-bottom: 1px solid var(--border-col);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 16px;
    flex-shrink: 0;
}

.browser-header .dots {
    display: flex;
    gap: 6px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #64748b;
}

.dot.red {
    background: #ef4444;
}

.dot.yellow {
    background: #eab308;
}

.dot.green {
    background: #22c55e;
}

.url-bar {
    flex: 1;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 6px 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--text-muted);
}

/* Dynamic View Area */
#focus-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 1024px) {
    .os-container {
        grid-template-columns: 200px 1fr 0;
        /* Hide right panel on tablet */
        grid-template-areas: "left browser";
    }

    #sidebar-right {
        display: none;
    }
}

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

    #sidebar-left,
    #sidebar-right {
        display: none;
        /* For now, or implement a drawer toggle */
    }

    #browser-panel {
        flex: 1;
        width: 100%;
    }

    /* Optional: Add mobile toggle logic in JS later */
}

/* === MOBILE OVERRIDE: force 1 column (added by ops) === */
@media (max-width: 768px) {

    .ideas-grid,
    .prompt-ideas-grid,
    .cards-grid,
    .grid-ideas,
    #ideasGrid,
    #promptIdeasGrid,
    #prompt-ideas-grid,
    [data-ideas-grid],
    .prompt-ideas {
        grid-template-columns: 1fr !important;
        width: 100% !important;
    }

    /* Si alguna parte usa flex en vez de grid */
    .ideas-grid>*,
    .prompt-ideas-grid>*,
    .cards-grid>* {
        width: 100% !important;
        max-width: 100% !important;
    }
}