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


/* ===== LIGHT THEME (default) ===== */
:root {
  --green-900: #064e3b;
  --green-800: #065f46;
  --green-700: #047857;
  --green-600: #059669;
  --green-500: #10b981;
  --green-400: #34d399;
  --green-300: #6ee7b7;
  --green-200: #a7f3d0;
  --green-100: #d1fae5;
  --green-50:  #ecfdf5;
  --white:     #ffffff;
  --gray-50:   #f9fafb;
  --gray-100:  #f3f4f6;
  --gray-200:  #e5e7eb;
  --gray-600:  #4b5563;
  --gray-700:  #374151;
  --gray-800:  #1f2937;
  --gray-900:  #111827;
  --bg:        #ffffff;
  --bg-alt:    #f9fafb;
  --bg-green:  #ecfdf5;
  --text-secondary: #6b7280;
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.12);
  --card-bg:   #edf0f3;
  --card-shadow: rgba(0,0,0,.10);
  --card-shadow-hover: rgba(0,0,0,.16);
  --text:      #1f2937;
  --text-muted: #4b5563;
  --border:    #e5e7eb;
  --nav-scrolled-bg: rgba(255,255,255,.7);
  --nav-scrolled-shadow: rgba(0,0,0,.08);
  --input-bg:  #fafbfc;
  --footer-bg: #064e3b;
  --marquee-bg: #059669;
  --deco-glow-strong: rgba(16,185,129,.24);
  --deco-glow-mid: rgba(52,211,153,.18);
  --deco-glow-soft: rgba(16,185,129,.10);
  --deco-blob-strong: rgba(16,185,129,.22);
  --deco-blob-mid: rgba(52,211,153,.14);
  --deco-blob-soft: rgba(16,185,129,.08);
  --deco-ring-border: rgba(16,185,129,.18);
  --deco-ring-dash: rgba(16,185,129,.14);
  --deco-dot-opacity: 0.28;
  --deco-cross-opacity: 0.22;
  --section-treneri-top:    #ecfdf5;
  --section-treneri-bottom: #d1fae5;
  --section-teretane-top:   #f0fdfa;
  --section-teretane-bottom:#d5f5f0;
  --section-sportovi-top:   #ecfdf5;
  --section-sportovi-bottom:#d1fae5;
  --section-testimonials-top:  #f0fdfa;
  --section-testimonials-bottom:#d5f5f0;
  --partners-marquee-bg:   #065f46;
  --section-kontakt-top:    #ede9fe;
  --section-kontakt-bottom: #ddd6fe;
}

/* ===== DARK THEME ===== */
[data-theme="dark"] {
  --bg:        #0f1419;
  --bg-alt:    #1a1f2e;
  --bg-green:  #0d1f17;
  --text-secondary: #9ca3af;
  --shadow-md: 0 4px 12px rgba(0,0,0,.3);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.4);
  --card-bg:   #121724;
  --card-shadow: rgba(0,0,0,.4);
  --card-shadow-hover: rgba(16,185,129,.08);
  --text:      #e5e7eb;
  --text-muted: #9ca3af;
  --border:    #2d3748;
  --gray-50:   #1a1f2e;
  --gray-100:  #1e2433;
  --gray-200:  #2d3748;
  --gray-600:  #9ca3af;
  --gray-700:  #d1d5db;
  --gray-800:  #e5e7eb;
  --gray-900:  #f9fafb;
  --white:     #0f1419;
  --green-50:  #0d1f17;
  --green-100: #132e22;
  --nav-scrolled-bg: rgba(15,20,25,.7);
  --nav-scrolled-shadow: rgba(0,0,0,.3);
  --input-bg:  #1a1f2e;
  --footer-bg: #0a0f12;
  --marquee-bg: #065f46;
  --deco-glow-strong: rgba(16,185,129,.14);
  --deco-glow-mid: rgba(52,211,153,.10);
  --deco-glow-soft: rgba(16,185,129,.05);
  --deco-blob-strong: rgba(16,185,129,.15);
  --deco-blob-mid: rgba(52,211,153,.10);
  --deco-blob-soft: rgba(16,185,129,.05);
  --deco-ring-border: rgba(16,185,129,.10);
  --deco-ring-dash: rgba(16,185,129,.08);
  --deco-dot-opacity: 0.18;
  --deco-cross-opacity: 0.15;
  --section-treneri-top:    #111a15;
  --section-treneri-bottom: #0f1712;
  --section-teretane-top:   #171c26;
  --section-teretane-bottom:#141925;
  --section-sportovi-top:   #111a15;
  --section-sportovi-bottom:#0f1712;
  --section-testimonials-top:  #131a1e;
  --section-testimonials-bottom:#111820;
  --partners-marquee-bg:   #042f1e;
  --section-kontakt-top:    #171c26;
  --section-kontakt-bottom: #141925;
}

