/* ──────────────────────────────────────────────────────────────────
 * Palette: Royal Purple (Variant A, 2026-04-24)
 *   primary  #5B47CC  — CTA, бренд, акценты навбара
 *   secondary #A89CF0 — мягкие бейджи, hover, вторичный фон
 *   success  #10B981  — статусы успеха, «оригинал диплома»
 *   amber    #F59E0B  — награды, дипломы, топ-места
 * Старые --primary1/2, --accent1..5, --neon-* оставлены как алиасы
 * на новую палитру, чтобы существующие места не сломались.
 * ────────────────────────────────────────────────────────────────── */
:root{
  /* Базовая палитра */
  --color-primary:#5B47CC;
  --color-primary-deep:#3F2EA8;
  --color-primary-soft:rgba(91, 71, 204, 0.10);
  --color-secondary:#A89CF0;
  --color-secondary-soft:rgba(168, 156, 240, 0.18);
  --color-success:#10B981;
  --color-success-deep:#059669;
  --color-amber:#F59E0B;
  --color-amber-deep:#D97706;
  --color-danger:#EF4444;

  /* Поверхности и текст */
  --bg:#F4F6FB;
  --bg2:#EEF1FA;
  --surface:rgba(255,255,255,.82);
  --surface2:rgba(255,255,255,.92);
  --border:rgba(20,20,40,.10);
  --text:#0f172a;
  --muted:#64748b;

  /* Алиасы под старый код */
  --primary1:var(--color-primary);
  --primary2:var(--color-primary-deep);
  --success1:var(--color-success);
  --success2:var(--color-success-deep);
  --danger1:var(--color-danger);
  --danger2:#F87171;
  --accent1:var(--color-amber);
  --accent2:var(--color-secondary);
  --accent3:var(--color-primary);
  --accent4:var(--color-amber);
  --accent5:var(--color-success);
  --neon-blue:var(--color-secondary);
  --neon-purple:var(--color-primary);
  --neon-green:var(--color-success);

  /* Тени, радиусы, градиенты */
  --shadow:0 16px 50px rgba(15, 23, 42, .10);
  --shadow2:0 10px 30px rgba(15, 23, 42, .08);
  --radius:22px;
  --radius-sm:14px;
  --ring:0 0 0 4px rgba(91, 71, 204, .18);
  --grad:linear-gradient(135deg, var(--color-primary), var(--color-primary-deep));
  --grad-soft:linear-gradient(135deg, rgba(91, 71, 204, .14), rgba(168, 156, 240, .10));
  --grad-amber:linear-gradient(135deg, var(--color-amber), var(--color-amber-deep));
  --transition:220ms cubic-bezier(.2,.8,.2,1);
}

html[data-theme="dark"]{
  --bg:#0B0E1A;
  --bg2:#11152A;
  --surface:rgba(17, 24, 39, .62);
  --surface2:rgba(17, 24, 39, .78);
  --border:rgba(255,255,255,.10);
  --text:#E5E7EB;
  --muted:#94A3B8;
  /* В тёмной чуть светлее основной — для контраста на тёмном фоне */
  --color-primary:#7C6AE8;
  --color-primary-deep:#5B47CC;
  --color-primary-soft:rgba(124, 106, 232, 0.18);
  --color-secondary:#A89CF0;
  --color-secondary-soft:rgba(168, 156, 240, 0.22);
  --shadow:0 20px 60px rgba(0,0,0,.40);
  --shadow2:0 12px 35px rgba(0,0,0,.35);
  --ring:0 0 0 4px rgba(124, 106, 232, .22);
  color-scheme: dark;
}

*{box-sizing:border-box}

body{
  background:var(--bg);
  color:var(--text);
  font-family:'Inter',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  min-height:100vh;
  text-rendering:optimizeLegibility;
  -webkit-font-smoothing:antialiased;
}

a{color:inherit}

::selection {
  background-color: #2563eb !important;
  color: #ffffff !important;
}

input::selection,
textarea::selection,
select::selection {
  background-color: #2563eb !important;
  color: #ffffff !important;
}

::-moz-selection {
  background-color: #2563eb !important;
  color: #ffffff !important;
}

input::-moz-selection,
textarea::-moz-selection,
select::-moz-selection {
  background-color: #2563eb !important;
  color: #ffffff !important;
}

:focus-visible {
  outline: 3px solid rgba(14, 165, 233, 0.55);
  outline-offset: 2px;
}

.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.nav-link:focus-visible,
.lang-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.35) !important;
}

.text-muted{color:var(--muted) !important;}

html[data-theme="dark"] .text-muted{
  color:rgba(229,231,235,.72) !important;
}

.container, .main-container{max-width:1200px}

/* Enhanced animations and effects */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33% { transform: translateY(-3px) rotate(1deg); }
  66% { transform: translateY(3px) rotate(-1deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

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

@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px rgba(109, 94, 252, 0.5); }
  50% { box-shadow: 0 0 20px rgba(109, 94, 252, 0.8), 0 0 30px rgba(176, 45, 255, 0.6); }
}

@keyframes neonGlow {
  0%, 100% { 
    box-shadow: 0 0 5px var(--neon-blue), 
                0 0 10px var(--neon-blue), 
                0 0 15px var(--neon-blue),
                0 0 20px var(--neon-blue);
  }
  50% { 
    box-shadow: 0 0 10px var(--neon-purple), 
                0 0 20px var(--neon-purple), 
                0 0 30px var(--neon-purple),
                0 0 40px var(--neon-purple);
  }
}

@keyframes particleFloat {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100vh) rotate(360deg); opacity: 0; }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% { transform: translateY(0); }
  40%, 43% { transform: translateY(-10px); }
  70% { transform: translateY(-5px); }
  90% { transform: translateY(-2px); }
}

@keyframes wiggle {
  0%, 7% { transform: rotateZ(0); }
  15% { transform: rotateZ(-15deg); }
  20% { transform: rotateZ(10deg); }
  25% { transform: rotateZ(-10deg); }
  30% { transform: rotateZ(6deg); }
  35% { transform: rotateZ(-4deg); }
  40%, 100% { transform: rotateZ(0); }
}

