:root {
    --primary-blue: #0052CC;
    --accent-yellow: #FFD100;
    --dark-text: #1a202c;
    --light-text: #f7fafc;
}

html {
    scroll-behavior: smooth;
}

body {
    padding-top: 88px;
    /* Matches header height */
    font-family: 'Inter', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, 'Sukhumvit Set', sans-serif;
    background-color: #f8f9fa;
    color: var(--dark-text);
}

/* Floating Background Animation */
.bg-hero-pattern {
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    position: relative;
}

.blob {
    position: absolute;
    filter: blur(120px);
    /* Much softer blur for premium feel */
    z-index: 0;
    opacity: 0.25;
    /* Subtle opacity */
    animation: float 12s infinite ease-in-out;
    border-radius: 50%;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: #4dabff;
    /* Vibrant Blue */
    animation-delay: 0s;
}

.blob-2 {
    top: 30%;
    right: -10%;
    width: 700px;
    height: 700px;
    background: #ffd93d;
    /* Warmer Yellow */
    animation-delay: 3s;
}

.blob-3 {
    bottom: -10%;
    left: 10%;
    width: 500px;
    height: 500px;
    background: #4dabff;
    animation-delay: 6s;
}

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

    50% {
        transform: translate(20px, -20px) scale(1.1);
    }

    100% {
        transform: translate(0, 0) scale(1);
    }
}

.accent-text {
    color: var(--primary-blue);
}

.accent-yellow-text {
    color: var(--accent-yellow);
}

.btn-primary {
    background-color: var(--primary-blue);
    color: var(--light-text);
    transition: all 0.3s ease;
    font-weight: 600;
    box-shadow: 0 4px 14px 0 rgba(0, 82, 204, 0.39);
}

.btn-primary:hover {
    background-color: #0041a3;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px 0 rgba(0, 82, 204, 0.45);
}

.btn-secondary {
    background-color: var(--accent-yellow);
    color: var(--dark-text);
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: #e6bb00;
    transform: translateY(-2px);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }
}

.section-subtitle {
    font-size: 1.2rem;
    color: #4a5568;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 768px) {
    .section-subtitle {
        font-size: 1rem;
    }
}

.card {
    background: #FFFFFF;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease-in-out;
}

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

.job-card {
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.job-card:hover {
    border-color: var(--primary-blue);
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 82, 204, 0.15);
}

.nav-link {
    position: relative;
    color: var(--dark-text);
    font-weight: 500;
    cursor: pointer;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-blue);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after,
.nav-link.active-menu::after {
    width: 100%;
}

.nav-link.active-menu {
    color: var(--primary-blue);
}

.hero-img {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-img:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.program-card {
    height: 450px;
}

.program-card-content {
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.program-card-content p {
    max-height: 0;
    overflow: hidden;
    margin: 0;
    opacity: 0;
    transition: all 0.4s ease;
}

.program-card:hover .program-card-content p {
    max-height: 100px;
    opacity: 1;
    margin-top: 0.5rem;
}

.program-card-image {
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.program-card:hover .program-card-image {
    transform: scale(1.1);
}

form[aria-busy="true"] {
    opacity: 0.7;
    pointer-events: none;
}

.honeypot-field {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

.testimonial-card {
    transition: all 0.5s ease-in-out;
}

.testimonial-card-image {
    transition: all 0.5s ease-in-out;
}

.testimonial-card.active .testimonial-card-image {
    transform: scale(1.05);
}

@media (max-width: 767px) {
    .testimonial-card .grid {
        flex-direction: column;
    }
}

.post-card-image {
    transition: transform 0.4s ease-in-out;
}

.post-card:hover .post-card-image {
    transform: scale(1.1);
}

/* ---- APPLE STYLE MEGA MENU CSS (Advanced Morphing & Premium Feel) ---- */

/* Shared Mega Menu Container (The white box) */
#mega-menu-container {
    position: absolute;
    top: 0;
    /* Starts at the VERY top of the screen/header */
    left: 0;
    width: 100%;
    overflow: hidden;
    background-color: #FFFFFF;
    /* Strong shadow for the whole panel */
    box-shadow: 0 50px 100px -20px rgba(50, 50, 93, 0.15),
        0 30px 60px -30px rgba(0, 0, 0, 0.15);
    transform-origin: top center;
    opacity: 0;
    visibility: hidden;
    height: 0;
    /* Initial height */
    /* UPDATED: Slower transitions for premium feel */
    transition:
        height 0.7s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.5s ease,
        visibility 0.5s;
    z-index: 40;
    /* Behind the nav items (z-50) */
}

/* Special class for CLOSING via Link Click (Fade Out Only, No Retraction) */
#mega-menu-container.nav-closing {
    transition: opacity 0.5s ease, visibility 0.5s !important;
    opacity: 0 !important;
    visibility: hidden !important;
    /* We purposely ignore height transition here to prevent the 'slide up' effect */
}

/* Active state for the container */
#mega-menu-container.active {
    opacity: 1;
    visibility: visible;
}

/* Individual Content Sections */
.mm-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    /* IMPORTANT: Padding top accommodates the header height (88px) + extra space */
    padding: 110px 0 5rem 0;
    /* Slower fade for content switching */
    transition: opacity 0.4s ease, visibility 0.4s;
    pointer-events: none;
}

