/* --- Global Styles & Fonts --- */
body {
    font-family: 'Kanit', sans-serif;
    scroll-behavior: smooth;
}

/* --- Particle Background --- */
#particle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: floatUp linear infinite;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.3), 0 0 10px rgba(255, 255, 255, 0.2);
}

@keyframes floatUp {
    0% {
        transform: translateY(100vh) translateX(var(--drift-x, 0)) scale(0.5);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-10vh) translateX(calc(var(--drift-x, 0) * 1.5)) scale(1.2);
        opacity: 0;
    }
}

/* --- Rainbow Text Animation (NEW STABLE FIX) --- */
.rainbow-text-animated {
    /* This new hue-rotate method is more stable for rendering Thai vowels */
    color: #f56565; /* Initial color */
    animation: rainbowHueRotate 8s linear infinite;
}

@keyframes rainbowHueRotate {
    0%   { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(180deg); }
    100% { filter: hue-rotate(360deg); }
}


/* --- Rainbow Border Animation for Logo --- */
.rainbow-border-animated {
    border: 3px solid transparent;
    border-radius: 50%;
    padding: 2px;
    position: relative;
    overflow: hidden;
}

.rainbow-border-animated::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: conic-gradient(
        #ff7e5f, #feb47b, #f6e58d, #82e0aa, #7ed6df, #4834d4, #be2edd, #ff7e5f
    );
    animation: spinBorder 5s linear infinite;
    z-index: -1;
}

@keyframes spinBorder {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Hover Float and Scale Effect --- */
.hover-float-scale {
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}

.hover-float-scale:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3), 0 8px 15px rgba(255, 215, 0, 0.2);
}

/* --- Promotion Banner Specific Style --- */
.promotion-banner {
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.promotion-banner p {
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

/* --- Glass Effect for Cards/Sections --- */
.glass-effect {
    background: rgba(41, 41, 56, 0.6);
    backdrop-filter: blur(12px) saturate(150%);
    -webkit-backdrop-filter: blur(12px) saturate(150%);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* --- Dropdown Menu Content --- */
.dropdown-content {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.group:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* --- Video Placeholder --- */
.video-placeholder {
    background: linear-gradient(45deg, #232526, #414345);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 1.5rem; 
    position: relative; 
}

.video-placeholder::before {
    content: '🎬'; 
    font-size: 4rem; 
    opacity: 0.3;
}

/* --- Table Styling --- */
table th, table td {
    transition: background-color 0.2s ease-in-out;
}

/* --- Button Styles --- */
.rainbow-button {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* --- Ripple Effect --- */
.ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* --- Mobile Menu --- */
#mobile-menu.hidden {
    display: none;
}
#mobile-menu .group .hidden { 
    display: none;
}
#mobile-menu .group .block { 
    display: block;
}

/* --- Active Navigation Link Styles --- */
.active-nav-link-page { /* For general page link and active dropdown button */
    color: #FDE047 !important; /* yellow-300, !important to override Tailwind hover */
    font-weight: 600 !important; /* semibold */
}
.active-nav-link-dropdown { /* For active item within dropdown */
     color: #FDE047 !important; /* yellow-300 */
     background-color: rgba(253, 224, 71, 0.15) !important; /* Slightly more visible */
     font-weight: 500 !important;
}


/* --- Tailwind Aspect Ratio Plugin Fallback --- */
.aspect-w-16 { --tw-aspect-w: 16; }
.aspect-h-9 { --tw-aspect-h: 9; }
.aspect-w-16.aspect-h-9 > * {
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}
.aspect-w-16.aspect-h-9 {
    position: relative;
    padding-bottom: calc(var(--tw-aspect-h) / var(--tw-aspect-w) * 100%);
}

/* --- Responsive Design Adjustments --- */
@media (max-width: 768px) { 
    .promotion-banner p {
        font-size: 1.5rem; 
    }
    .text-5xl {
        font-size: 2.5rem; 
    }
    .text-3xl {
        font-size: 1.875rem; 
    }
    .py-12 {
        padding-top: 2rem; 
        padding-bottom: 2rem; 
    }
    .mb-16 {
        margin-bottom: 3rem; 
    }
    .mb-10 {
        margin-bottom: 2rem; 
    }
    main.container {
        padding-top: 2rem; 
        padding-bottom: 2rem;
    }
    header .container {
        padding-left: 1rem; 
        padding-right: 1rem; 
    }
    .space-y-8 > :not([hidden]) ~ :not([hidden]) { 
        --tw-space-y-reverse: 0;
        margin-top: calc(1.5rem * calc(1 - var(--tw-space-y-reverse))); 
        margin-bottom: calc(1.5rem * var(--tw-space-y-reverse));
    }
}

@media (max-width: 480px) { 
    .promotion-banner p {
        font-size: 1.25rem; 
    }
    .text-5xl {
        font-size: 2rem;
    }
    .text-3xl {
        font-size: 1.5rem;
    }
    .py-3\.5 { 
        padding-top: 0.75rem; 
        padding-bottom: 0.75rem; 
    }
    .px-10 { 
        padding-left: 1.5rem; 
        padding-right: 1.5rem; 
    }
    .py-4 { 
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
    .px-12 { 
        padding-left: 2rem;
        padding-right: 2rem;
    }
    .text-xl { 
        font-size: 1rem;
    }
}
