/**
 * HỌC LIỆU TIỂU HỌC - Claymorphism Design System
 * Style: Playful, rounded, toy-like, soft 3D
 * Palette: Indigo + Emerald + Warm accents
 */

/* ============================================================
   CSS VARIABLES
============================================================ */
:root {
    /* Primary palette */
    --primary: #6366F1;
    --primary-hover: #4F46E5;
    --primary-light: #EEF2FF;
    --primary-glow: rgba(99, 102, 241, 0.25);

    /* Secondary / navy */
    --secondary: #1E1B4B;
    --secondary-hover: #312E81;

    /* CTA / Emerald */
    --cta: #10B981;
    --cta-hover: #059669;
    --cta-light: #D1FAE5;

    /* Accent warm tones */
    --accent-orange: #F59E0B;
    --accent-pink: #EC4899;
    --accent-red: #EF4444;
    --accent-sky: #38BDF8;

    /* Text hierarchy */
    --text-dark: #1E1B4B;
    --text-body: #374151;
    --text-muted: #6B7280;
    --text-light: #9CA3AF;

    /* Backgrounds */
    --bg-page: #F5F3FF;
    --bg-card: #FFFFFF;
    --bg-light: #F8F7FF;
    --bg-cream: #FFF7ED;
    --white: #FFFFFF;

    /* Borders */
    --border: #E5E7EB;
    --border-strong: #C7D2FE;

    /* Claymorphism Shadows */
    --clay-sm: 4px 4px 10px rgba(99, 102, 241, 0.08), -2px -2px 6px rgba(255, 255, 255, 0.9);
    --clay-md: 6px 6px 16px rgba(99, 102, 241, 0.12), -3px -3px 10px rgba(255, 255, 255, 0.9);
    --clay-lg: 8px 8px 24px rgba(99, 102, 241, 0.15), -4px -4px 12px rgba(255, 255, 255, 0.9);
    --clay-xl: 12px 12px 32px rgba(99, 102, 241, 0.18), -6px -6px 16px rgba(255, 255, 255, 0.9);
    --clay-inset: inset 2px 2px 5px rgba(99, 102, 241, 0.08), inset -2px -2px 5px rgba(255, 255, 255, 0.8);

    /* Legacy compat shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: var(--clay-md);
    --shadow-lg: var(--clay-lg);

    /* Radii — chunky & rounded */
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-pill: 999px;

    /* Transition */
    --transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-smooth: all 0.3s ease;

    /* Typography */
    --font-heading: 'Baloo 2', 'Be Vietnam Pro', cursive;
    --font-body: 'Comic Neue', 'Be Vietnam Pro', cursive;

    /* Thick borders for clay feel */
    --clay-border: 3px solid rgba(99, 102, 241, 0.12);
}

/* ============================================================
   DARK MODE VARIABLES
============================================================ */
[data-theme="dark"] {
    /* Primary palette — brighter for dark bg */
    --primary: #A5B4FC;
    --primary-hover: #818CF8;
    --primary-light: rgba(165, 180, 252, 0.1);
    --primary-glow: rgba(165, 180, 252, 0.25);

    /* Secondary — light text on dark */
    --secondary: #E2E8F0;
    --secondary-hover: #CBD5E1;

    /* CTA / Emerald — brighter green */
    --cta: #6EE7B7;
    --cta-hover: #34D399;
    --cta-light: rgba(110, 231, 183, 0.12);

    /* Accent warm tones — brighter for dark */
    --accent-orange: #FCD34D;
    --accent-pink: #F9A8D4;
    --accent-red: #FCA5A5;
    --accent-sky: #7DD3FC;

    /* Text hierarchy — proper contrast ratios */
    --text-dark: #F8FAFC;
    --text-body: #E2E8F0;
    --text-muted: #94A3B8;
    --text-light: #64748B;

    /* 3-tier background hierarchy */
    --bg-page: #0C1222;
    /* Deepest: page background */
    --bg-card: #1A2332;
    /* Mid: card/section surface */
    --bg-light: #1E293B;
    /* Inputs, subtle areas */
    --bg-cream: #1E293B;
    --white: #1A2332;
    /* Cards & elevated surfaces */

    /* Borders — subtle but visible */
    --border: rgba(148, 163, 184, 0.15);
    --border-strong: rgba(165, 180, 252, 0.25);

    /* Claymorphism Shadows — subtle glow for dark */
    --clay-sm: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 1px rgba(148, 163, 184, 0.05);
    --clay-md: 0 4px 16px rgba(0, 0, 0, 0.45), 0 0 1px rgba(148, 163, 184, 0.05);
    --clay-lg: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 1px rgba(148, 163, 184, 0.05);
    --clay-xl: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 1px rgba(148, 163, 184, 0.05);
    --clay-inset: inset 0 2px 4px rgba(0, 0, 0, 0.3);

    /* Clay border — more visible */
    --clay-border: 2px solid rgba(148, 163, 184, 0.1);
}

