:root {
    --primary-color: #29568f;
    --secondary-color: #f5a623;
    --white: #fff;
    --text-on-primary: #fff;
    --maxw: 1280px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Sarabun', sans-serif;
    color: var(--dark-gray);
    line-height: 1.6;
}

header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    max-width: 1400px;
    margin: 0 auto;
}

/* ลิงก์ด้านซ้าย: Home, หลักสูตร, เกี่ยวกับเรา, ติดต่อเรา */
.nav-links1 a {
    font-size: 16px;
    display: inline-block;
    padding: 10px 16px;
    font-weight: 500;
    transition: color 0.3s;
    color: #000;
    text-decoration: none;
    margin-left: 10px;
}

.nav-links1 a:hover {
    color: var(--primary-color);
}

.nav-links1 {
    display: flex;
    margin-left: auto;
    gap: 10px;
}

.nav-links2 a {
    background-color: #0f83e2;
    color: #f3eeee;
    padding: 8px 16px;
    border-radius: 5px;
    text-decoration: none;
    margin-left: 10px;
    font-weight: 500;
    transition: 0.3s;
}

/* Loading Screen */
.curve-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
    opacity: 1;
}

.curve-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 150px;
    height: 150px;
    margin-bottom: 30px;
}

.spinner path {
    stroke-width: 8;
    stroke-dasharray: 126;
    animation: dash 2s ease-in-out infinite;
}

