/* ===== ONES English Center - shared styles ===== */
body {
    font-family: 'Quicksand', sans-serif;
    -webkit-font-smoothing: antialiased;
}

.bg-ones-red { background-color: #D20A11; }
.text-ones-red { color: #D20A11; }
.bg-ones-yellow { background-color: #FFC20E; }
.text-ones-yellow { color: #B8860B; } /* darkened from #FFC20E for readable contrast on white */

/* Header/footer are injected via layout.js, and Tailwind's CDN build applies
   utility styles to newly-inserted elements asynchronously. Without this,
   there's a brief unstyled frame where the mobile menu panel (missing its
   translate-x-full/fixed positioning) flashes fully visible before snapping
   off-screen - looking like the menu opens itself and closes immediately.
   Hidden via our own stylesheet (no Tailwind dependency) until layout.js
   confirms styles are applied and flips visibility back on. */
#site-header, #site-footer {
    visibility: hidden;
}

/* While layout.js is still settling the injected header/footer (see above),
   also kill all transitions on it. If Tailwind resolves the mobile menu's
   transform mid-way through the hidden window, its transition-transform
   class can leave a 300ms slide still in flight; without this, un-hiding
   would reveal the tail end of that slide - the menu visibly sliding shut
   on its own right after the page loads. */
.layout-settling, .layout-settling * {
    transition: none !important;
}

/* NAVBAR GLASS */
nav {
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.75);
}

nav a.nav-active {
    color: #D20A11;
}

/* HERO LIGHT */
.hero-light {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 194, 14, 0.4), transparent 70%);
    top: -100px;
    right: -100px;
    filter: blur(80px);
    z-index: 0;
    pointer-events: none;
}

/* HERO IMAGE */
.hero-visual { perspective: 1000px; }

.hero-visual img {
    width: 100%;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 70%;
    animation: morph 10s ease-in-out infinite;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.15);
    transform: rotateY(-3deg);
    transition: transform 0.3s ease;
}

@keyframes morph {
    0%, 100% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 70%; }
    50% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-visual img { animation: none; }
}

/* SCROLL REVEAL */
.fade-up {
    opacity: 0;
    transform: translateY(40px);
}

.fade-up.show {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s ease;
}

/* CARD */
.card-hover:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.12);
}

/* BUTTON */
.btn-hover:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 20px 40px rgba(210, 10, 17, 0.4);
}

/* FLOAT CARD */
.float-card {
    transition: all 0.4s ease;
    transform: translateY(0) scale(1);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
}

.float-card:hover {
    transform: translateY(-16px) scale(1.02);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 194, 14, 0.2);
}

.float-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at top, rgba(255,194,14,0.2), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.float-card:hover::after { opacity: 1; }

/* Finite attention-grabbers instead of infinite bounce (less distracting, still noticeable) */
.bounce-limited {
    animation: bounce-limited 1s ease-in-out 3;
}

@keyframes bounce-limited {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Visible focus ring for keyboard users (accessibility) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #FFC20E;
    outline-offset: 2px;
}

/* Mobile "Khóa học" submenu accordion */
.mobile-courses-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-courses.open .mobile-courses-panel {
    max-height: 220px;
}

.mobile-courses.open .fa-chevron-down {
    transform: rotate(180deg);
}

/* FAQ accordion */
.faq-item .faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.faq-item.open .faq-answer {
    max-height: 300px;
}

.faq-item .faq-icon {
    transition: transform 0.3s ease;
}

.faq-item.open .faq-icon {
    transform: rotate(45deg);
}

/* Form feedback */
.form-error {
    color: #D20A11;
    font-size: 0.8rem;
    margin-top: 0.375rem;
    display: none;
}

.field-invalid.form-error { display: block; }

.field-invalid-input {
    border-color: #D20A11 !important;
}

#formSuccess, #formFailure {
    display: none;
}
