/* ===== WaveMoon Cosmic Theme v2 ===== */

@keyframes cosmicBg {
  0% { background-position: 0% 0%; }
  25% { background-position: 50% 100%; }
  50% { background-position: 100% 50%; }
  75% { background-position: 50% 0%; }
  100% { background-position: 0% 0%; }
}

@keyframes nebula-drift {
  0% { transform: translate(0, 0) scale(1); opacity: 0.08; }
  33% { transform: translate(30px, -20px) scale(1.1); opacity: 0.12; }
  66% { transform: translate(-20px, 15px) scale(0.95); opacity: 0.06; }
  100% { transform: translate(0, 0) scale(1); opacity: 0.08; }
}

@keyframes twinkle-slow {
  0%, 100% { opacity: 0.15; }
  50% { opacity: 0.7; }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* === BODY === */
body {
  background: #050810 !important;
  background-image:
    radial-gradient(ellipse at 15% 30%, rgba(88, 28, 135, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 20%, rgba(30, 58, 138, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(127, 29, 150, 0.08) 0%, transparent 50%),
    linear-gradient(180deg, #050810 0%, #0a0f2e 30%, #0d1225 60%, #080c1a 100%) !important;
  background-size: 400% 400% !important;
  animation: cosmicBg 30s ease infinite !important;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

/* Nebula overlay */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(ellipse 600px 400px at 20% 40%, rgba(139, 92, 246, 0.07) 0%, transparent 70%),
    radial-gradient(ellipse 500px 350px at 75% 25%, rgba(59, 130, 246, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 400px 300px at 50% 70%, rgba(168, 85, 247, 0.05) 0%, transparent 70%);
  animation: nebula-drift 20s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

/* Star field */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(1.5px 1.5px at 20px 30px, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 40px 70px, rgba(200,210,255,0.4), transparent),
    radial-gradient(2px 2px at 80px 15px, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 120px 60px, rgba(180,200,255,0.3), transparent),
    radial-gradient(1.5px 1.5px at 160px 45px, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 200px 80px, rgba(220,230,255,0.35), transparent),
    radial-gradient(2px 2px at 240px 25px, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 280px 55px, rgba(200,210,255,0.25), transparent),
    radial-gradient(1.5px 1.5px at 320px 90px, rgba(255,255,255,0.45), transparent),
    radial-gradient(1px 1px at 360px 35px, rgba(180,200,255,0.3), transparent),
    radial-gradient(2px 2px at 400px 65px, rgba(255,255,255,0.55), transparent),
    radial-gradient(1px 1px at 440px 20px, rgba(220,230,255,0.2), transparent),
    radial-gradient(1.5px 1.5px at 50px 95px, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 180px 105px, rgba(200,210,255,0.35), transparent),
    radial-gradient(2px 2px at 310px 110px, rgba(255,255,255,0.5), transparent);
  background-size: 480px 130px;
  animation: twinkle-slow 12s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
}

/* Shooting star */
.shooting-star {
  position: fixed;
  top: 10%;
  right: -5%;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 6px 2px rgba(255,255,255,0.6), -40px 0 20px 2px rgba(139,92,246,0.3);
  animation: shooting-star 4s linear infinite;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.shooting-star:nth-child(2) { top: 25%; right: 10%; animation-delay: 3s; animation-duration: 5s; }
.shooting-star:nth-child(3) { top: 5%; right: 30%; animation-delay: 7s; animation-duration: 3.5s; }

@keyframes shooting-star {
  0% { transform: translateX(0) translateY(0) rotate(-45deg); opacity: 1; width: 0; }
  30% { width: 80px; opacity: 1; }
  100% { transform: translateX(300px) translateY(300px) rotate(-45deg); opacity: 0; width: 0; }
}

/* === ROOT === */
#root {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* === HEADINGS === */
h1, h2, h3, h4, h5, h6 {
  background: linear-gradient(135deg, #e0e7ff 0%, #c4b5fd 40%, #a78bfa 70%, #818cf8 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  font-weight: 700 !important;
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(139,92,246,0.4), rgba(59,130,246,0.3));
  border-radius: 4px;
}

/* === INPUTS === */
input, textarea, select {
  background: rgba(8, 12, 30, 0.8) !important;
  border: 1px solid rgba(139, 92, 246, 0.15) !important;
  border-radius: 12px !important;
  color: #e2e8f0 !important;
  transition: all 0.3s ease !important;
}

input:focus, textarea:focus, select:focus {
  border-color: rgba(139, 92, 246, 0.5) !important;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1) !important;
  outline: none !important;
}

/* === LINKS === */
a { color: #a78bfa !important; transition: all 0.3s ease !important; }
a:hover { color: #c4b5fd !important; }

/* === BADGES === */
[class*="badge"], [class*="Badge"], [class*="tag"], [class*="Tag"],
[class*="chip"], [class*="Chip"] {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(99, 102, 241, 0.15)) !important;
  border: 1px solid rgba(139, 92, 246, 0.25) !important;
  color: #c4b5fd !important;
  border-radius: 20px !important;
}

/* === PROGRESS === */
[class*="progress"], [class*="Progress"], [class*="bar"], [class*="Bar"] {
  background: rgba(8, 12, 30, 0.8) !important;
  border-radius: 10px !important;
  overflow: hidden !important;
}

[class*="progress"] > *, [class*="Progress"] > *,
[class*="bar"] > *, [class*="Bar"] > * {
  background: linear-gradient(90deg, #7c3aed, #6366f1, #3b82f6, #06b6d4) !important;
  background-size: 200% 100% !important;
  animation: shimmer 2.5s ease infinite !important;
}

/* === DIVIDER === */
[class*="divider"], [class*="Divider"], [class*="separator"], [class*="Separator"] {
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.2), transparent) !important;
  height: 1px !important;
}

/* === STATUS === */
[class*="success"], [class*="Success"] {
  color: #34d399 !important;
}

[class*="error"], [class*="Error"], [class*="danger"], [class*="Danger"] {
  color: #fb7185 !important;
}

[class*="warning"], [class*="Warning"] {
  color: #fbbf24 !important;
}

/* === MODAL === */
[class*="modal"], [class*="Modal"], [class*="dialog"], [class*="Dialog"],
[class*="popup"], [class*="Popup"], [class*="overlay"], [class*="Overlay"] {
  background: rgba(5, 8, 16, 0.92) !important;
  backdrop-filter: blur(30px) !important;
  border: 1px solid rgba(139, 92, 246, 0.15) !important;
}

/* === DOCK / BOTTOM NAV === */
[class*="dock"], [class*="Dock"],
[class*="bottom-bar"], [class*="BottomBar"],
[class*="bottom-nav"], [class*="BottomNav"],
[class*="tab-bar"], [class*="TabBar"],
[class*="nav-bar"], [class*="NavBar"],
nav, [role="navigation"] {
  background: rgba(8, 12, 30, 0.85) !important;
  backdrop-filter: blur(20px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(20px) saturate(1.2) !important;
  border-top: 1px solid rgba(139, 92, 246, 0.1) !important;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3), 0 -1px 0 rgba(139, 92, 246, 0.08) !important;
}

/* Active tab in dock */
[class*="dock"] [class*="active"], [class*="Dock"] [class*="active"],
[class*="bottom-bar"] [class*="active"],
nav [class*="active"], [role="navigation"] [class*="active"] {
  color: #a78bfa !important;
}

/* === CARD ENTRANCE === */
.animate-card {
  animation: slideUp 0.5s ease-out forwards;
  opacity: 0;
}
.animate-card:nth-child(1) { animation-delay: 0.05s; }
.animate-card:nth-child(2) { animation-delay: 0.1s; }
.animate-card:nth-child(3) { animation-delay: 0.15s; }
.animate-card:nth-child(4) { animation-delay: 0.2s; }

/* === GRADIENT BORDER === */
.gradient-border {
  position: relative;
  background: rgba(8, 12, 30, 0.8);
  border-radius: 16px;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: 16px;
  background: linear-gradient(135deg, #7c3aed, #4f46e5, #2563eb, #06b6d4, #7c3aed);
  background-size: 300% 300%;
  animation: cosmicBg 6s ease infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* === SAFE AREA === */
.telegram-safe-area {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

/* === MOBILE === */
@media (max-width: 768px) {
  ::-webkit-scrollbar { display: none; }
  * { scrollbar-width: none; }
}
