/* ============================================================
   MCQ Platform — base stylesheet (plain CSS, no framework)
   ============================================================ */

:root {
    --color-primary: #1a56db;
    --color-primary-dark: #12429a;
    --color-accent: #16a34a;
    --color-premium: #b45309;
    --color-danger: #dc2626;
    --color-text: #1f2937;
    --color-muted: #6b7280;
    --color-bg: #f7f8fa;
    --color-card: #ffffff;
    --color-border: #e5e7eb;
    --radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Bengali", Arial, sans-serif;

    /* Extra accent hues used to cycle through cards so the site doesn't look flat/monochrome */
    --hue-1: #2563eb; /* blue */
    --hue-2: #7c3aed; /* purple */
    --hue-3: #db2777; /* pink */
    --hue-4: #ea580c; /* orange */
    --hue-5: #0d9488; /* teal */
    --hue-6: #ca8a04; /* gold */
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--color-bg);
    background-image:
        radial-gradient(circle at 8% 0%, rgba(37,99,235,0.06), transparent 40%),
        radial-gradient(circle at 95% 15%, rgba(219,39,119,0.06), transparent 40%);
    background-attachment: fixed;
    color: var(--color-text);
    line-height: 1.5;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---------- Header ---------- */
.site-header {
    background: var(--color-card);
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(90deg, var(--hue-1), var(--hue-2), var(--hue-3), var(--hue-4)) 1;
    position: sticky;
    top: 0;
    z-index: 50;
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 12px 16px;
}
.brand {
    display: flex;
    align-items: center;
    line-height: 0;
}
.brand-logo {
    height: 44px;
    width: auto;
    display: block;
}
@media (max-width: 560px) {
    .brand-logo { height: 36px; }
}
.main-nav { display: flex; gap: 18px; flex: 1; }
.main-nav a { color: var(--color-text); font-size: 0.95rem; font-weight: 600; }
.main-nav a:hover { color: var(--hue-1); text-decoration: none; }
.main-nav a.nav-premium { color: var(--color-premium); font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; }

@media (max-width: 860px) {
    .main-nav {
        display: none;
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--color-card);
        flex-direction: column;
        padding: 12px 16px;
        border-bottom: 1px solid var(--color-border);
    }
    .main-nav.open { display: flex; }
    .nav-toggle { display: block; }
}

/* ---------- Buttons & Badges ---------- */
.btn {
    display: inline-block;
    padding: 9px 18px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}
