/* =========================================
   1. MAIN WRAPPERS & CONTAINERS
========================================= */
.qa-wrapper { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 20px 20px; 
    font-family: 'Inter', system-ui, sans-serif; 
    color: var(--qa-text-main); 
}

/* =========================================
   2. PREMIUM HERO HEADER
========================================= */
.st-premium-hero {
    background: linear-gradient(135deg, var(--qa-bg-light) 0%, var(--qa-white) 100%);
    border-radius: var(--qa-radius, 20px); /* Fallback added just in case */
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
    border: 1px solid var(--qa-border);
    box-shadow: var(--qa-shadow);
}

.qa-breadcrumb { 
    font-size: 13px; 
    margin-bottom: 15px; 
    color: var(--qa-text-muted); 
    font-weight: 500;
}
.qa-breadcrumb a { color: var(--qa-primary); text-decoration: none; }
.qa-breadcrumb i.fa-angle-right { font-size: 10px; margin: 0 8px; color: var(--qa-border); }

.st-premium-hero h1 { 
    font-size: 32px; 
    font-weight: 800; 
    margin: 0 0 10px 0; 
    color: var(--qa-text-main); 
    letter-spacing: -0.5px;
}
.st-premium-hero h1 .title-icon { color: var(--qa-primary); opacity: 0.8; font-size: 28px;}
.st-premium-hero p { 
    font-size: 16px; 
    color: var(--qa-text-muted); 
    max-width: 600px; 
    margin: 0 auto; 
    line-height: 1.5;
}

/* =========================================
   3. UNIFIED SLEEK FILTER BAR
========================================= */
.st-filter-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    background: var(--qa-white);
    border: 1px solid var(--qa-border);
    border-radius: 100px; 
    padding: 8px 15px;
    margin-bottom: 40px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    gap: 15px;
}

/* Horizontal Scroll for Levels */
.st-levels-track {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; 
    padding: 5px 0;
    flex: 1;
    min-width: 200px;
}
.st-levels-track::-webkit-scrollbar { display: none; } 

.lvl-chip { 
    background: transparent; 
    color: var(--qa-text-muted); 
    padding: 8px 18px; 
    border-radius: 50px; 
    font-size: 14px; 
    font-weight: 600; 
    text-decoration: none; 
    white-space: nowrap;
    transition: all 0.2s ease; 
}
.lvl-chip:hover { color: var(--qa-text-main); background: var(--qa-bg-light); }
.lvl-chip.active { 
    background: var(--qa-primary); 
    color: var(--qa-white); 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15); 
}

