/*
 * Vaqf — Brand Hibrit Stylesheet
 * vaqf.uz teal+gold primary · DoM modernlik korunur
 */

/* Alpine.js — hide elements until JS hydrates */
[x-cloak] { display: none !important; }

/* =====================================================================
 * Yaratıcı animasyonlar paketi
 * ===================================================================== */

/* Hero: animated gradient mesh — 3 blob'lar lazy hareket eder */
.hero-mesh {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.hero-mesh::before,
.hero-mesh::after {
  content: '';
  position: absolute;
  width: 60vw;
  height: 60vw;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.45;
  animation: mesh-drift 22s ease-in-out infinite;
}
.hero-mesh::before {
  top: -20%;
  left: -10%;
  background: radial-gradient(circle, #d4a256 0%, transparent 70%);
}
.hero-mesh::after {
  bottom: -25%;
  right: -10%;
  background: radial-gradient(circle, #2d7878 0%, transparent 70%);
  animation-delay: -11s;
  animation-duration: 28s;
}
@keyframes mesh-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(8vw, -6vh) scale(1.15); }
  66%      { transform: translate(-6vw, 8vh) scale(0.92); }
}

/* Heartbeat pulse for ♥ icons */
.heartbeat {
  animation: heartbeat 1.6s ease-in-out infinite;
  transform-origin: center;
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14%      { transform: scale(1.18); }
  28%      { transform: scale(1); }
  42%      { transform: scale(1.12); }
  56%      { transform: scale(1); }
}

/* Magnetic button — JS sets --mx / --my via mousemove */
.btn-magnetic {
  transition: transform 0.15s cubic-bezier(0.22, 1, 0.36, 1);
  transform: translate(calc(var(--mx, 0) * 0.4px), calc(var(--my, 0) * 0.4px));
  will-change: transform;
}

/* Glow ring around primary CTA */
.btn-glow {
  position: relative;
  isolation: isolate;
}
.btn-glow::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: linear-gradient(135deg, #d4a256, #e9a23f, #d4a256);
  background-size: 200% 200%;
  z-index: -1;
  animation: glow-rotate 4s linear infinite;
  opacity: 0.7;
  filter: blur(8px);
}
@keyframes glow-rotate {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* Ripple on click — JS adds .ripple span */
.ripple-container { position: relative; overflow: hidden; }
.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  pointer-events: none;
  transform: scale(0);
  animation: ripple 0.6s ease-out;
}
@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

/* Amount card — selected state pulse */
.amount-card {
  position: relative;
  overflow: visible !important; /* badge'in 'Eng tanlangan ★' kırpılmasını engelle */
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.amount-card:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 14px 30px -8px rgba(212, 162, 86, 0.35);
}
.amount-card.is-selected {
  background: linear-gradient(135deg, #fdf8ef, #fbeed9);
  border-color: #d4a256;
  box-shadow: 0 0 0 4px rgba(212, 162, 86, 0.25);
  animation: selected-bounce 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes selected-bounce {
  0%   { transform: scale(0.95); }
  60%  { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* Recurring badge — "Eng tanlangan" pulse */
.recurring-badge {
  background: linear-gradient(135deg, #d4a256, #bd8237);
  color: white;
  font-size: 9px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 800;
  letter-spacing: 0.05em;
  animation: badge-pulse 2s ease-in-out infinite;
  box-shadow: 0 4px 12px -4px rgba(212, 162, 86, 0.6);
}
@keyframes badge-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 12px -4px rgba(212, 162, 86, 0.6); }
  50%      { transform: scale(1.06); box-shadow: 0 6px 20px -4px rgba(212, 162, 86, 0.9); }
}

/* 3D tilt for campaign cards — JS sets --rx / --ry */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s;
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  will-change: transform;
}
.tilt-card:hover {
  box-shadow: 0 30px 60px -15px rgba(13, 74, 74, 0.35);
}

/* Slot-machine counter rolling */
.slot-counter {
  display: inline-flex;
  gap: 0.05em;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
}
.slot-digit {
  display: inline-block;
  height: 1em;
  line-height: 1;
  overflow: hidden;
  position: relative;
}
.slot-digit > span {
  display: block;
  height: 1em;
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Live ticker — glow trail behind moving items */
.ticker-track > * {
  position: relative;
}
.ticker-track > *::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(212, 162, 86, 0.18), transparent 70%);
  pointer-events: none;
}

/* Confetti — JS spawns .confetti-piece children */
.confetti-burst {
  position: fixed;
  pointer-events: none;
  inset: 0;
  z-index: 999;
}
.confetti-piece {
  position: absolute;
  width: 8px; height: 8px;
  top: 50%; left: 50%;
  animation: confetti-fly 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes confetti-fly {
  0%   { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--cx), var(--cy)) rotate(var(--cr)); opacity: 0; }
}

/* Scroll-reveal stagger (data-reveal) */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease-out, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Donate FAB extra: 2-layer ring + heartbeat */
#floating-donate button {
  position: relative;
  overflow: visible;
}
#floating-donate button > svg {
  animation: heartbeat 1.6s ease-in-out infinite;
}

:root {
  --vaqf-teal: #1a5862;
  --vaqf-teal-deep: #0d4a4a;
  --vaqf-teal-darker: #082f2f;
  --vaqf-gold: #d4a256;
  --vaqf-gold-hover: #bd8237;
  --vaqf-cream: #fdf8ef;
  --vaqf-text: #0d2030;
  --vaqf-muted: #5c7079;
}

