/* ==========================================================================
   Modern enhancements layer
   Additive only — builds on style.css using the existing palette
   (--primary #054f25, --secondary #0f8924, --light-green #eff8ec, --yellow #ffa81d)
   Adds: smooth micro-animations, scroll reveal, unified button styling.
   Covers home, header/footer, course/group/paper/subject listing pages,
   search, inner banners, login/otp, dashboard and exam-result pages.
   The "premium" sales pages (lecture/group, lecture/paper, lecture/subject)
   already ship their own polished, page-scoped styles — rules here are
   deliberately scoped to classes that page does not already own, and the
   page's own <style> block (loaded later via @stack('styles')) always wins
   on a tie, so nothing here can clobber it.
   ========================================================================== */

:root {
  --primary-rgb: 5, 79, 37;
  --secondary-rgb: 15, 137, 36;
  --yellow-rgb: 255, 168, 29;
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

::selection {
  background: var(--secondary);
  color: #fff;
}

/* --------------------------------------------------------------------
   Buttons — one cohesive, theme-colored system
   -------------------------------------------------------------------- */
.btn,
.btn-course,
.btn-purple,
.compare-btn,
.down-app-btn a,
.course-box-view-all,
.site-header__icon-btn {
  position: relative;
  overflow: hidden;
  transition: transform 0.3s var(--ease-smooth), box-shadow 0.3s var(--ease-smooth),
    background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* .main-search / .menu-search buttons are already `position: absolute` in
   style.css to sit inside their search box — keep that, just layer the
   ripple + transition on top without touching position. */
.main-search button,
.menu-search button {
  overflow: hidden;
  transition: transform 0.3s var(--ease-smooth), box-shadow 0.3s var(--ease-smooth),
    background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.btn:active,
.btn-course:active,
.btn-purple:active,
.main-search button:active,
.menu-search button:active {
  transform: scale(0.97);
}

/* Primary call-to-action buttons: replace Bootstrap's default blue with the brand green */
.btn-primary {
  background: linear-gradient(135deg, var(--secondary), var(--primary)) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(var(--secondary-rgb), 0.3);
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
  box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.35);
  transform: translateY(-2px);
}

.btn:focus-visible,
.btn-course:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

/* Hero search button */
.main-search button {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  box-shadow: 0 4px 14px rgba(var(--secondary-rgb), 0.28);
}

.main-search button:hover {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 8px 18px rgba(var(--primary-rgb), 0.32);
  transform: translateY(-50%) scale(1.03);
  top: 50%;
}

.main-search:focus-within {
  box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.18);
}

/* Course / outline buttons get a touch of lift instead of a flat color swap */
.btn-course:hover {
  box-shadow: 0 6px 16px rgba(var(--secondary-rgb), 0.25);
  transform: translateY(-2px);
}

.btn-purple:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(var(--primary-rgb), 0.25);
}

.compare-btn:hover {
  transform: translateY(-1px);
}

.course-box-view-all {
  transition: background-color 0.3s ease, transform 0.35s var(--ease-smooth), box-shadow 0.35s var(--ease-smooth);
}

.course-box-view-all:hover {
  background: var(--secondary);
  color: #fff;
  transform: translateY(-4px);
  box-shadow: 0 14px 24px rgba(var(--secondary-rgb), 0.3);
}

.down-app-btn a {
  display: inline-flex;
}

.down-app-btn a:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

.site-header__icon-btn:hover {
  transform: translateY(-2px);
}

/* Ripple feedback — element is given the `.is-rippling` class briefly on click via JS */
.btn::after,
.btn-course::after,
.main-search button::after,
.menu-search button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
}

.btn.is-rippling::after,
.btn-course.is-rippling::after,
.main-search button.is-rippling::after,
.menu-search button.is-rippling::after {
  animation: ripple-pop 0.55s ease-out;
}

@keyframes ripple-pop {
  0% {
    width: 0;
    height: 0;
    opacity: 0.55;
  }
  100% {
    width: 260px;
    height: 260px;
    opacity: 0;
  }
}

/* --------------------------------------------------------------------
   Secondary CTA buttons across course/exam/profile pages
   -------------------------------------------------------------------- */
.c-btn,
.adc-btn,
.buy-btn,
.login-btn,
.exam-btn-primary,
.dash-btn-outline-light {
  transition: transform 0.3s var(--ease-smooth), box-shadow 0.3s var(--ease-smooth),
    background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.buy-btn,
.login-btn,
.exam-btn-primary {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  border-color: var(--primary);
}

.buy-btn:hover,
.login-btn:hover,
.exam-btn-primary:hover,
.c-btn:hover,
.adc-btn:hover {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  transform: translateY(-3px);
  box-shadow: 0 10px 22px rgba(var(--primary-rgb), 0.28);
}

.dash-btn-outline-light:hover {
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------
   Header — subtle shadow/shrink once the page scrolls
   -------------------------------------------------------------------- */
header.site-header,
header#site-header {
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

header.site-header.is-scrolled,
header#site-header.is-scrolled {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.logo img {
  transition: transform 0.3s var(--ease-smooth);
}

.logo__link:hover img {
  transform: scale(1.04);
}

/* --------------------------------------------------------------------
   Hero — gentle entrance animation (runs once on page load)
   -------------------------------------------------------------------- */


.main h2 {
  animation-delay: 0.2s;
}

.main-search {
  animation-delay: 0.35s;
}

@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.main-pos-1,
.main-pos-2 {
  animation: float-slow 6s ease-in-out infinite;
}

@keyframes float-slow {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-14px);
  }
}