html { font-size: 17px; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: var(--green-500) var(--green-50); }

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track {
  background: var(--green-50);
  border-left: 1px solid var(--border);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--green-400), var(--green-600));
  border-radius: 10px;
  border: 2px solid var(--green-50);
  transition: background .3s;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--green-500), var(--green-700));
}
::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, var(--green-600), var(--green-800));
}
[data-theme="dark"] { scrollbar-color: var(--green-600) #0f1419; }
[data-theme="dark"] ::-webkit-scrollbar-track {
  background: #0f1419;
  border-left-color: var(--border);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--green-600), var(--green-800));
  border-color: #0f1419;
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--green-500), var(--green-700));
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, var(--green-400), var(--green-600));
}
body {
  font-family: 'Outfit', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  line-height: 1.6;
  cursor: none;
  transition: background .25s, color .25s;
}
.theme-switching,
.theme-switching *,
.theme-switching *::before,
.theme-switching *::after {
  transition: background .25s, color .25s, border-color .25s, box-shadow .25s, fill .25s, stroke .25s !important;
}
.theme-switching .wave-divider,
.theme-switching .wave-divider *,
.theme-switching .wave-divider svg path,
.theme-switching #istrazi,
.theme-switching #treneri,
.theme-switching #teretane,
.theme-switching #sportovi,
.theme-switching #kako,
.theme-switching #mapa,
.theme-switching #kontakt,
.theme-switching .marquee,
.theme-switching .partners-marquee,
.theme-switching .footer {
  transition: none !important;
}
a, button, input, select, textarea { cursor: none; }

/* ===== FOCUS STYLES (accessibility) ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--green-400);
  outline-offset: 2px;
}
.explore-card:focus-visible {
  outline: 3px solid var(--green-400);
  outline-offset: 2px;
  border-radius: 24px;
}
.trainer-card:focus-visible,
.gym-card:focus-visible,
.sport-card:focus-visible,
.club-card:focus-visible,
.testimonial-card:focus-visible {
  outline: 2px solid var(--green-400);
  outline-offset: 2px;
}
a { text-decoration: none; color: inherit; }

/* ===== SKIP TO CONTENT (accessibility) ===== */
.skip-to-content {
  position: fixed;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100000;
  background: var(--green-600);
  color: #ffffff;
  padding: .75rem 1.5rem;
  border-radius: 0 0 12px 12px;
  font-weight: 700;
  font-size: .9rem;
  text-decoration: none;
  transition: top .3s;
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
.skip-to-content:focus {
  top: 0;
  outline: none;
}
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ===== PAGE TRANSITION ===== */
.page-transition {
  position: fixed;
  inset: 0;
  z-index: 99990;
  pointer-events: none;
  transform: translateY(101%);
  visibility: hidden;
  will-change: transform;
  overflow: hidden;
}
.page-transition__bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--green-700) 0%, var(--green-500) 50%, var(--green-400) 100%);
}
.page-transition__logo {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  opacity: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
.page-transition.is-active .page-transition__logo {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.page-transition__logo svg {
  width: 40px; height: 40px;
  filter: drop-shadow(0 0 20px rgba(255,255,255,.25));
}
.page-transition__logo span {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}
.page-entering .page-transition {
  transform: translateY(0);
  visibility: visible;
}

/* ===== LOADING SCREEN ===== */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.loading-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.loading-logo__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
}
.loading-logo__icon svg {
  width: 46px;
  height: 46px;
}
.loading-logo__text {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--text);
  font-family: 'Outfit', system-ui, sans-serif;
}
@keyframes drawBolt {
  0%   { stroke-dashoffset: 54; fill-opacity: 0; }
  55%  { stroke-dashoffset: 0;  fill-opacity: 0; }
  100% { stroke-dashoffset: 0;  fill-opacity: 1; }
}
.bolt-draw {
  stroke-dasharray: 54;
  stroke-dashoffset: 54;
  animation: drawBolt 0.65s cubic-bezier(.4, 0, .2, 1) 0.05s forwards;
}