/* Enhanced navbar with animations */
.navbar{
  background:linear-gradient(180deg, var(--surface2) 0%, var(--surface) 100%) !important;
  border-bottom:1px solid var(--border) !important;
  box-shadow:var(--shadow2) !important;
  backdrop-filter: blur(18px);
  animation: slideInFromTop 0.6s ease-out;
  position: relative;
  overflow: hidden;
}

.navbar::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-blue), var(--neon-purple), transparent);
  animation: shimmer 3s linear infinite;
}

.navbar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(109, 94, 252, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 80% 50%, rgba(176, 45, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
  animation: pulse 4s ease-in-out infinite;
}

.navbar .nav-link{
  color:var(--muted) !important;
  border:1px solid transparent;
  transition:all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  isolation: isolate;
  z-index: 1;
  overflow: hidden;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.8rem;
}

.navbar .nav-link::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: linear-gradient(45deg, var(--primary1), var(--primary2));
  transform: translate(-50%, -50%);
  transition: all 0.6s;
  z-index: -1;
  pointer-events: none;
}

.navbar .nav-link::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s;
  z-index: -1;
  pointer-events: none;
}

.navbar .nav-link:hover::before {
  width: 150%;
  height: 150%;
}

.navbar .nav-link:hover::after {
  transform: translateX(100%);
}

.navbar .nav-link:hover{
  color:var(--text) !important;
  transform: translateY(-3px) scale(1.05);
  background:var(--grad-soft) !important;
  border-color:var(--border);
  box-shadow: 0 8px 25px rgba(109, 94, 252, 0.3);
  text-shadow: none;
}

.navbar .nav-link.active{
  background:var(--grad) !important;
  color:#fff !important;
  box-shadow:0 10px 30px rgba(109,94,252,.20) !important;
  transform: scale(1.02);
  animation: none;
  text-shadow: none;
}

.navbar-brand-custom{
  background:var(--surface2) !important;
  border:1px solid var(--border) !important;
  box-shadow:0 10px 25px rgba(15, 23, 42, .08);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.navbar-brand-custom::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(109, 94, 252, 0.1), transparent);
  transform: rotate(45deg);
  transition: all 0.6s;
  opacity: 0;
}

.navbar-brand-custom:hover::before {
  opacity: 1;
  animation: gradientShift 3s ease infinite;
}

.navbar-brand-custom:hover { 
  transform: scale(1.08) translateY(-2px); 
  box-shadow: 0 15px 35px rgba(109,94,252,.25) !important;
  border-color: var(--primary1) !important;
  animation: neonGlow 2s ease-in-out infinite;
}

.brand-img {
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 0 10px rgba(109, 94, 252, 0.3));
}

.navbar-brand-custom:hover .brand-img {
  transform: rotate(5deg) scale(1.1);
  filter: drop-shadow(0 0 20px rgba(109, 94, 252, 0.6));
}

html[data-theme="dark"] .navbar-brand-custom{
  background:rgba(255,255,255,.06) !important;
  border-color:rgba(255,255,255,.10) !important;
}

html[data-theme="dark"] .navbar-brand-custom:hover {
  box-shadow: 0 15px 35px rgba(176,45,255,.3) !important;
  border-color: var(--primary2) !important;
}

html[data-theme="dark"] .navbar-brand-custom:hover .brand-img {
  filter: drop-shadow(0 0 20px rgba(176, 45, 255, 0.6));
}

/* Desktop polish: calmer nav/card interactions */
@media (min-width: 992px) {
  .navbar {
    animation: none;
  }

  .navbar::before,
  .navbar::after {
    animation: none;
    opacity: 0.45;
  }

  .navbar .nav-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(109, 94, 252, 0.16);
  }

  .navbar-brand-custom:hover {
    transform: translateY(-1px) scale(1.02);
    animation: none;
    box-shadow: 0 10px 24px rgba(109, 94, 252, 0.16) !important;
  }

  .navbar-brand-custom:hover::before,
  .navbar-brand-custom:hover .brand-img {
    animation: none;
    transform: none;
  }

  .olympiad-card:hover,
  .stat-card:hover {
    transform: translateY(-4px);
  }
}

/* Enhanced theme toggle button */
.theme-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:42px;
  height:42px;
  border-radius:12px;
  border:1px solid var(--border);
  background:var(--surface2);
  color:var(--text);
  box-shadow:0 10px 25px rgba(15, 23, 42, .06);
  transition:all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.theme-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: linear-gradient(45deg, var(--neon-blue), var(--neon-purple));
  transform: translate(-50%, -50%);
  transition: all 0.4s;
  z-index: 0;
}

.theme-btn::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--neon-blue), var(--neon-purple), var(--neon-green));
  border-radius: 12px;
  opacity: 0;
  z-index: -1;
  transition: opacity 0.4s;
  animation: neonGlow 3s ease-in-out infinite;
}

.theme-btn:hover::before {
  width: 100%;
  height: 100%;
}

.theme-btn:hover::after {
  opacity: 1;
}

.theme-btn i {
  position: relative;
  z-index: 1;
  transition: all 0.3s;
  filter: drop-shadow(0 0 5px rgba(109, 94, 252, 0.3));
}

.theme-btn:hover{ 
  transform: translateY(-3px) rotate(180deg); 
  box-shadow: 0 15px 35px rgba(109, 94, 252, 0.4);
  border-color: var(--primary1);
  animation: bounce 1s ease-in-out;
}

.theme-btn:hover i {
  transform: scale(1.2);
  color: white;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.8));
  animation: wiggle 0.5s ease-in-out;
}

