/* ==========================================================================
   🎨 CORE SYSTEM RESET & VARIABLES
   ========================================================================== */
:root {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-color: #ffffff;
    --text-muted: #8c8c8c;
    --accent-color: #007acc;
    --border-color: #2d2d2d;
    --sidebar-width: 320px;
    --transition-speed: 0.3s;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    overflow-x: hidden;
}

/* ==========================================================================
   🚪 PORTAL GATEWAY ENTRY PANEL (SPLASH LAYER)
   ========================================================================== */
.splash-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #0e0c0c;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
}

.splash-content {
    text-align: center;
    color: #ffffff;
    max-width: 600px;
    padding: 2rem;
    
    /* Flexbox layout ensures perfect vertical rhythm and spacing gaps */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.75rem;
}

.splash-content h1 {
    font-size: 3.5rem;
    letter-spacing: 7px;
    font-weight: 700;
}

.splash-content p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    letter-spacing: 1px;
}

#yt-compute-thumbnail {
    width: 300px;
    height: 300px;
    object-fit: contain;
}

/* Update this specific block in your style.css */
.portal-btn {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;       /* Stretch completely across the screen width */
    height: 10vh;       /* Lock exactly to the bottom 10% of viewport height */
    background-color: #121212;
    border: none;
    border-top: 2px solid var(--accent-color); /* Premium accent boundary line */
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 3px;
    cursor: pointer;
    border-radius: 0;   /* Flatten edges for full flush alignment */
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;     /* Float over all other elements */
}

.portal-btn:hover {
    background-color: var(--accent-color);
    box-shadow: 0 -10px 30px rgba(0, 122, 204, 0.4); /* Glow shifts upwards */
}

#yt-compute-thumbnail {
    width: 300px;
    height: 300px;
    object-fit: contain;
}
/* ==========================================================================
   🎛️ DASHBOARD STRUCTURAL LAYOUT
   ========================================================================== */
.site-header {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 2rem;
    height: 65px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: 2px;
    color: #ffffff;
}

/* --- HAMBURGER MENU BUTTON LAYOUT --- */
.hamburger-menu {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-speed) ease;
    z-index: 1000;
}

.hamburger-menu:hover {
    color: var(--accent-color);
}

.app-container {
    display: flex;
    width: 100vw;
    min-height: calc(100vh - 115px); /* Header + Footer offset */
    align-items: flex-start;
    position: relative;
}

/* ==========================================================================
   ⚡ SIDEBAR WORKSPACE & TAXONOMY FILTERS
   ========================================================================== */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background-color: var(--card-bg);
    border-right: 1px solid var(--border-color);
    padding: 2rem;
    align-self: stretch;
    overflow-y: auto;
    transition: transform var(--transition-speed) ease, margin-left var(--transition-speed) ease;
}

.search-wrapper {
    margin-bottom: 2rem;
    width: 100%;
}

#engine-search { 
    width: 100%; 
    background-color: #121212; 
    border: 1px solid var(--border-color); 
    color: #ffffff; 
    padding: 0.75rem 1rem; 
    border-radius: 4px; 
    font-size: 0.9rem; 
    outline: none; 
    transition: border-color 0.2s ease, box-shadow 0.2s ease; 
}

#engine-search:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 8px rgba(0, 122, 204, 0.3);
}

/* --- CHECKBOX ENGINE --- */
.filter-group {
    margin-bottom: 2.25rem;
    display: flex;
    flex-direction: column; 
    align-items: flex-start;
}

.filter-group h4 {
    margin-bottom: 1rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-color);
    width: 100%;
}

.checkbox-label {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%; 
    margin-bottom: 0.75rem; 
    cursor: pointer;
    font-size: 0.92rem;
    color: #e0e0e0;
    user-select: none;
    transition: color 0.2s ease;
}

.checkbox-label:hover {
    color: var(--text-color);
}

