/* ==========================================================================
   1. GLOBAL ROOT VARIABLES & BASE STYLES
   ========================================================================== */
:root {
    --primary: #0b255e;       
    --primary-hover: #071942; 
    --secondary: #2563eb;     
    --bg: #f8fafc;            
    --card: #ffffff;
    --text: #0f172a;          
    --muted: #64748b;         
    --navbar-bg: #ffffff;
    --hero-gradient-start: #0f2b61; 
    --hero-gradient-end: #0a1931;
    --pyq-color: #f97316;
    --notes-color: #10b981;
    --syll-color: #06b6d4;
    --model-color: #8b5cf6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* ==========================================================================
   2. HEADER, NAVBAR & HERO SECTION
   ========================================================================== */
.disclaimer-banner {
    background-color: #fef3c7; 
    color: #92400e;            
    text-align: center;
    padding: 8px 15px;
    font-size: 0.85rem;
    font-weight: 700;
    border-bottom: 1px solid #fcd34d;
    z-index: 1001;
    position: relative;
}

header {
    background-color: var(--navbar-bg);
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--text);
    letter-spacing: -0.05em;
}
.logo span { color: var(--secondary); }

.nav-links a {
    text-decoration: none;
    color: var(--muted);
    margin-left: 20px;
    font-weight: 500;
}
.nav-links a:hover { color: var(--secondary); }

.hero {
    background: linear-gradient(180deg, var(--hero-gradient-start) 0%, var(--hero-gradient-end) 100%);
    text-align: center;
    padding: 50px 20px;
    color: #ffffff;
}
.hero h1 {
    font-size: 2.6rem;
    color: #ffffff;
    margin-bottom: 12px;
    font-weight: 700;
}
.hero p {
    color: #94a3b8;
    font-size: 1.1rem;
    margin-bottom: 25px;
}

/* ==========================================================================
   3. SEARCH CONTAINER & RESULTS INTERFACE (INDEX PAGE)
   ========================================================================== */
.search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 1.1rem;
    border-radius: 50px;
    border: 2px solid transparent;
    outline: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    color: var(--text);
}
.search-input:focus {
    border-color: var(--secondary);
}

.search-results-section {
    max-width: 1200px;
    margin: 30px auto 0 auto;
    padding: 0 20px;
    display: none; 
}

.search-results-header {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 15px;
    font-weight: 700;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

/* ==========================================================================
   4. DASHBOARD SYSTEM & LAYOUT STRUCTURE (DASHBOARD PAGES)
   ========================================================================== */
.main-container { 
    max-width: 1200px; 
    margin: 30px auto; 
    padding: 0 20px; 
    display: grid; 
    grid-template-columns: 300px 1fr; 
    gap: 30px; 
}

.sidebar { 
    background: var(--card); 
    padding: 24px; 
    border-radius: 16px; 
    border: 1px solid #e2e8f0; 
    height: fit-content; 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.03); 
}

.sidebar h3 { 
    font-size: 1.15rem; 
    margin-bottom: 20px; 
    color: var(--primary); 
    border-bottom: 2px solid #f1f5f9; 
    padding-bottom: 10px; 
    font-weight: 700; 
}

.filter-group { 
    margin-bottom: 25px; 
}
.filter-group label { 
    display: block; 
    font-size: 0.88rem; 
    font-weight: 600; 
    margin-bottom: 8px; 
    color: var(--text); 
}
.filter-group select { 
    width: 100%; 
    padding: 12px; 
    border-radius: 8px; 
    border: 1px solid #cbd5e1; 
    background-color: #fff; 
    font-size: 0.92rem; 
    outline: none; 
    transition: 0.2s ease; 
    color: var(--text); 
}
.filter-group select:focus { 
    border-color: var(--secondary); 
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); 
}

#exam-type-wrapper { 
    display: none; 
    animation: fadeIn 0.3s ease-in-out; 
}

@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(-5px); } 
    to { opacity: 1; transform: translateY(0); } 
}

.content-area { 
    background: var(--card); 
    padding: 28px; 
    border-radius: 16px; 
    border: 1px solid #e2e8f0; 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.03); 
}
.content-header h2 { 
    font-size: 1.4rem; 
    margin-bottom: 20px; 
    color: var(--text); 
    font-weight: 700; 
}

/* ==========================================================================
   5. COMMON DOWNLOAD MATRIX ELEMENTS (USED BY BOTH ENGINE LOGICS)
   ========================================================================== */
.file-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 30px; }

