/* ============================================================
   VIZITKA — Premium Visual Enhancement CSS
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ── Design Tokens ─────────────────────────────────────── */
:root {
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --c-bg:        #080c14;
  --c-surface:   #0d1220;
  --c-border:    rgba(255,255,255,0.06);
  --c-border-hi: rgba(99,102,241,0.45);
  --c-indigo:    #6366f1;
  --c-violet:    #8b5cf6;
  --c-emerald:   #10b981;
  --glow-indigo: rgba(99,102,241,0.35);
  --glow-violet: rgba(139,92,246,0.30);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-main);
  background-color: var(--c-bg);
  color: #e2e8f0;
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Dot-grid background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
  z-index: 0;
}

/* ── Custom Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--c-bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6366f1, #8b5cf6);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { filter: brightness(1.25); }

/* ── Text selection ─────────────────────────────────────── */
::selection { background: rgba(99,102,241,0.42); color: #fff; }

/* ── Focus ring ─────────────────────────────────────────── */
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2.5px var(--c-indigo), 0 0 12px var(--glow-indigo);
}

/* ── Glassmorphism ──────────────────────────────────────── */
.glass-panel {
  background: rgba(10, 14, 26, 0.88);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid rgba(255,255,255,0.07);
}

.glass-card {
  background: rgba(10, 14, 26, 0.65);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--c-border);
  transition:
    border-color 0.35s var(--ease-out-expo),
    transform    0.35s var(--ease-out-expo),
    box-shadow   0.35s var(--ease-out-expo);
  position: relative;
  overflow: hidden;
}

/* Subtle top highlight on every card */
.glass-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%, rgba(255,255,255,0.10) 40%,
    rgba(255,255,255,0.10) 60%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}
.glass-card > * { position: relative; z-index: 2; }

.glass-card:hover {
  border-color: var(--c-border-hi);
  transform: translateY(-6px) scale(1.01);
  box-shadow:
    0 0 0 1px rgba(99,102,241,0.18),
    0 24px 52px -12px rgba(99,102,241,0.22),
    0 0 80px -24px rgba(99,102,241,0.14);
}

/* Background Gradients */
.bg-glow-radial {
  background: radial-gradient(ellipse at 50% -10%, rgba(99,102,241,0.18) 0%, rgba(8,12,20,0) 65%);
}
.bg-glow-emerald {
  background: radial-gradient(ellipse at 85% 10%, rgba(16,185,129,0.12) 0%, transparent 55%);
}

/* ── Keyframe Animations ────────────────────────────────── */

/* Online pulse */
@keyframes pulse-dot {
  0%   { transform: scale(0.95); box-shadow: 0 0 0 0   rgba(34,197,94,0.75); }
  70%  { transform: scale(1);    box-shadow: 0 0 0 9px  rgba(34,197,94,0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0   rgba(34,197,94,0); }
}
.online-pulse { animation: pulse-dot 2s infinite; }

/* Shimmer sweep */
@keyframes shimmer {
  from { background-position: 200% center; }
  to   { background-position: -200% center; }
}

/* Float */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-9px); }
}

