/* Tailwind utility classes are provided by the Tailwind CDN (Play) build
   loaded in index.php — this file only holds the project's custom design
   language on top of it. */

/* ============================================================
   VIOLET PULSE — modern SaaS-style design language.
   Adapts to Telegram's light/dark theme automatically (.dark class).
   Each category (Premium / Stars / Gift) keeps its own brand color.
   ============================================================ */

:root {
  --font-display: "Fraunces", ui-serif, Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  --ink: #f4f2fb;
  --paper: #f4f2fb;
  --surface: #ffffff;
  --surface-2: #f1eefb;
  --hairline: rgba(46, 24, 90, 0.09);
  --hairline-strong: rgba(46, 24, 90, 0.2);
  --text-primary: #1c1533;
  --text-secondary: #6d6685;

  /* primary brand accent (violet) */
  --gold: #6f4ce0;
  --gold-2: #8a6bf0;
  --gold-soft: rgba(111, 76, 224, 0.1);
  --tg-blue: #6f4ce0;

  /* per-category brand colors */
  --c-premium: #7c5cff;
  --c-premium-2: #b98bff;
  --c-premium-soft: rgba(124, 92, 255, 0.12);
  --c-stars: #f5a623;
  --c-stars-2: #ffcf5c;
  --c-stars-soft: rgba(245, 166, 35, 0.13);
  --c-gift: #2f8cff;
  --c-gift-2: #6db4ff;
  --c-gift-soft: rgba(47, 140, 255, 0.12);

  --card-shadow: 0 1px 2px rgba(35, 20, 70, 0.04), 0 16px 36px -18px rgba(35, 20, 70, 0.16);
  --grain-opacity: 0.015;
}

.dark {
  --ink: #0c0a16;
  --paper: #0c0a16;
  --surface: #161327;
  --surface-2: #1d1836;
  --hairline: rgba(200, 190, 240, 0.09);
  --hairline-strong: rgba(200, 190, 240, 0.22);
  --text-primary: #f0edfa;
  --text-secondary: #948dbb;

  --gold: #9b7bff;
  --gold-2: #b79dff;
  --gold-soft: rgba(155, 123, 255, 0.16);
  --tg-blue: #9b7bff;

  --c-premium: #9b7bff;
  --c-premium-2: #c3aeff;
  --c-premium-soft: rgba(155, 123, 255, 0.16);
  --c-stars: #ffb84d;
  --c-stars-2: #ffd98a;
  --c-stars-soft: rgba(255, 184, 77, 0.16);
  --c-gift: #5aa8ff;
  --c-gift-2: #8fc4ff;
  --c-gift-soft: rgba(90, 168, 255, 0.16);

  --card-shadow: 0 1px 1px rgba(0, 0, 0, 0.4), 0 24px 48px -20px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(200, 190, 240, 0.05) inset;
  --grain-opacity: 0.02;
}

html,
body {
  height: 100%;
  -webkit-tap-highlight-color: transparent;
}

input,
textarea {
  -webkit-user-select: text;
  user-select: text;
}

body {
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
  color: var(--text-primary);
  background: var(--paper);
  font-family: var(--font-body);
  font-feature-settings: "cv02", "cv03", "tnum";
  overscroll-behavior-y: none;
  letter-spacing: -0.01em;
}

/* ---------- Heading weight (clean sans, matches the reference design) ---------- */
h1,
h2,
h3,
.text-gradient,
.font-display {
  font-family: var(--font-body);
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ---------- Film grain + vignette backdrop ---------- */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(130% 85% at 18% -12%, var(--gold-soft), transparent 52%),
    radial-gradient(90% 70% at 105% 8%, rgba(207, 159, 79, 0.08), transparent 58%),
    radial-gradient(100% 85% at 90% 115%, rgba(150, 108, 30, 0.08), transparent 62%);
}
.aurora::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* sparkles retired in this design language */
.sparkle {
  display: none;
}

/* ---------- Surfaces (was glass — now solid boutique cards) ---------- */
.glass {
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: var(--card-shadow);
}

.glass-strong {
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  box-shadow: var(--card-shadow);
}

/* ---------- Corner-tick frame (signature detail) ---------- */
.border-glow {
  position: relative;
}
.border-glow::before,
.border-glow::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--gold);
  border-style: solid;
  opacity: 0.85;
  pointer-events: none;
  transition: width 0.3s ease, height 0.3s ease;
}
.border-glow::before {
  top: 8px;
  left: 8px;
  border-width: 1.5px 0 0 1.5px;
  border-top-left-radius: 6px;
}
.border-glow::after {
  bottom: 8px;
  right: 8px;
  border-width: 0 1.5px 1.5px 0;
  border-bottom-right-radius: 6px;
}
.border-glow:hover::before,
.border-glow:hover::after {
  width: 22px;
  height: 22px;
}