.file-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 16px 20px; 
    background: #ffffff; 
    border-radius: 12px; 
    border: 1px solid #e2e8f0; 
    transition: all 0.2s ease; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.02); 
}
.file-row:hover { border-color: var(--secondary); background: #f0fdf4; transform: translateX(2px); }

.file-info { display: flex; align-items: center; gap: 15px; }
.file-icon { font-size: 1.8rem; background: #f8fafc; padding: 8px; border-radius: 10px; }
.file-details h4 { font-size: 1rem; color: var(--text); font-weight: 600; margin-bottom: 4px; text-align: left;}

/* Badges Systems */
.badge { font-size: 0.75rem; text-transform: uppercase; padding: 3px 10px; border-radius: 50px; color: #fff; font-weight: 700; display: inline-block; }
.badge-pyq { background-color: var(--pyq-color); }
.badge-notes { background-color: var(--notes-color); }
.badge-syllabus { background-color: var(--syll-color); }
.badge-model { background-color: var(--model-color); }
.sub-badge { font-size: 0.75rem; color: var(--muted); margin-left: 8px; font-weight: 600; background: #e2e8f0; padding: 3px 10px; border-radius: 50px; text-transform: capitalize; }
.class-badge { font-size: 0.75rem; color: #fff; margin-left: 8px; font-weight: 600; background: var(--primary); padding: 3px 10px; border-radius: 50px; }

/* Control Interaction Buttons */
.action-btns { display: flex; gap: 10px; }
.btn { text-decoration: none; padding: 10px 18px; border-radius: 8px; font-size: 0.88rem; font-weight: 600; transition: 0.2s; display: inline-flex; align-items: center; }
.btn-view { background: #eff6ff; color: var(--secondary); }
.btn-view:hover { background: #dbeafe; }
.btn-dl { background: var(--primary); color: #fff; }
.btn-dl:hover { background: var(--primary-hover); }

.no-data { text-align: center; padding: 30px; color: var(--muted); font-style: italic; }

/* ==========================================================================
   6. HOMEPAGE GRID LINKS
   ========================================================================== */
.grid-title { text-align: center; margin: 40px 0 10px 0; font-size: 2rem; color: var(--primary); font-weight: 700; }
.grid-subtitle { text-align: center; color: var(--muted); margin-bottom: 40px; font-size: 1rem; }

.course-grid { max-width: 1200px; margin: 0 auto; padding: 0 20px 50px 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.course-card { background: var(--card); border-radius: 16px; padding: 32px 24px; text-align: center; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); text-decoration: none; color: var(--text); transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); border: 1px solid #e2e8f0; border-top: 4px solid var(--primary); }
.course-card:hover { transform: translateY(-5px); box-shadow: 0 20px 25px -5px rgba(11, 37, 94, 0.1); border-top-color: var(--secondary); }
.card-icon { font-size: 2.2rem; margin-bottom: 12px; display: inline-block; }
.course-card h2 { font-size: 1.5rem; margin-bottom: 8px; font-weight: 700; color: var(--primary); }
.course-card p { color: var(--muted); font-size: 0.9rem; margin-bottom: 18px; }
.view-btn { display: inline-block; font-size: 0.9rem; color: var(--text); font-weight: 500; transition: 0.2s; }
.course-card:hover .view-btn { color: var(--secondary); font-weight: 600; }

/* ==========================================================================
   7. SEO TEXT CONTAINER & FOOTER SYSTEM
   ========================================================================== */
.seo-text-section { max-width: 1200px; margin: 20px auto 50px auto; padding: 35px; background: #f1f5f9; border-radius: 16px; border: 1px solid #e2e8f0; }
.seo-text-section h2 { color: var(--primary); margin-bottom: 12px; font-weight: 700; }

footer { background-color: #0f172a; color: #f8fafc; padding: 50px 20px 25px 20px; margin-top: 60px; border-top: 4px solid var(--primary); }
.footer-sections-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 35px; }
.footer-col h3 { color: #ffffff; margin-bottom: 18px; font-size: 1.15rem; font-weight: 600; border-bottom: 2px solid var(--secondary); padding-bottom: 10px; }
.footer-col p, .contact-list li { font-size: 0.9rem; color: #94a3b8; margin-bottom: 12px; list-style: none; }
.contact-list a { color: #cbd5e1; text-decoration: none; transition: 0.2s; }
.contact-list a:hover { color: var(--secondary); }
.footer-bottom { max-width: 1200px; margin: 40px auto 0 auto; padding-top: 25px; border-top: 1px solid #1e293b; text-align: center; font-size: 0.85rem; color: #64748b; }

/* ==========================================================================
   8. MEDIA QUERIES FOR RESPONSIVE OPERATION
   ========================================================================== */
@media (max-width: 768px) { 
    .main-container { 
        grid-template-columns: 1fr; 
    } 
}

@media (max-width: 576px) {
    .file-row { flex-direction: column; align-items: flex-start; gap: 15px; }
    .action-btns { width: 100%; justify-content: flex-end; }
}


/* ==========================================================================
   FIX PATCH FOR DASHBOARD ALIGNMENT (MSBSHSEONLINE)
   ========================================================================== */

/* Main layout grid adjustment */
.main-container {
    display: grid !important;
    grid-template-columns: 280px 1fr !important;
    gap: 25px !important;
    margin: 30px auto !important;
    align-items: flex-start !important;
}

/* Sidebar full width forms correction */
.sidebar .filter-group select {
    width: 100% !important;
    display: block !important;
    -webkit-appearance: select !important; /* CyberPanel/LiteSpeed engine compatibility */
    appearance: select !important;
}

/* Right content container normalization */
.content-area {
    width: 100% !important;
    display: block !important;
}

/* Ensure data list rows render as clean full-width strips */
#files-dashboard {
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    width: 100% !important;
    margin-top: 15px !important;
}

#files-dashboard .file-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Mobile responsive fix for tablets & phones */
@media (max-width: 768px) {
    .main-container {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    #files-dashboard .file-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }
    
    #files-dashboard .action-btns {
        width: 100% !important;
        justify-content: flex-start !important;
    }
}