/* CSS Variables for Modern Vibrant Theme */
@font-face {
    font-family: 'Angsana New';
    src: url('../Angsana New/Angsana New.woff2') format('woff2'),
        url('../Angsana New/Angsana New.woff') format('woff'),
        url('../Angsana New/Angsana New.ttf') format('truetype'),
        url('../Angsana New/angsana.ttc') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary-blue: #0ea5e9;
    --primary-dark: #0369a1;
    --bg-color: #e0f2fe;
    /* Lighter, slightly more vibrant blue bg */
    --text-main: #0f172a;
    --text-muted: #334155;

    /* Vibrant Accident Colors for Cards */
    --color-content: #f97316;
    /* Orange */
    --color-exercise: #10b981;
    /* Emerald Green */
    --color-quiz: #8b5cf6;
    /* Violet */
    --color-doc: #06b6d4;
    /* Cyan */
    --color-game: #f43f5e;
    /* Rose */


    --card-bg: rgba(255, 255, 255, 0.85);
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.025);
}

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

body {
    font-family: 'Angsana New', 'Sarabun', sans-serif;
    font-size: 22px;
    /* Increased base font size for Angsana New readability */
    /* Vibrant gradient background */
    background: linear-gradient(135deg, #e0f2fe 0%, #bfdbfe 50%, #ddd6fe 100%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Decorative background blobs */
body::before,
body::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.6;
    animation: float 10s ease-in-out infinite alternate;
}

body::before {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: #7dd3fc;
}

body::after {
    bottom: -10%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: #c4b5fd;
    animation-delay: -5s;
}

@keyframes float {
    0% {
        transform: translateY(0) scale(1);
    }

    100% {
        transform: translateY(30px) scale(1.1);
    }
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 1;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 4rem;
    animation: fadeInDown 0.8s ease-out;
}

.header h1 {
    font-size: 5rem;
    /* Increased for Angsana New (equal to ~3.5rem Kanit) */
    /* Gradient Text */
    background: linear-gradient(to right, #0284c7, #4f46e5);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;

    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.header p {
    font-size: 1.7rem;
    /* Increased for Angsana New */
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    font-weight: 400;
}

/* Grid Layout */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

/* Card Styles with Glassmorphism */
.menu-card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 1.5rem;
    padding: 3rem 2rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(255, 255, 255, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s ease-out backwards;
}

/* Stagger card animations */
.menu-card:nth-child(1) {
    animation-delay: 0.1s;
}

.menu-card:nth-child(2) {
    animation-delay: 0.2s;
}

.menu-card:nth-child(3) {
    animation-delay: 0.3s;
}

.menu-card:nth-child(4) {
    animation-delay: 0.4s;
}

.menu-card:nth-child(5) {
    animation-delay: 0.5s;
}


/* Top colored border for cards */
.menu-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    transition: height 0.3s ease;
}

.content-card::after {
    background: linear-gradient(90deg, #fdba74, var(--color-content));
}

.exercise-card::after {
    background: linear-gradient(90deg, #6ee7b7, var(--color-exercise));
}

.quiz-card::after {
    background: linear-gradient(90deg, #c4b5fd, var(--color-quiz));
}

.doc-card::after {
    background: linear-gradient(90deg, #67e8f9, var(--color-doc));
}

.game-card::after {
    background: linear-gradient(90deg, #fda4af, var(--color-game));
}


.menu-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.menu-card:-webkit-any-link:hover {
    text-decoration: none;
}

/* Icon Styles */
.icon {
    margin-bottom: 2rem;
    z-index: 2;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    position: relative;
    background: white;
}

/* Colored Icon Backgrounds & Shadows */
.content-card .icon {
    color: var(--color-content);
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.2);
}

.exercise-card .icon {
    color: var(--color-exercise);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.2);
}

.quiz-card .icon {
    color: var(--color-quiz);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.2);
}

.doc-card .icon {
    color: var(--color-doc);
    box-shadow: 0 8px 20px rgba(6, 182, 212, 0.2);
}

.game-card .icon {
    color: var(--color-game);
    box-shadow: 0 8px 20px rgba(244, 63, 94, 0.2);
}


.menu-card:hover .icon {
    transform: scale(1.1) translateY(-5px) rotate(5deg);
    color: white;
}

/* Icon Hover Backgrounds */
.content-card:hover .icon {
    background: linear-gradient(135deg, #fb923c, var(--color-content));
}

.exercise-card:hover .icon {
    background: linear-gradient(135deg, #34d399, var(--color-exercise));
}

.quiz-card:hover .icon {
    background: linear-gradient(135deg, #a78bfa, var(--color-quiz));
}

.doc-card:hover .icon {
    background: linear-gradient(135deg, #22d3ee, var(--color-doc));
}

.game-card:hover .icon {
    background: linear-gradient(135deg, #fb7185, var(--color-game));
}


/* Text inside cards */
.menu-card h2 {
    font-size: 2.25rem;
    /* Increased for Angsana New */
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 1rem;
    z-index: 2;
}

.menu-card p {
    color: var(--text-muted);
    font-size: 1.4rem;
    /* Increased for Angsana New */
    z-index: 2;
    line-height: 1.5;
}

/* Footer Section */
.footer {
    text-align: center;
    padding-top: 2rem;
    color: var(--text-muted);
    font-size: 1.25rem;
    /* Increased for Angsana New */
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    animation: fadeIn 1s ease-out 0.8s backwards;
}

/* Keyframe Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 2rem 1.5rem;
    }

    .header h1 {
        font-size: 3.5rem;
        /* Adjusted for mobile */
    }

    .header p {
        font-size: 1.4rem;
        /* Adjusted for mobile */
    }

    .menu-grid {
        gap: 1.5rem;
    }

    .menu-card {
        padding: 2.5rem 1.5rem;
    }
}

:root { --color-model: #f59e0b; }
.menu-card:nth-child(5) { animation-delay: 0.5s; }
.menu-card:nth-child(6) { animation-delay: 0.6s; }
.model-card::after { background: linear-gradient(90deg, #fde047, var(--color-model)); }
.model-card .icon { color: var(--color-model); box-shadow: 0 8px 20px rgba(245, 158, 11, 0.2); }
.model-card:hover .icon { background: linear-gradient(135deg, #fbbf24, var(--color-model)); }

.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); text-decoration: none; background: rgba(255, 255, 255, 0.5); padding: 8px 20px; border-radius: 50px; border: 1px solid rgba(0, 0, 0, 0.05); margin-bottom: 2rem; font-size: 1.1rem; transition: all 0.3s ease; backdrop-filter: blur(8px); } .back-link:hover { color: var(--primary-blue); border-color: var(--primary-blue); background: white; transform: translateX(-5px); }