/* Compact Dropdowns */
.st-compact-form {
    display: flex;
    align-items: center;
    gap: 10px;
}
.st-compact-form select {
    background-color: var(--qa-bg-light);
    border: 1px solid var(--qa-border);
    color: var(--qa-text-main);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 30px 8px 15px;
    border-radius: 50px;
    appearance: none;
    cursor: pointer;
    outline: none;
    transition: 0.2s;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="%2364748b" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.st-compact-form select:hover, .st-compact-form select:focus {
    border-color: var(--qa-primary);
    background-color: var(--qa-white);
}
.st-clear-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fee2e2; /* Keeping this hardcoded slightly as it's a specific destructive action color, unless you have a var(--qa-danger-light) */
    color: #ef4444; /* var(--qa-danger) if you have it */
    text-decoration: none;
    transition: 0.2s;
}
.st-clear-btn:hover { background: #ef4444; color: var(--qa-white); }

/* =========================================
   4. POST CARDS & GRID
========================================= */
.qa-grid { 
    display: grid; 
    gap: 25px; 
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
}
.qa-card { 
    background: var(--qa-white); 
    border: 1px solid var(--qa-border); 
    border-radius: var(--qa-radius); 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
    transition: 0.3s; 
    box-shadow: var(--qa-shadow); 
}
.qa-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); 
    border-color: var(--qa-primary); 
}
.qa-thumb { height: 160px; position: relative; display: block; overflow: hidden; background: var(--qa-bg-light); }
.qa-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.qa-card:hover .qa-thumb img { transform: scale(1.05); }
.qa-badge { position: absolute; top: 12px; left: 12px; background: rgba(255,255,255,0.95); color: var(--qa-primary); font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 8px; text-transform: uppercase; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

.qa-content { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.qa-content h3 { font-size: 17px; margin: 0 0 8px 0; line-height: 1.4; font-weight: 700;}
.qa-content h3 a { color: var(--qa-text-main); text-decoration: none; }
.qa-content h3 a:hover { color: var(--qa-primary); }
.qa-content p { font-size: 14px; color: var(--qa-text-muted); margin: 0 0 15px 0; flex-grow: 1; line-height: 1.5; }

.qa-meta { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--qa-border); padding-top: 15px; }
.qa-meta-item { font-size: 12px; color: var(--qa-text-muted); font-weight: 600; display: flex; align-items: center; gap: 5px; }
.qa-meta-item i { color: var(--qa-primary); opacity: 0.7; }

/* =========================================
   5. PAGINATION
========================================= */
.qa-pagination { margin-top: 50px; text-align: center; }
.qa-pagination ul.page-numbers { display: flex; justify-content: center; gap: 8px; list-style: none; padding: 0; }
.qa-pagination ul.page-numbers li a.page-numbers,
.qa-pagination ul.page-numbers li span.page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; border-radius: 50%; font-size: 14px; font-weight: 600; color: var(--qa-text-main); background: var(--qa-white); border: 1px solid var(--qa-border); text-decoration: none; transition: 0.2s; }
.qa-pagination ul.page-numbers li a.page-numbers:hover { background: var(--qa-bg-light); color: var(--qa-primary); border-color: var(--qa-primary); }
.qa-pagination ul.page-numbers li span.current { background: var(--qa-primary); color: var(--qa-white); border-color: var(--qa-primary); box-shadow: 0 4px 10px rgba(0,0,0,0.15); }