/* ============================================================
   RESET & BASE
============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-body);
    background-color: var(--bg-page);
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-smooth);
}

ul,
ol {
    list-style: none;
}

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

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--text-dark);
    line-height: 1.3;
}

/* ============================================================
   UTILITY
============================================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.py-5 {
    padding-top: 40px;
    padding-bottom: 40px;
}

.mt-2 {
    margin-top: 12px;
}

.w-100 {
    width: 100%;
}

/* ============================================================
   BUTTONS — Chunky clay style
============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 26px;
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font-heading);
    border-radius: var(--radius);
    border: 3px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
    cursor: pointer;
    position: relative;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary-hover);
    box-shadow: var(--clay-sm);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--clay-md);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--clay-inset);
}

.btn-success {
    background: var(--cta);
    color: var(--white);
    border-color: var(--cta-hover);
    box-shadow: var(--clay-sm);
}

.btn-success:hover {
    background: var(--cta-hover);
    transform: translateY(-2px);
    box-shadow: var(--clay-md);
}

.btn-outline {
    background: var(--white);
    color: var(--primary);
    border: 3px solid var(--border-strong);
    box-shadow: var(--clay-sm);
}

.btn-outline:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--white);
    border-color: var(--secondary-hover);
    box-shadow: var(--clay-sm);
}

.btn-zalo {
    background: var(--primary);
    color: var(--white);
    width: 100%;
    border-color: var(--primary-hover);
}

.btn-sm {
    padding: 8px 18px;
    font-size: 14px;
    border-radius: var(--radius-sm);
    border-width: 2px;
}

.btn-lg {
    padding: 16px 34px;
    font-size: 17px;
    border-radius: var(--radius-lg);
}

.btn-block {
    width: 100%;
}

/* ============================================================
   HEADER — Floating clay navbar
============================================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 3px solid rgba(99, 102, 241, 0.08);
    transition: var(--transition-smooth);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--primary);
    text-decoration: none;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), #818CF8);
    border-radius: var(--radius-sm);
    box-shadow: var(--clay-sm);
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.logo-icon svg {
    width: 22px;
    height: 22px;
    fill: white;
}

/* Navigation */
.main-nav .nav-list {
    display: flex;
    gap: 4px;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-weight: 600;
    font-family: var(--font-heading);
    color: var(--text-body);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.nav-link:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-link i {
    font-size: 10px;
    transition: var(--transition-smooth);
}

/* Dropdown */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 210px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--clay-lg);
    border: var(--clay-border);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition-smooth);
    z-index: 100;
}

.nav-item:hover .dropdown-menu,
.user-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-body);
}

.dropdown-menu li a:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.dropdown-menu .divider {
    height: 2px;
    background: var(--border);
    margin: 6px 0;
    border-radius: 1px;
}

/* Search */
.header-search {
    flex: 1;
    max-width: 380px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-light);
    border-radius: var(--radius-pill);
    padding: 0 20px;
    height: 46px;
    border: 3px solid transparent;
    transition: var(--transition-smooth);
    box-shadow: var(--clay-inset);
}

.search-box:focus-within {
    background: var(--white);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.search-box i {
    color: var(--primary);
    font-size: 15px;
}

.search-box input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
}

.search-box input::placeholder {
    color: var(--text-light);
}

/* Auth */
.header-auth {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-dropdown {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-family: var(--font-heading);
    border: 2px solid var(--border);
    transition: var(--transition-smooth);
}

.user-btn:hover {
    background: var(--primary-light);
    border-color: var(--border-strong);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-strong);
}

.mobile-toggle {
    display: none;
    font-size: 24px;
    color: var(--primary);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    align-items: center;
    justify-content: center;
}

/* ============================================================
   THEME TOGGLE BUTTON
============================================================ */
.theme-toggle {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-light);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: rotate(15deg) scale(1.08);
    box-shadow: 0 0 20px var(--primary-glow);
}

.theme-toggle:hover .toggle-icon {
    color: #fff;
}