/* Hero */
.hero-section{
  position: relative;
  isolation: isolate;
  overflow: hidden;
  text-align: center;
  padding: 64px 44px;
  margin-bottom: 28px;
  background:
    radial-gradient(1200px 520px at -8% -18%, rgba(255,255,255,.22) 0%, transparent 60%),
    radial-gradient(950px 420px at 102% 10%, rgba(255,255,255,.14) 0%, transparent 62%),
    linear-gradient(135deg, #5f57f5 0%, #7a5cf2 45%, #9544f3 100%);
  border:1px solid rgba(255,255,255,.22);
  border-radius: 30px;
  box-shadow:0 22px 56px rgba(95, 87, 245, .26);
  background-size: 130% 130%;
  animation: heroGradientShift 11s ease-in-out infinite;
}

.hero-section::before,
.hero-section::after {
  content: '';
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.hero-sweep {
  position: absolute;
  inset: -40% auto auto -35%;
  width: 50%;
  height: 220%;
  background: linear-gradient(100deg, rgba(255,255,255,0) 20%, rgba(255,255,255,.20) 50%, rgba(255,255,255,0) 80%);
  transform: rotate(14deg) translateX(-120%);
  mix-blend-mode: screen;
  opacity: .65;
  pointer-events: none;
  z-index: 0;
  animation: heroSweep 7.8s ease-in-out infinite;
}

.hero-section::before {
  width: 340px;
  height: 340px;
  border-radius: 50%;
  right: -90px;
  top: -110px;
  background: rgba(255, 255, 255, 0.12);
  filter: blur(2px);
  animation: heroOrbFloatA 9s ease-in-out infinite;
}

.hero-section::after {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  left: -70px;
  bottom: -120px;
  background: rgba(255, 255, 255, 0.08);
  animation: heroOrbFloatB 11s ease-in-out infinite;
}

.hero-title{
  letter-spacing:-.02em;
  font-size: clamp(2rem, 4vw, 3.15rem);
  margin-bottom: 14px;
  text-align: center !important;
  margin-left: auto;
  margin-right: auto;
  color: #ffffff !important;
  text-shadow: 0 10px 26px rgba(17, 24, 39, 0.24);
  position: relative;
  z-index: 1;
  animation: heroItemIn .7s ease both;
}

@keyframes heroGradientShift {
  0% { background-position: 0% 20%; }
  50% { background-position: 100% 80%; }
  100% { background-position: 0% 20%; }
}

@keyframes heroOrbFloatA {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: .95; }
  50% { transform: translate3d(-18px, 14px, 0) scale(1.08); opacity: .72; }
}

@keyframes heroOrbFloatB {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: .82; }
  50% { transform: translate3d(16px, -12px, 0) scale(1.06); opacity: .58; }
}

.hero-subtitle {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  line-height: 1.5;
  max-width: 760px;
  margin: 0 auto;
  text-align: center !important;
  color: rgba(255, 255, 255, 0.92) !important;
  position: relative;
  z-index: 1;
  animation: heroItemIn .7s ease both;
  animation-delay: .12s;
}

.hero-subject-cloud {
  position: relative;
  height: 96px;
  margin: 18px auto 8px;
  max-width: 820px;
  z-index: 1;
  animation: heroItemIn .8s ease both;
  animation-delay: .22s;
}

.hero-cta {
  position: relative;
  z-index: 2;
  animation: heroItemIn .8s ease both;
  animation-delay: .34s;
}

.hero-subject-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: .02em;
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 26px rgba(2, 6, 23, .18);
  white-space: nowrap;
  animation: heroChipFloat 8.6s ease-in-out infinite;
  transition: transform .16s ease-out;
}

.hero-subject-chip i {
  font-size: .86rem;
  opacity: .96;
}

.hero-subject-chip.chip-1 { left: 4%; top: 20px; animation-delay: -0.8s; }
.hero-subject-chip.chip-2 { left: 24%; top: 2px; animation-delay: -2.2s; }
.hero-subject-chip.chip-3 { left: 44%; top: 28px; animation-delay: -4.4s; }
.hero-subject-chip.chip-4 { left: 63%; top: 0; animation-delay: -1.4s; }
.hero-subject-chip.chip-5 { right: 5%; top: 24px; animation-delay: -3.2s; }

@keyframes heroChipFloat {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  25% { transform: translate3d(5px, -6px, 0) scale(1.02); }
  50% { transform: translate3d(-4px, 4px, 0) scale(0.99); }
  75% { transform: translate3d(3px, -3px, 0) scale(1.01); }
}

@keyframes heroSweep {
  0%, 18% { transform: rotate(14deg) translateX(-120%); opacity: 0; }
  30% { opacity: .6; }
  56% { transform: rotate(14deg) translateX(260%); opacity: .3; }
  100% { transform: rotate(14deg) translateX(260%); opacity: 0; }
}