/* ---------- Gold shine sweep (subtle, slow) ---------- */
.shine {
  position: relative;
  overflow: hidden;
}
.shine::after {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 45%;
  height: 100%;
  transform: skewX(-20deg);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(216, 172, 84, 0.12),
    transparent
  );
  animation: shine-sweep 6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes shine-sweep {
  0%,
  65% {
    left: -80%;
  }
  90%,
  100% {
    left: 140%;
  }
}

/* ---------- Micro interactions ---------- */
.pressable {
  transition:
    transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}
.pressable:active {
  transform: scale(0.965);
}
.card-hover {
  transition:
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s ease,
    border-color 0.3s ease;
}
.card-hover:hover {
  transform: translateY(-3px);
  border-color: var(--hairline-strong);
  box-shadow:
    0 2px 4px rgba(20, 21, 26, 0.08),
    0 20px 48px -20px rgba(20, 21, 26, 0.28);
}

.card-hover:hover .icon-bounce {
  animation: icon-bounce 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes icon-bounce {
  0% {
    transform: scale(1) rotate(0);
  }
  35% {
    transform: scale(1.12) rotate(-5deg);
  }
  70% {
    transform: scale(0.97) rotate(3deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

.float-slow {
  animation: float-slow 5.5s ease-in-out infinite;
}
@keyframes float-slow {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* Gold pulse ring (avatar / logo) */
.glow-ring {
  position: relative;
}
.glow-ring::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  border: 1.5px solid var(--gold);
  animation: glow-pulse 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes glow-pulse {
  0%,
  100% {
    opacity: 0.2;
    transform: scale(1);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.05);
  }
}

/* ---------- Entrances ---------- */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.fade-up {
  animation: fade-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes slide-in-right {
  from {
    opacity: 0;
    transform: translateX(22px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.slide-in-right {
  animation: slide-in-right 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes zoom-in {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.zoom-in {
  animation: zoom-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.stagger > * {
  animation: fade-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.stagger > *:nth-child(1) { animation-delay: 0.03s; }
.stagger > *:nth-child(2) { animation-delay: 0.08s; }
.stagger > *:nth-child(3) { animation-delay: 0.13s; }
.stagger > *:nth-child(4) { animation-delay: 0.18s; }
.stagger > *:nth-child(5) { animation-delay: 0.23s; }
.stagger > *:nth-child(6) { animation-delay: 0.28s; }
.stagger > *:nth-child(7) { animation-delay: 0.33s; }
.stagger > *:nth-child(8) { animation-delay: 0.38s; }
.stagger > *:nth-child(9) { animation-delay: 0.43s; }
.stagger > *:nth-child(10) { animation-delay: 0.48s; }

@keyframes sheet-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}
.sheet-up {
  animation: sheet-up 0.4s cubic-bezier(0.32, 0.72, 0, 1) both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.toast-in {
  animation: toast-in 0.32s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.pop-in {
  animation: pop-in 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.dot-pulse {
  animation: dot-pulse 1.8s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.55;
  }
}

/* ---------- Skeletons ---------- */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(216, 172, 84, 0.14),
    transparent
  );
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

/* ---------- Gold utilities ---------- */
.gradient-animate {
  background-size: 200% 200%;
  animation: gradient-pan 7s ease infinite;
}
@keyframes gradient-pan {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.text-gradient {
  background: linear-gradient(110deg, var(--gold) 20%, var(--gold-2) 50%, var(--gold) 80%);
  background-size: 200% 200%;
  animation: gradient-pan 7s ease infinite;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Primary action — ink bar with gold underline that fills on hover */
.btn-lux {
  position: relative;
  background: var(--ink);
  color: #f4ecdc;
  border: 1px solid var(--hairline-strong);
  overflow: hidden;
}
.dark .btn-lux {
  background: var(--gold);
  color: #17130a;
  border-color: transparent;
}
.btn-lux::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
  transform: scaleX(0.25);
  transform-origin: left;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.btn-lux:hover::after {
  transform: scaleX(1);
}
.dark .btn-lux::after {
  background: rgba(23, 19, 10, 0.35);
}

/* Micro label — editorial uppercase tag */
.micro-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* Index number — "01 /" editorial detail */
.index-num {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--gold);
}

/* Dotted separator */
.dotted-sep {
  border-top: 1px dashed var(--hairline-strong);
}

/* ---------- Bottom nav — gold underline indicator ---------- */
.nav-pill {
  position: relative;
}
.nav-pill::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  height: 2px;
  width: 22px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
  opacity: 0;
  transform: translateX(-50%) scaleX(0.4);
  transition:
    opacity 0.25s ease,
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nav-pill.active::before {
  opacity: 1;
  transform: translateX(-50%) scaleX(1);
}

/* ---------- Scrollbars ---------- */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-thumb {
  background: var(--hairline-strong);
  border-radius: 999px;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  scrollbar-width: none;
}

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