/* ==========================================================================
   THEME STYLESHEET: LIVEMOCK CORE ARCHITECTURE
   ========================================================================== */

:root {
    --primary: #e74c3c;
    --primary-hover: #c0392b;
    --secondary: #2980b9;
    --secondary-hover: #1f618d;
    --dark-bg: #1a252f;
    --light-bg: #f4f7f6;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    --hover-shadow: 0 15px 35px rgba(231, 76, 60, 0.12);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent;}
html { scroll-behavior: smooth; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; line-height: 1.6; color: #2c3e50; background-color: var(--light-bg); overflow-x: hidden; width: 100%;}
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Navigation */
header { background-color: #ffffff; box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06); padding: 16px 0; z-index: 1000; transition: var(--transition-smooth); }
.desktop-sticky { position: sticky; top: 0; }
.nav-container { display: flex; justify-content: space-between; align-items: center; }
.logo a { font-size: 1.8rem; font-weight: 800; color: var(--dark-bg); letter-spacing: -0.5px;}
.logo span { color: var(--primary); }
.dot-anim { display: inline-block; animation: pulseDot 2s infinite; }
@keyframes pulseDot { 0%, 100% { opacity: 0.2; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.2); } }

nav ul { list-style: none; display: flex; gap: 32px; }
nav a { font-weight: 600; color: #64748b; position: relative; padding: 4px 0; transition: var(--transition-smooth); }
nav a:hover, nav a.active { color: var(--primary); }
nav a::after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background-color: var(--primary); transition: var(--transition-smooth); }
nav a:hover::after, nav a.active::after { width: 100%; }
.mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.mobile-menu-btn .bar { display: block; width: 24px; height: 3px; margin: 5px 0; background-color: var(--dark-bg); transition: var(--transition-smooth); border-radius: 2px; }

/* Buttons */
.btn-primary, .btn-take-test, .btn-outline-small { position: relative; overflow: hidden; display: inline-block; border-radius: 6px; font-weight: 700; text-align: center; transition: var(--transition-smooth); cursor: pointer; border: none; }
.btn-primary { padding: 14px 32px; background-color: var(--primary); color: white; box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3); }
.btn-primary:hover { background-color: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4); }
.btn-take-test { padding: 10px 20px; background-color: #27ae60; color: white; font-size: 0.88rem; }
.btn-take-test:hover { background-color: #2ecc71; transform: scale(1.03); box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3); }
.btn-outline-small { padding: 6px 14px; background: transparent; color: var(--secondary); border: 1px solid var(--secondary); font-size: 0.8rem; }
.btn-outline-small:hover { background: var(--secondary); color: white; }

/* Hero */
.hero { background: radial-gradient(circle at top right, rgba(44, 62, 80, 0.95), rgba(26, 37, 47, 1)), url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="60" height="60" viewBox="0 0 60 60"><circle cx="30" cy="30" r="1" fill="rgba(255,255,255,0.05)"/></svg>'); color: white; padding: 140px 0 120px; text-align: center; }
.badge-2027-2028 { display: inline-block; padding: 6px 16px; background: rgba(231, 76, 60, 0.15); border: 1px solid var(--primary); color: var(--primary); border-radius: 30px; font-weight: 700; font-size: 0.9rem; margin-bottom: 24px; letter-spacing: 0.5px; }
.hero h1 { font-size: 3.6rem; margin-bottom: 24px; line-height: 1.15; font-weight: 800; letter-spacing: -1px; }
.hero p { font-size: 1.3rem; margin-bottom: 36px; opacity: 0.85; max-width: 800px; margin: 0 auto 36px;}

/* Grid & Cards */
.subjects-section { padding: 100px 0; }
h2 { text-align: center; font-size: 2.4rem; margin-bottom: 12px; color: var(--dark-bg); font-weight: 800; }
.section-subtitle { margin-bottom: 60px; color: #64748b; font-size: 1.1rem; }
.grid-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 32px; }
.subject-card { background: #ffffff; border-radius: 12px; box-shadow: var(--card-shadow); border: 1px solid #e2e8f0; overflow: hidden; transition: var(--transition-smooth); }
.subject-card:hover { transform: translateY(-4px); box-shadow: var(--hover-shadow); border-color: rgba(231, 76, 60, 0.2); }

@media screen and (min-width: 1024px) { .architectural-card { grid-column: span 2; } }

.subject-header { background: #ffffff; padding: 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #f1f5f9; }
.title-with-icon { display: flex; align-items: center; gap: 14px; }
.subject-icon { width: 24px; height: 24px; fill: var(--secondary); transition: var(--transition-smooth); }
.subject-card:hover .subject-icon { fill: var(--primary); transform: scale(1.1); }
.highlighted-card { border-top: 4px solid var(--primary); }
.subject-header h3 { color: var(--dark-bg); font-size: 1.25rem; font-weight: 700; }

.meta-badge { font-size: 0.78rem; padding: 6px 12px; border-radius: 20px; font-weight: 700; }
.meta-badge.grey { background: #f1f5f9; color: #64748b; }
.meta-badge.blue { background: rgba(41, 128, 185, 0.1); color: var(--secondary); }
.meta-badge.live { background: rgba(39, 174, 96, 0.1); color: #27ae60; }
.topic-list { padding: 8px 24px 24px; }

/* ==========================================================================
   SMART CURRENT AFFAIRS UI (Banner + Scrollable Archives)
   ========================================================================== */
.latest-test-banner {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.08), rgba(46, 204, 113, 0.02));
    border: 1px solid rgba(39, 174, 96, 0.3);
    border-radius: 8px;
    padding: 24px 20px;
    position: relative;
    margin: 15px 0 25px;
}
.latest-badge {
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    padding: 4px 14px;
    border-radius: 20px;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.banner-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}
.banner-text h4 { font-size: 1.1rem; color: #1e293b; margin-bottom: 5px; font-weight: 700;}
.banner-text p { font-size: 0.85rem; color: #64748b; }

.pulse-btn {
    animation: gentlePulse 2s infinite;
}
@keyframes gentlePulse {
    0% { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(39, 174, 96, 0); }
    100% { box-shadow: 0 0 0 0 rgba(39, 174, 96, 0); }
}

/* The SCROLLABLE MAGIC for Archive Container */
.scrollable-test-list {
    max-height: 240px; /* Forces uniform height, infinite tests scroll inside */
    overflow-y: auto;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    padding-right: 5px;
}
/* Sleek Custom Scrollbar */
.scrollable-test-list::-webkit-scrollbar { width: 5px; }
.scrollable-test-list::-webkit-scrollbar-track { background: #f8fafc; border-radius: 10px; }
.scrollable-test-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
.scrollable-test-list::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Nested Accordions */
.accordion { margin-top: 12px; background-color: #ffffff; border-radius: 8px; border: 1px solid #e2e8f0; transition: var(--transition-smooth); }
.accordion summary { font-weight: 700; cursor: pointer; outline: none; padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; list-style: none; user-select: none; transition: var(--transition-smooth); }
.accordion summary::-webkit-details-marker { display: none; }
.summary-title { display: flex; align-items: center; gap: 10px; }
.accordion summary::after { content: '+'; font-size: 1.2rem; color: #94a3b8; transition: var(--transition-smooth); }
.accordion[open] > summary::after { content: '−'; transform: rotate(180deg); color: var(--primary); }
.accordion-meta { font-size: 0.8rem; color: #94a3b8; font-weight: 500; margin-right: 12px; margin-left: auto; }

.level-1 > summary { background: #f8fafc; color: #1e293b; }
.level-1 > summary:hover { background: #f1f5f9; }
.level-2 { margin: 12px; border-left: 4px solid var(--secondary); }
.level-2 > summary { background: #ffffff; color: #334155; font-size: 0.98rem;}
.level-3 { margin: 12px 12px 12px 24px; border-left: 4px solid var(--primary); background: #fdfdfd;}
.level-3 > summary { font-size: 0.92rem; color: #475569; }

.nested-content { animation: openAccordion 0.35s ease-out; overflow: hidden; }
@keyframes openAccordion { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

.border-placeholder { padding: 18px; font-size: 0.88rem; color: #94a3b8; text-align: center; background: #f8fafc; margin: 12px; border: 1px dashed #cbd5e1; border-radius: 6px; }

.test-container { background: #ffffff; border-top: 1px solid #e2e8f0;}
.test-item { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid #f1f5f9; transition: var(--transition-smooth); }
.test-item:last-child { border-bottom: none; }
.test-item:hover { background-color: #fafafa; }
.daily-item { padding: 12px 15px; } /* Slightly tighter padding for scroll lists */
.test-details h4 { font-size: 0.96rem; color: #1e293b; margin-bottom: 4px; font-weight: 700;}
.test-meta { font-size: 0.84rem; color: #64748b; }
.test-count-badge { font-size: 0.78rem; color: var(--primary); background: rgba(231, 76, 60, 0.08); padding: 2px 10px; border-radius: 12px; font-weight: 600; }

/* Futuristic Back To Top */
.back-to-top { position: fixed; bottom: 40px; right: 40px; width: 52px; height: 52px; border-radius: 50%; background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px); border: none; cursor: pointer; display: flex; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transform: translateY(15px) scale(0.9); transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); z-index: 9999; }
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.progress-ring { position: absolute; top: 2px; left: 2px; transform: rotate(-90deg); }
.progress-ring__circle { transition: stroke-dashoffset 0.1s; transform-origin: 50% 50%; }
.arrow-svg { position: relative; z-index: 2; color: var(--dark-bg); transition: var(--transition-smooth); }
.back-to-top:hover .arrow-svg { color: var(--primary); transform: translateY(-3px); }

/* Pro Footer */
.pro-footer { background-color: var(--dark-bg); color: #94a3b8; padding: 80px 0 30px; font-size: 0.92rem; border-top: 4px solid var(--primary); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: 48px; margin-bottom: 60px; }
.footer-logo { font-size: 2rem; font-weight: 800; color: #ffffff; margin-bottom: 20px; }
.footer-logo span { color: var(--primary); }
.brand-col p { line-height: 1.75; color: #94a3b8;}
.footer-col h4 { color: #ffffff; margin-bottom: 24px; font-size: 1.05rem; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 12px; }
.footer-col ul li a { color: #94a3b8; transition: var(--transition-smooth); }
.footer-col ul li a:hover { color: #ffffff; padding-left: 4px; }
.sub-footer-btn { margin-top: 16px; width: 100%; }
.footer-bottom { text-align: center; border-top: 1px solid #2c3e50; padding-top: 30px; font-size: 0.86rem; color: #64748b;}
.footer-bottom a { color: #94a3b8; margin: 0 8px; transition: var(--transition-smooth);}
.footer-bottom a:hover { color: #ffffff; }

/* Mobile Logic */
@media screen and (max-width: 768px) {
    .desktop-sticky { position: static !important; }
    .mobile-menu-btn { display: block; z-index: 2001; }
    .mobile-menu-btn.open .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); background-color: var(--primary); }
    .mobile-menu-btn.open .bar:nth-child(2) { opacity: 0; }
    .mobile-menu-btn.open .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); background-color: var(--primary); }

    nav { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background-color: #ffffff; z-index: 2000; padding: 100px 30px 30px; }
    nav.active { display: block; animation: fadeInMobile 0.3s forwards; }
    @keyframes fadeInMobile { from { opacity: 0; } to { opacity: 1; } }
    nav ul { flex-direction: column; gap: 0; }
    nav ul li { width: 100%; border-bottom: 1px solid #f1f5f9; }
    nav a { display: block; padding: 20px 0; font-size: 1.2rem; }
    nav a::after { display: none; }
    .nav-container { flex-wrap: wrap; }

    .hero { padding: 90px 0 70px; }
    .hero h1 { font-size: 2.3rem; }
    .grid-container { grid-template-columns: 1fr; gap: 24px; }
    
    /* Layout reflow for Current Affairs Spotlight */
    .banner-content { flex-direction: column; text-align: center; gap: 10px;}
    .pulse-btn { width: 100%;}
    
    .level-2 { margin-left: 8px; margin-right: 8px; }
    .level-3 { margin-left: 12px; margin-right: 8px; }
    .test-item { flex-direction: column; align-items: flex-start; gap: 14px; padding: 20px 16px; }
    .btn-take-test { width: 100%; padding: 12px; }

    .footer-grid { grid-template-columns: 1fr; gap: 36px; text-align: center; }
    .sub-footer-btn { max-width: 280px; margin: 16px auto 0; }
    .back-to-top { bottom: 24px; right: 24px; }
}