/* ==========================================================================
   TOEFL Mock Test - Shared Stylesheet
   Design System: Navy/Blue/Teal with Sora font
   Built on top of Tailwind CSS utilities
   ========================================================================== */

/* ==========================================================================
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   ========================================================================== */
:root {
  /* Primary */
  --color-navy: #031f42;
  --color-blue: #005bff;

  /* Secondary / Accent */
  --color-teal: #00e2c5;
  --color-gold: #ffd25d;
  --color-lime: #c3f499;

  /* Neutral */
  --color-muted: #5b6d84;
  --color-light-bg: #f4f9ff;
  --color-border: #e6efff;
  --color-border-gray: #e0e3ed;
  --color-white: #ffffff;
  --color-black: #000000;

  /* Typography */
  --font-family: 'Sora', sans-serif;

  /* Transitions */
  --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.645, 0.045, 0.355, 1);
  --duration-fast: 0.2s;
  --duration-normal: 0.3s;
  --duration-slow: 0.4s;
  --duration-slower: 0.6s;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 15px 40px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.12);

  /* Z-index scale */
  --z-dropdown: 100;
  --z-sticky: 500;
  --z-fixed: 1000;
  --z-overlay: 1500;
  --z-modal: 2000;
  --z-toast: 2500;
}

/* ==========================================================================
   2. CSS RESET & BASE STYLES
   ========================================================================== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  color: var(--color-navy);
  background-color: var(--color-white);
}

/* Override Tailwind preflight heading font-size:inherit */
h1, h2, h3, h4, h5, h6 {
  font-size: revert-layer;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Custom selection color */
::selection {
  background-color: var(--color-navy);
  color: var(--color-white);
}

::-moz-selection {
  background-color: var(--color-navy);
  color: var(--color-white);
}

/* ==========================================================================
   3. CUSTOM TEXT SIZES (Responsive with clamp)
   ========================================================================== */
.text-hero {
  font-size: clamp(40px, 5vw, 75px) !important;
  line-height: 1.2;
}

.text-section {
  font-size: clamp(32px, 4vw, 55px) !important;
  line-height: 1.2;
  letter-spacing: -0.9px;
}

.text-sub {
  font-size: clamp(24px, 2.5vw, 35px) !important;
  line-height: 1.2;
}

.text-card-title {
  font-size: 22px !important;
  line-height: 1.3;
}

.text-stat {
  font-size: clamp(36px, 4vw, 55px) !important;
  line-height: 1.2;
}

.text-30 {
  font-size: 30px !important;
  line-height: 1.2;
  letter-spacing: -1.05px;
}

.text-20 {
  font-size: 20px !important;
  line-height: 1.4;
}

/* ==========================================================================
   4. SCROLLBAR STYLING
   ========================================================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: var(--color-navy);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #052d5a;
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-navy) #f1f1f1;
}

/* ==========================================================================
   5. MARQUEE ANIMATIONS
   ========================================================================== */
@keyframes scroll-left {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes scroll-right {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

.marquee-wrap {
  overflow: hidden;
  width: 100%;
}

.marquee-left {
  display: flex;
  width: fit-content;
  animation: scroll-left 60s linear infinite;
}

.marquee-right {
  display: flex;
  width: fit-content;
  animation: scroll-right 60s linear infinite;
}

.marquee-left:hover,
.marquee-right:hover {
  animation-play-state: paused;
}

/* ==========================================================================
   6. FLOAT BOB ANIMATION
   ========================================================================== */
@keyframes float-bob-y {
  0%   { transform: translateY(-30px); }
  50%  { transform: translateY(-10px); }
  100% { transform: translateY(-30px); }
}

.float-bob-y {
  animation: float-bob-y 3s linear infinite;
}

/* ==========================================================================
   7. FADE ANIMATIONS (Scroll-triggered with .visible)
   ========================================================================== */

/* --- Fade In Up --- */
@keyframes fadeInUp {
  0%   { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--duration-slower) ease, transform var(--duration-slower) ease;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Fade In Left --- */
@keyframes fadeInLeft {
  0%   { opacity: 0; transform: translateX(-30px); }
  100% { opacity: 1; transform: translateX(0); }
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

/* --- Fade In Right --- */
@keyframes fadeInRight {
  0%   { opacity: 0; transform: translateX(30px); }
  100% { opacity: 1; transform: translateX(0); }
}

.fade-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* --- Fade In (simple) --- */
@keyframes fadeIn {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}

.fade-in {
  opacity: 0;
  transition: opacity var(--duration-slower) ease;
}

.fade-in.visible {
  opacity: 1;
}

/* ==========================================================================
   8. IMAGE CLIP-PATH ANIMATIONS
   ========================================================================== */
@keyframes img-anim-left {
  0%   { transform: translateX(-5%); clip-path: inset(0 100% 0 0); opacity: 0; }
  100% { transform: translateX(0);   clip-path: inset(0);           opacity: 1; }
}

@keyframes img-anim-top {
  0%   { transform: translateY(-5%); clip-path: inset(0 0 100%); opacity: 0; }
  100% { transform: translateY(0);   clip-path: inset(0);        opacity: 1; }
}

.img-anim-left {
  opacity: 0;
}

.img-anim-left.visible {
  animation: img-anim-left 1.3s var(--ease-bounce) forwards;
}

.img-anim-top {
  opacity: 0;
}

.img-anim-top.visible {
  animation: img-anim-top 1.3s var(--ease-bounce) forwards;
}

/* ==========================================================================
   9. STROKE TEXT EFFECT WITH SHINE ANIMATION
   ========================================================================== */
@keyframes shine {
  0%   { mask-position: 150% center; -webkit-mask-position: 150% center; }
  100% { mask-position: -50% center; -webkit-mask-position: -50% center; }
}

/* Light variant (teal stroke on dark backgrounds) */
.stroke-text {
  -webkit-text-stroke: 1px var(--color-teal);
  color: var(--color-white);
  -webkit-text-fill-color: rgba(0, 0, 0, 0);
  font-weight: 700;
  font-size: clamp(140px, 14vw, 200px);
  line-height: 1.2;
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(-75deg, rgba(255, 255, 255, 0.07) 50%, #fff 50%, rgba(255, 255, 255, 0.07) 70%);
  mask-image: linear-gradient(-75deg, rgba(255, 255, 255, 0.07) 50%, #fff 50%, rgba(255, 255, 255, 0.07) 70%);
  -webkit-mask-size: 200%;
  mask-size: 200%;
  animation: shine 3s linear infinite;
}

/* Dark variant (muted stroke on light backgrounds) */
.stroke-text-dark {
  -webkit-text-stroke: 1px var(--color-muted);
  color: var(--color-white);
  -webkit-text-fill-color: rgba(0, 0, 0, 0);
  font-weight: 700;
  font-size: clamp(140px, 14vw, 200px);
  line-height: 1.2;
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(-75deg, rgba(3, 31, 66, 0.1) 50%, #5b6d84 50%, rgba(3, 31, 66, 0.1) 70%);
  mask-image: linear-gradient(-75deg, rgba(3, 31, 66, 0.1) 50%, #5b6d84 50%, rgba(3, 31, 66, 0.1) 70%);
  -webkit-mask-size: 200%;
  mask-size: 200%;
  animation: shine 3s linear infinite;
}

/* ==========================================================================
   10. HOVER EFFECTS
   ========================================================================== */

/* Button hover — lift + shadow */
.btn-hover {
  transition: all var(--duration-slow) ease-in-out;
}

.btn-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.btn-hover:active {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Card hover — lift + shadow */
.card-hover {
  transition: all var(--duration-slow) ease-in-out;
}

.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

/* Nav link hover */
.nav-hover {
  transition: color var(--duration-normal) ease;
}

.nav-hover:hover {
  color: var(--color-blue) !important;
}

/* Arrow gliding animation */
@keyframes arryUpDown {
  0%   { transform: translateY(-10px); }
  100% { transform: translateY(10px); }
}

/* ==========================================================================
   11. DELAY UTILITY CLASSES
   ========================================================================== */
.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }
.delay-500 { transition-delay: 0.5s; }
.delay-600 { transition-delay: 0.6s; }

/* Animation delay variants */
.anim-delay-100 { animation-delay: 0.1s; }
.anim-delay-200 { animation-delay: 0.2s; }
.anim-delay-300 { animation-delay: 0.3s; }
.anim-delay-400 { animation-delay: 0.4s; }
.anim-delay-500 { animation-delay: 0.5s; }
.anim-delay-600 { animation-delay: 0.6s; }

/* ==========================================================================
   12. SKELETON LOADING ANIMATION
   ========================================================================== */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-border) 25%,
    #dde8f8 37%,
    var(--color-border) 63%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  border-radius: 4px;
}

.skeleton-text:last-child {
  width: 60%;
}

.skeleton-title {
  height: 22px;
  margin-bottom: 12px;
  width: 80%;
  border-radius: 4px;
}

.skeleton-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.skeleton-image {
  width: 100%;
  height: 200px;
  border-radius: 12px;
}

/* ==========================================================================
   13. TOAST NOTIFICATION STYLES
   ========================================================================== */
@keyframes toastSlideIn {
  0%   { transform: translateX(100%); opacity: 0; }
  100% { transform: translateX(0);    opacity: 1; }
}

@keyframes toastSlideOut {
  0%   { transform: translateX(0);    opacity: 1; }
  100% { transform: translateX(100%); opacity: 0; }
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: 12px;
  background: var(--color-white);
  box-shadow: var(--shadow-xl);
  border-left: 4px solid var(--color-blue);
  font-size: 14px;
  color: var(--color-navy);
  pointer-events: auto;
  animation: toastSlideIn 0.4s var(--ease-default) forwards;
  max-width: 380px;
}

.toast.toast-exit {
  animation: toastSlideOut 0.3s var(--ease-default) forwards;
}

.toast-success {
  border-left-color: var(--color-teal);
}

.toast-error {
  border-left-color: #ef4444;
}

.toast-warning {
  border-left-color: var(--color-gold);
}

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.toast-message {
  flex: 1;
  line-height: 1.4;
}

.toast-close {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity var(--duration-fast);
}

.toast-close:hover {
  opacity: 1;
}

/* ==========================================================================
   14. MODAL / OVERLAY STYLES
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 31, 66, 0.6);
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-normal) ease, visibility var(--duration-normal) ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

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

.modal {
  background: var(--color-white);
  border-radius: 20px;
  padding: 40px;
  max-width: 560px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: translateY(20px) scale(0.97);
  transition: transform var(--duration-normal) var(--ease-default);
  z-index: var(--z-modal);
  position: relative;
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-light-bg);
  color: var(--color-navy);
  font-size: 18px;
  transition: background var(--duration-fast);
  cursor: pointer;
}

.modal-close:hover {
  background: var(--color-border);
}

/* ==========================================================================
   15. FOCUS-VISIBLE STYLES (Accessibility)
   ========================================================================== */
:focus-visible {
  outline: 2px solid var(--color-blue);
  outline-offset: 2px;
}

/* Remove default outline for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* Skip-to-content link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  padding: 12px 24px;
  background: var(--color-blue);
  color: var(--color-white);
  border-radius: 8px;
  font-weight: 600;
  z-index: 9999;
  transition: top var(--duration-fast);
}

.skip-link:focus {
  top: 16px;
}

/* ==========================================================================
   16. PRINT STYLES
   ========================================================================== */
@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
    animation: none !important;
    transition: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000 !important;
  }

  a,
  a:visited {
    color: #000 !important;
    text-decoration: underline;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #555;
  }

  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    page-break-inside: avoid;
  }

  p, blockquote, ul, ol {
    orphans: 3;
    widows: 3;
  }

  /* Hide non-essential elements */
  nav,
  footer,
  .toast-container,
  .modal-overlay,
  .marquee-wrap,
  .float-bob-y,
  .no-print {
    display: none !important;
  }

  .print-only {
    display: block !important;
  }
}

/* ==========================================================================
   17. PAGE LOAD FADE-IN ANIMATION
   ========================================================================== */
@keyframes pageLoadFadeIn {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}

.page-load-fade {
  animation: pageLoadFadeIn 0.5s ease forwards;
}

/* Prevent FOUC (flash of unstyled content) */
.js-loading {
  opacity: 0;
}

.js-loaded {
  animation: pageLoadFadeIn 0.4s ease forwards;
}

/* ==========================================================================
   18. COUNTER ANIMATION SUPPORT
   ========================================================================== */
.counter-value {
  display: inline;
  font-variant-numeric: tabular-nums;
}

.counter-wrap {
  overflow: hidden;
  display: inline-flex;
}

/* ==========================================================================
   19. ACCORDION ANIMATION STYLES
   ========================================================================== */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-slow) ease, padding var(--duration-slow) ease;
}

.accordion-content.open {
  max-height: 300px;
  padding-top: 0;
  padding-bottom: 35px;
}

.accordion-icon {
  transition: transform var(--duration-normal) ease;
}

.accordion-icon.rotated {
  transform: rotate(45deg);
}

.accordion-trigger {
  cursor: pointer;
  user-select: none;
}

.accordion-item {
  border-bottom: 1px solid var(--color-border);
}

.accordion-item:last-child {
  border-bottom: none;
}

/* ==========================================================================
   20. TESTIMONIAL SLIDER DOT STYLES
   ========================================================================== */
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-border);
  cursor: pointer;
  transition: all var(--duration-normal) ease;
}