@keyframes heroItemIn {
  from { opacity: 0; transform: translateY(12px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Cards */
.glass-card,
.stat-card,
.olympiad-card,
.reg-card,
.admin-card,
.table-card,
.login-container{
  background:linear-gradient(180deg, var(--surface2) 0%, var(--surface) 100%) !important;
  border:1px solid var(--border) !important;
  box-shadow:var(--shadow) !important;
  border-radius: 24px !important;
  overflow: hidden;
  animation:app_fade_up 420ms ease both;
}

.olympiad-card:hover,
.stat-card:hover{
  transform: translateY(-10px);
}

.bg-icon{color:rgba(255,255,255,.22) !important}

/* Site-wide visual unification for page-level blocks */
.content-card,
.mini-card,
.result-card,
.pay-card,
.login-card,
.choice-card,
.reg-card,
.table-card {
  background: linear-gradient(180deg, var(--surface2) 0%, var(--surface) 100%) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(255,255,255,0.28) inset !important;
  border-radius: 24px !important;
  position: relative;
  overflow: hidden;
}

.content-card::before,
.mini-card::before,
.result-card::before,
.pay-card::before,
.login-card::before,
.choice-card::before,
.reg-card::before,
.table-card::before {
  content: '';
  position: absolute;
  width: 160px;
  height: 160px;
  right: -70px;
  top: -70px;
  border-radius: 50%;
  background: rgba(8, 145, 178, 0.08);
  pointer-events: none;
}

html[data-theme="dark"] .content-card,
html[data-theme="dark"] .mini-card,
html[data-theme="dark"] .result-card,
html[data-theme="dark"] .pay-card,
html[data-theme="dark"] .login-card,
html[data-theme="dark"] .choice-card,
html[data-theme="dark"] .reg-card,
html[data-theme="dark"] .table-card {
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(255,255,255,0.05) inset !important;
}

.btn,
.btn-primary,
.btn-success,
.btn-reg,
.btn-login,
.btn-confirm,
.participate-btn,
.btn-choice {
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}

.btn:hover,
.btn-primary:hover,
.btn-success:hover,
.btn-reg:hover,
.btn-login:hover,
.btn-confirm:hover,
.participate-btn:hover,
.btn-choice:hover {
  transform: translateY(-2px);
  filter: saturate(1.06);
}

.main-container {
  padding-top: 24px;
  padding-bottom: 24px;
}

.hero-section + .row,
.hero-section + .content-card,
.hero-section + .table-card,
.hero-section + .mini-card,
.hero-section + .search-container,
.hero-section + h2 {
  margin-top: 8px;
}

/* Inputs */
.form-control, .form-select, .input-group{
  border-radius:16px !important;
}

.form-control, .form-select{
  background:rgba(255,255,255,.72);
  border-color:var(--border);
  color:var(--text);
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select{
  background:rgba(2, 6, 23, .35);
  border-color:rgba(255,255,255,.12);
  color:var(--text);
}

html[data-theme="dark"] .form-control::placeholder{
  color:rgba(229,231,235,.55);
}

.form-control:focus, .form-select:focus{
  box-shadow:var(--ring) !important;
  border-color:rgba(109,94,252,.55) !important;
}

/* Buttons */
.btn-primary{
  background:var(--grad) !important;
  border:none !important;
  box-shadow:0 14px 35px rgba(109,94,252,.22);
}

.btn-primary:hover{transform:translateY(-2px)}

.participate-btn{
  background:linear-gradient(135deg,var(--success1),var(--success2)) !important;
  box-shadow:0 14px 35px rgba(25,195,125,.22);
}

.participate-btn:hover{transform:translateY(-2px)}

/* Tables */
.table{
  color:var(--text);
}

html[data-theme="dark"] .table{
  color:rgba(229,231,235,.92);
}

.table>:not(caption)>*>*{
  background:transparent;
}

.table thead th{
  color:var(--muted);
  font-weight:800;
  border-bottom:1px solid var(--border) !important;
}

.table tbody td{
  border-color:var(--border) !important;
}

/* Bootstrap table header background (admin questions uses .table-light) */
.table-light{
  --bs-table-bg: rgba(255,255,255,.65);
  --bs-table-striped-bg: rgba(255,255,255,.45);
  --bs-table-striped-color: var(--text);
  --bs-table-active-bg: rgba(109,94,252,.12);
  --bs-table-active-color: var(--text);
  --bs-table-hover-bg: rgba(109,94,252,.10);
  --bs-table-hover-color: var(--text);
}

html[data-theme="dark"] .table-light{
  --bs-table-bg: rgba(17,24,39,.70);
  --bs-table-striped-bg: rgba(17,24,39,.55);
}

/* Admin tabs */
.nav-tabs{
  border-bottom:1px solid var(--border);
}

.nav-tabs .nav-link{
  color:var(--muted);
  border:1px solid transparent;
  border-radius:14px;
  padding:10px 18px;
  font-weight:800;
}

.nav-tabs .nav-link:hover{
  background:var(--grad-soft);
  border-color:var(--border);
  color:var(--text);
}

.nav-tabs .nav-link.active{
  background:var(--grad) !important;
  color:#fff !important;
  border-color:transparent;
  box-shadow:0 10px 30px rgba(109,94,252,.20);
}

/* Badges */
.badge.bg-primary{background:var(--grad) !important;}

/* Card defaults */
.card{
  border-radius:var(--radius);
  border:1px solid var(--border);
  box-shadow:var(--shadow2);
  background:linear-gradient(180deg, var(--surface2) 0%, var(--surface) 100%);
}

/* Footer adaptation */
.footer{
  background:linear-gradient(135deg, var(--bg) 0%, var(--bg2) 100%) !important;
  border-top:1px solid var(--border);
}

html[data-theme="dark"] .footer{
  background:linear-gradient(135deg, var(--bg) 0%, var(--bg2) 100%) !important;
}

.footer .footer-links a{color:var(--muted) !important;}
.footer .footer-links a:hover{color:var(--primary1) !important;}

.footer h5,
.footer p,
.footer .copyright{
  color:var(--text);
}

.footer p,
.footer .footer-links a{
  opacity:.88;
}

html[data-theme="dark"] .footer h5,
html[data-theme="dark"] .footer p,
html[data-theme="dark"] .footer .copyright{
  color:rgba(229,231,235,.85);
}

.footer .social-icon{
  background:rgba(255,255,255,.55);
  border:1px solid var(--border);
  color:var(--text) !important;
}

/* Skeleton loading */
.skeleton {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.22) 25%, rgba(203, 213, 225, 0.42) 50%, rgba(148, 163, 184, 0.22) 75%);
  background-size: 220% 100%;
  animation: skeletonShimmer 1.2s linear infinite;
  border-radius: 12px;
  min-height: 1rem;
}

@keyframes skeletonShimmer {
  from { background-position: 200% 0; }
  to { background-position: -20% 0; }
}

/* Loading button state */
.btn.is-loading {
  opacity: .82;
  pointer-events: none;
  position: relative;
}

.btn.is-loading::after {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,.65);
  border-top-color: transparent;
  border-radius: 50%;
  display: inline-block;
  margin-left: 8px;
  vertical-align: -2px;
  animation: btnSpinner .7s linear infinite;
}

@keyframes btnSpinner {
  to { transform: rotate(360deg); }
}

/* Toasts */
.toast-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 20000;
  max-width: min(92vw, 360px);
}

.oziq-toast {
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface2), var(--surface));
  color: var(--text);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
  font-size: .9rem;
}

.oziq-toast.success { border-color: rgba(22, 163, 74, .45); }
.oziq-toast.error { border-color: rgba(239, 68, 68, .45); }
.oziq-toast.info { border-color: rgba(14, 165, 233, .45); }