.checkbox-label input {
    margin-right: 0.85rem;
    accent-color: var(--accent-color);
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0; 
}

/* ==========================================================================
   📖 CONTENT VIEWPORT LAYER & RESPONSIVE GRID
   ========================================================================== */
.content-area {
    flex: 1;
    padding: 2rem;
    min-width: 0;
    transition: padding var(--transition-speed) ease;
}

.content-title {
    margin-bottom: 1.75rem;
    font-weight: 500;
    font-size: 1.5rem;
    letter-spacing: 0.5px;
}

/* --- FLUID AUTO-FILL PERCENTAGE ENGINE --- */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.manual-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 180px;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.manual-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   🔄 STATE ENGINE TRANSFORMS (HAMBURGER TOGGLE TRIGGERS)
   ========================================================================== */
.sidebar-closed .sidebar {
    margin-left: calc(-1 * var(--sidebar-width));
    transform: translateX(-100%);
}

/* ==========================================================================
   🛠️ SYSTEM UTILITIES & ANIMATIONS
   ========================================================================== */
.hidden-engine {
    display: none !important;
}

.splash-fade-out {
    opacity: 0 !important;
    transform: scale(1.02);
    
    /* 1. Tell the browser engine to ignore this layer for touch tracking entirely */
    pointer-events: none !important;
    
    /* 2. Completely crush it out of the browser's interactive layout layer tree */
    visibility: hidden !important; 
}

.site-footer {
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 1rem 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   📱 RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .sidebar-closed .sidebar {
        margin-left: 0;
        transform: translateY(-100%);
        display: none !important;
    }
}

/* ==========================================================================
   🎯 SLICER INTERACTION PATCH (REMIX)
   ========================================================================== */

/* Force checkboxes to accept touch events and sit cleanly in the stack layer */
.sidebar {
    position: relative;
    z-index: 50; /* Ensure it towers over the basic content grid layers */
}

.checkbox-label {
    position: relative;
    z-index: 51;
    pointer-events: auto !important; /* Explicitly forces the browser to allow clicks */
}

.checkbox-label input[type="checkbox"] {
    pointer-events: auto !important; /* Prevents parent containers from trapping touch */
}

/* Guard against mobile viewport layout shifting blocking clicks */
@media (max-width: 768px) {
    .sidebar {
        position: relative;
        z-index: 100; /* Max out structural priority on phone viewports */
    }
}

/* ==========================================================================
   📱 HIGH-PERFORMANCE MOBILE STACK ARCHITECTURE
   ========================================================================== */
@media (max-width: 768px) {
    /* 1. Hide the hamburger button entirely on mobile—no drawers needed! */
    .hamburger-menu {
        display: none !important;
    }

    /* 2. Unpack the header layout to sit cleanly on small screens */
    .site-header {
        height: auto;
        padding: 1rem;
        justify-content: center;
    }

    /* 3. Force the application shell to stack top-to-bottom instead of left-to-right */
    .app-container {
        flex-direction: column;
        width: 100%;
        min-height: auto;
    }
    
    /* 4. Transform the sidebar into a natural vertical control section */
    .sidebar {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 1.5rem 1rem;
        overflow-y: visible; /* Let it expand down naturally */
        align-self: auto;
    }

    /* Keep search and filter groupings tight and highly scannable */
    .search-wrapper {
        margin-bottom: 1.5rem;
    }
    
    .filter-group {
        margin-bottom: 1.5rem;
    }

    /* Override any residual menu-closing styles so filters are ALWAYS visible on phone */
    .sidebar-closed .sidebar {
        margin-left: 0 !important;
        transform: none !important;
        display: block !important;
    }
    
    /* 5. Flow the content grid smoothly below the filter station */
    .content-area {
        width: 100%;
        padding: 1.5rem 1rem;
    }

    .grid-container {
        grid-template-columns: 1fr; /* Force cards to span full phone width */
        gap: 1rem;
    }
}