.btn-primary { background: linear-gradient(135deg, var(--hue-1), #1e3fce); color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,0.35); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(37,99,235,0.45); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--color-text); border-color: var(--color-border); }
.btn-ghost:hover { background: var(--color-bg); text-decoration: none; }
.btn-premium { background: linear-gradient(135deg, #f59e0b, var(--color-premium)); color: #fff; box-shadow: 0 2px 8px rgba(180,83,9,0.35); }
.btn-premium:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(180,83,9,0.45); text-decoration: none; }
.btn-block { width: 100%; text-align: center; }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; }
.btn-danger { background: linear-gradient(135deg, #ef4444, var(--color-danger)); color: #fff; }

.badge {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}
.badge-premium { background: linear-gradient(135deg, #fde68a, #fcd34d); color: #92400e; }
.badge-free { background: #e0e7ff; color: #3730a3; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius); margin: 16px 0; font-size: 0.92rem; border-left: 4px solid transparent; }
.alert-success { background: #dcfce7; color: #166534; border-left-color: #16a34a; }
.alert-error { background: #fee2e2; color: #991b1b; border-left-color: #dc2626; }

/* ---------- Layout helpers ---------- */
.page-main { padding: 24px 16px 48px; min-height: 60vh; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---------- Cards ---------- */
.card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.card h3 { margin-top: 0; }

.category-card {
    text-align: center;
    padding: 24px 16px;
    border-top: 4px solid var(--hue-1);
    font-weight: 700;
    color: var(--color-text);
}
.category-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.1); text-decoration: none; }
.category-card .count { color: var(--color-muted); font-size: 0.85rem; font-weight: 400; }
/* Cycle a different accent color per card so a grid of categories/subjects feels lively rather than flat */
.grid .category-card:nth-child(6n+1) { border-top-color: var(--hue-1); }
.grid .category-card:nth-child(6n+2) { border-top-color: var(--hue-2); }
.grid .category-card:nth-child(6n+3) { border-top-color: var(--hue-3); }
.grid .category-card:nth-child(6n+4) { border-top-color: var(--hue-4); }
.grid .category-card:nth-child(6n+5) { border-top-color: var(--hue-5); }
.grid .category-card:nth-child(6n+6) { border-top-color: var(--hue-6); }

/* ---------- Hero banner (homepage) ---------- */
.hero-banner {
    text-align: center;
    padding: 48px 24px;
    border-radius: var(--radius);
    background: linear-gradient(120deg, var(--hue-1), var(--hue-2) 55%, var(--hue-3));
    color: #fff;
    box-shadow: 0 10px 30px rgba(124,58,237,0.25);
}
.hero-banner h1 { margin-top: 0; }
.hero-banner p { color: rgba(255,255,255,0.9); }
.hero-banner .btn-primary { background: #fff; color: var(--hue-2); box-shadow: none; }
.hero-banner .btn-primary:hover { background: #f3f4ff; }
.hero-banner .badge-free { background: rgba(255,255,255,0.25); color: #fff; }

/* ---------- Hero slider (homepage, multiple slides) ---------- */
.hero-slider { position: relative; min-height: 320px; border-radius: var(--radius); overflow: hidden; box-shadow: 0 10px 30px rgba(124,58,237,0.25); }
.hero-slide {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 48px 24px; color: #fff;
    opacity: 0; visibility: hidden; transition: opacity 0.6s ease;
    background-size: cover; background-position: center;
}
.hero-slide.active { opacity: 1; visibility: visible; }
.hero-slide-inner { position: relative; z-index: 1; max-width: 700px; }
.hero-slide h1 { margin-top: 0; }
.hero-slide p { color: rgba(255,255,255,0.9); }
.hero-slide .badge-free { background: rgba(255,255,255,0.25); color: #fff; }
.hero-slide .btn-primary, .hero-slide .btn-premium { background: #fff; color: var(--hue-2); box-shadow: none; }
.hero-slide .btn-primary:hover, .hero-slide .btn-premium:hover { background: #f3f4ff; }

.hero-slide.grad-1 { background-image: linear-gradient(120deg, var(--hue-1), var(--hue-2) 55%, var(--hue-3)); }
.hero-slide.grad-2 { background-image: linear-gradient(120deg, var(--hue-5), #059669 55%, #10b981); }
.hero-slide.grad-3 { background-image: linear-gradient(120deg, var(--hue-4), var(--hue-6) 60%, #f59e0b); }
.hero-slide.custom::before { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,0.4); }

.hero-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.25); border: none; color: #fff;
    width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1.3rem; z-index: 2;
    line-height: 1;
}
.hero-arrow:hover { background: rgba(255,255,255,0.4); }
.hero-prev { left: 12px; }
.hero-next { right: 12px; }
.hero-dots { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 2; }
.hero-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.5); border: none; cursor: pointer; padding: 0; }
.hero-dot.active { background: #fff; }
@media (max-width: 560px) { .hero-slider { min-height: 380px; } }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=number], input[type=date], select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--hue-1);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
textarea { resize: vertical; }
.auth-card { max-width: 420px; margin: 40px auto; border-top: 4px solid var(--hue-1); }
.form-hint { font-size: 0.8rem; color: var(--color-muted); }

/* ---------- Tables (admin) ---------- */
table { width: 100%; border-collapse: collapse; background: var(--color-card); }
table th, table td { padding: 10px 12px; border-bottom: 1px solid var(--color-border); text-align: left; font-size: 0.9rem; }
table th { background: #eef2ff; color: #3730a3; }
table tr:hover td { background: #fafaff; }

/* ---------- Dashboard ---------- */
.stat-box { text-align: center; }
.stat-box .num { font-size: 1.8rem; font-weight: 800; background: linear-gradient(135deg, var(--hue-1), var(--hue-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat-box .label { color: var(--color-muted); font-size: 0.85rem; }

/* ---------- Exam interface ---------- */
.exam-header {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--color-card); border-bottom: 1px solid var(--color-border);
    padding: 12px 16px; position: sticky; top: 0; z-index: 40;
}
.exam-timer { font-weight: 800; font-size: 1.1rem; color: var(--hue-1); }
.exam-timer.low-time { color: var(--color-danger); }
.exam-layout { display: grid; grid-template-columns: 1fr 260px; gap: 20px; margin-top: 16px; }
@media (max-width: 860px) { .exam-layout { grid-template-columns: 1fr; } }
.question-box { background: var(--color-card); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 20px; }
.option-row { display: block; padding: 10px 14px; border: 1px solid var(--color-border); border-radius: 8px; margin-bottom: 10px; cursor: pointer; transition: border-color 0.12s ease, background 0.12s ease; }
.option-row:hover { background: #f0f4ff; border-color: var(--hue-1); }
.option-row input { margin-right: 10px; }
.option-row.selected { border-color: var(--hue-1); background: #e8edff; }
.exam-nav-buttons { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.question-palette { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.palette-btn {
    width: 100%; aspect-ratio: 1; border: 1px solid var(--color-border); border-radius: 6px;
    background: #fff; cursor: pointer; font-size: 0.85rem; font-weight: 700;
}
.palette-btn.answered { background: linear-gradient(135deg, #22c55e, var(--color-accent)); color: #fff; border-color: var(--color-accent); }
.palette-btn.marked { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; border-color: #f59e0b; }
.palette-btn.current { outline: 2px solid var(--hue-1); }

/* ---------- Result ---------- */
.result-summary { display: flex; gap: 24px; flex-wrap: wrap; }
.correct-text { color: var(--color-accent); }
.wrong-text { color: var(--color-danger); }

/* ---------- Ads ---------- */
.ad-slot { text-align: center; margin: 20px 0; }
.ad-slot img { max-width: 100%; border-radius: 8px; }

/* ---------- Pricing ---------- */
.pricing-card { text-align: center; border-top: 4px solid var(--hue-1); }
.pricing-card .price { font-size: 2.2rem; font-weight: 800; }
.pricing-card.highlight {
    border: none;
    border-top: 4px solid var(--color-premium);
    background: linear-gradient(160deg, #fffbeb, #fff);
    box-shadow: 0 8px 24px rgba(180,83,9,0.18);
}
.grid-3 .pricing-card:nth-child(2) { border-top-color: var(--hue-1); }
.grid-3 .pricing-card:nth-child(3) { border-top-color: var(--hue-2); }

/* ---------- Footer ---------- */
.site-footer { border-top: 3px solid transparent; border-image: linear-gradient(90deg, var(--hue-1), var(--hue-2), var(--hue-3), var(--hue-4)) 1; margin-top: 40px; padding: 20px 0; color: var(--color-muted); font-size: 0.85rem; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ---------- Category group titles (Job / Admission / Academic / ...) ---------- */
.category-group-title { text-align: center; font-weight: 800; margin-bottom: 16px; }
.title-color-1 { color: var(--hue-1); }
.title-color-2 { color: var(--hue-2); }
.title-color-3 { color: var(--hue-3); }
.title-color-4 { color: var(--hue-4); }
.title-color-5 { color: var(--hue-5); }
.title-color-6 { color: var(--hue-6); }

/* ---------- Locked / premium prompts ---------- */
.locked-box { text-align: center; padding: 40px 20px; }
.locked-box .lock-icon { font-size: 2.5rem; }