/* PWA install button */
.install-app-btn {
  position: fixed;
  right: 18px;
  bottom: 86px;
  z-index: 15000;
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: .82rem;
  color: #fff;
  background: linear-gradient(135deg, #0ea5e9, #22c55e);
  box-shadow: 0 10px 24px rgba(14, 165, 233, 0.35);
}

.install-app-btn[hidden] { display: none !important; }

/* FAQ right visual (index) */
.faq-section {
  position: relative;
}

.faq-lottie-fixed {
  position: absolute;
  left: 1260px;
  top: 50%;
  transform: translateY(-50%);
  width: 460px;
  max-width: 460px;
  z-index: 2;
}

.faq-3d {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.14);
  background: radial-gradient(circle at 30% 20%, rgba(109, 94, 252, 0.18), transparent 55%),
              radial-gradient(circle at 70% 75%, rgba(34, 197, 94, 0.16), transparent 58%),
              rgba(255,255,255,0.03);
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  backdrop-filter: blur(18px);
  position: relative;
  overflow: hidden;
}

.faq-3d::before {
  content: '';
  position: absolute;
  inset: -40% -30% auto auto;
  width: 70%;
  height: 70%;
  background: radial-gradient(circle, rgba(255,255,255,0.14), transparent 70%);
  transform: rotate(12deg);
  pointer-events: none;
}

.faq-3d-lottie {
  width: 100%;
  height: 100%;
  display: block;
}