body {
  font-family: "Inter", "Inter Display", system-ui, -apple-system, sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  overflow-x: hidden;
  color: var(--vaqf-text);
}

html { overflow-x: hidden; scroll-behavior: smooth; }

/* Arabic-style support for Cyrillic */
[lang="uz-cyrl"] body, [lang="ru"] body {
  font-family: "IBM Plex Sans Arabic", "Inter", system-ui, sans-serif;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #f0fafa; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #1a5862, #0d4a4a);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: #0d4a4a; }

/* ===== Hero ===== */
.hero-vaqf {
  background: linear-gradient(135deg, #1a5862 0%, #0d4a4a 60%, #082f2f 100%);
  position: relative;
  overflow: hidden;
}
.hero-vaqf::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('/static/images/pattern-geometric.svg');
  background-size: 240px 240px;
  opacity: 0.1;
  mix-blend-mode: screen;
  pointer-events: none;
}

/* Gradient text */
.text-gold-gradient {
  background: linear-gradient(135deg, #d4a256 0%, #f0bf6f 50%, #d4a256 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Glass card */
.glass-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 25px 50px -12px rgba(13, 74, 74, 0.25);
}

/* ===== Campaign progress bar ===== */
.progress-bar {
  background: linear-gradient(90deg, #d4a256, #e9a23f);
  position: relative;
  overflow: hidden;
}
.progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
  animation: shimmer 2.5s infinite;
}
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ===== Ticker marquee ===== */
.ticker-track {
  display: flex;
  gap: 3rem;
  animation: marquee 50s linear infinite;
  white-space: nowrap;
  width: max-content;
}
.ticker-track:hover { animation-play-state: paused; }
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ===== Prayer widget ===== */
.prayer-widget {
  background: linear-gradient(135deg, #0d4a4a 0%, #082f2f 100%);
  color: white;
  border-bottom: 1px solid rgba(212, 162, 86, 0.3);
}
.prayer-time-current {
  background: linear-gradient(135deg, rgba(212, 162, 86, 0.25), rgba(212, 162, 86, 0.1));
  border: 1px solid rgba(212, 162, 86, 0.5);
  box-shadow: 0 0 20px rgba(212, 162, 86, 0.2);
}
.prayer-countdown { font-variant-numeric: tabular-nums; }

/* ===== Map (Faz 6) ===== */
.map-uz path {
  fill: rgba(26, 88, 98, 0.08);
  stroke: rgba(26, 88, 98, 0.4);
  stroke-width: 1.5;
  transition: all 0.3s ease;
  cursor: pointer;
}
.map-uz path:hover {
  fill: rgba(212, 162, 86, 0.35);
  stroke: #d4a256;
}
.map-uz path.active {
  fill: rgba(212, 162, 86, 0.6);
  stroke: #d4a256;
  stroke-width: 2;
}
.donation-pulse {
  fill: #d4a256;
  animation: pulse-grow 2s infinite;
  transform-origin: center;
}
@keyframes pulse-grow {
  0%, 100% { r: 4; opacity: 1; }
  50%      { r: 12; opacity: 0.3; }
}
.diaspora-arc {
  fill: none;
  stroke: #d4a256;
  stroke-width: 2;
  stroke-dasharray: 4 6;
  animation: dash-flow 1.5s linear infinite;
}
@keyframes dash-flow { to { stroke-dashoffset: -20; } }

/* ===== Stories ===== */
.story-card {
  aspect-ratio: 9 / 16;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.story-card:hover { transform: translateY(-8px); }
.story-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13, 32, 48, 0.9) 0%, transparent 50%);
}

/* ===== Buttons ===== */
.btn-vaqf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  border-radius: 9999px;
  font-weight: 700;
  background: linear-gradient(135deg, #d4a256 0%, #bd8237 100%);
  color: #0d2030;
  box-shadow: 0 10px 30px -8px rgba(212, 162, 86, 0.6);
  transition: all 0.2s ease;
}
.btn-vaqf:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px -8px rgba(212, 162, 86, 0.75);
}
.btn-vaqf-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  border-radius: 9999px;
  font-weight: 700;
  border: 2px solid rgba(255, 255, 255, 0.4);
  color: white;
  transition: all 0.2s ease;
}
.btn-vaqf-outline:hover {
  border-color: #d4a256;
  background: rgba(212, 162, 86, 0.15);
}

/* ===== Section divider ===== */
.divider-pattern {
  height: 60px;
  background-image: url('/static/images/pattern-geometric.svg');
  background-size: 80px 80px;
  background-repeat: repeat-x;
  opacity: 0.15;
}

/* ===== Counter animation ===== */
.counter {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

/* ===== Payment provider grid ===== */
.payment-card {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  padding: 1.25rem;
  transition: all 0.2s ease;
  cursor: pointer;
}
.payment-card:hover {
  border-color: #d4a256;
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -6px rgba(212, 162, 86, 0.3);
}
.payment-card.selected {
  border-color: #1a5862;
  background: #f0fafa;
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  .hero-vaqf { min-height: 80vh; }
  .ticker-track { animation-duration: 70s; }
}

@media print {
  .prayer-widget, .ticker-track, header, footer { display: none; }
}
