* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.7;
    color: var(--body-color);
    background: var(--body-bg);
    overflow-x: hidden;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 480px) {
    .container { padding: 0 16px; }
}

a { text-decoration: none; color: var(--primary); transition: color 0.2s; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

/* Navbar */
.navbar {
    background: var(--header-bg);
    position: sticky; top: 0; z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.navbar .container {
    display: flex; justify-content: space-between; align-items: center;
    height: 70px;
}
.navbar-brand {
    display: flex; align-items: center; gap: 10px;
    font-size: 1.3rem; font-weight: 800;
    color: var(--header-color); letter-spacing: -0.5px;
    flex-shrink: 0;
    transition: opacity 0.2s;
}
.navbar-brand:hover { opacity: 0.85; color: var(--header-color); }
.navbar-brand img { height: 34px; width: auto; }
.navbar-menu { display: flex; align-items: center; gap: 2px; }
.navbar-menu ul { list-style: none; display: flex; gap: 1px; align-items: center; }
.navbar-menu ul li a:not(.btn-login):not(.btn-register):not(.btn-logout) {
    color: var(--header-color); opacity: 0.8; padding: 8px 14px; border-radius: 8px;
    font-size: 13.5px; font-weight: 500; transition: all 0.2s; white-space: nowrap;
    letter-spacing: 0.2px; position: relative;
}
.navbar-menu ul li a:not(.btn-login):not(.btn-register):not(.btn-logout):hover {
    opacity: 1; background: rgba(255,255,255,0.1);
}
.navbar-menu ul li a:not(.btn-login):not(.btn-register):not(.btn-logout)::after {
    content: ''; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%) scaleX(0);
    width: calc(100% - 28px); height: 2px; background: var(--header-color);
    border-radius: 1px; transition: transform 0.25s ease; opacity: 0.6;
}
.navbar-menu ul li a:not(.btn-login):not(.btn-register):not(.btn-logout):hover::after {
    transform: translateX(-50%) scaleX(1);
}
.navbar-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.navbar-toggler {
    display: none; position: relative; align-items: center; justify-content: center;
    width: 40px; height: 40px; background: none; border: none; cursor: pointer;
    border-radius: 8px; transition: background 0.2s;
}
.navbar-toggler:hover { background: rgba(255,255,255,0.1); }
.hamburger-line {
    display: block; width: 20px; height: 2px; background: var(--header-color);
    border-radius: 2px; transition: all 0.3s ease; position: absolute;
    left: 50%; transform: translateX(-50%);
}
.hamburger-line:nth-child(1) { top: 14px; }
.hamburger-line:nth-child(2) { top: 19px; }
.hamburger-line:nth-child(3) { top: 24px; }
.navbar-toggler.open .hamburger-line:nth-child(1) {
    top: 19px; transform: translateX(-50%) rotate(45deg);
}
.navbar-toggler.open .hamburger-line:nth-child(2) { opacity: 0; }
.navbar-toggler.open .hamburger-line:nth-child(3) {
    top: 19px; transform: translateX(-50%) rotate(-45deg);
}

/* Dropdown */
.dropdown { position: relative; }
.dropdown::after {
    content: ''; position: absolute; bottom: -10px; left: 0; right: 0;
    height: 10px;
}
.dropdown-toggle { cursor: pointer; display: flex; align-items: center; gap: 3px; }
.dropdown-toggle .arrow {
    font-size: 9px; opacity: 0.6; transition: transform 0.25s ease; margin-top: 1px;
}
.dropdown.open .dropdown-toggle .arrow,
.dropdown:hover .dropdown-toggle .arrow { transform: rotate(180deg); }
.dropdown-menu {
    display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    min-width: 220px; background: var(--header-bg); border-radius: 12px; padding: 6px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.25); z-index: 1001;
    margin-top: 4px; border: 1px solid rgba(255,255,255,0.1);
    animation: ddFadeIn 0.2s ease;
}
@keyframes ddFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-6px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.dropdown-menu li { display: block; }
.dropdown-menu li a {
    display: flex !important; align-items: center; gap: 10px;
    padding: 10px 16px !important; border-radius: 8px !important;
    color: #fff !important; opacity: 0.85 !important; font-size: 13.5px !important;
    font-weight: 500 !important; transition: all 0.15s;
}
.dropdown-menu li a:hover {
    background: rgba(255,255,255,0.12) !important; opacity: 1 !important;
    transform: translateX(3px); color: #fff !important;
}
.dropdown-menu li a::after { display: none !important; }
@media (max-width: 768px) {
    .dropdown.open .dropdown-menu { display: block; }
}

