@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  --color-yexe: #e50914;
  --color-accent: #5c6ac4;
  --bg-dark: #0a0a0f;
  --bg-surface: #12121a;
  --bg-card: #1a1a24;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --border-color: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Custom scrollbar - dark theme */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-surface);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-yexe);
}

/* Typography */
.font-display {
  font-family: "Inter", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ==================== HERO SECTION ==================== */
.hero-section {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 0%, rgba(229, 9, 20, 0.15) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 50%, rgba(92, 106, 196, 0.1) 0%, transparent 40%),
              linear-gradient(180deg, var(--bg-dark) 0%, #0d0d14 100%);
}

.hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

/* ==================== 3D FLOATING ELEMENTS ==================== */
.floating-3d-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  perspective: 2000px;
  overflow: hidden;
}

.floating-3d-element {
  position: absolute;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

/* Glowing orbs */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
  animation: orb-float 20s ease-in-out infinite;
}

.glow-orb.red {
  background: var(--color-yexe);
  width: 400px;
  height: 400px;
}

.glow-orb.purple {
  background: var(--color-accent);
  width: 300px;
  height: 300px;
}

.glow-orb.cyan {
  background: #06b6d4;
  width: 250px;
  height: 250px;
}

@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.1); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(40px, 30px) scale(1.05); }
}

/* 3D Card Effect */
.card-3d {
  background: linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.05) inset,
    0 20px 60px -20px rgba(0, 0, 0, 0.5),
    0 40px 100px -40px rgba(229, 9, 20, 0.15);
  transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform-style: preserve-3d;
}

.card-3d:hover {
  transform: translateY(-10px) rotateX(5deg) rotateY(-5deg);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.1) inset,
    0 30px 80px -20px rgba(0, 0, 0, 0.6),
    0 60px 120px -40px rgba(229, 9, 20, 0.25);
}

/* Dashboard preview mockup */
.dashboard-preview {
  background: var(--bg-surface);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
}

.dashboard-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, var(--bg-dark) 100%);
  pointer-events: none;
  z-index: 10;
}

/* ==================== FLOATING TRADERS ==================== */
.floating-trader {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 100px;
  font-size: 14px;
  color: white;
  animation: float-trader 15s ease-in-out infinite;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.floating-trader .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.floating-trader .profit {
  color: #22c55e;
  font-weight: 600;
}

@keyframes float-trader {
  0%, 100% { transform: translateY(0) translateX(0); }
  25% { transform: translateY(-20px) translateX(10px); }
  50% { transform: translateY(10px) translateX(-15px); }
  75% { transform: translateY(-10px) translateX(20px); }
}

/* Different animation delays and paths */
.floating-trader:nth-child(1) { animation-duration: 18s; animation-delay: 0s; }
.floating-trader:nth-child(2) { animation-duration: 22s; animation-delay: -5s; }
.floating-trader:nth-child(3) { animation-duration: 20s; animation-delay: -10s; }
.floating-trader:nth-child(4) { animation-duration: 24s; animation-delay: -3s; }
.floating-trader:nth-child(5) { animation-duration: 19s; animation-delay: -8s; }
.floating-trader:nth-child(6) { animation-duration: 21s; animation-delay: -12s; }

/* ==================== BUTTONS ==================== */
.btn-primary {
  background: linear-gradient(135deg, var(--color-yexe) 0%, #c50812 100%);
  color: white;
  padding: 14px 32px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(229, 9, 20, 0.4);
}

.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(229, 9, 20, 0.5);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: white;
  padding: 14px 32px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* ==================== NAVIGATION ==================== */
.nav-dark {
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.nav-pill:hover {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

.nav-pill.active {
  background: var(--color-yexe);
  color: white;
}

/* ==================== FEATURE CARDS ==================== */
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
}

.feature-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-card:hover {
  transform: translateY(-8px);
  border-color: rgba(229, 9, 20, 0.3);
  box-shadow: 0 20px 60px -20px rgba(229, 9, 20, 0.2);
}

.icon-container {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.icon-container.red {
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.2), rgba(229, 9, 20, 0.05));
  color: var(--color-yexe);
}

.icon-container.blue {
  background: linear-gradient(135deg, rgba(92, 106, 196, 0.2), rgba(92, 106, 196, 0.05));
  color: var(--color-accent);
}

.icon-container.green {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.05));
  color: #22c55e;
}

/* ==================== TESTIMONIALS ==================== */
.testimonial-card {
  flex-shrink: 0;
  width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 32px;
  transition: all 0.3s ease;
}

.testimonial-card:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.5);
}

.testimonial-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  font-weight: 700;
}

.testimonial-stars {
  color: #fbbf24;
  display: flex;
  gap: 2px;
}

.testimonials-track {
  display: flex;
  gap: 24px;
  animation: scroll-testimonials 60s linear infinite;
}

.testimonials-track:hover {
  animation-play-state: paused;
}

@keyframes scroll-testimonials {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ==================== MARQUEE ==================== */
.marquee-container {
  overflow: hidden;
  position: relative;
}

.marquee-container::before,
.marquee-container::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 150px;
  z-index: 10;
  pointer-events: none;
}

.marquee-container::before {
  left: 0;
  background: linear-gradient(to right, var(--bg-dark), transparent);
}

.marquee-container::after {
  right: 0;
  background: linear-gradient(to left, var(--bg-dark), transparent);
}

.marquee {
  display: flex;
  gap: 3rem;
  animation: marquee 40s linear infinite;
}