.faq-3d-lottie > svg {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.faq-3d[data-three-disabled="1"] {
  display: none;
}

@media (max-width: 991px) {
  .faq-lottie-fixed {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .faq-lottie-fixed {
    display: none;
  }
}

html[data-theme="dark"] .footer .social-icon{
  background:rgba(255,255,255,.10);
  border-color:rgba(255,255,255,.10);
  color:#fff !important;
}

/* Admin navbar quick unification */
.navbar.bg-dark,
.navbar-dark.bg-dark{
  background:linear-gradient(135deg, rgba(17,24,39,.90), rgba(2,6,23,.92)) !important;
  border-bottom:1px solid rgba(255,255,255,.10) !important;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  *{animation:none !important; transition:none !important}
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */

/* Tablets and smaller (max-width: 992px) */
@media (max-width: 992px) {
  .container, .main-container {
    max-width: 100%;
    padding: 0 15px;
  }
  
  .hero-section {
    padding: 40px 20px !important;
    margin: 20px 0 !important;
  }
  
  .hero-title {
    font-size: 2rem !important;
  }
  
  .hero-subtitle {
    font-size: 1rem !important;
  }

  .hero-subject-cloud {
    height: 132px;
    max-width: 640px;
  }

  .hero-subject-chip {
    font-size: 0.78rem;
    padding: 8px 12px;
  }

  .hero-subject-chip.chip-1 { left: 4%; top: 8px; }
  .hero-subject-chip.chip-2 { left: 34%; top: 0; }
  .hero-subject-chip.chip-3 { left: 7%; top: 54px; }
  .hero-subject-chip.chip-4 { left: 46%; top: 56px; }
  .hero-subject-chip.chip-5 { right: 6%; top: 16px; }
  
  /* Navigation adjustments */
  .navbar .nav-link {
    font-size: 0.75rem;
    padding: 8px 12px !important;
  }
  
  .navbar-brand-custom {
    padding: 8px 12px !important;
  }
  
  .brand-img {
    height: 35px !important;
  }
  
  /* Cards */
  .glass-card,
  .stat-card,
  .olympiad-card {
    margin-bottom: 15px;
  }
  
  /* Tables */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .table {
    font-size: 0.85rem;
  }
  
  .table th,
  .table td {
    padding: 10px 8px !important;
  }
}

/* Mobile phones (max-width: 768px) */
@media (max-width: 768px) {
  /* Typography */
  body {
    font-size: 14px;
  }

  .container,
  .main-container {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  
  h1 {
    font-size: 1.75rem !important;
  }
  
  h2 {
    font-size: 1.5rem !important;
  }
  
  h3 {
    font-size: 1.25rem !important;
  }
  
  h4 {
    font-size: 1.1rem !important;
  }
  
  /* Hero section */
  .hero-section {
    padding: 30px 15px !important;
    margin: 15px 0 !important;
    border-radius: 16px !important;
  }
  
  .hero-title {
    font-size: 1.75rem !important;
    line-height: 1.2;
  }
  
  .hero-subtitle {
    font-size: 0.9rem !important;
  }

  .hero-subject-cloud {
    height: 120px;
    margin-top: 14px;
  }

  .hero-subject-chip {
    font-size: 0.74rem;
    padding: 7px 11px;
  }

  .hero-subject-chip.chip-1 { left: 4%; top: 0; }
  .hero-subject-chip.chip-2 { left: 40%; top: 4px; }
  .hero-subject-chip.chip-3 { left: 8%; top: 50px; }
  .hero-subject-chip.chip-4 { left: 46%; top: 56px; }
  .hero-subject-chip.chip-5 { display: none; }
  
  /* Navigation - Mobile Menu */
  .navbar {
    padding: 10px 0 !important;
  }
  
  .navbar-collapse {
    width: 100%;
    margin-top: 0;
    border-radius: 0;
  }
  
  .navbar-nav {
    width: 100%;
    align-items: stretch !important;
  }

  .navbar-nav .nav-item {
    width: 100%;
  }
  
  .navbar .nav-link {
    display: block;
    width: 100%;
    text-align: left;
    padding: 13px 14px !important;
    margin: 8px 0;
    border-radius: 12px;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
  }
  
  .navbar .nav-link:hover,
  .navbar .nav-link.active {
    transform: none !important;
  }
  
  .navbar .nav-link i {
    margin-right: 8px;
    width: 20px;
    text-align: center;
  }
  
  .theme-btn {
    width: 100%;
    margin: 12px 0 10px 0;
    padding: 12px !important;
    justify-content: center;
    font-size: 1rem;
  }
  
  .lang-switcher {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    width: 100%;
  }
  
  .lang-btn {
    flex: 1;
    text-align: center;
    padding: 12px 10px !important;
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    border: 2px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s;
  }
  
  .lang-btn:hover {
    transform: scale(1.05);
    border-color: var(--primary1);
  }
  
  .lang-btn.active {
    background: var(--grad) !important;
    color: white !important;
    border-color: transparent;
  }
  
  /* Hamburger menu button */
  .navbar-toggler {
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 10px;
    z-index: 10030;
  }
  
  .navbar-toggler:focus {
    box-shadow: var(--ring);
  }
  
  /* Cards */
  .glass-card,
  .stat-card,
  .olympiad-card,
  .reg-card,
  .admin-card {
    padding: 20px !important;
    margin-bottom: 15px;
    border-radius: 18px !important;
  }
  
  .olympiad-card {
    margin-bottom: 20px;
  }
  
  .olympiad-card:hover {
    transform: translateY(-5px) !important;
  }
  
  /* Stat cards */
  .stat-val,
  .stat-value {
    font-size: 2rem !important;
  }
  
  .stat-label {
    font-size: 0.75rem !important;
  }
  
  /* Buttons - Make them bigger for touch */
  .btn,
  .btn-primary,
  .btn-success,
  .participate-btn {
    padding: 12px 20px !important;
    font-size: 0.95rem !important;
    border-radius: 12px !important;
    min-height: 44px; /* iOS recommended touch target */
  }
  
  .btn-sm {
    padding: 8px 15px !important;
    font-size: 0.85rem !important;
    min-height: 38px;
  }
  
  /* Forms - Bigger inputs for mobile */
  .form-control,
  .form-select {
    padding: 12px 15px !important;
    font-size: 16px !important; /* Prevents zoom on iOS */
    border-radius: 12px !important;
    min-height: 44px;
  }
  
  .form-label {
    font-size: 0.9rem;
    margin-bottom: 8px;
  }
  
  /* Tables - Stack on mobile */
  .table-responsive {
    border-radius: 12px;
    overflow: hidden;
  }
  
  .table {
    font-size: 0.8rem;
  }
  
  .table th,
  .table td {
    padding: 8px 6px !important;
    white-space: nowrap;
  }
  
  /* Hide less important columns on mobile */
  .table .d-none-mobile {
    display: none !important;
  }
  
  /* Modals */
  .modal-dialog {
    margin: 10px;
  }
  
  .modal-content {
    border-radius: 18px !important;
  }
  
  /* Footer */
  .footer {
    padding: 30px 15px !important;
    margin-top: 30px !important;
    text-align: center;
  }
  
  .footer .row > div {
    margin-bottom: 20px;
  }
  
  /* Admin panel adjustments */
  .admin-card {
    overflow-x: auto;
  }
  
  /* Test page */
  .test-container {
    padding: 15px !important;
  }
  
  .question-card {
    padding: 20px 15px !important;
  }
  
  .option-btn {
    padding: 15px !important;
    font-size: 0.9rem !important;
  }
  
  /* Certificate/Diploma */
  .cert-card {
    padding: 20px !important;
    font-size: 0.85rem;
  }
  
  /* Analytics charts */
  .chart-container {
    height: 250px !important;
  }
  
  /* Profile page */
  .profile-card {
    margin-bottom: 15px;
  }
  
  /* Payment page */
  .pay-card {
    padding: 25px 20px !important;
  }

  .table-card,
  .content-card,
  .verify-card,
  .result-card,
  .doc-card {
    padding: 18px 16px !important;
    border-radius: 18px !important;
  }

  .table {
    width: max-content;
    min-width: 100%;
  }

  .whatsapp-btn {
    width: 56px !important;
    height: 56px !important;
    font-size: 30px !important;
    bottom: 18px !important;
    left: 18px !important;
  }

  .qr-wrapper {
    padding: 20px !important;
  }
  
  .qr-frame {
    width: 150px !important;
    height: 150px !important;
  }
  
  .price-tag {
    font-size: 1.8rem !important;
  }
}

/* Small mobile phones (max-width: 480px) */
@media (max-width: 480px) {
  /* Even smaller adjustments */
  .hero-title {
    font-size: 1.5rem !important;
  }
  
  .hero-subtitle {
    font-size: 0.85rem !important;
  }
  
  .stat-val,
  .stat-value {
    font-size: 1.75rem !important;
  }
  
  .btn,
  .btn-primary {
    font-size: 0.9rem !important;
  }
  
  .navbar-brand-custom {
    padding: 6px 10px !important;
  }
  
  .brand-img {
    height: 30px !important;
  }
  
  /* Stack columns */
  .row > [class*='col-'] {
    margin-bottom: 15px;
  }
  
  /* Smaller spacing */
  .mb-3,
  .my-3 {
    margin-bottom: 1rem !important;
  }
  
  .mb-4,
  .my-4 {
    margin-bottom: 1.5rem !important;
  }
  
  .mb-5,
  .my-5 {
    margin-bottom: 2rem !important;
  }
  
  /* Table - even more compact */
  .table {
    font-size: 0.75rem;
  }
  
  .table th,
  .table td {
    padding: 6px 4px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .hero-section {
    padding: 20px 15px !important;
  }
  
  .navbar-collapse {
    max-height: 60vh;
    overflow-y: auto;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  /* Remove hover effects on touch devices */
  .olympiad-card:hover,
  .stat-card:hover {
    transform: none !important;
  }
  
  /* Make interactive elements more obvious */
  .btn,
  .nav-link,
  .form-control {
    -webkit-tap-highlight-color: rgba(109, 94, 252, 0.2);
  }
  
  /* Prevent text selection on buttons */
  .btn,
  .nav-link {
    -webkit-user-select: none;
    user-select: none;
  }
}

/* ============================================
   ENHANCED UI STYLES - Premium Design System
   ============================================ */

/* Improved Button Styles */
.btn {
  font-weight: 700;
  border-radius: 14px;
  padding: 14px 28px;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: var(--grad);
  color: white !important;
  box-shadow: 0 8px 25px rgba(109, 94, 252, 0.25);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(109, 94, 252, 0.35);
}

.btn-success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white !important;
  box-shadow: 0 8px 25px rgba(34, 197, 94, 0.25);
}

.btn-success:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 35px rgba(34, 197, 94, 0.35);
}

.btn-lg {
  padding: 18px 40px;
  font-size: 1.15rem;
  border-radius: 18px;
}

.btn-sm {
  padding: 10px 20px;
  font-size: 0.9rem;
  border-radius: 12px;
}

/* Toast Notifications */
.toast-stack {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
}

.oziq-toast {
  padding: 18px 24px;
  border-radius: 16px;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toastSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
}

.oziq-toast.success {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.95), rgba(22, 163, 74, 0.95));
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.oziq-toast.success::before {
  content: '✓';
  font-size: 1.2rem;
}

.oziq-toast.error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(220, 38, 38, 0.95));
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.oziq-toast.error::before {
  content: '✕';
  font-size: 1.2rem;
}

.oziq-toast.info {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(37, 99, 235, 0.95));
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.oziq-toast.info::before {
  content: 'ℹ';
  font-size: 1.2rem;
}

.oziq-toast.warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.95), rgba(217, 119, 6, 0.95));
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.oziq-toast.warning::before {
  content: '⚠';
  font-size: 1.2rem;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Glass Card - Premium */
.glass-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px);
  transition: all 0.3s ease;
}