/* Desktop hover dropdown */
@media (min-width: 769px) {
    .dropdown .dropdown-menu { display: none; }
    .dropdown:hover .dropdown-menu { display: block; }
}

/* Language Switcher */
.lang-switcher { position: relative; }
.lang-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px; border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px; background: rgba(255,255,255,0.08);
    cursor: pointer; font-size: 13px; color: var(--header-color);
    transition: all 0.2s; font-family: inherit; line-height: 1.4;
}
.lang-btn:hover { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.3); }
.lang-arrow { font-size: 9px; opacity: 0.6; transition: transform 0.2s; }
.lang-switcher.open .lang-arrow { transform: rotate(180deg); }
.lang-dropdown {
    display: none; position: absolute; top: 100%; right: 0; margin-top: 6px;
    min-width: 140px; background: #fff; border-radius: 10px; padding: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15); z-index: 100;
    border: 1px solid rgba(0,0,0,0.06);
}
.lang-dropdown a {
    display: flex !important; align-items: center; gap: 8px;
    padding: 8px 12px !important; border-radius: 6px !important;
    color: #333 !important; font-size: 13px !important; opacity: 1 !important;
}
.lang-dropdown a:hover { background: #f5f5f5 !important; }
.lang-dropdown a.active { background: #f0fdf4 !important; color: #166534 !important; font-weight: 600 !important; }
.lang-switcher.open .lang-dropdown { display: block; }

/* Admin Language Switcher */
.admin-lang { margin-right: 16px; }
.admin-lang .lang-btn {
    border-color: #d0d0d0; background: #fff; color: #333; padding: 6px 12px;
}
.admin-lang .lang-btn:hover { border-color: var(--primary); background: #f9f9f9; }

/* Nav active state */
.nav-left > li > a.active-link {
    opacity: 1; background: rgba(255,255,255,0.12);
}
.nav-left > li > a.active-link::after {
    transform: translateX(-50%) scaleX(1);
}

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 22px; border-radius: 10px; font-size: 14px; font-weight: 600;
    cursor: pointer; border: none; transition: all 0.25s; line-height: 1.4;
}
.btn-primary { background: var(--btn-bg); color: var(--btn-color); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); }
.btn-secondary { background: rgba(255,255,255,0.12); color: #fff; backdrop-filter: blur(4px); border: 1px solid rgba(255,255,255,0.15); }
.btn-secondary:hover { background: rgba(255,255,255,0.2); transform: translateY(-2px); }
.hero .btn-secondary { background: transparent; color: var(--header-color); border: 2px solid var(--header-color); }
.hero .btn-secondary:hover { background: var(--header-color); color: var(--header-bg); }
.btn-sm { padding: 7px 16px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-outline {
    background: transparent; border: 2px solid var(--btn-bg); color: var(--btn-bg); box-shadow: none;
}
.btn-outline:hover { background: var(--btn-bg); color: var(--btn-color); transform: translateY(-2px); }
.btn-login {
    background: transparent; color: var(--header-color); padding: 8px 18px; border-radius: 8px;
    font-size: 14px; font-weight: 500; border: 1.5px solid var(--header-color); opacity: 0.85;
}
.btn-login:hover { background: var(--header-color); color: var(--header-bg); opacity: 1; }
.btn-register {
    background: var(--btn-bg); color: var(--btn-color); padding: 8px 18px;
    border-radius: 8px; font-size: 14px; font-weight: 600;
}
.btn-register:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-logout {
    background: none; border: none; color: var(--header-color); opacity: 0.7; cursor: pointer;
    font-size: 14px; font-weight: 500; padding: 8px 14px; border-radius: 8px; transition: all 0.2s;
}
.btn-logout:hover { opacity: 1; background: rgba(255,255,255,0.1); }
.btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }
.btn-danger:hover { opacity: 0.9; }
.btn-warning { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.btn-info { background: linear-gradient(135deg, #06b6d4, #0891b2); color: #fff; }
.btn-lg { padding: 14px 32px; font-size: 16px; border-radius: 12px; }

/* Hero */
.hero {
    background: var(--header-bg);
    position: relative;
    color: var(--header-color); padding: 100px 0 90px; text-align: center;
}
.hero h1 { font-size: 2.8rem; font-weight: 800; margin-bottom: 16px; line-height: 1.2; letter-spacing: -1px; color: var(--header-color); }
.hero h1 span { color: var(--header-color); }
.hero p { font-size: 1.15rem; margin-bottom: 32px; opacity: 0.85; max-width: 600px; margin-left: auto; margin-right: auto; color: var(--header-color); }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* Page Header */
.page-header {
    background: var(--primary-light);
    padding: 40px 0 36px;
    border-bottom: 1px solid var(--primary-border);
}
.page-header h1 {
    font-size: 1.75rem; font-weight: 700;
    color: var(--primary-dark); letter-spacing: -0.5px;
}
.page-header p { color: var(--primary); font-size: 0.95rem; margin-top: 4px; }

/* Sections */
section { padding: 70px 0; }
.section-title {
    text-align: center; font-size: 1.8rem; font-weight: 700;
    margin-bottom: 40px; color: #000; letter-spacing: -0.5px;
}
.section-title::after {
    content: ''; display: block; width: 60px; height: 4px;
    background: var(--primary);
    border-radius: 2px; margin: 12px auto 0;
}
section:nth-child(even) { background: #fff; }

/* Filter Forms - Professional Look */
.filter-form {
    margin-bottom: 28px;
    padding: 20px 24px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.filter-group {
    display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
}
.filter-group .form-control {
    flex: 1; min-width: 180px;
    padding: 10px 14px 10px 38px;
    border: 1.5px solid #e2e8f0; border-radius: 10px;
    font-size: 14px; background: #fff;
    transition: all 0.2s; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}
.filter-group .form-control:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}
.filter-group .search-input {
    position: relative; flex: 2; min-width: 220px;
}
.filter-group .search-input input {
    width: 100%; padding: 10px 14px 10px 40px;
    border: 1.5px solid #e2e8f0; border-radius: 10px;
    font-size: 14px; background: #fff;
    transition: all 0.2s;
}
.filter-group .search-input input:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}
.filter-group .search-input::before {
    content: '\1F50D'; position: absolute; left: 14px; top: 50%;
    transform: translateY(-50%); font-size: 15px; opacity: 0.5;
}
.filter-group .btn { flex-shrink: 0; }

/* Category Cards */
.categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.category-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 16px;
    padding: 32px 24px; text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative; overflow: hidden;
}
.category-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
    background: var(--primary);
    opacity: 0; transition: opacity 0.3s;
}
.category-card:hover {
    box-shadow: 0 20px 40px rgba(0,0,0,0.08); transform: translateY(-8px);
    border-color: var(--primary-border);
}
.category-card:hover::before { opacity: 1; }
.category-icon { font-size: 3rem; margin-bottom: 16px; display: block; }
.category-card h3 { color: #000; margin-bottom: 8px; font-size: 1.15rem; }
.category-card p { color: #64748b; font-size: 14px; line-height: 1.6; }

/* Cards Grid */
.materials-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 24px; }
.material-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
    padding: 28px; transition: all 0.3s; display: block; color: inherit; text-decoration: none;
}
.material-card:hover { box-shadow: 0 12px 28px rgba(0,0,0,0.06); border-color: var(--primary-border); transform: translateY(-4px); }
.material-card h3 { margin-bottom: 10px; font-size: 1.1rem; color: #000; }
.material-card p { color: #666; font-size: 0.9rem; line-height: 1.5; }
.material-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }

/* Quiz Cards */
.quizzes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.quiz-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
    padding: 28px 24px; text-align: center; transition: all 0.3s;
}
.quiz-card:hover { box-shadow: 0 12px 28px rgba(0,0,0,0.06); border-color: var(--primary-border); transform: translateY(-4px); }
.quiz-card h3 { margin-bottom: 8px; color: #000; }
.quiz-card p { color: #64748b; margin-bottom: 18px; font-size: 14px; }
.quiz-info { list-style: none; padding: 0; margin: 0 0 15px; font-size: 0.9rem; color: #666; text-align: left; }
.quiz-info li { margin-bottom: 5px; }

/* Job Cards */
.jobs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; }
.job-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 14px;
    padding: 28px; transition: all 0.3s;
}
.job-card:hover { box-shadow: 0 12px 28px rgba(0,0,0,0.06); border-color: var(--primary-border); transform: translateY(-4px); }
.job-card h3 { color: #000; margin-bottom: 6px; font-size: 1.1rem; }
.job-org { color: var(--primary); font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; display: flex; align-items: center; gap: 6px; }
.job-info { list-style: none; padding: 0; margin: 0 0 15px; font-size: 0.9rem; color: #666; }
.job-info li { margin-bottom: 5px; }
.job-deadline { color: #dc2626; font-size: 13px; margin-bottom: 16px; display: flex; align-items: center; gap: 6px; }

/* Affairs */
.affairs-list { max-width: 800px; margin: 0 auto; }
.affair-item {
    padding: 18px 24px; border-bottom: 1px solid #e2e8f0;
    display: flex; align-items: center; gap: 16px; transition: all 0.2s;
    border-radius: 10px;
}
.affair-item:hover { background: #f8fafc; }
.affair-date {
    color: #64748b; font-size: 13px; white-space: nowrap;
    background: #fff; padding: 4px 12px; border-radius: 20px; font-weight: 500;
}
.affair-item h3 { margin: 0; font-size: 1rem; }
.affair-item h3 a { color: #000; font-weight: 600; }
.affair-item h3 a:hover { color: var(--primary); }

/* Auth */
.auth-container {
    display: flex; justify-content: center; align-items: center;
    min-height: 80vh; padding: 60px 20px;
    background: #fff;
}
.auth-card {
    background: #fff; border-radius: 20px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.06); padding: 48px 40px;
    width: 100%; max-width: 440px; border: 1px solid #e2e8f0;
}
.auth-card .auth-logo { text-align: center; margin-bottom: 20px; }
.auth-card .auth-logo-img { max-height: 50px; }
.auth-card .auth-logo-text { font-size: 1.4rem; font-weight: 800; color: var(--primary); }
.auth-card h2 {
    margin-bottom: 8px; text-align: center; color: #000;
    font-size: 1.6rem; font-weight: 700;
}
.auth-card .auth-subtitle {
    text-align: center; color: #64748b; margin-bottom: 32px; font-size: 14px;
}
.auth-link { text-align: center; margin-top: 24px; color: #64748b; font-size: 14px; }

/* Social login */
.social-divider { display: flex; align-items: center; margin: 24px 0; color: #94a3b8; font-size: 13px; }
.social-divider::before, .social-divider::after { content: ''; flex: 1; height: 1px; background: #e2e8f0; }
.social-divider span { padding: 0 16px; }
.social-login { display: flex; flex-direction: column; gap: 12px; }
.btn-social { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 12px 16px; border: none; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none; transition: opacity 0.2s; }
.btn-social:hover { opacity: 0.9; text-decoration: none; }
.btn-google { background: #DE5246; color: #fff; }
.btn-google:hover { color: #fff; }
.btn-facebook { background: #1877F2; color: #fff; }
.btn-facebook:hover { color: #fff; }

/* Form row */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; color: #000; font-size: 14px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 12px 14px;
    border: 1.5px solid #e2e8f0; border-radius: 10px;
    font-size: 14px; transition: all 0.2s; background: #fff;
    font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.06);
}
.form-group textarea { min-height: 120px; resize: vertical; }
.form-group .error { color: #dc2626; font-size: 13px; margin-top: 4px; display: block; }
.checkbox-group label { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.checkbox-group input[type="checkbox"] { width: auto; accent-color: var(--primary); }

/* Alerts */
.alert {
    padding: 14px 20px; border-radius: 12px; margin-bottom: 20px;
    font-size: 14px; font-weight: 500;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: var(--primary-light); color: var(--primary); border: 1px solid var(--primary-border); }

/* Badges */
.badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; letter-spacing: 0.3px; }
.badge-free { background: #dcfce7; color: #166534; }
.badge-paid { background: #fef3c7; color: #92400e; }
.badge-both { background: var(--primary-light); color: var(--primary); }
.badge-admin { background: #fef2f2; color: #991b1b; }
.badge-subadmin { background: #fff; color: #333; }
.badge-user { background: #e0f2fe; color: #075985; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-info { background: var(--primary-light); color: var(--primary); }
.badge-secondary { background: #fff; color: #475569; }
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-category { background: #e3f2fd; color: #1565c0; }
.badge-subject { background: #f3e5f5; color: #7b1fa2; }
.badge-danger { background: #ffebee; color: #c62828; }
.badge-correct { background: #e8f5e9; color: #2e7d32; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--primary-border); font-size: 14px; }
.table th { background: #fff; font-weight: 600; color: #64748b; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; }
.table tr:hover td { background: #f8fafc; }
.table-responsive { overflow-x: auto; }

/* Footer */
.footer {
    background: var(--footer-bg); color: var(--footer-color); padding: 60px 0 30px; margin-top: 60px;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 40px; margin-bottom: 30px; }
.footer h3 { color: var(--footer-color); margin-bottom: 18px; font-size: 1.1rem; }
.footer p { line-height: 1.8; font-size: 14px; }
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 10px; }
.footer ul li a { color: var(--footer-color); font-size: 14px; transition: all 0.2s; display: inline-flex; align-items: center; gap: 6px; opacity: 0.7; }
.footer ul li a:hover { opacity: 1; transform: translateX(4px); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.15); padding-top: 24px; text-align: center; font-size: 14px; }

/* Pagination */
.pagination-wrapper { margin-top: 30px; }
.pagination-wrapper nav > div { margin-bottom: 12px; }
.pagination-mobile { display: none; text-align: center; gap: 10px; }
.pagination-mobile a, .pagination-mobile .btn-disabled {
    display: inline-block; padding: 10px 20px;
    border: 1.5px solid #e2e8f0; border-radius: 10px;
    font-size: 14px; font-weight: 500; transition: all 0.2s;
}
.pagination-mobile a { color: #475569; background: #fff; }
.pagination-mobile a:hover {
    border-color: var(--primary); color: var(--primary);
    background: var(--primary-light);
}
.pagination-mobile .btn-disabled { color: #94a3b8; background: #f8fafc; cursor: not-allowed; }
.pagination-info { text-align: center; margin-bottom: 12px; }
.pagination-info p { color: #64748b; font-size: 14px; margin: 0; }
.pagination-info .font-medium { font-weight: 600; color: #334155; }
.pagination-pages { text-align: center; }
.pagination {
    display: inline-flex; justify-content: center; gap: 6px; flex-wrap: wrap;
    padding: 0; margin: 0; list-style: none;
}
.pagination li { list-style: none; display: inline-flex; }
.pagination a, .pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px;
    padding: 0 12px; border: 1.5px solid #e2e8f0; border-radius: 10px;
    color: #475569; font-size: 14px; font-weight: 500;
    transition: all 0.2s; background: #fff;
}
.pagination a:hover {
    border-color: var(--primary); color: var(--primary);
    background: var(--primary-light); transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.pagination li.active span {
    background: var(--btn-bg); color: var(--btn-color);
    border-color: var(--btn-bg); font-weight: 700;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.pagination li.disabled span {
    opacity: 0.4; cursor: not-allowed; background: #f8fafc;
}
@media (max-width: 640px) {
    .pagination-mobile { display: flex; justify-content: center; }
    .pagination-pages { display: none; }
}

/* Main Content */
.main-content { min-height: calc(100vh - 200px); }

/* Utility */
.text-center { text-align: center; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 24px; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* Quiz timer */
.timer { position: sticky; top: 0; background: #fff3e0; padding: 10px 20px; border-radius: 8px; font-size: 1.2rem; font-weight: 700; text-align: center; margin-bottom: 20px; z-index: 10; border: 1px solid #ffe0b2; }

/* Question options */
.options-list { list-style: none; padding: 0; margin: 0; }
.options-list li { padding: 2px 0; font-size: 0.9rem; }
.options-list li label {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px; border: 1.5px solid #e2e8f0; border-radius: 12px;
    cursor: pointer; transition: all 0.2s; font-size: 15px;
}
.options-list li label:hover { border-color: var(--primary-border); background: #f8fafc; }
.options-list li input[type="radio"] { accent-color: var(--primary); }
.correct-option { color: #2e7d32; font-weight: 600; }
.check-mark { color: #4caf50; margin-left: 5px; }
.question-card { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 20px; margin-bottom: 15px; }
.question-card h3 { margin: 0 0 10px; font-size: 1rem; color: #333; }
.question-card p { margin-bottom: 10px; font-size: 1rem; }
.option-label { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid #e0e0e0; border-radius: 6px; cursor: pointer; transition: background 0.2s; }
.option-label:hover { background: #f5f5f5; }
.option-label input[type="radio"] { margin: 0; }

/* Quiz Detail */
.quiz-detail { margin-bottom: 20px; }
.quiz-description { color: #666; font-size: 1rem; }
.quiz-meta { list-style: none; padding: 0; display: flex; gap: 20px; flex-wrap: wrap; }
.quiz-meta li { background: #f5f5f5; padding: 8px 15px; border-radius: 6px; font-size: 0.95rem; }

/* Result */
.result-summary { text-align: center; margin-bottom: 30px; }
.result-stats { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; margin-top: 20px; }
.stat-card { padding: 20px 30px; border-radius: 12px; min-width: 150px; }
.stat-pass { background: #e8f5e9; border: 2px solid #4caf50; }
.stat-fail { background: #ffebee; border: 2px solid #f44336; }
.stat-value { font-size: 1.8rem; font-weight: 700; }
.stat-label { font-size: 0.9rem; color: #666; margin-top: 5px; }
.result-actions { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; }
.row-correct { background: #f1f8e9; }
.row-wrong { background: #fce4ec; }

/* Leaderboard */
.leaderboard-table th { background: #f5f5f5; font-weight: 600; white-space: nowrap; }
.rank-top { background: #fffde7; }
.rank-current { background: #e3f2fd; font-weight: 600; }
.rank-badge { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; font-weight: 700; font-size: 0.9rem; color: #fff; }
.gold { background: #ffc107; }
.silver { background: #9e9e9e; }
.bronze { background: #ff8f00; }

/* WhatsApp Floating Button */
.whatsapp-float {
    position: fixed; bottom: 24px; right: 24px; z-index: 999;
    width: 56px; height: 56px; border-radius: 50%;
    background: #25d366; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; text-decoration: none;
    box-shadow: 0 4px 20px rgba(37,211,102,0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: whatsappPulse 2s infinite;
}
.whatsapp-float:hover {
    transform: scale(1.1); color: #fff;
    box-shadow: 0 6px 28px rgba(37,211,102,0.5);
}
@keyframes whatsappPulse {
    0% { box-shadow: 0 4px 20px rgba(37,211,102,0.4); }
    50% { box-shadow: 0 4px 30px rgba(37,211,102,0.7); }
    100% { box-shadow: 0 4px 20px rgba(37,211,102,0.4); }
}

/* Toast Notifications */
#toast-container { position: fixed; top: 20px; right: 20px; z-index: 99999; display: flex; flex-direction: column; gap: 10px; max-width: 400px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-radius: 12px; font-size: 14px; font-weight: 500; box-shadow: 0 8px 30px rgba(0,0,0,0.12); animation: toastSlideIn 0.4s cubic-bezier(0.22, 1, 0.36, 1); transition: all 0.4s; position: relative; }
.toast-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.toast-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.toast-info { background: var(--primary-light); color: var(--primary-dark); border: 1px solid var(--primary-border); }
.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-msg { flex: 1; }
.toast-close { background: none; border: none; font-size: 18px; cursor: pointer; opacity: 0.5; padding: 0 4px; color: inherit; flex-shrink: 0; }
.toast-close:hover { opacity: 1; }
@keyframes toastSlideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Responsive */
@media (max-width: 768px) {
    .navbar-toggler { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; }
    .navbar-menu {
        display: block; position: fixed; top: 0; right: -100%; width: 300px; height: 100vh;
        background: var(--header-bg); padding: 80px 20px 24px;
        box-shadow: -8px 0 40px rgba(0,0,0,0.2);
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto; z-index: 999;
    }
    .navbar-menu.active { right: 0; }
    .navbar-menu .nav-left { flex-direction: column; width: 100%; gap: 0; }
    .navbar-menu .nav-left > li { width: 100%; }
    .navbar-menu .nav-left > li > a:not(.dropdown-toggle) {
        padding: 12px 14px; display: block; width: 100%;
        font-size: 14px; border-radius: 10px;
    }
    .navbar-menu .nav-left > li > a:not(.dropdown-toggle)::after { display: none !important; }
    .navbar-menu .dropdown-toggle {
        padding: 12px 14px; display: flex !important; justify-content: space-between; width: 100%;
        border-radius: 10px; font-size: 14px;
    }
    .navbar-menu .dropdown-toggle::after { display: none !important; }
    .navbar-menu .dropdown { width: 100%; }
    .navbar-menu .dropdown-menu {
        position: static; box-shadow: none; border-radius: 10px; margin-top: 2px; margin-bottom: 4px;
        background: rgba(0,0,0,0.15); border: none; padding: 4px;
        min-width: auto; width: 100%; animation: none;
        transform: none; left: auto;
    }
    .navbar-menu .dropdown-menu li a {
        color: rgba(255,255,255,0.85) !important; opacity: 1 !important;
        padding: 10px 16px !important; font-size: 13.5px !important;
    }
    .navbar-menu .dropdown-menu li a:hover {
        background: rgba(255,255,255,0.12) !important; opacity: 1 !important;
        transform: none !important; color: #fff !important;
    }
    .navbar-right { margin-left: 0; margin-top: 12px; width: 100%; flex-direction: column; align-items: stretch; gap: 8px; }
    .navbar-right li { width: 100%; }
    .navbar-right li a.btn-login,
    .navbar-right li a.btn-register,
    .navbar-right li form button.btn-logout { display: flex; justify-content: center; width: 100%; padding: 10px; }
    .navbar-right li a.btn-login {
        background: rgba(255,255,255,0.1); color: var(--header-color); border-color: transparent;
        border-radius: 10px;
    }
    .navbar-right li a.btn-register { border-radius: 10px; }
    .navbar-right li form button.btn-logout {
        background: none; border: 1px solid rgba(255,255,255,0.2);
        color: var(--header-color); border-radius: 10px; padding: 10px;
        font-size: 14px;
    }
    .lang-btn { width: 100%; justify-content: space-between; padding: 10px 14px; }
    .lang-dropdown { position: static; box-shadow: none; border: none; margin-top: 2px;
        background: rgba(0,0,0,0.1); border-radius: 8px; padding: 2px; }
    .lang-dropdown a { color: var(--header-color) !important; }
    .lang-dropdown a:hover { background: rgba(255,255,255,0.08) !important; }
    .lang-dropdown a.active { background: rgba(255,255,255,0.12) !important; color: #fff !important; }

    /* Mobile overlay */
    body.nav-open::after {
        content: ''; position: fixed; inset: 0; background: rgba(0,0,0,0.35);
        z-index: 998; animation: overlayFadeIn 0.3s ease;
    }
    body.nav-open { overflow: hidden; }
    @keyframes overlayFadeIn { from { opacity: 0; } to { opacity: 1; } }
    .dropdown-menu { animation: ddFadeInMobile 0.2s ease; }
    @keyframes ddFadeInMobile { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

    .hero h1 { font-size: 1.6rem; }
    .hero p { font-size: 1rem; }
    .hero { padding: 60px 0 50px; }
    .hero-actions { flex-direction: column; align-items: center; }
    .hero-actions .btn { width: 100%; max-width: 280px; }

    .categories-grid, .jobs-grid, .quizzes-grid, .materials-grid { grid-template-columns: 1fr; gap: 16px; }
    .auth-card { padding: 28px 20px; }
    .auth-card h2 { font-size: 1.3rem; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    section { padding: 40px 0; }
    .section-title { font-size: 1.4rem; margin-bottom: 28px; }
    .books-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .book-cover { height: 160px !important; }
    .book-cover-placeholder { height: 160px !important; }
    .filter-group { flex-direction: column; }
    .filter-group .form-control, .filter-group .search-input { min-width: 100%; }
    .filter-form { padding: 16px; }

    .result-stats { flex-direction: column; align-items: center; }
    .result-actions { flex-direction: column; align-items: center; }
    .quiz-meta { flex-direction: column; gap: 8px; }
    .quiz-meta li { width: 100%; text-align: center; }

    .table { font-size: 0.8rem; }
    .table th, .table td { padding: 8px 6px; }
    .table-responsive { margin: 0 -16px; padding: 0 16px; }

    .affair-item { flex-direction: column; gap: 6px; align-items: flex-start; }
    .affair-date { min-width: auto; }

    .dashboard-grid { grid-template-columns: 1fr; }
    .stats-grid { flex-direction: column; }
    .dashboard-links { flex-direction: column; }
    .profile-edit-grid { grid-template-columns: 1fr; }
    .book-detail { flex-direction: column; }
    .book-detail-cover { width: 100%; max-width: 300px; }
    .job-meta { grid-template-columns: 1fr; }
    .job-actions { flex-direction: column; align-items: flex-start; }

    .pagination { gap: 4px; }
    .pagination a, .pagination span { min-width: 36px; height: 36px; font-size: 13px; }

    .footer { padding: 40px 0 24px; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }

    .whatsapp-float { width: 48px; height: 48px; font-size: 24px; bottom: 16px; right: 16px; }
    #toast-container { right: 12px; left: 12px; max-width: none; }
}

@media (max-width: 480px) {
    .navbar .container { height: 60px; }
    .navbar-brand { font-size: 1rem; }
    .navbar-brand img { height: 28px; }
    .navbar-menu { width: 280px; right: -100%; padding: 72px 16px 20px; }
    .hero h1 { font-size: 1.4rem; }
    .page-header h1 { font-size: 1.3rem; }
    .page-header { padding: 28px 0; }
    .filter-group .search-input input { font-size: 13px; }
    .books-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .book-cover { height: 140px !important; }
    .book-cover-placeholder { height: 140px !important; }
    .category-card { padding: 24px 16px; }
    .material-card { padding: 20px; }
    .job-card { padding: 20px; }
    .quiz-card { padding: 20px 16px; }
    .auth-container { padding: 40px 16px; }
    .stat-card { padding: 16px 20px; }
    .stats-grid { gap: 12px; }
}

@media (max-width: 380px) {
    .books-grid { grid-template-columns: 1fr; }
    .navbar-brand span { display: none; }
    .hero-actions .btn { font-size: 13px; padding: 10px 18px; }
}
