
/* ============================================
   FULLY MOBILE‑RESPONSIVE, COLORFUL DESIGN
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #0a58ca;
    --primary-dark: #084298;
    --primary-light: #e7f1ff;
    --success: #198754;
    --success-bg: #d1e7dd;
    --danger: #dc3545;
    --danger-bg: #f8d7da;
    --warning: #ffc107;
    --warning-bg: #fff3cd;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --bg-card: #ffffff;
    --bg-body: #f8fafc;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow: 0 4px 12px rgba(0,0,0,0.04);
    --shadow-hover: 0 12px 24px rgba(0,0,0,0.06);
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-body);
    color: var(--text-dark);
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden; /* prevent horizontal scroll */
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Breadcrumbs */
.ev-breadcrumb-area {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    font-size: 14px;
    overflow-x: auto; /* allow scroll if needed */
}
.ev-breadcrumb {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.ev-breadcrumb li {
    display: flex;
    align-items: center;
    color: var(--text-muted);
}
.ev-breadcrumb li a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}
.ev-breadcrumb li a:hover {
    text-decoration: underline;
}
.ev-breadcrumb li::after {
    content: '/';
    margin-left: 8px;
    color: #cbd5e1;
    font-weight: 400;
}
.ev-breadcrumb li:last-child::after {
    display: none;
}
.ev-breadcrumb li.active {
    font-weight: 600;
    color: var(--text-dark);
}

/* Main Layout */
.ev-main-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin: 30px auto 60px;
}
.ev-content-area {
    flex: 1 1 0%;
    min-width: 0;  /* prevent flex child from overflowing */
}
.ev-sidebar {
    width: 320px;
    flex-shrink: 0;
}

/* ---- VIBRANT HERO ---- */
.ev-hero {
    background: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
    border-radius: var(--radius);
    padding: 45px 35px;
    color: white;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(124, 58, 237, 0.25);
}
.ev-hero::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    z-index: 0;
}
.ev-hero-content {
    position: relative;
    z-index: 2;
}
.ev-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.25);
    backdrop-filter: blur(5px);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255,255,255,0.3);
}
.ev-hero-title {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 18px;
}
.ev-hero-desc {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-bottom: 28px;
    max-width: 600px;
}
.ev-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 28px;
}
.ev-stat-box {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.2);
    min-width: 150px;
    flex: 1 1 auto;
}
.ev-stat-box i {
    font-size: 2rem;
    margin-right: 12px;
    opacity: 0.9;
}
.ev-stat-box div strong {
    font-size: 1.6rem;
    display: block;
    line-height: 1.2;
}
.ev-stat-box div span {
    font-size: 0.75rem;
    opacity: 0.8;
    text-transform: uppercase;
}
.ev-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.ev-btn-hero {
    padding: 14px 32px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    font-size: 16px;
}
.ev-btn-hero.primary {
    background: white;
    color: #7c3aed;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.ev-btn-hero.primary:hover {
    background: #fafafa;
    transform: translateY(-2px);
}
.ev-btn-hero.outline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255,255,255,0.7);
}
.ev-btn-hero.outline:hover {
    background: rgba(255,255,255,0.15);
}

/* ---- SEARCH ---- */
.ev-search-box {
    background: #fff;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 30px;
}
.ev-input-wrapper {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 4px;
    transition: 0.3s;
}
.ev-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(10,88,202,0.1);
}
.search-icon {
    padding: 0 15px;
    color: #94a3b8;
    font-size: 1.1rem;
}
.ev-search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 0;
    font-size: 1rem;
    outline: none;
    color: var(--text-dark);
}
.ev-btn-search {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}
.ev-btn-search:hover {
    background: var(--primary-dark);
}
.ev-btn-clear {
    margin-left: 10px;
    color: var(--text-muted);
    padding: 8px;
    border-radius: 50%;
    display: flex;
}
.ev-btn-clear:hover {
    background: #fee2e2;
    color: var(--danger);
}

/* ---- SECTION CARDS (colorful) ---- */
.ev-section-wrapper {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 30px;
    overflow: hidden;
}
.ev-section-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border);
    background: #fdfdfd;
}
.ev-section-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ev-section-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 5px;
}
.ev-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 25px;
    background: #fafafa;
}
.ev-category-card {
    border-radius: var(--radius-sm);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.03);
    border: 2px solid;
    word-break: break-word;
}
.ev-category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 25px rgba(0,0,0,0.08);
    text-decoration: none;
}
.ev-cat-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}
.ev-cat-info {
    flex: 1;
    min-width: 0;
}
.ev-cat-info h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.ev-cat-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    color: inherit;
    opacity: 0.8;
}
.ev-cat-stats span i {
    margin-right: 5px;
}
.ev-cat-arrow {
    font-size: 1.4rem;
    opacity: 0.6;
    transition: transform 0.3s;
    flex-shrink: 0;
}
.ev-category-card:hover .ev-cat-arrow {
    transform: translateX(6px);
    opacity: 1;
}