.theme-toggle:active {
    transform: rotate(0deg) scale(0.95);
}

.toggle-icon {
    position: absolute;
    font-size: 18px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: var(--primary);
}

.toggle-icon.sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.toggle-icon.moon {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

[data-theme="dark"] .toggle-icon.sun {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

[data-theme="dark"] .toggle-icon.moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    color: #FBBF24;
}

[data-theme="dark"] .theme-toggle {
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.3);
}

[data-theme="dark"] .theme-toggle:hover {
    background: #FBBF24;
    border-color: #FBBF24;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}

[data-theme="dark"] .theme-toggle:hover .toggle-icon.moon {
    color: #1E293B;
}

/* ============================================================
   HERO SECTION — Playful, bouncy
============================================================ */
.hero {
    background: linear-gradient(135deg, var(--bg-page) 0%, #EDE9FE 40%, #DBEAFE 100%);
    padding: 70px 0;
    overflow: hidden;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--primary-glow), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -60px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.15), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-title {
    font-size: 48px;
    font-weight: 800;
    font-family: var(--font-heading);
    line-height: 1.2;
    color: var(--secondary);
    margin-bottom: 20px;
}

.hero-title span {
    color: var(--primary);
    position: relative;
}

.hero-title span::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0;
    right: 0;
    height: 8px;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 4px;
    z-index: -1;
}

.hero-desc {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 32px;
    max-width: 480px;
    line-height: 1.8;
}

.hero-btns {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-image {
    position: relative;
}

.hero-image img {
    width: 100%;
    border-radius: var(--radius-xl);
    box-shadow: var(--clay-xl);
    border: 4px solid rgba(255, 255, 255, 0.7);
}

.hero-badge {
    position: absolute;
    top: 20px;
    right: -16px;
    background: var(--white);
    padding: 12px 20px;
    border-radius: var(--radius-pill);
    box-shadow: var(--clay-lg);
    border: var(--clay-border);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 14px;
    font-family: var(--font-heading);
    color: var(--text-dark);
    animation: float 3s ease-in-out infinite;
}

.hero-badge i {
    color: var(--primary);
    font-size: 18px;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* ============================================================
   FILTER PILLS — Round & bouncy
============================================================ */
.filter-section {
    padding: 28px 0;
    border-bottom: 3px solid rgba(99, 102, 241, 0.06);
    background: var(--white);
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--primary);
    font-size: 15px;
}

.filter-pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--white);
    border: 3px solid var(--border);
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 14px;
    font-family: var(--font-heading);
    transition: var(--transition);
    cursor: pointer;
    box-shadow: var(--clay-sm);
    color: var(--text-body);
}

.filter-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--clay-md);
}

.filter-pill.active {
    background: var(--primary);
    border-color: var(--primary-hover);
    color: var(--white);
    box-shadow: var(--clay-md);
}

.filter-pill .pill-icon {
    width: 26px;
    height: 26px;
    background: var(--primary-light);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: var(--primary);
    border: 2px solid rgba(99, 102, 241, 0.15);
}

.filter-pill:hover .pill-icon {
    background: rgba(99, 102, 241, 0.15);
}

.filter-pill.active .pill-icon {
    background: rgba(255, 255, 255, 0.25);
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ============================================================
   SECTIONS
============================================================ */
.section {
    padding: 50px 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.section-title {
    font-size: 26px;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title::before {
    content: '';
    width: 6px;
    height: 30px;
    background: linear-gradient(180deg, var(--primary), var(--cta));
    border-radius: 3px;
}

.section-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-weight: 700;
    font-size: 15px;
    font-family: var(--font-heading);
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    background: var(--primary-light);
    border: 2px solid transparent;
}

.section-link:hover {
    gap: 10px;
    border-color: var(--primary);
}

/* ============================================================
   DOCUMENT GRID & CARDS — Clay cards
============================================================ */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.doc-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: var(--clay-border);
    transition: var(--transition);
    box-shadow: var(--clay-sm);
    cursor: pointer;
    display: block;
}

.doc-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--clay-lg);
    border-color: rgba(99, 102, 241, 0.25);
}

.doc-thumb {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-light), #DBEAFE);
}

.doc-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.doc-card:hover .doc-thumb img {
    transform: scale(1.06);
}

.doc-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 800;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--clay-sm);
}

.doc-badge.free {
    background: var(--cta);
    color: var(--white);
}

.doc-badge.premium {
    background: var(--primary);
    color: var(--white);
}