.marquee:hover {
  animation-play-state: paused;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.trader-profile {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 100px;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.trader-profile:hover {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.trader-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
}

.trader-info {
  display: flex;
  flex-direction: column;
}

.trader-name {
  font-weight: 600;
  font-size: 14px;
  color: white;
}

.trader-profit {
  font-size: 13px;
  color: #22c55e;
  font-weight: 500;
}

/* ==================== GRADIENT TEXT ==================== */
.gradient-text {
  background: linear-gradient(135deg, var(--color-yexe) 0%, #ff6b6b 50%, var(--color-accent) 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 5s ease infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ==================== STATS ==================== */
.stat-card {
  text-align: center;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  transition: all 0.3s ease;
}

.stat-card:hover {
  border-color: rgba(229, 9, 20, 0.3);
  transform: translateY(-4px);
}

.stat-value {
  font-size: 3rem;
  font-weight: 800;
  color: white;
}

.stat-value span {
  color: var(--color-yexe);
}

/* ==================== PRICING ==================== */
.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 2.5rem;
  position: relative;
  transition: all 0.3s ease;
}

.pricing-card.popular {
  border-color: var(--color-yexe);
  box-shadow: 0 0 60px -20px rgba(229, 9, 20, 0.4);
}

.pricing-card:hover {
  transform: translateY(-8px);
}

/* ==================== ANIMATIONS ==================== */
.float-animation {
  animation: floating 6s ease-in-out infinite;
}

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

.pulse-glow {
  animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(229, 9, 20, 0.3); }
  50% { box-shadow: 0 0 40px rgba(229, 9, 20, 0.6); }
}

/* Live indicator */
.live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-indicator::before {
  content: "";
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* ==================== RESPONSIVE ==================== */

/* Extra Small devices (phones, 320px to 480px) */
@media (max-width: 480px) {
  .floating-trader {
    display: none;
  }

  .glow-orb {
    width: 120px !important;
    height: 120px !important;
    filter: blur(50px);
  }

  .testimonial-card {
    width: 280px;
    padding: 20px;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }

  .feature-card {
    padding: 1.25rem;
    border-radius: 16px;
  }

  .icon-container {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }

  .pricing-card {
    padding: 1.5rem;
    border-radius: 16px;
  }

  .btn-primary,
  .btn-secondary {
    padding: 12px 24px;
    font-size: 14px;
    border-radius: 10px;
  }

  .card-3d {
    border-radius: 16px;
  }

  .dashboard-preview {
    border-radius: 12px;
  }

  .nav-pill {
    padding: 8px 14px;
    font-size: 12px;
  }

  .trader-profile {
    padding: 10px 16px;
    gap: 10px;
  }

  .trader-avatar {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }

  .trader-name {
    font-size: 12px;
  }

  .trader-profit {
    font-size: 11px;
  }

  /* Typography scaling */
  h1.font-display {
    font-size: 2rem !important;
    line-height: 1.2;
  }

  h2.font-display {
    font-size: 1.5rem !important;
  }

  .gradient-text {
    font-size: inherit;
  }

  /* Marquee speed on mobile */
  .marquee {
    animation-duration: 25s;
    gap: 1.5rem;
  }

  .testimonials-track {
    animation-duration: 40s;
    gap: 16px;
  }
}

/* Small devices (large phones, 481px to 640px) */
@media (min-width: 481px) and (max-width: 640px) {
  .floating-trader {
    display: none;
  }

  .glow-orb {
    width: 150px !important;
    height: 150px !important;
    filter: blur(60px);
  }

  .testimonial-card {
    width: 300px;
    padding: 24px;
  }

  .stat-value {
    font-size: 1.75rem;
  }
}

/* Medium devices (tablets, 641px to 768px) */
@media (min-width: 641px) and (max-width: 768px) {
  .floating-trader {
    display: none;
  }

  .glow-orb {
    width: 180px !important;
    height: 180px !important;
  }

  .testimonial-card {
    width: 320px;
  }

  .stat-value {
    font-size: 2rem;
  }
}

/* Large tablets (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .floating-trader {
    transform: scale(0.85);
  }

  .floating-trader .avatar {
    width: 32px;
    height: 32px;
  }

  .glow-orb {
    width: 250px !important;
    height: 250px !important;
  }
}

/* Improve touch targets on mobile */
@media (max-width: 768px) {
  button, a {
    min-height: 44px;
    min-width: 44px;
  }

  .nav-pill {
    min-height: 40px;
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .floating-trader,
  .glow-orb,
  .float-animation,
  .marquee,
  .testimonials-track {
    animation: none !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .feature-card,
  .testimonial-card,
  .pricing-card,
  .stat-card {
    border-width: 2px;
  }
}

/* Custom selection */
::selection {
  background: rgba(229, 9, 20, 0.3);
  color: inherit;
}

/* ==================== LIQUID GLASS COMPATIBILITY ==================== */
.glass-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.glass-badge.badge-accent {
  color: #e50914;
  border-color: rgba(229, 9, 20, 0.2);
  background: rgba(229, 9, 20, 0.12);
}

.glass-badge.badge-emerald {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.12);
}

.glass-badge.badge-cyan {
  color: #5c6ac4;
  border-color: rgba(92, 106, 196, 0.3);
  background: rgba(92, 106, 196, 0.12);
}

.glass-badge.badge-sun {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.12);
}

.glass-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.5);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.theme-toggle-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--color-yexe);
  box-shadow: 0 0 8px rgba(229, 9, 20, 0.6);
}