/* ---- SUB-TOPIC CARDS ---- */
.ev-topics-wrapper {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    margin-bottom: 30px;
    overflow: hidden;
}
.ev-topics-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border);
    background: #fdfdfd;
}
.ev-topics-header h3 {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.ev-subtopic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    padding: 20px;
}
.ev-topic-card {
    display: flex;
    align-items: center;
    gap: 15px;
    border-radius: var(--radius-sm);
    padding: 18px 20px;
    text-decoration: none;
    color: #1e293b;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    border: 1px solid rgba(0,0,0,0.05);
    word-break: break-word;
}
.ev-topic-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    text-decoration: none;
    filter: brightness(0.98);
}
.ev-topic-icon {
    font-size: 1.3rem;
    width: 40px;
    text-align: center;
    opacity: 0.8;
    flex-shrink: 0;
}
.ev-topic-content {
    flex: 1;
    min-width: 0;
}
.ev-topic-content h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
}
.badge-count {
    display: inline-block;
    background: rgba(0,0,0,0.08);
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.ev-topic-arrow {
    margin-left: auto;
    font-size: 1rem;
    opacity: 0.5;
    flex-shrink: 0;
}

/* ---- PAGE HEADING ---- */
.ev-page-heading {
    background: #fff;
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-left: 5px solid #7c3aed;
    margin-bottom: 25px;
}
.ev-page-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
}
.ev-page-desc {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Filter bar, quiz cards, etc. */
.ev-filter-bar {
    background: #fff;
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.ev-quiz-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}
.ev-quiz-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow-sm);
}
.ev-qc-question {
    font-weight: 600;
    font-size: 1.05rem;
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
}
.ev-qc-index {
    color: #7c3aed;
    font-weight: 800;
}
.ev-qc-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}
.ev-qc-option {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 18px;
    cursor: pointer;
    transition: 0.2s;
    gap: 12px;
}
.ev-qc-option:hover {
    background: #fafafa;
    border-color: #c4b5fd;
}
.ev-opt-letter {
    width: 34px;
    height: 34px;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #475569;
    flex-shrink: 0;
}
.ev-opt-text {
    flex: 1;
}
.ev-opt-icon {
    font-size: 1.4rem;
}
.ev-opt-icon i { display: none; }
.ev-qc-option.validated-correct {
    background: #d1fae5;
    border-color: #6ee7b7;
}
.ev-qc-option.validated-correct .ev-opt-letter {
    background: #10b981;
    color: white;
}
.ev-qc-option.validated-correct .correct-icon { display: block; color: #065f46; }
.ev-qc-option.validated-wrong {
    background: #fee2e2;
    border-color: #fca5a5;
}
.ev-qc-option.validated-wrong .ev-opt-letter {
    background: #ef4444;
    color: white;
}
.ev-qc-option.validated-wrong .wrong-icon { display: block; color: #991b1b; }
.ev-qc-option.lock-state { pointer-events: none; }

.ev-qc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    border-top: 1px solid var(--border);
    padding-top: 18px;
}
.ev-qc-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    background: white;
    color: var(--text-dark);
    text-decoration: none;
    transition: 0.2s;
    cursor: pointer;
}
.ev-qc-btn:hover {
    background: #f8fafc;
    border-color: #7c3aed;
    color: #7c3aed;
}

/* Pagination */
.ev-pagination { margin: 35px 0; display: flex; justify-content: center; }
.ev-pagination-list { display: flex; list-style: none; gap: 10px; flex-wrap: wrap; }
.ev-page-link {
    display: flex; align-items: center; justify-content: center;
    min-width: 42px; height: 42px; padding: 0 15px;
    background: white; border: 1px solid var(--border); border-radius: 8px;
    text-decoration: none; color: var(--text-dark); font-weight: 500;
}
.ev-page-link.active {
    background: #7c3aed; color: white; border-color: #7c3aed;
}