.spinner path:nth-child(1){ stroke:#29568f; }

.spinner path:nth-child(2) {
    stroke:#FFC107;
    animation-delay: .3s;
}

@keyframes dash {
    0% {
        stroke-dashoffset: 126;
    }

    50% {
        stroke-dashoffset: 0;
    }

    100% {
        stroke-dashoffset: -126;
    }
}

.loading-text {
    font-size: 1.5rem;
    color: #29568f; 
    font-weight: 500;
    letter-spacing: 1px;
}

/* Hero Split */
/* ซ่อน scrollbar แนวนอน */
html,
body {
    overflow-x: hidden;
}

/* ปรับ  ให้พอดีกับหน้าจอ */
.hero-split {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.hero-content,
.hero-visual {
    flex: 1 1 45%;
    min-width: 300px;
}

/* 1) Background Gradient + Wavy SVG */
.hero-background {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #e3fbf6 0%, #fef3ec 100%);
    /* วาง SVG คลื่นเป็น overlay ด้านบน gradient */
    background-image:
        url("data:image/svg+xml,%3Csvg width='800' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0,100 C200,200 400,0 800,100 L800,200 L0,200 Z' fill='rgba(255,255,255,0.4)'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: top left;
    background-size: cover;
    z-index: 0;
}

/* 2) Shapes ที่ลอยๆ */
.hero-shapes .shape {
    position: absolute;
    border-radius: 50%;
    opacity: .25;
    animation: drift 12s ease-in-out infinite;
}

/* วงกลมใหญ่ซ้ายบน */
.shape--circle {
    width: 250px;
    height: 250px;
    background: #b3d8ff;
    top: 10%;
    left: -5%;
    animation-duration: 16s;
}

/* จุดเล็กๆ */
.shape--dot {
    width: 20px;
    height: 20px;
    background: #3fd1c4;
}

.shape--dot--1 {
    top: 30%;
    left: 25%;
    animation-delay: 2s;
    animation-duration: 10s;
}

.shape--dot--2 {
    bottom: 20%;
    right: 30%;
    background: #8c82ff;
    animation-delay: 4s;
    animation-duration: 14s;
}

/* Drift animation */
@keyframes drift {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(10px, -15px) rotate(8deg);
    }

    50% {
        transform: translate(-10px, 10px) rotate(-5deg);
    }

    75% {
        transform: translate(-5px, -10px) rotate(12deg);
    }

    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

/* เนื้อหาและรูป Hero */
.hero-content {
    position: relative;
    z-index: 1;
    flex: 1;
    max-width: 40%;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-content p {
    margin-bottom: 2rem;
    color: #555;
}

.hero-buttons a {
    display: inline-block;
    margin-right: 1rem;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 500;
    text-decoration: none;
}

.btn-primary {
    background: #3b82f6;
    color: #fff;
}

.btn-secondary {
    border: 2px solid #3b82f6;
    color: #3b82f6;
}

/* รูป Hero */
.hero-visual {
    position: relative;
    z-index: 1;
    flex: 1;
    text-align: right;
}

.hero-visual img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}


/* 1. เพิ่ม keyframes สำหรับอนิเมชัน */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 2. เริ่มต้นให้ card ซ่อนอยู่และเลื่อนไม่ขึ้น */
.feature-card {
    opacity: 0;
    transform: translateY(30px);
}

/* 3. เมื่อการ์ดพร้อมเล่นอนิเมชัน ให้ใส่คลาสนี้ */
.feature-card.animate {
    animation: fadeUp 0.6s ease-out forwards;
}

/* Hero Split */
.hero-split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 80px 5%;
    max-width: 1400px;
    margin: auto;
    gap: 40px;
    opacity: 0;
    transform: translateY(30px);
    transition: all .8s ease-out;
}

.hero-split.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-content {
    flex: 1;
}

.hero-content h1 {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--primary-color);
    animation: fadeInLeft 1s ease-out forwards;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #444;
    animation: fadeInLeft 1s ease-out .3s forwards;
}

.hero-buttons a {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 30px;
    font-weight: 500;
    text-decoration: none;
    margin-right: 16px;
    transition: all .3s;
}

.btn-primary {
    background: #0f83e2;
    color: var(--white);
}

.btn-primary:hover {
    background: #0f83e2;
    transform: translateY(-2px) scale(1.02);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-secondary:hover {
    background: rgba(41, 86, 143, 0.1);
    transform: translateY(-2px);
}

.hero-visual {
    flex: 1;
    text-align: right;
}

.hero-visual img {
    width: 100%;
    max-width: 700px;
    height: auto;
    opacity: 0;
    animation: fadeInRight 1s ease-out .6s forwards;
    display: block;
    margin: 0 auto;
}

@keyframes fadeInLeft {
    from {
        transform: translateX(-50px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeInRight {
    from {
        transform: translateX(50px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* แท็บเล็ต / พิวโต (768px) */
@media (max-width: 768px) {
    .hero-split {
        flex-direction: column;
        padding: 40px 5%;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    /* ทำให้ปุ่มเต็มความกว้าง */
    .hero-buttons a {
        display: block;
        width: 100%;
        margin-bottom: .5rem;
    }
}

/* มือถือเล็ก / สมาร์ทโฟน (576px) */
@media (max-width: 576px) {
    .navbar {
        flex-direction: column;
        gap: .5rem;
    }

    .nav-links1,
    .nav-links2 {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero-content {
        text-align: center;
    }
}

/* Navbar */
header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    max-width: 1400px;
    margin: auto;
}

.logo img {
    height: 60px;
}

.nav-links1 a {
    font-size: 16px;
    font-weight: 500;
    margin-left: 10px;
    text-decoration: none;
    color: #000;
    transition: color .3s;
}

.nav-links1 a:hover {
    color: var(--primary-color);
}

.nav-links2 a {
    background-color: #0f83e2;
    color: #f3eeee;
    padding: 8px 16px;
    border-radius: 5px;
    text-decoration: none;
    margin-left: 10px;
    font-weight: 500;
    transition: all .3s;
}

.login-btn {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 8px 20px;
    border-radius: 5px;
    font-weight: 500;
    transition: background-color .3s;
}

.login-btn:hover {
    background-color: #1e4470;
}

/* Section titles */
.section {
    padding: 60px 5%;
    max-width: 1400px;
    margin: auto;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    color: var(--primary-color);
}

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: auto;
}

.feature-card {
    text-align: center;
    padding: 30px 20px;
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform .3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

/* Courses */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.course-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform .3s, box-shadow .3s;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.course-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.course-info {
    padding: 20px;
}

.course-title {
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--primary-color);
    height: 60px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
}

.course-provider {
    font-size: .9rem;
    color: #666;
    margin-bottom: 5px;
}

.course-publisher {
    font-size: .85rem;
    color: #888;
}

/* Testimonials */
.testimonial-section {
    background-color: #F8F9FA;
    padding: 60px 5%;
}

.testimonials {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    padding: 20px 0;
    max-width: 1200px;
    margin: auto;
}

.testimonial-card {
    min-width: 300px;
    background: var(--white);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.testimonial-text {
    font-style: italic;
    margin-bottom: 20px;
}

.testimonial-author {
    display: flex;
    align-items: center;
}

.testimonial-author img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
}

.author-name {
    font-weight: 500;
    color: var(--primary-color);
}

.author-title {
    font-size: .9rem;
    color: #666;
}

/* Stats */
.stats-section {
    background-color: #29568F;
    color: var(--white);
    padding: 60px 5%;
}

.stats-container {
    display: flex;
    justify-content: space-around;
    max-width: 1200px;
    margin: auto;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 20px;
    opacity: 0;
    transform: translateY(30px);
    transition: all .8s ease;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--secondary-color);
    transition: all .5s ease;
}

.stat-item:hover .stat-number {
    transform: scale(1.1);
}

.stat-label {
    font-size: 1.2rem;
    letter-spacing: 1px;
}

/* News */
.news-section {
    padding: 60px 5%;
    background-color: #f8f9fa;
}

.news-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.news-card {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.news-date {
    color: #666;
    font-size: .9rem;
    margin-bottom: 8px;
}

.news-title {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.news-excerpt {
    color: #555;
    margin-bottom: 15px;
}

.news-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
}

.view-all {
    display: inline-block;
    margin-top: 20px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

/* Partners */
.partners-section {
    padding: 60px 5%;
    text-align: center;
}

.partners-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 30px;
}

.partners-grid img {
    height: 80px;
    opacity: .8;
    transition: opacity .3s;
}

.partners-grid img:hover {
    opacity: 1;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 60px 5% 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    max-width: 1400px;
    margin: auto;
}

.footer-logo img {
    height: 60px;
    margin-bottom: 20px;
}

.footer-links h3,
.footer-contact h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-links h3::after,
.footer-contact h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 2px;
    background-color: var(--secondary-color);
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
    transition: color .3s;
}

.footer-links a:hover {
    color: var(--secondary-color);
}

.contact-info p {
    margin-bottom: 10px;
    display: flex;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    margin-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: .9rem;
}

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
    padding: 16px 5%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    transform: translateY(100%);
    transition: transform .4s ease;
    z-index: 10000;
}

.cookie-banner.visible {
    transform: translateY(0);
}

.cookie-banner p {
    flex: 1 1 60%;
    margin-right: 1rem;
    font-size: .9rem;
    color: #333;
}

.cookie-buttons {
    display: flex;
    gap: .5rem;
}

.cookie-buttons button {
    padding: 8px 16px;
    border: none;
    font-size: .9rem;
    cursor: pointer;
    border-radius: 4px;
}

#cookieSettings {
    background: #444;
    color: #fff;
}

#cookieDecline {
    background: #555;
    color: #fff;
}

#cookieAccept {
    background: #0f83e2;
    color: #fff;
}

/* style.css */

#fatherPopup {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 9999;
}

/* กล่องเนื้อหา */
#fatherPopup .popup-content {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

/* ปุ่มปิด */
#fatherPopup .close-btn {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 1.5rem;
    cursor: pointer;
}

/* เมื่อเปิด popup */
#fatherPopup.open {
    opacity: 1;
    visibility: visible;
}

#fatherPopup.open .popup-content {
    transform: scale(1);
}

/* style.css */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.1s,
        visibility 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.1s;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-dialog {
    position: relative;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    max-width: 800px;
    width: 90%;
    transform: translateY(20px) scale(0.95);
    transition:
        transform 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s,
        opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
    opacity: 0;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-overlay.open .modal-dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    color: #555;
    transition: color 0.2s ease;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    color: #333;
    background: rgba(0, 0, 0, 0.05);
}

/* เพิ่ม animation เมื่อปิด */
.modal-overlay.closing .modal-dialog {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
}