/* Message pop */
@keyframes message-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Fade up for chat bubble */
@keyframes fade-up-sm {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Text Gradients ─────────────────────────────────────── */
.text-gradient-primary {
  background: linear-gradient(135deg, #818cf8 0%, #a78bfa 40%, #e879f9 80%, #f472b6 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 5s linear infinite;
}

.text-shimmer {
  background: linear-gradient(110deg, #94a3b8 0%, #f1f5f9 35%, #94a3b8 65%, #f1f5f9 100%);
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 6s linear infinite;
}

/* ── Header ─────────────────────────────────────────────── */
header {
  background: rgba(8,12,20,0.88) !important;
  backdrop-filter: blur(24px) saturate(1.5) !important;
  -webkit-backdrop-filter: blur(24px) saturate(1.5) !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* Nav link underline slide */
header nav a {
  position: relative;
  padding-bottom: 2px;
  transition: color 0.25s ease;
}
header nav a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 2px;
  transition: width 0.3s var(--ease-out-expo);
}
header nav a:hover::after { width: 100%; }
header nav a:hover { color: #fff !important; }

/* Header CTA shine sweep */
header a.inline-flex {
  position: relative;
  overflow: hidden;
}
header a.inline-flex::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}
header a.inline-flex:hover::after { transform: translateX(100%); }

/* ── Hero Section ───────────────────────────────────────── */
/* Float the code card */
section:first-of-type .glass-card.rounded-3xl {
  animation: float 5.5s ease-in-out infinite;
}

/* Hero H1 tighter tracking */
section:first-of-type h1 {
  letter-spacing: -0.03em;
  line-height: 1.12;
}

/* Mini stat cards */
section:first-of-type .grid .p-4 {
  transition: all 0.3s var(--ease-out-expo);
}
section:first-of-type .grid .p-4:hover {
  transform: translateY(-4px);
  border-color: rgba(99,102,241,0.35) !important;
  box-shadow: 0 8px 24px -6px rgba(99,102,241,0.18);
  background: rgba(99,102,241,0.06);
}

/* Primary CTA hero button */
section:first-of-type a[href="#contacts"] {
  position: relative;
  overflow: hidden;
  transition: all 0.3s var(--ease-out-expo) !important;
}
section:first-of-type a[href="#contacts"]::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
section:first-of-type a[href="#contacts"]:hover::after { opacity: 1; }
section:first-of-type a[href="#contacts"]:hover {
  transform: translateY(-3px) scale(1.02) !important;
  box-shadow: 0 0 0 2px rgba(99,102,241,0.3), 0 18px 44px -8px rgba(99,102,241,0.5) !important;
}

/* Credential badge bottom of code card */
section:first-of-type .glass-card.p-4 {
  animation: float 6s ease-in-out infinite;
  animation-delay: 0.8s;
}

/* ── Section Headings ───────────────────────────────────── */
h2.text-xs.font-bold {
  letter-spacing: 0.16em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
h2.text-xs.font-bold::before,
h2.text-xs.font-bold::after {
  content: '';
  display: block;
  width: 20px; height: 1px;
  background: var(--c-indigo);
  border-radius: 1px;
  opacity: 0.7;
}

/* ── Courses Section ────────────────────────────────────── */
#courses .glass-card {
  background: rgba(8, 12, 22, 0.72);
}

/* Coloured top accent bar per card */
#courses .grid > .glass-card { overflow: hidden; }
#courses .grid > .glass-card:nth-child(1) { border-top: 2px solid rgba(99,102,241,0.5); }
#courses .grid > .glass-card:nth-child(2) { border-top: 2px solid rgba(124,58,237,0.5); }
#courses .grid > .glass-card:nth-child(3) { border-top: 2px solid rgba(225,29,72,0.5); }
#courses .grid > .glass-card:nth-child(4) { border-top: 2px solid rgba(5,150,105,0.5); }

/* Course buttons */
#courses button {
  transition: all 0.25s var(--ease-spring);
  position: relative;
  overflow: hidden;
}
#courses button::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
}
#courses button:hover { transform: scale(1.07); }
#courses button:hover::before { opacity: 1; }
#courses button:active { transform: scale(0.97); }

/* ── Schedule Section ───────────────────────────────────── */
#schedule .glass-card { background: rgba(8,12,22,0.78); }

#schedule thead th {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

#schedule tbody tr {
  transition: background 0.2s ease;
}
#schedule tbody tr:hover td {
  background: rgba(99,102,241,0.04);
}

/* Timezone switcher active state glow */
#tz-btn-ekb, #tz-btn-msk {
  transition: all 0.3s var(--ease-out-expo);
}
#tz-btn-ekb.active,
#tz-btn-msk.active {
  box-shadow: 0 0 16px rgba(99,102,241,0.4);
}

/* Free slot hover */
td .cursor-pointer:hover,
td button:hover {
  box-shadow: inset 0 0 0 1px rgba(16,185,129,0.45), 0 0 10px rgba(16,185,129,0.18);
}

/* ── About Section ──────────────────────────────────────── */
#about .w-64 {
  position: relative;
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7) !important;
  padding: 3px !important;
  box-shadow:
    0 0 0 1px rgba(99,102,241,0.2),
    0 0 56px rgba(99,102,241,0.28),
    0 24px 64px rgba(0,0,0,0.55);
  transition: box-shadow 0.4s ease, transform 0.4s ease;
}
#about .w-64:hover {
  box-shadow:
    0 0 0 2px rgba(99,102,241,0.55),
    0 0 80px rgba(99,102,241,0.42),
    0 24px 64px rgba(0,0,0,0.65);
  transform: scale(1.025);
}

/* Credential info boxes slide right on hover */
#about .flex.items-start.gap-4.p-4 {
  transition: all 0.3s var(--ease-out-expo);
}
#about .flex.items-start.gap-4.p-4:hover {
  border-color: rgba(99,102,241,0.35) !important;
  transform: translateX(8px);
  background: rgba(99,102,241,0.05);
}

/* ── Contacts / Form Section ────────────────────────────── */
#contacts .glass-card {
  background: rgba(8,12,22,0.82);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.05),
    0 36px 88px -20px rgba(0,0,0,0.65),
    0 0 64px -24px rgba(99,102,241,0.12);
}