.doc-badge.hot {
    background: var(--accent-red);
    color: var(--white);
}

.doc-body {
    padding: 16px;
}

.doc-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.doc-tag {
    padding: 4px 12px;
    background: var(--bg-light);
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    border: 2px solid var(--border);
}

.doc-tag.grade {
    background: var(--primary-light);
    color: var(--primary);
    border-color: rgba(99, 102, 241, 0.15);
}

.doc-title {
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--text-dark);
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.doc-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 2px solid var(--border);
}

.doc-stats {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: var(--text-light);
    font-weight: 600;
}

.doc-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.doc-stats i {
    color: var(--text-light);
    font-size: 12px;
}

.doc-price {
    font-size: 15px;
    font-weight: 800;
    font-family: var(--font-heading);
}

.doc-price.free {
    color: var(--cta);
}

.doc-price.paid {
    color: var(--primary);
}

/* ============================================================
   FOOTER — Rounded & friendly
============================================================ */
.footer {
    background: linear-gradient(135deg, var(--secondary) 0%, #312E81 100%);
    color: var(--white);
    padding: 60px 0 0;
    margin-top: 40px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.footer-brand .logo {
    color: var(--white);
    margin-bottom: 16px;
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    line-height: 1.8;
}

.footer-links h4,
.footer-contact h4 {
    font-size: 17px;
    font-family: var(--font-heading);
    margin-bottom: 20px;
    color: var(--white);
}

.footer-links ul li {
    margin-bottom: 12px;
}

.footer-links ul li a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 600;
    padding: 4px 0;
    display: inline-block;
}

.footer-links ul li a:hover {
    color: var(--white);
    transform: translateX(4px);
}

.footer-contact p,
.footer-contact a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.footer-bottom {
    padding: 20px 0;
    text-align: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
}

/* Zalo Float — Clay bubble */
.zalo-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), #818CF8);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: var(--clay-lg);
    border: 3px solid rgba(255, 255, 255, 0.4);
    z-index: 999;
    animation: bounce-float 3s ease-in-out infinite;
    cursor: pointer;
}

@keyframes bounce-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 14px 28px;
    border-radius: var(--radius);
    font-weight: 700;
    font-family: var(--font-heading);
    box-shadow: var(--clay-lg);
    border: var(--clay-border);
    z-index: 10000;
    opacity: 0;
    transition: var(--transition-smooth);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-success {
    background: var(--cta-light);
    color: var(--cta-hover);
}

.toast-error {
    background: #FEE2E2;
    color: var(--accent-red);
}

/* Alert */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-weight: 600;
    border: 3px solid transparent;
}

.alert-success {
    background: var(--cta-light);
    color: #065F46;
    border-color: rgba(16, 185, 129, 0.2);
}

/* ============================================================
   DARK MODE COMPONENT OVERRIDES
============================================================ */

/* Smooth transition for theme switching */
body,
.header,
.doc-card,
.search-box,
.filter-section,
.filter-pill,
.dropdown-menu,
.hero,
.footer,
.doc-body,
.doc-footer,
.section-header,
.btn {
    transition: background-color 0.35s ease, color 0.35s ease,
        border-color 0.35s ease, box-shadow 0.35s ease;
}

