/* Design System & CSS Variables */
:root {
    /* Colors - Red and Yellow Theme (Klaeng Vidyastavorn) */
    --primary: #dc2626; /* Crimson Red */
    --primary-light: #ef4444;
    --primary-dark: #991b1b;
    --secondary: #eab308; /* School Yellow */
    --secondary-light: #fde047;
    --secondary-dark: #a16207;
    
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #f8fafc;
    
    /* Typography */
    --font-sans: 'Inter', sans-serif;
    --font-thai: 'Prompt', sans-serif;
    
    /* Layout */
    --max-width: 1200px;
    --header-height: 80px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 20px rgba(251, 191, 36, 0.4);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-spring: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-thai);
    font-weight: 600;
    line-height: 1.2;
    color: var(--primary-dark);
}

p {
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-light);
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 6rem 0;
}

.bg-light {
    background-color: #f1f5f9;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--secondary);
    border-radius: 2px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.125rem;
}

/* Buttons */
.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 500;
    font-size: 1rem;
    transition: all var(--transition-normal);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--text-light) !important;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-light) !important;
    border: 2px solid var(--text-light);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    transition: all var(--transition-normal);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
    height: 70px;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: var(--shadow-md);
}

.logo-text h1 {
    font-size: 1.25rem;
    margin: 0;
    color: var(--primary-dark);
}

.logo-text span {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-main);
    font-weight: 500;
    position: relative;
}

.nav-links a:not(.btn-primary)::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary);
    transition: width var(--transition-normal);
}

.nav-links a:not(.btn-primary):hover::after,
.nav-links a.active:not(.btn-primary)::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 24px;
    position: relative;
    z-index: 1001;
}

.mobile-menu-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--primary-dark);
    position: absolute;
    left: 0;
    transition: all var(--transition-normal);
}

.mobile-menu-btn span:nth-child(1) { top: 0; }
.mobile-menu-btn span:nth-child(2) { top: 11px; }
.mobile-menu-btn span:nth-child(3) { top: 22px; }

.mobile-menu-btn.open span:nth-child(1) {
    transform: rotate(45deg);
    top: 11px;
}
.mobile-menu-btn.open span:nth-child(2) {
    opacity: 0;
}
.mobile-menu-btn.open span:nth-child(3) {
    transform: rotate(-45deg);
    top: 11px;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.98);
    z-index: 999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transform: translateY(-100%);
    transition: transform var(--transition-normal);
}

.mobile-menu-overlay.active {
    transform: translateY(0);
}

.mobile-menu-overlay a {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-dark);
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: var(--header-height);
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/hero.png');
    background-size: cover;
    background-position: center;
    z-index: -2;
    transform: scale(1.05);
    animation: zoomOut 20s infinite alternate;
}

@keyframes zoomOut {
    0% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.4));
    z-index: -1;
}

.hero-content {
    max-width: 800px;
    padding: 0 2rem;
    color: var(--text-light);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 1s ease forwards 0.5s;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
}

.hero-title {
    font-size: clamp(3rem, 5vw, 5rem);
    color: white;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.text-gradient {
    background: linear-gradient(to right, var(--secondary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2.5rem;
    text-shadow: 0 1px 5px rgba(0,0,0,0.5);
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    opacity: 0.7;
    animation: bounce 2s infinite;
}

.mouse {
    width: 26px;
    height: 40px;
    border: 2px solid white;
    border-radius: 13px;
    position: relative;
    margin-bottom: 0.5rem;
}

.wheel {
    width: 4px;
    height: 8px;
    background-color: white;
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 1.5s infinite;
}

@keyframes scroll {
    0% { top: 6px; opacity: 1; }
    100% { top: 18px; opacity: 0; }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) translateX(-50%); }
    40% { transform: translateY(-10px) translateX(-50%); }
    60% { transform: translateY(-5px) translateX(-50%); }
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.about-card {
    background-color: var(--bg-card);
    padding: 3rem 2rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-spring);
    border: 1px solid rgba(0,0,0,0.05);
}

.about-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.icon-wrapper {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(30, 58, 138, 0.1));
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    transition: all var(--transition-normal);
}

.icon-wrapper svg {
    width: 40px;
    height: 40px;
}

.about-card:hover .icon-wrapper {
    background: var(--primary);
    color: white;
    transform: scale(1.1) rotate(5deg);
}

.about-card h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.about-card p {
    color: var(--text-muted);
}

/* Curriculum Section */
.levels-container {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.level-box {
    display: flex;
    align-items: center;
    gap: 3rem;
    background-color: var(--bg-card);
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.level-box:nth-child(even) {
    flex-direction: row-reverse;
}

.level-image {
    flex: 1;
    min-height: 400px;
    background-size: cover;
    background-position: center;
    background-color: var(--primary-light);
}

.m-ton {
    /* Fallback gradients if no image */
    background: linear-gradient(45deg, #3b82f6, #8b5cf6);
}

.m-plai {
    background: linear-gradient(45deg, #10b981, #3b82f6);
}

.level-content {
    flex: 1;
    padding: 3rem;
}

.level-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--primary);
    color: white;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.level-content h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.feature-list {
    margin-top: 1.5rem;
}

.feature-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}

.feature-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--secondary);
    font-weight: bold;
}

/* News Section */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.news-card {
    background-color: var(--bg-card);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
}

.news-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-5px);
}

.news-img {
    height: 200px;
    background-color: #cbd5e1;
}

.img-1 { background: linear-gradient(to right, #64748b, #94a3b8); }
.img-2 { background: linear-gradient(to right, #94a3b8, #cbd5e1); }
.img-3 { background: linear-gradient(to right, #cbd5e1, #e2e8f0); }

.news-content {
    padding: 1.5rem;
}

.news-date {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 500;
    display: block;
    margin-bottom: 0.5rem;
}

.news-content h4 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.read-more {
    display: inline-block;
    margin-top: 1rem;
    font-weight: 600;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    padding: 6rem 0;
    text-align: center;
    color: white;
}

.cta-content h2 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Footer */
.footer {
    background-color: #0f172a;
    color: #cbd5e1;
    padding: 4rem 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-logo {
    width: 50px;
    height: 50px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.footer-info h3 {
    color: white;
    margin-bottom: 0.25rem;
}

.footer-info p.address {
    margin-top: 1rem;
    font-size: 0.875rem;
}

.footer-links h4, .footer-contact h4 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
}

.footer-links ul li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: #cbd5e1;
}

.footer-links a:hover {
    color: var(--secondary);
}

.footer-contact ul li {
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 1.5rem 0;
    text-align: center;
    font-size: 0.875rem;
}

/* Scroll Animations */
.reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s ease;
}

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: all 0.8s ease;
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.8s ease;
}

.reveal-up.active, .reveal-left.active, .reveal-right.active {
    opacity: 1;
    transform: translate(0);
}

/* Responsive */
@media (max-width: 992px) {
    .level-box, .level-box:nth-child(even) {
        flex-direction: column;
    }
    
    .level-image {
        width: 100%;
        min-height: 300px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .section {
        padding: 4rem 0;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
}