.glass-card:hover {
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.12);
}

/* Form Controls - Enhanced */
.form-control,
.form-select {
  padding: 16px 20px;
  border-radius: 14px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary1);
  box-shadow: 0 0 0 4px rgba(109, 94, 252, 0.15);
  outline: none;
}

.form-control::placeholder {
  color: var(--muted);
  font-weight: 400;
}

/* Alert Styles - Modern */
.alert {
  border-radius: 16px;
  padding: 18px 24px;
  border: none;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-success {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(22, 163, 74, 0.1));
  color: #16a34a;
  border-left: 4px solid #22c55e;
}

.alert-danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.15), rgba(220, 38, 38, 0.1));
  color: #dc2626;
  border-left: 4px solid #ef4444;
}

.alert-warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.1));
  color: #b45309;
  border-left: 4px solid #f59e0b;
}

.alert-info {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.1));
  color: #2563eb;
  border-left: 4px solid #3b82f6;
}

/* Spacing - More Air */
.section-spacing {
  padding: 80px 0;
}

.section-spacing-sm {
  padding: 50px 0;
}

/* Typography - Premium */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 15px;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 40px;
}

/* Badge Styles */
.badge-premium {
  padding: 8px 16px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-gold {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #78350f;
}

.badge-silver {
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  color: #475569;
}

.badge-bronze {
  background: linear-gradient(135deg, #fb923c, #ea580c);
  color: #431407;
}

/* Mobile Toast */
@media (max-width: 768px) {
  .toast-stack {
    left: 15px;
    right: 15px;
    bottom: 20px;
    max-width: none;
  }
  
  .oziq-toast {
    padding: 14px 18px;
    font-size: 0.9rem;
  }
  
  .btn {
    padding: 12px 24px;
  }
  
  .btn-lg {
    padding: 16px 32px;
  }
  
  .glass-card {
    padding: 24px;
    border-radius: 20px;
  }
  
  .section-title {
    font-size: 1.8rem;
  }
}

/* ============================================
   LIVE UI ANIMATIONS - Modern Interactive Design
   ============================================ */

/* Button Click Animation */
.btn:active {
  transform: scale(0.96) !important;
  transition: transform 0.1s ease;
}

/* Card Hover Animations */
.card-animated,
.olympiad-card,
.glass-card,
.info-card,
.diploma-card,
.review-card,
.partner-item {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-animated:hover,
.olympiad-card:hover,
.diploma-card:hover,
.review-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 50px rgba(15, 23, 42, 0.15);
}

.partner-item:hover {
  transform: translateY(-6px) scale(1.02);
}

/* Ripple Effect for Buttons */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(255,255,255,0.3) 10%, transparent 10.01%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(10, 10);
  opacity: 0;
  transition: transform 0.5s, opacity 0.8s;
}

.btn-ripple:active::after {
  transform: scale(0, 0);
  opacity: 0.3;
  transition: 0s;
}

/* Input Focus Animation */
.form-control-animated,
.form-control,
.form-select {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-control:focus,
.form-select:focus {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(109, 94, 252, 0.15), 0 0 0 4px rgba(109, 94, 252, 0.1);
}

/* Floating Labels Animation */
.form-floating label {
  transition: all 0.3s ease;
}

/* Icon Bounce on Hover */
.icon-bounce:hover i,
.icon-bounce:hover .fa,
.icon-bounce:hover .fas {
  animation: iconBounce 0.5s ease;
}

@keyframes iconBounce {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-5px); }
  50% { transform: translateY(0); }
  75% { transform: translateY(-3px); }
}

/* Pulse Animation for CTAs */
.pulse-animation {
  animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(109, 94, 252, 0.4);
  }
  50% {
    box-shadow: 0 0 0 15px rgba(109, 94, 252, 0);
  }
}

/* Success Checkmark Animation */
@keyframes checkmark {
  0% { stroke-dashoffset: 100; }
  100% { stroke-dashoffset: 0; }
}

.success-checkmark {
  animation: checkmark 0.5s ease-in-out forwards;
}

/* Fade In Up Animation */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s ease forwards;
}

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

/* Fade In Scale Animation */
.fade-in-scale {
  opacity: 0;
  transform: scale(0.9);
  animation: fadeInScale 0.5s ease forwards;
}

@keyframes fadeInScale {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Stagger Animation for Lists */
.stagger-item {
  opacity: 0;
  transform: translateY(20px);
}

.stagger-item.animate {
  animation: staggerFadeIn 0.5s ease forwards;
}

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

/* Page Transition */
.page-transition {
  animation: pageSlideIn 0.4s ease-out;
}

@keyframes pageSlideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading Spinner */
.spinner-modern {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary1);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Skeleton Loading Animation */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: skeletonLoading 1.5s infinite;
  border-radius: 8px;
}

@keyframes skeletonLoading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Decorative Line Animation */
.animated-line {
  position: relative;
  overflow: hidden;
}