/* --------------------------------------------------------------------
   Inner page banners (course/group/paper/subject/test listing pages)
   -------------------------------------------------------------------- */
.inner-banner {
  overflow: hidden;
}

.inner-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: inherit;
  background-size: cover;
  background-position: center;
  animation: banner-zoom 12s ease-out forwards;
  z-index: 0;
}

/* .inner-banner-img already carries `position: absolute; z-index: 10;` from
   style.css, which is what stretches it to the banner's full height and
   keeps it above the ::before zoom layer — it must stay untouched here. */

.inner-banner h1 {
  animation: hero-rise 0.7s var(--ease-smooth) forwards;
  opacity: 0;
}

@keyframes banner-zoom {
  from {
    transform: scale(1.08);
  }
  to {
    transform: scale(1);
  }
}

.inner-page-title {
  background: linear-gradient(135deg, var(--light-green), #ffffff);
  position: relative;
  overflow: hidden;
}

.inner-page-title h1 {
  animation: hero-rise 0.6s var(--ease-smooth) forwards;
  opacity: 0;
}

/* --------------------------------------------------------------------
   Cards — lift + image zoom on hover
   -------------------------------------------------------------------- */
.course-box {
  transition: transform 0.4s var(--ease-smooth), box-shadow 0.4s var(--ease-smooth);
}

.course-box:hover {
  transform: translateY(-6px);
}

.course-img img {
  transition: transform 0.5s var(--ease-smooth);
}

.course-box:hover .course-img img {
  transform: scale(1.08);
}

.home-strip-cont {
  transition: transform 0.3s var(--ease-smooth);
}

.home-strip-cont i {
  background: var(--light-green);
  transition: transform 0.4s var(--ease-smooth), background-color 0.4s ease, color 0.4s ease;
}

.home-strip:hover .home-strip-cont i,
.home-strip-cont:hover i {
  background: var(--secondary);
  color: #fff;
  transform: rotate(8deg) scale(1.08);
}

.top-cat-cont {
  transition: transform 0.35s var(--ease-smooth), border-color 0.3s ease, box-shadow 0.35s ease;
}

.top-cat-cont:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(var(--secondary-rgb), 0.12);
}

/* --------------------------------------------------------------------
   Plain info cards that don't already carry their own hover treatment
   (the premium/feature/lesson/subject cards on lecture/* sales pages
   already style themselves and are intentionally left alone here)
   -------------------------------------------------------------------- */
.course-price-box,
.c-detail-cont,
.login-cont,
.ans-cont,
.instructions-cont,
.leaders-content,
.joining-cont {
  transition: transform 0.35s var(--ease-smooth), box-shadow 0.35s var(--ease-smooth);
}

.login-cont {
  animation: hero-rise 0.6s var(--ease-smooth) forwards;
}

.course-price-box:hover {
  box-shadow: rgba(var(--secondary-rgb), 0.18) 0px 10px 26px;
  transform: translateY(-3px);
}

.leaders-content {
  border-radius: 8px;
}

.leaders-content:hover {
  transform: translateX(4px);
  box-shadow: 0 6px 16px rgba(var(--secondary-rgb), 0.12);
}

.student-review li {
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.student-review li:hover {
  transform: translateX(4px);
  border-color: var(--secondary);
}

.form-control {
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.form-control:focus {
  box-shadow: 0 0 0 4px rgba(var(--secondary-rgb), 0.12) !important;
}

/* Leaderboard medals: hover pop */
.leaders-list > li {
  transition: transform 0.3s var(--ease-smooth);
}

.leaders-list > li:hover {
  transform: translateY(-5px);
}

.ans-list-title li a {
  transition: color 0.25s ease, transform 0.25s ease;
}

.ans-list-title li a:hover {
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------
   Scroll reveal — progressive enhancement, driven by modern-enhancements.js
   Elements only get the reveal treatment once JS adds `.reveal`,
   so content stays visible with JS disabled.
   -------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s var(--ease-smooth), transform 0.7s var(--ease-smooth);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger.is-visible > * {
  animation: hero-rise 0.6s var(--ease-smooth) backwards;
}

.reveal-stagger.is-visible > *:nth-child(1) { animation-delay: 0.05s; }
.reveal-stagger.is-visible > *:nth-child(2) { animation-delay: 0.12s; }
.reveal-stagger.is-visible > *:nth-child(3) { animation-delay: 0.19s; }
.reveal-stagger.is-visible > *:nth-child(4) { animation-delay: 0.26s; }
.reveal-stagger.is-visible > *:nth-child(5) { animation-delay: 0.33s; }
.reveal-stagger.is-visible > *:nth-child(6) { animation-delay: 0.4s; }