.mm-section.active-section {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    position: relative;
    /* To take up space for height calculation */
}

/* Animation: Initial Entry (Slide Down + Fade In) */
.anim-entry .mm-col {
    animation: mmSlideDown 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

@keyframes mmSlideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

/* Stagger delays for Initial Entry */
.anim-entry .mm-col:nth-child(1) {
    animation-delay: 0.1s;
}

.anim-entry .mm-col:nth-child(2) {
    animation-delay: 0.15s;
}

.anim-entry .mm-col:nth-child(3) {
    animation-delay: 0.2s;
}

.anim-entry .mm-col:nth-child(4) {
    animation-delay: 0.25s;
}

/* Seamless Header Integration */
#main-header {
    background-color: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 15px -5px rgba(0, 0, 0, 0.05);
}

body.menu-open #main-header {
    background-color: transparent !important;
    box-shadow: none !important;
    border-bottom-color: transparent !important;
}

/* Page Content Blur Effect */
body.menu-open main,
body.menu-open footer,
body.menu-open #back-to-top {
    filter: blur(12px);
    opacity: 0.7;
    transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Force remove blur immediately when switching page */
body.switching-page main,
body.switching-page footer {
    filter: none !important;
    opacity: 1 !important;
    transition: none !important;
}

.mm-header {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #86868b;
    margin-bottom: 1.5rem;
    display: block;
}

.mm-link {
    display: block;
    font-size: 1rem;
    font-weight: 500;
    color: #1d1d1f;
    margin-bottom: 1rem;
    transition: color 0.2s ease;
    text-decoration: none;
    cursor: pointer;
}

.mm-link:hover {
    color: var(--primary-blue);
}

.mm-sub-text {
    font-size: 0.8rem;
    color: #86868b;
    font-weight: 400;
    margin-left: 0.3rem;
}

.submenu {
    visibility: hidden;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease-in-out;
}

.group\/sub:hover .submenu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

/* .faq-answer styles moved to faq.html inline styles */

#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-blue);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#back-to-top:hover {
    background-color: var(--accent-yellow);
    transform: translateY(-5px);
    color: var(--dark-text);
}

/* New Page Transition Animation - Premium Slow Float */
@keyframes fadeInUpContent {
    0% {
        opacity: 0;
        transform: translateY(30px);
        /* Slightly less distance for subtle feel */
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    /* 1s duration with a very soft ease-out */
    animation: fadeInUpContent 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

/* Scrolled State: Shrink & Frosted Glass */
#main-header.scrolled {
    height: 70px !important;
    /* Shrink height */
    background-color: rgba(255, 255, 255, 0.85) !important;
    /* More transparent */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    /* Soft shadow */
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Logo Adjustment */
#main-header.scrolled .nav-logo img {
    transform: scale(0.9);
    transition: transform 0.5s ease;
}

/* Rotate dropdown arrow on hover or when active */
.group-trigger:hover .fa-chevron-down,
.group-trigger.active .fa-chevron-down {
    transform: rotate(180deg);
}

/* =============================================
   MOBILE MENU - Full Screen Overlay
   ============================================= */

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* Header */
.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
}