/* =========================================
   6. RESPONSIVE MOBILE FIXES
========================================= */
/* =========================================
   NO CONTENT FOUND BOX
========================================= */
.qa-no-content {
    text-align: center; 
    padding: 60px 20px; 
    background: var(--qa-bg-light); 
    border-radius: var(--qa-radius, 16px); 
    border: 1px dashed var(--qa-border); 
    margin: 40px auto; /* Auto margin se ye perfect center rahega */
    max-width: 600px; /* Jyaada lamba nahi khichega PC par */
}
.qa-no-content i { color: #cbd5e1; margin-bottom: 15px; }
.qa-no-content h3 { margin: 0 0 10px 0; font-size: 22px; color: var(--qa-text-main); }
.qa-no-content p { color: var(--qa-text-muted); margin: 0 0 20px 0; }
.qa-no-content .qa-filter-btn { display: inline-block; text-decoration: none; }

/* =========================================
   6. RESPONSIVE MOBILE FIXES
========================================= */
@media(max-width: 768px) {
    .st-premium-hero { padding: 30px 20px; }
    .st-premium-hero h1 { font-size: 24px; }
    
    /* Toolbar ko column me change kiya */
    .st-filter-toolbar { 
        flex-direction: column; 
        border-radius: var(--qa-radius, 16px); 
        padding: 15px; 
        align-items: stretch;
        gap: 15px;
    }
    
    /* Levels (All, Class, etc) ko horizontal scroll hi rakha par width full di */
    .st-levels-track {
        width: 100%;
        padding-bottom: 10px;
        border-bottom: 1px solid var(--qa-border);
    }
    
    /* Dropdowns ko ek ke neeche ek (stack) kar diya */
    .st-compact-form { 
        flex-direction: column; 
        align-items: stretch;
        width: 100%;
        gap: 12px;
    }
    .st-compact-form select { 
        width: 100%; 
        min-width: 100%; 
    }
    
    /* Clear Filter button ko circle se full width mobile button bana diya */
    .st-clear-btn {
        width: 100%;
        border-radius: 50px;
        padding: 10px;
        text-align: center;
        background: #fee2e2;
        color: #ef4444;
    }
    /* Mobile me Clear Filter button pe text bhi dikhega */
    .st-clear-btn::after { 
        content: " Clear Filters"; 
        font-family: 'Inter', sans-serif; 
        font-size: 14px; 
        font-weight: 600;
    }
}


/* =========================================
   1. TAXONOMY ARCHIVE HEADER (HERO)
========================================= */
.st-archive-header {
    background: var(--qa-white, #ffffff);
    border: 1px solid var(--qa-border, #e2e8f0);
    border-radius: var(--qa-radius, 16px);
    margin-bottom: 40px;
    box-shadow: var(--qa-shadow, 0 4px 6px -1px rgba(0,0,0,0.05));
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Split Layout agar image hai */
.st-archive-header.has-image .st-header-body {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

.st-breadcrumb-bar {
    padding: 15px 25px;
    background: var(--qa-bg-light, #f8fafc);
    border-bottom: 1px solid var(--qa-border, #e2e8f0);
}

.st-breadcrumb {
    font-size: 13px;
    color: var(--qa-text-muted, #64748b);
    font-weight: 500;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.st-breadcrumb a { color: var(--qa-primary, #2563eb); text-decoration: none; transition: 0.2s;}
.st-breadcrumb a:hover { text-decoration: underline; }
.st-breadcrumb i { font-size: 10px; color: #cbd5e1; }

.st-header-body { display: flex; flex-direction: column; }

.st-header-image {
    width: 40%;
    min-height: 250px;
    background: var(--qa-bg-light, #f8fafc);
    border-right: 1px solid var(--qa-border, #e2e8f0);
}
.st-header-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

.st-header-text-box {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Agar image nahi hai toh sab center mein */
.st-archive-header:not(.has-image) .st-header-text-box {
    text-align: center;
    align-items: center;
}

.st-header-text-box h1 {
    font-size: 32px;
    font-weight: 800;
    margin: 0 0 15px 0;
    color: var(--qa-text-main, #0f172a);
    line-height: 1.2;
}
.st-header-text-box p {
    font-size: 16px;
    color: var(--qa-text-muted, #475569);
    margin: 0;
    line-height: 1.6;
    max-width: 800px;
}

/* =========================================
   2. SECTION TITLES & HEADINGS
========================================= */
.st-section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--qa-text-main, #1e293b);
    display: flex;
    align-items: center;
}

/* =========================================
   3. SUB-CATEGORIES / CHILD TERMS GRID
========================================= */
.st-child-tax-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}

.st-child-tax-card {
    background: var(--qa-white, #ffffff);
    border: 1px solid var(--qa-border, #e2e8f0);
    padding: 15px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--qa-text-main, #1e293b);
    text-decoration: none;
    transition: 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.st-child-tax-card span:last-child {
    background: var(--qa-bg-light, #f1f5f9);
    color: var(--qa-text-muted, #64748b);
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
}
.st-child-tax-card:hover {
    border-color: var(--qa-primary, #2563eb);
    color: var(--qa-primary, #2563eb);
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.05);
}

/* =========================================
   4. SIBLINGS & CROSS-FILTERS (CHIPS)
========================================= */
.st-filter-section, .st-siblings-section {
    background: var(--qa-white, #ffffff);
    border: 1px solid var(--qa-border, #e2e8f0);
    border-radius: 16px;
    padding: 25px 30px;
    margin-bottom: 40px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.st-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px dashed var(--qa-border, #cbd5e1);
}
.st-filter-title { margin: 0; font-size: 18px; font-weight: 700; }

.st-clear-filter {
    font-size: 12px;
    font-weight: 600;
    color: #ef4444;
    background: #fef2f2;
    padding: 6px 14px;
    border-radius: 20px;
    text-decoration: none;
    border: 1px solid #fecaca;
    transition: 0.2s;
}
.st-clear-filter:hover { background: #ef4444; color: #fff; }

.st-filter-grid { display: flex; flex-wrap: wrap; gap: 10px; }

.st-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--qa-bg-light, #f8fafc);
    color: var(--qa-text-muted, #475569);
    border: 1px solid var(--qa-border, #e2e8f0);
    padding: 8px 18px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: 0.2s;
}
.st-filter-chip:hover {
    background: var(--qa-white, #fff);
    border-color: var(--qa-primary, #2563eb);
    color: var(--qa-primary, #2563eb);
    transform: translateY(-2px);
}
.st-filter-chip.active {
    background: var(--qa-primary, #2563eb);
    color: #fff;
    border-color: var(--qa-primary, #2563eb);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.st-filter-chip.active i { color: #fff; }

/* =========================================
   5. JUNIOR THEME - VIBRANT CARDS
========================================= */
.junior-subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.j-sub-card {
    padding: 25px 15px;
    border-radius: 16px;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    color: #fff;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}
.j-sub-card i { font-size: 32px; }
.j-sub-card:hover { transform: translateY(-5px); box-shadow: 0 15px 25px -5px rgba(0,0,0,0.15); }

/* Premium Gradients for Junior Cards */
.j-sub-math { background: linear-gradient(135deg, #F59E0B, #D97706); }
.j-sub-eng { background: linear-gradient(135deg, #3B82F6, #2563EB); }
.j-sub-evs { background: linear-gradient(135deg, #10B981, #059669); }
.j-sub-gk { background: linear-gradient(135deg, #F43F5E, #E11D48); }


/* =========================================
   6. RESPONSIVE MOBILE FIXES
========================================= */
@media (max-width: 768px) {
    /* Header Stacking */
    .st-archive-header.has-image .st-header-body { flex-direction: column; }
    .st-header-image { 
        width: 100%; 
        border-right: none; 
        border-bottom: 1px solid var(--qa-border, #e2e8f0); 
        min-height: 200px; 
    }
    .st-header-text-box { padding: 30px 20px; text-align: center; }
    .st-header-text-box h1 { font-size: 26px; }
    
    /* Filters */
    .st-filter-header { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 15px; 
    }
    .st-filter-section, .st-siblings-section { padding: 20px; }
    
    /* Grids to 2 Columns */
    .st-child-tax-grid { grid-template-columns: repeat(2, 1fr); }
    .junior-subjects-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    /* Mobile Grids to 1 Column */
    .st-child-tax-grid, .junior-subjects-grid { grid-template-columns: 1fr; }
    .st-breadcrumb { font-size: 12px; }
}
/* =========================================
   7. EXPLORE FOOTER (BOTTOM LINKS)
========================================= */
.st-explore-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px dashed var(--qa-border, #cbd5e1); /* Soft dashed divider */
}

.st-explore-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--qa-white, #ffffff);
    color: var(--qa-text-main, #1e293b);
    border: 1px solid var(--qa-border, #e2e8f0);
    padding: 12px 28px;
    border-radius: 50px; /* Modern Pill shape */
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.st-explore-btn i {
    color: var(--qa-primary, #2563eb);
    font-size: 16px;
    transition: 0.3s ease;
}

/* Premium Hover Effect */
.st-explore-btn:hover {
    background: var(--qa-primary, #2563eb);
    color: var(--qa-white, #ffffff);
    border-color: var(--qa-primary, #2563eb);
    transform: translateY(-4px); /* Halka sa upar aayega */
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2); /* Soft blue glowing shadow */
}

/* Icon color changes to white on hover */
.st-explore-btn:hover i {
    color: var(--qa-white, #ffffff);
}

/* =========================================
   RESPONSIVE MOBILE FIXES FOR FOOTER
========================================= */
@media (max-width: 768px) {
    .st-explore-footer {
        flex-direction: column;
        gap: 12px;
        margin-top: 40px;
        padding-top: 30px;
    }
    
    .st-explore-btn {
        width: 100%; /* Mobile me button full width ho jayega */
        justify-content: center; /* Text center me aayega */
        padding: 14px 20px;
    }
}