/* SEO & FAQ */
.ev-seo-article {
    background: white; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 25px; margin-bottom: 30px; box-shadow: var(--shadow-sm);
}
.ev-seo-article h2 { font-size: 1.4rem; display: flex; align-items: center; gap: 10px; color: #7c3aed; }
.ev-faq-section {
    background: white; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 25px; margin-bottom: 30px; border-top: 4px solid #7c3aed;
}
.faq-item { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.faq-question {
    width: 100%; text-align: left; padding: 15px 20px; background: #fdfdfd; border: none;
    font-weight: 600; display: flex; justify-content: space-between; align-items: center;
    cursor: pointer; font-size: 0.95rem;
}
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s; }
.faq-item.active .faq-answer { max-height: 500px; }
.faq-answer p { padding: 15px 20px; margin: 0; color: var(--text-muted); }

/* Sidebar */
.ev-widget {
    background: white; border: 1px solid var(--border); border-radius: var(--radius);
    margin-bottom: 20px; box-shadow: var(--shadow-sm);
}
.ev-widget-header {
    padding: 16px 20px; font-weight: 700; background: #fdfdfd; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 10px;
}
.ev-widget-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.ev-sidebar-btn {
    display: block; text-align: center; padding: 12px; border-radius: 8px; font-weight: 600;
    text-decoration: none; transition: 0.2s;
}
.ev-sidebar-btn.primary { background: #7c3aed; color: white; }
.ev-sidebar-btn.primary:hover { background: #6d28d9; }
.ev-sidebar-btn.secondary { background: white; border: 1px solid #cbd5e1; color: var(--text-dark); }
.ev-sidebar-btn.secondary:hover { border-color: #7c3aed; color: #7c3aed; }

.ev-widget-menu ul { list-style: none; }
.ev-widget-menu li { border-bottom: 1px solid var(--border); }
.ev-widget-menu li:last-child { border-bottom: none; }
.ev-widget-menu a {
    display: block; padding: 12px 20px; color: var(--text-muted); text-decoration: none;
    font-size: 0.9rem; transition: 0.2s;
}
.ev-widget-menu a:hover { background: #f8fafc; color: #7c3aed; padding-left: 25px; }
.ev-widget-menu a.active { font-weight: 600; color: #7c3aed; background: #f5f3ff; border-left: 3px solid #7c3aed; }

/* Modal */
.ev-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
    display: none; align-items: center; justify-content: center;
    z-index: 5000; padding: 20px; opacity: 0; transition: 0.3s;
}
.ev-modal-overlay.show { opacity: 1; }
.ev-modal-wrapper {
    background: white; width: 100%; max-width: 550px; border-radius: var(--radius);
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    transform: scale(0.95); transition: 0.3s;
}
.ev-modal-overlay.show .ev-modal-wrapper { transform: scale(1); }
.ev-modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 22px 25px; border-bottom: 1px solid var(--border);
}
.ev-modal-header h3 { font-size: 1.3rem; display: flex; align-items: center; gap: 8px; }
.ev-modal-close {
    background: #f1f5f9; border: none; width: 36px; height: 36px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 1.2rem;
}
.ev-modal-body { padding: 25px; }
.ev-modal-correct { background: #d1fae5; border: 1px solid #6ee7b7; border-radius: 8px; padding: 15px; margin-bottom: 20px; }
.ev-modal-correct-label { font-weight: 700; text-transform: uppercase; font-size: 0.85rem; }
.ev-modal-correct-text { font-weight: 600; margin-top: 5px; font-size: 1rem; }
.ev-modal-explanation { background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 15px; }
.ev-modal-explanation h5 { color: #92400e; margin-bottom: 10px; }
.ev-modal-footer { padding: 15px 25px; border-top: 1px solid var(--border); text-align: right; }
.ev-btn-primary { background: #7c3aed; color: white; border: none; padding: 10px 24px; border-radius: 8px; font-weight: 600; cursor: pointer; }

/* Alert */
.ev-alert {
    display: flex; align-items: center; gap: 12px; padding: 20px;
    border-radius: var(--radius); background: #fff3cd; border: 1px solid #ffeeba;
    color: #856404; margin-top: 20px;
}

/* ============================================
   MOBILE RESPONSIVENESS FIXES
   ============================================ */
@media (max-width: 992px) {
    .ev-main-layout { flex-direction: column; }
    .ev-sidebar { width: 100%; }
}

@media (max-width: 768px) {
    .container { padding: 0 16px; }
    .ev-hero { padding: 35px 25px; }
    .ev-hero-title { font-size: 2rem; }
    .ev-hero-desc { font-size: 1rem; }
    .ev-hero-stats { flex-direction: column; }
    .ev-stat-box { min-width: 100%; }
    .ev-category-grid {
        grid-template-columns: 1fr;  /* single column */
        padding: 20px 15px;
    }
    .ev-subtopic-grid {
        grid-template-columns: 1fr;  /* single column */
        padding: 15px;
    }
    .ev-section-header,
    .ev-topics-header { padding: 20px 15px; }
    .ev-filter-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .ev-page-heading { padding: 20px; }
    .ev-quiz-card { padding: 20px; }
    .ev-qc-actions { flex-direction: column; }
    .ev-btn-hero { width: 100%; justify-content: center; }
    .ev-breadcrumb-area { font-size: 12px; padding: 12px 0; }
}

@media (max-width: 480px) {
    .ev-hero { padding: 25px 15px; }
    .ev-hero-title { font-size: 1.8rem; }
    .ev-hero-badge { font-size: 11px; padding: 6px 14px; }
    .ev-search-box { padding: 15px; }
    .ev-input-wrapper { flex-wrap: wrap; }
    .ev-btn-search { padding: 10px 20px; width: 100%; margin-top: 5px; }
    .ev-category-card { padding: 18px; }
    .ev-topic-card { padding: 15px; }
}