.dot.active {
  background: var(--color-blue);
  width: 30px;
  border-radius: 5px;
}

.dot:hover:not(.active) {
  background: var(--color-muted);
}

.slider-dots {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   21. PROGRESS RING ANIMATION (SVG)
   ========================================================================== */
@keyframes progressRing {
  0%   { stroke-dashoffset: var(--progress-circumference, 283); }
  100% { stroke-dashoffset: var(--progress-offset, 0); }
}

.progress-ring {
  transform: rotate(-90deg);
  transform-origin: center;
}

.progress-ring__circle {
  fill: none;
  stroke: var(--color-border);
  stroke-width: 6;
}

.progress-ring__progress {
  fill: none;
  stroke: var(--color-blue);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s var(--ease-default);
}

.progress-ring__progress--teal {
  stroke: var(--color-teal);
}

.progress-ring__progress--gold {
  stroke: var(--color-gold);
}

/* ==========================================================================
   22. STICKY HEADER
   ========================================================================== */
.header-sticky {
  transition: all var(--duration-normal) ease;
}

.header-sticky.scrolled {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-fixed);
  background: var(--color-white);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   23. TAB COMPONENT
   ========================================================================== */
.tab-btn {
  transition: all var(--duration-normal) ease;
  border-bottom: 3px solid transparent;
}

.tab-btn.active {
  border-bottom-color: var(--color-blue);
  color: var(--color-blue);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* ==========================================================================
   24. REDUCED MOTION PREFERENCES
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .fade-in-up,
  .fade-in-left,
  .fade-in-right,
  .fade-in,
  .img-anim-left,
  .img-anim-top {
    opacity: 1;
    transform: none;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ==========================================================================
   25. UTILITY HELPERS
   ========================================================================== */

/* Visually hidden but accessible to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* No-scroll utility (for modal open state on body) */
.no-scroll {
  overflow: hidden;
}

/* Hidden utility */
.print-only {
  display: none;
}
