body {
    font-family: 'Kanit', sans-serif;
    scroll-behavior: smooth;
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.grade-section {
    scroll-margin-top: 100px;
}

.chapter-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid #f1f5f9;
}

.chapter-card:hover {
    transform: translateY(-8px);
    border-color: #2563eb;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.05);
}

.grade-card {
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.grade-card:hover {
    transform: translateY(-12px) scale(1.02);
}

.option-btn {
    transition: all 0.2s ease;
    border: 2px solid #f1f5f9;
}

.option-btn.selected {
    border-color: #2563eb;
    background-color: #eff6ff;
}

/* สไตล์พิเศษสำหรับ Navbar Link */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: -5px;
    left: 0;
    background-color: #2563eb;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f8fafc;
}

::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

/* Modal Popup */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: white;
    border-radius: 32px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-overlay.show .modal-box {
    transform: scale(1) translateY(0);
}