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

/* === KEYFRAMES === */
@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 {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.3); }
}

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

@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; }
}

@keyframes cosmic-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.2), 0 0 60px rgba(99, 102, 241, 0.1); }
  50% { box-shadow: 0 0 40px rgba(139, 92, 246, 0.4), 0 0 80px rgba(59, 130, 246, 0.2), 0 0 120px rgba(99, 102, 241, 0.1); }
}

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

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

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

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

@keyframes aurora {
  0% { background-position: 0% 50%; filter: hue-rotate(0deg); }
  50% { background-position: 100% 50%; filter: hue-rotate(30deg); }
  100% { background-position: 0% 50%; filter: hue-rotate(0deg); }
}

/* === 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%),
    radial-gradient(ellipse at 70% 60%, rgba(15, 23, 80, 0.2) 0%, transparent 40%),
    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%),
    radial-gradient(ellipse 300px 200px at 30% 80%, rgba(6, 182, 212, 0.04) 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;
}

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

/* === CARDS — deep space glass === */
[class*="card"], [class*="Card"], [class*="panel"], [class*="Panel"],
[class*="block"], [class*="Block"], [class*="item"], [class*="Item"],
[class*="container"], [class*="Container"] {
  background: rgba(8, 12, 30, 0.7) !important;
  backdrop-filter: blur(24px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(24px) saturate(1.2) !important;
  border: 1px solid rgba(139, 92, 246, 0.12) !important;
  border-radius: 16px !important;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

[class*="card"]:hover, [class*="Card"]:hover,
[class*="panel"]:hover, [class*="Panel"]:hover,
[class*="block"]:hover, [class*="Block"]:hover {
  border-color: rgba(139, 92, 246, 0.35) !important;
  box-shadow:
    0 8px 32px rgba(139, 92, 246, 0.12),
    0 0 0 1px rgba(139, 92, 246, 0.08),
    inset 0 1px 0 rgba(255,255,255,0.03) !important;
  transform: translateY(-1px) !important;
}

/* === BUTTONS — cosmic gradient === */
button, [class*="btn"], [class*="Btn"], [class*="button"], [class*="Button"] {
  background: linear-gradient(135deg, #7c3aed 0%, #6366f1 40%, #4f46e5 70%, #4338ca 100%) !important;
  background-size: 200% 200% !important;
  animation: shimmer 4s ease infinite !important;
  border: none !important;
  border-radius: 12px !important;
  color: white !important;
  font-weight: 600 !important;
  transition: all 0.3s ease !important;
  position: relative;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

button::before, [class*="btn"]::before, [class*="Btn"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: 0.6s;
}

button:hover::before, [class*="btn"]:hover::before,
[class*="Btn"]::hover::before { left: 100%; }

button:hover, [class*="btn"]:hover, [class*="Btn"]:hover {
  transform: translateY(-1px) !important;
  box-shadow:
    0 8px 24px rgba(124, 58, 237, 0.35),
    0 0 40px rgba(99, 102, 241, 0.15) !important;
}

button:active, [class*="btn"]:active {
  transform: translateY(0) !important;
}

/* Primary CTA — brighter */
button[class*="primary"], button[class*="Primary"],
[class*="btn-primary"], [class*="btnPrimary"] {
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 40%, #6d28d9 100%) !important;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3) !important;
}

/* === TEXT === */
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;
  letter-spacing: -0.01em;
}

/* Body text */
p, span, div {
  color: rgba(226, 232, 240, 0.9);
}

/* === 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;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(139,92,246,0.6), rgba(59,130,246,0.5));
}

/* === 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), 0 0 20px 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; text-shadow: 0 0 8px rgba(139,92,246,0.4); }

/* === 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;
  font-weight: 500 !important;
}

/* === PRICES === */
[class*="price"], [class*="Price"], [class*="amount"], [class*="Amount"],
[class*="sum"], [class*="Sum"], [class*="cost"], [class*="Cost"] {
  background: linear-gradient(135deg, #c4b5fd 0%, #818cf8 50%, #60a5fa 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  font-weight: 800 !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;
}

/* === AVATAR === */
[class*="avatar"], [class*="Avatar"] {
  border: 2px solid rgba(139, 92, 246, 0.3) !important;
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.15) !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;
}

/* === STATUS === */
[class*="online"], [class*="Online"], [class*="active"], [class*="Active"],
[class*="success"], [class*="Success"] {
  color: #34d399 !important;
  text-shadow: 0 0 8px rgba(52, 211, 153, 0.4);
}

[class*="error"], [class*="Error"], [class*="danger"], [class*="Danger"] {
  color: #fb7185 !important;
  text-shadow: 0 0 8px rgba(251, 113, 133, 0.4);
}

[class*="warning"], [class*="Warning"] {
  color: #fbbf24 !important;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

/* === 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;
}

/* === LOGO GLOW === */
.logo-animated {
  animation: cosmic-pulse 4s ease-in-out infinite, float 6s ease-in-out infinite;
}

/* === 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; }
.animate-card:nth-child(5) { animation-delay: 0.25s; }
.animate-card:nth-child(6) { animation-delay: 0.3s; }

/* === 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; }
}
