/* ==============================================
   VARIABLES & THEMES
============================================== */
:root {
    /* Base Font config */
    --font-heading: 'Baloo 2', cursive;
    --font-body: 'Nunito', sans-serif;

    /* Theme Colors */
    --c-primary: #7B61FF;
    --c-primary-light: #A390FF;
    --c-primary-dark: #5A3DE0;
    
    --c-mam-non: #FF6B8B;
    --c-mam-non-light: #FF9EBB;
    
    --c-tieu-hoc: #FFB347;
    --c-tieu-hoc-light: #FFD18C;
    
    --c-thcs: #48C6EF;
    --c-thcs-light: #8FE3FF;
    
    --c-thpt: #18E0B7;
    --c-thpt-light: #89F7DE;

    --c-bg: #F8F9FE;
    --c-text: #2D3748;
    --c-text-muted: #718096;
    --c-white: #FFFFFF;

    /* Shadows & Border Radius */
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-colored: 0 10px 20px rgba(123, 97, 255, 0.2);
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    /* Spacing */
    --container-width: 1200px;
}

/* ==============================================
   RESET & GLOBAL
============================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--c-bg);
    color: var(--c-text);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

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

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ==============================================
   BACKGROUND SHAPES & ANIMATIONS
============================================== */
.bg-animated-shapes {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: floating 20s infinite alternate linear;
}

.shape-1 {
    width: 400px; height: 400px;
    background: var(--c-mam-non-light);
    top: -100px; left: -100px;
}

.shape-2 {
    width: 500px; height: 500px;
    background: var(--c-thcs-light);
    bottom: -200px; right: -100px;
    animation-delay: -5s;
}

.shape-3 {
    width: 300px; height: 300px;
    background: var(--c-tieu-hoc-light);
    top: 30%; right: 10%;
    animation-delay: -10s;
}
.shape-4 {
    width: 350px; height: 350px;
    background: var(--c-thpt-light);
    bottom: 20%; left: 10%;
    animation-delay: -15s;
}

@keyframes floating {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(100px, 150px) rotate(90deg); }
}

/* ==============================================
   HERO / HEADER
============================================== */
.hero {
    padding: 100px 0 60px;
    text-align: center;
    position: relative;
}

.logo-title {
    font-size: 4rem;
    color: var(--c-text);
    margin-bottom: 20px;
}

.logo-title .highlight {
    color: var(--c-primary);
    background: linear-gradient(135deg, var(--c-primary), #FF6B8B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--c-text-muted);
    max-width: 700px;
    margin: 0 auto 40px;
    font-weight: 600;
}

/* Navigation Buttons */
.hero-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.nav-btn {
    padding: 12px 28px;
    border-radius: var(--radius-full);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--c-white);
    background: var(--c-primary);
    box-shadow: var(--shadow-colored);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 2px solid transparent;
}

.btn-mam-non { background: var(--c-mam-non); box-shadow: 0 6px 15px rgba(255,107,139,0.3); }
.btn-tieu-hoc { background: var(--c-tieu-hoc); box-shadow: 0 6px 15px rgba(255,179,71,0.3); }
.btn-thcs { background: var(--c-thcs); box-shadow: 0 6px 15px rgba(72,198,239,0.3); }
.btn-thpt { background: var(--c-thpt); box-shadow: 0 6px 15px rgba(24,224,183,0.3); }

.nav-btn:hover {
    transform: translateY(-5px) scale(1.05);
}

/* ==============================================
   SECTIONS & GRIDS
============================================== */
.main-content {
    padding-bottom: 100px;
}

.level-section {
    margin-top: 80px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px dashed rgba(0,0,0,0.05);
}

.header-icon {
    font-size: 3rem;
    background: var(--c-white);
    width: 80px; height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.section-header h2 {
    font-size: 2.5rem;
}
.section-header p {
    font-size: 1.1rem;
    color: var(--c-text-muted);
}

.theme-mam-non h2 { color: var(--c-mam-non); }
.theme-tieu-hoc h2 { color: var(--c-tieu-hoc); }
.theme-thcs h2 { color: var(--c-thcs); }
.theme-thpt h2 { color: var(--c-thpt); }

/* Grid Layout */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

/* ==============================================
   GAME CARDS
============================================== */
.game-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 30px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    box-shadow: var(--shadow-md);
    border: 2px solid transparent;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 6px;
    height: 100%;
    background: var(--c-primary);
    transition: width 0.3s;
}

.game-card.theme-mam-non::before { background: var(--c-mam-non); }
.game-card.theme-tieu-hoc::before { background: var(--c-tieu-hoc); }
.game-card.theme-thcs::before { background: var(--c-thcs); }
.game-card.theme-thpt::before { background: var(--c-thpt); }

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    background: #fff;
}

.game-card:hover::before {
    width: 10px;
}

.card-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
    width: 60px; height: 60px;
    background: var(--c-bg);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
}

.card-content h3 {
    font-size: 1.35rem;
    margin-bottom: 8px;
    color: var(--c-text);
}

.card-content p {
    color: var(--c-text-muted);
    font-size: 0.95rem;
    line-height: 1.4;
}

.card-badge {
    position: absolute;
    top: 15px; right: -30px;
    background: #FF3B30;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 30px;
    transform: rotate(45deg);
    text-transform: uppercase;
}

/* ==============================================
   FOOTER
============================================== */
.site-footer {
    text-align: center;
    padding: 30px;
    color: var(--c-text-muted);
    font-weight: 600;
}

/* ==============================================
   RESPONSIVE LOGIC
============================================== */
@media (max-width: 768px) {
    .logo-title { font-size: 3rem; }
    .hero-subtitle { font-size: 1rem; }
    .section-header h2 { font-size: 2rem; }
    
    .games-grid {
        grid-template-columns: 1fr;
    }
}
