:root {
    --brand: #0ea5e9;         
    --brand-dark: #0284c7;    
    --brand-gradient: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
    --bg-main: #f8fafc;       
    --bg-card: #ffffff;
    --text-strong: #0f172a;
    --text-light: #64748b;
    --border: #e2e8f0;
    --sidebar-w: 280px;
    --shadow-soft: 0 4px 20px -2px rgba(0,0,0,0.05);
    --shadow-hover: 0 10px 30px -5px rgba(14, 165, 233, 0.15);
}

/* Base Resets & Custom Scrollbar */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', system-ui, -apple-system, sans-serif; }
html { scroll-behavior: smooth; }
body { background: var(--bg-main); background-image: radial-gradient(#cbd5e1 1px, transparent 1px); background-size: 30px 30px; color: var(--text-strong); overflow-x: hidden; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand); }

.hidden { display: none !important; } 
.w-100 { width: 100%; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 4rem; }
a { text-decoration: none; color: inherit; }

/* Animations */
.fade-in { animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

/* Typography */
h1 { font-size: 2.4rem; line-height: 1.2; margin-bottom: 1rem; font-weight: 800; color: #0f172a; letter-spacing: -0.5px;}
h2 { font-size: 1.6rem; font-weight: 700; color: #1e293b; }
.hero-section { margin-bottom: 3rem; background: white; padding: 2.5rem; border-radius: 20px; border: 1px solid var(--border); box-shadow: var(--shadow-soft); position: relative; overflow: hidden;}
.hero-section::before { content: ""; position: absolute; top: 0; left: 0; width: 6px; height: 100%; background: var(--brand-gradient); }
.hero-section p { color: var(--text-light); font-size: 1.15rem; line-height: 1.6; }

/* Buttons */
.btn-main { background: var(--brand-gradient); color: white; border: none; padding: 14px 28px; border-radius: 12px; font-weight: 700; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(14, 165, 233, 0.25); display: inline-block; text-align: center;}
.btn-main:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(14, 165, 233, 0.4); }
.text-danger { color: #ef4444 !important; }

/* Layout Grid */
.app-layout { display: flex; min-height: 100vh; }
.main-content { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; width: calc(100% - var(--sidebar-w));}
.content-wrapper { padding: 3rem; max-width: 1300px; margin: 0 auto; width: 100%; }

/* Sidebar (Glassmorphism) */
.sidebar { width: var(--sidebar-w); background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(16px); border-right: 1px solid rgba(226, 232, 240, 0.8); position: fixed; height: 100vh; display: flex; flex-direction: column; padding: 2rem 1.5rem; z-index: 100; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.brand-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3rem; }
.brand-logo { font-size: 1.8rem; font-weight: 900; background: var(--brand-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.close-sidebar { display: none; background: none; border: none; font-size: 1.8rem; color: var(--text-light); cursor: pointer; }
.nav-label { font-size: 0.8rem; text-transform: uppercase; font-weight: 800; color: #94a3b8; letter-spacing: 0.1em; margin-bottom: 1rem; padding-left: 0.5rem; }
.nav-btn { display: block; width: 100%; text-align: left; background: none; border: none; padding: 14px 18px; margin-bottom: 0.5rem; border-radius: 12px; font-size: 1.05rem; font-weight: 600; color: var(--text-light); cursor: pointer; transition: all 0.2s; }
.nav-btn:hover { background: #f1f5f9; color: var(--text-strong); transform: translateX(5px); }
.nav-btn.active { background: #e0f2fe; color: var(--brand-dark); box-shadow: inset 4px 0 0 var(--brand); }
.auth-section { margin-top: auto; padding-top: 1.5rem; border-top: 1px solid var(--border); }

/* Header (Glassmorphism) */
.top-header { background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(16px); padding: 1.25rem 3rem; border-bottom: 1px solid rgba(226, 232, 240, 0.8); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 50; gap: 2rem; box-shadow: 0 2px 10px rgba(0,0,0,0.02);}
.header-left { display: flex; align-items: center; gap: 1rem; }
.hamburger { display: none; background: #f1f5f9; border: none; font-size: 1.5rem; width: 45px; height: 45px; border-radius: 10px; cursor: pointer; color: var(--text-strong); }
.search-container { flex: 1; max-width: 500px; }
.search-container input { width: 100%; padding: 14px 24px; border-radius: 50px; border: 2px solid var(--border); outline: none; background: white; font-size: 0.95rem; transition: 0.2s; box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);}
.search-container input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1); }
.user-chip { background: #f1f5f9; padding: 10px 20px; border-radius: 50px; font-weight: 700; font-size: 0.95rem; color: #0f172a; display: inline-block; transition: 0.2s; border: 1px solid #e2e8f0;}
.user-chip:hover { background: #e2e8f0; }

/* Filter Pills */
.filter-pills { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 2.5rem; }
.pill { background: white; border: 2px solid var(--border); padding: 10px 22px; border-radius: 50px; font-weight: 700; font-size: 0.95rem; color: var(--text-light); cursor: pointer; transition: all 0.2s; }
.pill:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(14, 165, 233, 0.1); }
.pill.active { background: var(--text-strong); color: white; border-color: var(--text-strong); }

/* Test Grid & Cards */
.group-title { margin: 2rem 0 1.5rem; display: inline-block; font-size: 1.6rem; color: #1e293b;}
.pyq-title { color: #4f46e5; } .mock-title { color: #e11d48; }
.test-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 2rem; }
.test-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; padding: 2rem; display: flex; flex-direction: column; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: var(--shadow-soft); position: relative; overflow: hidden;}
.test-card::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 5px; background: var(--brand-gradient); opacity: 0; transition: 0.3s; }
.test-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); border-color: transparent; }
.test-card:hover::before { opacity: 1; }
.test-card.locked { background: #f8fafc; }

.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.tag-subject { background: #e0f2fe; color: #0284c7; font-size: 0.75rem; font-weight: 800; padding: 6px 12px; border-radius: 6px; text-transform: uppercase; letter-spacing: 0.5px;}
.tag-institute { background: #fce7f3; color: #be185d; font-size: 0.75rem; font-weight: 800; padding: 6px 12px; border-radius: 6px; text-transform: uppercase; letter-spacing: 0.5px;}

.badge { font-size: 0.7rem; font-weight: 900; padding: 6px 12px; border-radius: 50px; text-transform: uppercase; letter-spacing: 0.5px;}
.badge-free { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0;}
.badge-premium { background: #fef3c7; color: #92400e; border: 1px solid #fde68a;}

.test-card h3 { font-size: 1.25rem; margin-bottom: 1rem; flex-grow: 1; line-height: 1.4; color: #0f172a;}
.meta { font-size: 0.95rem; color: var(--text-light); margin-bottom: 1.5rem; font-weight: 600; display: flex; align-items: center; gap: 8px;}

.btn-action { text-align: center; padding: 14px; border-radius: 12px; font-weight: 800; display: block; transition: all 0.2s; font-size: 1rem;}
.btn-start { background: #f0f9ff; color: var(--brand-dark); border: 2px solid #bae6fd; }
.btn-start:hover { background: var(--brand); color: white; border-color: var(--brand); }
.btn-lock { background: #fffbeb; color: #b45309; border: 2px solid #fde68a; cursor: pointer; }
.btn-lock:hover { background: #f59e0b; color: white; border-color: #f59e0b;}

/* PYQ Design */
.pyq-grid { display: flex; flex-direction: column; gap: 1.25rem; }
.pyq-card { background: white; border: 1px solid var(--border); border-radius: 20px; padding: 1.5rem 2.5rem; display: flex; align-items: center; gap: 2.5rem; transition: all 0.3s; box-shadow: var(--shadow-soft); position: relative; overflow: hidden;}
.pyq-card::before { content: ""; position: absolute; left: 0; top: 0; height: 100%; width: 6px; background: #6366f1; border-radius: 20px 0 0 20px; opacity: 0; transition: 0.3s;}
.pyq-card:hover { transform: translateX(6px); box-shadow: 0 10px 25px rgba(99, 102, 241, 0.15); border-color: transparent;}
.pyq-card:hover::before { opacity: 1; }
.pyq-year-circle { width: 75px; height: 75px; border-radius: 50%; background: #e0e7ff; color: #4338ca; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; font-weight: 900; flex-shrink: 0; border: 3px solid #c7d2fe; box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);}
.pyq-info { flex-grow: 1; }
.pyq-info h3 { font-size: 1.35rem; margin-bottom: 0.5rem; color: #1e293b;}
.pyq-action { display: flex; align-items: center; gap: 1.5rem; }
.pyq-btn { min-width: 200px; }

/* SEO Features & FAQ */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 2rem; }
.feature-card { background: white; padding: 2rem; border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow-soft); }
.feature-card h3 { margin-bottom: 1rem; font-size: 1.2rem; color: #0f172a; }
.feature-card p { color: var(--text-light); line-height: 1.6; }

.faq-container { display: flex; flex-direction: column; gap: 1.5rem; }
.faq-item { background: white; padding: 2rem; border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow-soft); }
.faq-item h4 { font-size: 1.15rem; color: #1e293b; margin-bottom: 0.75rem; }
.faq-item p { color: var(--text-light); line-height: 1.6; }

.seo-footer { margin-top: 5rem; padding: 4rem 3rem; background: white; border-radius: 20px; border: 1px solid var(--border); color: var(--text-light); font-size: 0.95rem; line-height: 1.8; text-align: center; box-shadow: var(--shadow-soft);}
.seo-footer h3 { font-size: 1.3rem; color: #334155; margin-bottom: 1.5rem; }
.copyright { margin-top: 2rem; font-weight: 600; color: #94a3b8; }

/* Modals & Overlays */
.modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.75); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; z-index: 10000; }
.login-card { background: white; padding: 3.5rem; border-radius: 24px; width: 90%; max-width: 440px; position: relative; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5); }
.close-modal { position: absolute; top: 1.5rem; right: 1.5rem; background: #f1f5f9; border: none; width: 36px; height: 36px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; transition: 0.2s;}
.close-modal:hover { background: #e2e8f0; transform: rotate(90deg);}
.brand-badge { background: #fee2e2; color: #b91c1c; padding: 6px 14px; border-radius: 50px; font-size: 0.85rem; font-weight: 800; width: fit-content; margin: 0 auto 1.5rem; text-transform: uppercase; letter-spacing: 0.5px;}
.login-card h2 { text-align: center; margin-bottom: 0.5rem; font-size: 1.8rem;}
.login-card p { text-align: center; color: var(--text-light); font-size: 1rem; margin-bottom: 2.5rem; }
.input-group { margin-bottom: 1.5rem; }
.input-group label { display: block; font-size: 0.95rem; font-weight: 700; margin-bottom: 0.5rem; color: #334155; }
.input-group input { width: 100%; padding: 14px; border: 2px solid var(--border); border-radius: 12px; font-size: 1.05rem; transition: 0.2s; background: #f8fafc;}
.input-group input:focus { border-color: var(--brand); background: white; box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);}
.error-box { background: #fef2f2; color: #dc2626; padding: 12px; border-radius: 10px; margin-top: 1.5rem; text-align: center; font-size: 0.95rem; font-weight: 700; border: 1px solid #fecaca; }

/* Back to Top */
.back-to-top { position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px; border-radius: 50%; background: var(--brand-gradient); color: white; border: none; font-size: 1.5rem; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: 0 10px 25px rgba(14, 165, 233, 0.4); z-index: 90; transform: translateY(20px);}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0);}
.back-to-top:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(14, 165, 233, 0.6); }
.back-to-top svg { width: 28px; height: 28px; }

/* === EdTech Profile Layout (Fixed) === */
.profile-layout { background: #f1f5f9; }
.profile-header { position: relative; background: white; box-shadow: 0 2px 15px rgba(0,0,0,0.05); z-index: 100; padding: 1.5rem 5%; }
.profile-nav { display: flex; align-items: center; gap: 2rem; }

.profile-container { max-width: 1000px; margin: 3rem auto; padding: 0 1.5rem; }
.profile-banner-card { background: white; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-soft); margin-bottom: 2.5rem; border: 1px solid var(--border); }
.banner { height: 180px; background: var(--brand-gradient); position: relative; }
.profile-summary { padding: 1.5rem 2.5rem 2.5rem; display: flex; align-items: flex-end; gap: 2rem; margin-top: -75px; position: relative; }
.avatar { width: 130px; height: 130px; border-radius: 50%; background: white; border: 6px solid white; display: flex; align-items: center; justify-content: center; font-size: 3.5rem; font-weight: 800; color: var(--brand); box-shadow: 0 4px 15px rgba(0,0,0,0.1); flex-shrink: 0;}
.user-titles { padding-bottom: 0.5rem; flex-grow: 1; }
.user-titles h1 { font-size: 2rem; margin-bottom: 0.2rem; color: #0f172a; }
.target-exam { font-weight: 600; color: var(--text-light); font-size: 1.1rem; margin-bottom: 0.75rem; }
.pro-badge { background: #f59e0b; color: white; font-size: 0.75rem; font-weight: 800; padding: 6px 14px; border-radius: 50px; letter-spacing: 1px; }

.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.details-section { background: white; padding: 2.5rem; border-radius: 20px; border: 1px solid var(--border); box-shadow: var(--shadow-soft); position: relative; overflow: hidden;}
.section-icon { position: absolute; top: -10px; right: -10px; font-size: 6rem; opacity: 0.03; transform: rotate(-15deg); pointer-events: none;}
.section-title { font-size: 1.3rem; color: #1e293b; margin-bottom: 1.75rem; border-bottom: 2px solid #f1f5f9; padding-bottom: 1rem; }
.details-list { display: flex; flex-direction: column; gap: 1.5rem; }
.detail-row { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px dashed var(--border); padding-bottom: 1rem; }
.detail-label { color: var(--text-light); font-size: 1rem; font-weight: 600; }
.detail-value { font-weight: 700; color: #0f172a; font-size: 1.05rem;}


/* === STRICT MOBILE RULES (Un-sticky, Fit-width) === */
.mobile-overlay { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.6); z-index: 99; opacity: 0; transition: opacity 0.3s; backdrop-filter: blur(2px);}
.mobile-overlay.active { display: block; opacity: 1; }

@media (max-width: 900px) {
    html, body { width: 100%; max-width: 100vw; overflow-x: hidden; }
    .app-layout { flex-direction: column; }
    
    .top-header { position: relative !important; width: 100%; flex-wrap: wrap; padding: 1.25rem 1.5rem; gap: 1.5rem; background: white; border-bottom: 1px solid var(--border);}
    .header-left { width: 100%; justify-content: space-between; }
    .hamburger { display: flex; align-items: center; justify-content: center; }
    .search-container { max-width: 100%; order: 3; flex-basis: 100%; }
    #headerAuthArea { margin-left: auto; }
    
    .main-content { margin-left: 0; width: 100%; }
    .content-wrapper { padding: 1.5rem; width: 100%; }
    
    .sidebar { transform: translateX(-100%); top: 0; left: 0; height: 100%; background: white; box-shadow: 10px 0 30px rgba(0,0,0,0.1); width: 280px; z-index: 1000;}
    .sidebar.sidebar-open { transform: translateX(0); }
    .close-sidebar { display: block; }
    
    .test-grid { grid-template-columns: 1fr; gap: 1.5rem;}
    .pyq-card { flex-direction: column; align-items: flex-start; gap: 1.5rem; padding: 2rem; }
    .pyq-year-circle { width: 60px; height: 60px; font-size: 1.1rem; }
    .pyq-action { width: 100%; flex-direction: column; gap: 1rem; }
    .pyq-btn { width: 100%; margin-left: 0; }
    
    h1 { font-size: 1.8rem; }
    .hero-section { padding: 1.5rem; }
    .group-title { font-size: 1.4rem; }
    .seo-footer { padding: 2rem 1.5rem; }
    
    .back-to-top { bottom: 20px; right: 20px; width: 50px; height: 50px; }

    .profile-summary { flex-direction: column; align-items: center; text-align: center; margin-top: -65px; gap: 1rem; }
    .user-titles { padding-bottom: 0; }
    .profile-grid { grid-template-columns: 1fr; }
    .profile-nav { gap: 1rem; }
}