/* Inputs */
#contacts input[type="text"],
#contacts input[type="tel"],
#contacts select {
  background: rgba(4, 7, 15, 0.9) !important;
  border-color: rgba(255,255,255,0.08) !important;
  transition: border-color 0.25s ease, box-shadow 0.25s ease !important;
}
#contacts input:focus,
#contacts select:focus {
  background: rgba(4, 7, 15, 1) !important;
  border-color: var(--c-indigo) !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.2), 0 0 24px rgba(99,102,241,0.12) !important;
}

/* Messenger radio labels */
#contacts label.flex.items-center.justify-center.gap-2 {
  transition: all 0.25s ease;
  cursor: pointer;
}
#contacts label.flex.items-center.justify-center.gap-2:hover {
  border-color: rgba(99,102,241,0.4) !important;
  background: rgba(99,102,241,0.07);
}

/* Submit button */
#lead-submit-btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s var(--ease-out-expo);
  letter-spacing: 0.02em;
}
#lead-submit-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.14), transparent);
  transition: left 0.55s ease;
}
#lead-submit-btn:hover::before { left: 100%; }
#lead-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.3), 0 14px 36px -6px rgba(99,102,241,0.52);
}
#lead-submit-btn:active { transform: scale(0.98); }

/* ── Footer ─────────────────────────────────────────────── */
footer {
  background: rgba(4, 7, 15, 0.99) !important;
  position: relative;
  overflow: hidden;
}
footer::after {
  content: '';
  position: absolute;
  bottom: -60px; left: 50%;
  transform: translateX(-50%);
  width: 500px; height: 120px;
  background: radial-gradient(ellipse, rgba(99,102,241,0.07) 0%, transparent 70%);
  pointer-events: none;
}
footer a {
  transition: color 0.2s ease;
}
footer a:hover { color: #c7d2fe; }

/* ── Chat Widget ─────────────────────────────────────────── */
#chat-widget-container {
  transition: all 0.3s var(--ease-out-expo);
  z-index: 9999;
}

/* Launcher button */
#chat-launcher {
  background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
  box-shadow: 0 8px 32px -4px rgba(99,102,241,0.5);
  transition: all 0.3s var(--ease-spring);
}
#chat-launcher:hover {
  transform: scale(1.13) rotate(6deg);
  box-shadow: 0 0 0 8px rgba(99,102,241,0.12), 0 0 36px rgba(99,102,241,0.42);
}
#chat-launcher:active { transform: scale(0.94); }

/* Callout bubble float */
#chat-callout-bubble {
  border-color: rgba(99,102,241,0.3) !important;
  box-shadow: 0 8px 24px -4px rgba(0,0,0,0.5), 0 0 18px rgba(99,102,241,0.1);
  animation: float 3.5s ease-in-out infinite;
}

/* Chat window */
#chat-window {
  transform-origin: bottom right;
  transition:
    opacity   0.3s var(--ease-out-expo),
    transform 0.3s var(--ease-out-expo);
  background: rgba(7, 10, 20, 0.97) !important;
  backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid rgba(255,255,255,0.08) !important;
  box-shadow:
    0 0 0 1px rgba(99,102,241,0.14),
    0 32px 80px -12px rgba(0,0,0,0.82),
    0 0 52px rgba(99,102,241,0.07);
}
#chat-window.hidden-chat {
  opacity: 0;
  transform: scale(0.88) translateY(16px);
  pointer-events: none;
}
#chat-window.visible-chat {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

/* Chat message bubbles */
.chat-message-bubble {
  max-width: 82%;
  word-break: break-word;
  animation: message-pop 0.28s var(--ease-out-expo);
}

/* ── Mobile menu slide ───────────────────────────────────── */
#mobile-menu a {
  transition: all 0.2s ease;
  border-radius: 8px;
  padding-left: 8px;
}
#mobile-menu a:hover {
  padding-left: 16px;
  background: rgba(99,102,241,0.08);
}

/* ── Badge chips ─────────────────────────────────────────── */
span.px-2\.5.rounded-lg,
span[class*="rounded-lg"][class*="font-mono"] {
  transition: filter 0.2s ease, transform 0.2s ease;
}
span.px-2\.5.rounded-lg:hover,
span[class*="rounded-lg"][class*="font-mono"]:hover {
  filter: brightness(1.3);
  transform: scale(1.06);
}

/* ── Reduced motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Mobile tweaks ──────────────────────────────────────── */
@media (max-width: 768px) {
  section:first-of-type h1 { letter-spacing: -0.02em; }
  .glass-card:hover { transform: translateY(-3px) scale(1.005); }
}
