/* ========================================================
   ❄️ ELZA UC — MAGICAL FROZEN THEME CSS
   Inspired by Queen Elsa, Crystal Ice & Sparkling Snowflakes
   ======================================================== */

:root {
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --tg-top-inset: 0px;
  --tg-bottom-inset: 0px;
  --ice-cyan: #38BDF8;
  --ice-glow: rgba(56, 189, 248, 0.35);
  --frost-bg: #070D1E;
}

html, body {
  background-color: var(--frost-bg);
  color: #F8FAFC;
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  padding-top: 0;
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  background-image: 
    radial-gradient(circle at 10% 15%, rgba(56, 189, 248, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 90% 40%, rgba(192, 132, 252, 0.1) 0%, transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(14, 165, 233, 0.08) 0%, transparent 50%);
  background-attachment: fixed;
}

/* Header Safe Area: compact in normal browser, 76px clearance only inside Telegram Mini App */
header,
.app-top-header {
  padding-top: max(0.875rem, env(safe-area-inset-top, 0px)) !important;
  padding-bottom: 0.75rem !important;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
  transition: padding-top 0.2s ease;
}

body.is-telegram-miniapp header,
body.is-telegram-miniapp .app-top-header {
  padding-top: max(
    4.75rem, /* exactly 76px */
    calc(var(--tg-content-safe-area-inset-top, 0px) + 0.85rem),
    calc(var(--tg-safe-area-inset-top, 0px) + 0.85rem),
    calc(env(safe-area-inset-top, 0px) + 0.85rem),
    calc(var(--tg-top-inset, 0px) + 0.5rem)
  ) !important;
}

/* Toast Notification positioned safely */
#toast-container {
  top: 1rem !important;
}

body.is-telegram-miniapp #toast-container {
  top: max(5.75rem, calc(var(--tg-top-inset, 74px) + 1rem)) !important;
}

/* Bottom Navigation Bar — Flush to Bottom */
nav,
.app-bottom-nav {
  bottom: 0px !important;
  left: 0 !important;
  right: 0 !important;
  border-radius: 0 !important;
  border-top: 1px solid rgba(56, 189, 248, 0.25) !important;
  padding-bottom: max(0.625rem, calc(env(safe-area-inset-bottom, 0px) + 0.375rem)) !important;
  box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.4) !important;
}

@media (min-width: 480px) {
  nav,
  .app-bottom-nav {
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: 100% !important;
    max-width: 28rem !important; /* max-w-md */
  }
}

/* Glassmorphism Frosted Cards */
.frost-card {
  background: rgba(11, 20, 42, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(56, 189, 248, 0.22);
}

.frost-card-hover {
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.frost-card-hover:hover {
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
  transform: translateY(-1px);
}

/* Background Wallpaper Layer */
.app-bg-wallpaper {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background-image: 
    linear-gradient(to bottom, rgba(7, 13, 30, 0.84) 0%, rgba(7, 13, 30, 0.90) 50%, rgba(7, 13, 30, 0.96) 100%),
    url('assets/bg-frozen.jpg');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  z-index: 0;
  pointer-events: none;
}

/* Shimmering Text Gradient */
.text-shimmer {
  background: linear-gradient(135deg, #FFFFFF 0%, #BAE6FD 50%, #E0F2FE 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-elza-gold {
  background: linear-gradient(135deg, #FDE68A 0%, #F59E0B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Ice Glow Effects */
.glow-ice {
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.35);
}

.glow-crystal {
  box-shadow: 0 0 25px rgba(34, 211, 238, 0.3);
}

.glow-purple {
  box-shadow: 0 0 20px rgba(192, 132, 252, 0.25);
}

/* Package Card Selection */
.pkg-card {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.pkg-card.selected {
  border-color: #38BDF8 !important;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2) 0%, rgba(15, 26, 52, 0.95) 100%) !important;
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.35);
}

.pkg-card.selected::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
  background-color: #38BDF8;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23070D1E' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: 11px 11px;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.8);
}

/* Category Filter Tabs */
.category-tab {
  white-space: nowrap;
  transition: all 0.2s ease;
}

.category-tab.active {
  background: linear-gradient(135deg, #38BDF8 0%, #0284C7 100%);
  color: #070D1E;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.35);
  border-color: #7DD3FC;
}

/* Modal Card Buttons */
.modal-card-btn {
  transition: all 0.2s ease-in-out;
}
.modal-card-btn.active {
  border-color: #38BDF8 !important;
  background-color: rgba(56, 189, 248, 0.15) !important;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.25);
}
.modal-card-btn.active .check-icon {
  color: #38BDF8 !important;
  opacity: 1 !important;
}

/* Bottom Nav Active State */
.nav-item.active {
  color: #38BDF8;
}
.nav-item.active i {
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.8));
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: #070D1E;
}
::-webkit-scrollbar-thumb {
  background: #1E293B;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #38BDF8;
}

/* Subtle Glowing Light Crystal Particles (Pure CSS, 0 Stickers/Emojis) */
.snowflakes-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.crystal-particle {
  position: absolute;
  top: -10px;
  width: 4px;
  height: 4px;
  background: #38BDF8;
  border-radius: 50%;
  box-shadow: 0 0 8px #38BDF8, 0 0 14px rgba(56, 189, 248, 0.6);
  opacity: 0.6;
  animation: fall linear infinite;
}

.crystal-particle:nth-child(1) { left: 12%; animation-duration: 8s; animation-delay: 0s; width: 3px; height: 3px; }
.crystal-particle:nth-child(2) { left: 28%; animation-duration: 11s; animation-delay: 2s; width: 5px; height: 5px; opacity: 0.8; }
.crystal-particle:nth-child(3) { left: 45%; animation-duration: 9s; animation-delay: 4s; width: 3px; height: 3px; }
.crystal-particle:nth-child(4) { left: 65%; animation-duration: 13s; animation-delay: 1s; width: 4px; height: 4px; opacity: 0.7; }
.crystal-particle:nth-child(5) { left: 82%; animation-duration: 10s; animation-delay: 3s; width: 3px; height: 3px; }
.crystal-particle:nth-child(6) { left: 94%; animation-duration: 12s; animation-delay: 5s; width: 4px; height: 4px; }

@keyframes fall {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 0;
  }
  15% {
    opacity: 0.7;
  }
  90% {
    opacity: 0.7;
  }
  100% {
    transform: translateY(105vh) rotate(360deg);
    opacity: 0;
  }
}