/* ── Header ── */
[data-theme="dark"] .header {
    background: rgba(12, 18, 34, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

[data-theme="dark"] .nav-link {
    color: #CBD5E1;
}

[data-theme="dark"] .nav-link:hover {
    color: #A5B4FC;
}

[data-theme="dark"] .logo {
    color: #E2E8F0;
}

[data-theme="dark"] .logo-icon {
    background: linear-gradient(135deg, #6366F1, #818CF8);
}

/* ── Search Box ── */
[data-theme="dark"] .search-box {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(148, 163, 184, 0.12);
}

[data-theme="dark"] .search-box:focus-within {
    background: rgba(30, 41, 59, 0.8);
    border-color: #A5B4FC;
    box-shadow: 0 0 0 3px rgba(165, 180, 252, 0.15);
}

[data-theme="dark"] .search-box input {
    color: #F1F5F9;
}

[data-theme="dark"] .search-box input::placeholder {
    color: #64748B;
}

[data-theme="dark"] .search-box i {
    color: #64748B;
}

/* ── Hero Section ── */
[data-theme="dark"] .hero {
    background: linear-gradient(135deg, #0C1222 0%, #1E1B4B 50%, #172554 100%);
}

[data-theme="dark"] .hero::before {
    background: radial-gradient(circle, rgba(165, 180, 252, 0.12), transparent 70%);
}

[data-theme="dark"] .hero::after {
    background: radial-gradient(circle, rgba(110, 231, 183, 0.08), transparent 70%);
}

[data-theme="dark"] .hero-title {
    color: #F8FAFC;
}

[data-theme="dark"] .hero-desc {
    color: #CBD5E1;
}

[data-theme="dark"] .hero-image img {
    border-color: rgba(165, 180, 252, 0.2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .hero-badge {
    background: rgba(26, 35, 50, 0.95);
    border-color: rgba(165, 180, 252, 0.2);
    color: #E2E8F0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .hero-badge i {
    color: #A5B4FC;
}

/* Hero Buttons */
[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, #6366F1, #818CF8);
    color: #FFFFFF;
    border-color: rgba(165, 180, 252, 0.3);
}

[data-theme="dark"] .btn-primary:hover {
    background: linear-gradient(135deg, #818CF8, #A5B4FC);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

[data-theme="dark"] .btn-outline {
    background: transparent;
    border-color: rgba(148, 163, 184, 0.25);
    color: #E2E8F0;
}

[data-theme="dark"] .btn-outline:hover {
    background: rgba(165, 180, 252, 0.1);
    border-color: #A5B4FC;
    color: #A5B4FC;
}

/* ── Filter Section ── */
[data-theme="dark"] .filter-section {
    background: rgba(26, 35, 50, 0.8);
    border-bottom: 1px solid rgba(148, 163, 184, 0.06);
}

[data-theme="dark"] .filter-label {
    color: #94A3B8;
}

[data-theme="dark"] .filter-pill {
    background: rgba(12, 18, 34, 0.6);
    border-color: rgba(148, 163, 184, 0.12);
    color: #CBD5E1;
}

[data-theme="dark"] .filter-pill:hover {
    background: rgba(165, 180, 252, 0.1);
    border-color: rgba(165, 180, 252, 0.3);
    color: #A5B4FC;
}

[data-theme="dark"] .filter-pill.active {
    background: rgba(165, 180, 252, 0.15);
    border-color: #A5B4FC;
    color: #A5B4FC;
}

[data-theme="dark"] .filter-pill .pill-icon {
    background: rgba(165, 180, 252, 0.12);
    border-color: rgba(165, 180, 252, 0.15);
}

/* ── Section Headers ── */
[data-theme="dark"] .section-title {
    color: #F8FAFC;
}

[data-theme="dark"] .section-title::before {
    background: linear-gradient(to bottom, #A5B4FC, #6366F1);
}

[data-theme="dark"] .section-link {
    background: rgba(26, 35, 50, 0.8);
    border-color: rgba(148, 163, 184, 0.12);
    color: #A5B4FC;
}

[data-theme="dark"] .section-link:hover {
    background: rgba(165, 180, 252, 0.1);
    border-color: rgba(165, 180, 252, 0.3);
}

/* ── Document Cards ── */
[data-theme="dark"] .doc-card {
    background: #1A2332;
    border-color: rgba(148, 163, 184, 0.08);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .doc-card:hover {
    border-color: rgba(165, 180, 252, 0.25);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    transform: translateY(-4px);
}

[data-theme="dark"] .doc-thumb {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(56, 189, 248, 0.06));
}

[data-theme="dark"] .doc-body {
    background: #1A2332;
}

[data-theme="dark"] .doc-title {
    color: #F1F5F9;
}

[data-theme="dark"] .doc-title:hover {
    color: #A5B4FC;
}

[data-theme="dark"] .doc-tag {
    background: rgba(12, 18, 34, 0.7);
    border-color: rgba(148, 163, 184, 0.1);
    color: #94A3B8;
}

[data-theme="dark"] .doc-tag.grade {
    background: rgba(165, 180, 252, 0.1);
    color: #A5B4FC;
    border-color: rgba(165, 180, 252, 0.15);
}

[data-theme="dark"] .doc-footer {
    border-top-color: rgba(148, 163, 184, 0.08);
}

[data-theme="dark"] .doc-stats {
    color: #64748B;
}

[data-theme="dark"] .doc-price.free {
    color: #6EE7B7;
}

[data-theme="dark"] .doc-price.paid {
    color: #A5B4FC;
}

[data-theme="dark"] .doc-badge.free {
    background: #059669;
}

[data-theme="dark"] .doc-badge.premium {
    background: #6366F1;
}

[data-theme="dark"] .doc-badge.hot {
    background: #DC2626;
}

/* ── Dropdown Menus ── */
[data-theme="dark"] .dropdown-menu {
    background: #1E293B;
    border-color: rgba(148, 163, 184, 0.1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .dropdown-menu li a {
    color: #CBD5E1;
}

[data-theme="dark"] .dropdown-menu li a:hover {
    background: rgba(165, 180, 252, 0.1);
    color: #A5B4FC;
}

[data-theme="dark"] .dropdown-menu .divider {
    background: rgba(148, 163, 184, 0.08);
}

/* ── User Button ── */
[data-theme="dark"] .user-btn {
    border-color: rgba(148, 163, 184, 0.12);
    background: rgba(26, 35, 50, 0.6);
    color: #E2E8F0;
}

[data-theme="dark"] .user-btn:hover {
    background: rgba(165, 180, 252, 0.08);
    border-color: rgba(165, 180, 252, 0.25);
}

/* ── Footer ── */
[data-theme="dark"] .footer {
    background: linear-gradient(135deg, #060A14 0%, #0C1222 100%);
    border-top: 1px solid rgba(148, 163, 184, 0.06);
}

[data-theme="dark"] .footer-grid {
    border-bottom-color: rgba(148, 163, 184, 0.06);
}

[data-theme="dark"] .footer-brand p {
    color: rgba(226, 232, 240, 0.6);
}

[data-theme="dark"] .footer-links ul li a {
    color: rgba(226, 232, 240, 0.5);
}

[data-theme="dark"] .footer-links ul li a:hover {
    color: #A5B4FC;
}

[data-theme="dark"] .footer-bottom {
    color: rgba(148, 163, 184, 0.4);
}

/* ── Toast & Alert ── */
[data-theme="dark"] .toast-success {
    background: rgba(110, 231, 183, 0.12);
    color: #6EE7B7;
    border-color: rgba(110, 231, 183, 0.15);
}

[data-theme="dark"] .toast-error {
    background: rgba(252, 165, 165, 0.12);
    color: #FCA5A5;
    border-color: rgba(252, 165, 165, 0.15);
}

[data-theme="dark"] .alert-success {
    background: rgba(110, 231, 183, 0.1);
    color: #6EE7B7;
    border-color: rgba(110, 231, 183, 0.15);
}

/* ── Zalo Float ── */
[data-theme="dark"] .zalo-float {
    background: linear-gradient(135deg, #6366F1, #818CF8);
    border-color: rgba(165, 180, 252, 0.3);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

/* ── Mobile Menu ── */
[data-theme="dark"] .mobile-toggle {
    background: rgba(165, 180, 252, 0.1);
    color: #A5B4FC;
}

/* ── Pagination ── */
[data-theme="dark"] .pagination a,
[data-theme="dark"] .pagination span {
    background: #1A2332;
    border-color: rgba(148, 163, 184, 0.1);
    color: #CBD5E1;
}

[data-theme="dark"] .pagination a:hover {
    background: rgba(165, 180, 252, 0.1);
    border-color: #A5B4FC;
    color: #A5B4FC;
}

[data-theme="dark"] .pagination .current {
    background: #6366F1;
    border-color: #6366F1;
    color: #FFFFFF;
}

/* ── General text & links ── */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: #F8FAFC;
}

[data-theme="dark"] a:hover {
    color: #A5B4FC;
}

/* ── Scrollbar ── */
[data-theme="dark"]::-webkit-scrollbar {
    width: 10px;
}

[data-theme="dark"]::-webkit-scrollbar-track {
    background: #0C1222;
}

[data-theme="dark"]::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 5px;
}

[data-theme="dark"]::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 1024px) {
    .doc-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-title {
        font-size: 34px;
    }

    .hero-desc {
        margin: 0 auto 30px;
    }

    .hero-btns {
        justify-content: center;
    }

    .hero-image {
        order: -1;
        max-width: 360px;
        margin: 0 auto;
    }

    .doc-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .main-nav,
    .header-search {
        display: none;
    }

    .mobile-toggle {
        display: flex;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-contact p,
    .footer-contact a {
        justify-content: center;
    }

    .section-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .doc-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 40px 0;
    }

    .hero-title {
        font-size: 28px;
    }

    .filter-pills {
        gap: 8px;
    }

    .header-inner {
        height: 64px;
    }
}

/* ============================================================
   PREFERS REDUCED MOTION
============================================================ */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}