.animated-line::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: var(--grad);
  animation: lineSlide 3s ease-in-out infinite;
}

@keyframes lineSlide {
  0%, 100% { left: -100%; }
  50% { left: 100%; }
}

/* Floating Decoration */
.floating-element {
  animation: floatUpDown 4s ease-in-out infinite;
}

@keyframes floatUpDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

/* Gradient Background Animation */
.gradient-animated {
  background: linear-gradient(-45deg, var(--primary1), var(--primary2), #0891b2, #22c55e);
  background-size: 400% 400%;
  animation: gradientMove 8s ease infinite;
}

/* Alternate section background */
.alt-section {
  position: relative;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.10), rgba(168, 85, 247, 0.10));
  padding: 64px 0;
  margin: 70px 0;
  overflow: hidden;
}

html[data-theme="dark"] .alt-section {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.22), rgba(168, 85, 247, 0.18));
}

.alt-section::before,
.alt-section::after {
  content: '';
  position: absolute;
  left: -2%;
  width: 104%;
  height: 46px;
  background: var(--surface);
  border-radius: 999px;
  filter: blur(0.2px);
}

.mid-gradient-section {
  position: relative;
  padding: 86px 0;
  margin: 80px auto;
  overflow: hidden;
  background: radial-gradient(1100px 420px at 50% 20%, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 65%),
              linear-gradient(120deg, rgba(34, 211, 238, 0.35) 0%, rgba(168, 85, 247, 0.35) 42%, rgba(236, 72, 153, 0.32) 100%);
  border-radius: 32px;
  max-width: calc(100% - 32px);
  margin-left: auto;
  margin-right: auto;
}

html[data-theme="dark"] .mid-gradient-section {
  background: radial-gradient(1000px 420px at 50% 20%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 65%),
              linear-gradient(120deg, rgba(34, 211, 238, 0.22) 0%, rgba(168, 85, 247, 0.22) 42%, rgba(236, 72, 153, 0.20) 100%);
}

.prefooter-gradient::before,
.prefooter-gradient::after {
  content: '';
  position: absolute;
  left: -2%;
  width: 104%;
  height: 46px;
  background: var(--surface);
  border-radius: 999px;
  filter: blur(0.2px);
}

.prefooter-gradient {
  position: relative;
  padding: 78px 0;
  margin-top: 84px;
  overflow: hidden;
  background: radial-gradient(1000px 380px at 50% 20%, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0) 68%),
              linear-gradient(135deg, rgba(91, 71, 204, 0.10) 0%, rgba(168, 156, 240, 0.18) 100%);
}

html[data-theme="dark"] .prefooter-gradient {
  background: radial-gradient(1000px 380px at 50% 20%, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 68%),
              linear-gradient(135deg, rgba(91, 71, 204, 0.18) 0%, rgba(168, 156, 240, 0.10) 100%);
}

.prefooter-gradient::before {
  top: -24px;
}

.prefooter-gradient::after {
  bottom: -24px;
}

html[data-theme="dark"] .mid-gradient-section::before,
html[data-theme="dark"] .mid-gradient-section::after,
html[data-theme="dark"] .prefooter-gradient::before,
html[data-theme="dark"] .prefooter-gradient::after {
  background: #0b1220;
}

@media (max-width: 768px) {
  .mid-gradient-section { padding: 56px 16px; margin: 62px auto; border-radius: 24px; max-width: calc(100% - 24px); }
  .prefooter-gradient { padding: 54px 0; margin-top: 64px; }
}

.alt-section::before {
  top: -24px;
}

.alt-section::after {
  bottom: -24px;
}

html[data-theme="dark"] .alt-section::before,
html[data-theme="dark"] .alt-section::after {
  background: #0b1220;
}

@media (max-width: 768px) {
  .alt-section {
    padding: 44px 0;
    margin: 56px 0;
  }
}

@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Number Counter Animation */
.counter-animated {
  display: inline-block;
  animation: counterPop 0.5s ease;
}

@keyframes counterPop {
  0% { transform: scale(0.5); opacity: 0; }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

/* Modal Animations */
.modal-animated {
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-backdrop-animated {
  animation: backdropFadeIn 0.3s ease;
}

@keyframes backdropFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Notification Badge Bounce */
.badge-notification {
  animation: badgeBounce 0.5s ease;
}

@keyframes badgeBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* Link Underline Animation */
.link-animated {
  position: relative;
  text-decoration: none;
}

.link-animated::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary1);
  transition: width 0.3s ease;
}

.link-animated:hover::after {
  width: 100%;
}

/* Tab Switch Animation */
.tab-content-animated {
  animation: tabFadeIn 0.3s ease;
}

@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Success State Animation */
.success-state {
  animation: successPulse 0.6s ease;
}

@keyframes successPulse {
  0% { transform: scale(1); }
  25% { transform: scale(1.05); background-color: rgba(34, 197, 94, 0.1); }
  50% { transform: scale(1); }
  75% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* Error Shake Animation */
.error-shake {
  animation: errorShake 0.5s ease;
}

@keyframes errorShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========================================
   ADMIN PANEL - DISABLE ALL ANIMATIONS
   ======================================== */
body.admin-page .card-animated,
body.admin-page .card,
body.admin-page .table,
body.admin-page .table tr,
body.admin-page .table td,
body.admin-page .form-control,
body.admin-page .form-select,
body.admin-page .btn,
body.admin-page .nav-link,
body.admin-page .stat-card,
body.admin-page [class*="card"] {
  transform: none !important;
  animation: none !important;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease !important;
}

body.admin-page .card-animated:hover,
body.admin-page .card:hover,
body.admin-page .table tr:hover,
body.admin-page .table td:hover,
body.admin-page .form-control:hover,
body.admin-page .form-control:focus,
body.admin-page .form-select:hover,
body.admin-page .form-select:focus,
body.admin-page [class*="card"]:hover {
  transform: none !important;
  box-shadow: none !important;
}

body.admin-page .table-hover tbody tr:hover td {
  transform: none !important;
  box-shadow: none !important;
}