.mobile-menu-close {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #64748b;
    background: #f8fafc;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-menu-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Navigation */
.mobile-menu-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

/* Accordion */
.mobile-accordion {
    border-bottom: 1px solid #f1f5f9;
}

.mobile-accordion-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-accordion-icon {
    font-size: 12px;
    color: #94a3b8;
    transition: transform 0.3s ease;
}

.mobile-accordion.active .mobile-accordion-icon {
    transform: rotate(180deg);
}

.mobile-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-accordion.active .mobile-accordion-content {
    max-height: 500px;
}

/* Menu Links */
.mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    font-size: 16px;
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.mobile-menu-link i {
    width: 24px;
    font-size: 14px;
    color: #94a3b8;
}

.mobile-menu-link:hover,
.mobile-menu-link:active {
    color: #3b82f6;
}

.mobile-menu-link:hover i,
.mobile-menu-link:active i {
    color: #3b82f6;
}

.mobile-menu-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 8px 0;
}

/* Direct Links */
.mobile-menu-direct {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    text-decoration: none;
    border-bottom: 1px solid #f1f5f9;
}

.mobile-menu-direct i {
    width: 24px;
    font-size: 16px;
    color: #64748b;
}

.mobile-menu-direct:hover {
    color: #3b82f6;
}

/* Footer */
.mobile-menu-footer {
    padding: 24px;
    border-top: 1px solid #f1f5f9;
}

.mobile-apply-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    font-size: 18px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.mobile-apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

/* Variable Proximity Text Effect */
.focus-line {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0;
}

.focus-char {
    display: inline-block;
    white-space: pre;
    font-weight: 800;
    /* Original Extrabold */
    transition: none;
    /* Removed for direct mouse-response smoothness */
    will-change: transform, font-weight;
}

/* Character scale on direct hover */
.focus-char:hover {
    transform: scale(1.1);
}

/* =============================================
   MOBILE RESPONSIVE - Apple Style Clean Design
   ============================================= */

@media (max-width: 768px) {

    /* Body - reduce padding for mobile header */
    body {
        padding-top: 70px;
        overflow-x: hidden;
    }

    html {
        overflow-x: hidden;
    }

    /* Reduce blob effects on mobile - cleaner look */
    .blob {
        opacity: 0.1;
        filter: blur(80px);
    }

    .blob-1 {
        width: 300px;
        height: 300px;
    }

    .blob-2 {
        width: 350px;
        height: 350px;
    }

    .blob-3 {
        width: 250px;
        height: 250px;
    }

    /* Section titles - more compact */
    .section-title {
        font-size: 1.75rem;
        letter-spacing: -0.02em;
        line-height: 1.2;
    }

    .section-subtitle {
        font-size: 0.95rem;
        margin-bottom: 2rem;
    }

    /* Cards - less dramatic hover */
    .card:hover {
        transform: translateY(-5px);
    }

    /* Post cards - smaller image height */
    .post-card .overflow-hidden {
        height: 180px !important;
    }

    /* Stats frame - more compact on mobile */
    .stats-frame {
        border-radius: 24px !important;
        padding: 20px !important;
    }

    /* Back to top button - smaller on mobile */
    #back-to-top {
        width: 44px;
        height: 44px;
        bottom: 20px;
        right: 20px;
    }

    /* Program Highlights section - cleaner on mobile */
    #program-highlights .absolute {
        opacity: 0 !important;
    }

    #program-highlights>div>div {
        border-radius: 24px !important;
        padding: 24px 16px !important;
        box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08) !important;
    }

    /* Remove inline glow effects */
    #program-highlights [style*="box-shadow"],
    #program-highlights [style*="gradient"] {
        box-shadow: none !important;
    }

    /* Program image - smaller on mobile */
    #program-highlights img {
        height: 200px !important;
        max-width: 280px !important;
    }

    /* Program dots - prevent overflow */
    .program-dots {
        flex-wrap: wrap;
        gap: 8px !important;
        max-width: 100%;
        padding: 0 16px;
    }

    /* Program dots - easier to tap */
    .program-dot {
        width: 10px;
        height: 10px;
    }

    /* Hide decorative gradient backgrounds on mobile */
    #program-highlights .absolute[class*="gradient"],
    #program-highlights div[style*="radial-gradient"],
    #program-highlights div[style*="gradient"] {
        display: none !important;
    }
}

@media (max-width: 480px) {

    /* Extra small screens */
    body {
        padding-top: 60px;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .section-subtitle {
        font-size: 0.9rem;
    }

    /* Blobs - almost invisible on small screens */
    .blob {
        opacity: 0.05;
    }
}