/* ===== CUSTOM CURSOR ===== */
.cursor {
  position: fixed;
  left: 0; top: 0;
  width: 12px; height: 12px;
  background: var(--green-400);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10003;
  transform: translate(-50%, -50%);
  transition: width .25s, height .25s, background .25s, opacity .25s;
  mix-blend-mode: difference;
  opacity: 0;
}
.cursor.hover { width: 20px; height: 20px; background: var(--green-300); }
.cursor.click { transform: translate(-50%, -50%) scale(.6); }

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 50px;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  position: absolute; right: 3rem;
  overflow: hidden;
  color: #ffffff;
  transition: background .3s, border-color .3s, color .3s, box-shadow .3s, transform .3s;
}
.theme-toggle:hover {
  background: rgba(255,255,255,.3);
  border-color: rgba(255,255,255,.5);
  transform: translateY(-1px);
}
.navbar.scrolled .theme-toggle {
  background: rgba(5,150,105,.08);
  border-color: rgba(5,150,105,.2);
  color: var(--green-600);
}
.navbar.scrolled .theme-toggle:hover {
  background: var(--green-600); color: #ffffff;
  border-color: var(--green-600);
  box-shadow: 0 4px 15px rgba(5,150,105,.3);
}
.theme-toggle__icon {
  position: absolute;
  display: flex; align-items: center; justify-content: center;
  transition: transform .5s cubic-bezier(.4, 0, .2, 1), opacity .35s;
}
.theme-toggle__icon svg { display: block; }
.theme-toggle__sun { opacity: 1; transform: rotate(0deg) scale(1); }
.theme-toggle__moon { opacity: 0; transform: rotate(-45deg) scale(0); }
[data-theme="dark"] .theme-toggle__sun { opacity: 0; transform: rotate(90deg) scale(0); }
[data-theme="dark"] .theme-toggle__moon { opacity: 1; transform: rotate(0deg) scale(1); }
[data-theme="dark"] .theme-toggle {
  background: rgba(52,211,153,.1);
  border-color: rgba(52,211,153,.2);
  color: var(--green-400);
}
[data-theme="dark"] .theme-toggle:hover {
  background: var(--green-500); color: #0f1419;
  border-color: var(--green-500);
}
[data-theme="dark"] .navbar.scrolled .theme-toggle {
  background: rgba(52,211,153,.1);
  border-color: rgba(52,211,153,.2);
  color: var(--green-400);
}
[data-theme="dark"] .navbar.scrolled .theme-toggle:hover {
  background: var(--green-500); color: #0f1419;
  border-color: var(--green-500);
}

/* ===== REDUCED MOTION ===== */
@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;
  }
}

/* ===== TOUCH DEVICES ===== */
/* Restore native cursor and hide custom cursor on touch-primary devices,
   regardless of whether the JS-applied .is-mobile-device class is present.
   Catches iPads with Magic Keyboard, Surface devices, etc. */
@media (hover: none) {
  body,
  a, button, input, select, textarea { cursor: auto; }
  .cursor { display: none; }
}
