/* ==========================================================================
   BETMADA - DISCORD & X REWARDS COMMUNITY THEME DESIGN SYSTEM
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700&family=Outfit:wght@300;400;500;600;700;800;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  /* Color Palette - Inspired by BetMada Mascot Logo */
  --bg-darker: #0a0312;
  --bg-dark: #120720;
  --bg-card: #1b0d2e;
  --bg-card-hover: #26133d;
  --bg-glass: rgba(27, 13, 46, 0.82);
  --bg-glass-heavy: rgba(18, 7, 32, 0.92);

  --neon-purple: #a855f7;
  --neon-purple-glow: rgba(168, 85, 247, 0.45);
  --neon-purple-dark: #7e22ce;

  --neon-violet: #8b5cf6;
  --neon-cyan: #06b6d4;
  --neon-cyan-glow: rgba(6, 182, 212, 0.3);

  --stake-green: #00e701;
  --stake-green-glow: rgba(0, 231, 1, 0.35);

  --discord-blue: #5865F2;
  --discord-blue-glow: rgba(88, 101, 242, 0.4);

  --x-white: #ffffff;
  --x-glow: rgba(255, 255, 255, 0.3);

  --cash-gold: #fbbf24;
  --cash-gold-glow: rgba(251, 191, 36, 0.35);

  --text-primary: #ffffff;
  --text-secondary: #cbd5e1;
  --text-muted: #78716c;

  --border-light: rgba(168, 85, 247, 0.15);
  --border-purple: rgba(168, 85, 247, 0.4);
  --border-glow: rgba(168, 85, 247, 0.6);
  --border-green: rgba(0, 231, 1, 0.3);
  --border-discord: rgba(88, 101, 242, 0.4);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-full: 9999px;

  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-darker);
}
::-webkit-scrollbar-thumb {
  background: #3b1566;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--neon-purple);
}

/* Global Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent; /* Makes tap on mobile feel native */
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-darker);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(168, 85, 247, 0.18) 0%, transparent 40%),
    radial-gradient(circle at 85% 35%, rgba(88, 101, 242, 0.14) 0%, transparent 45%),
    radial-gradient(circle at 50% 80%, rgba(0, 231, 1, 0.08) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100dvh;
}

/* Typography Utility */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-main);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
p { font-size: clamp(0.9rem, 2vw, 1rem); }

.text-gradient-purple {
  background: linear-gradient(135deg, #ffffff 0%, #c084fc 50%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-discord {
  background: linear-gradient(135deg, #ffffff 0%, #7983f5 50%, #5865F2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-green {
  background: linear-gradient(135deg, #ffffff 0%, #00e701 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-gold {
  background: linear-gradient(135deg, #fff 0%, #fbbf24 50%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-stake {
  color: var(--stake-green);
}

.text-purple {
  color: var(--neon-purple);
}

.text-discord {
  color: var(--discord-blue);
}

.font-mono {
  font-family: var(--font-mono);
}

/* Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Glassmorphism Cards */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-card:hover {
  border-color: var(--border-purple);
}

.glass-card-hover:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: 0 12px 40px var(--neon-purple-glow);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #a855f7 0%, #7e22ce 100%);
  color: #ffffff;
  box-shadow: 0 4px 20px var(--neon-purple-glow);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(168, 85, 247, 0.6);
  background: linear-gradient(135deg, #c084fc 0%, #9333ea 100%);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-discord {
  background: linear-gradient(135deg, #5865F2 0%, #4752C4 100%);
  color: #ffffff;
  box-shadow: 0 4px 20px var(--discord-blue-glow);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-discord:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(88, 101, 242, 0.65);
  background: linear-gradient(135deg, #6975F3 0%, #5865F2 100%);
}

.btn-x {
  background: linear-gradient(135deg, #27272a 0%, #09090b 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 18px rgba(255, 255, 255, 0.1);
}

.btn-x:hover {
  transform: translateY(-2px);
  border-color: #ffffff;
  box-shadow: 0 6px 25px rgba(255, 255, 255, 0.25);
}

.btn-stake {
  background: linear-gradient(135deg, #00e701 0%, #00b301 100%);
  color: #0a0312;
  box-shadow: 0 4px 20px var(--stake-green-glow);
  font-weight: 800;
}

.btn-stake:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(0, 231, 1, 0.5);
  background: linear-gradient(135deg, #22ff22 0%, #00e701 100%);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  backdrop-filter: blur(10px);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--neon-purple);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  border-radius: var(--radius-md);
}

/* Badges & Tags */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-live {
  background: rgba(255, 42, 95, 0.15);
  color: #ff2a5f;
  border: 1px solid rgba(255, 42, 95, 0.4);
}

.badge-live-dot {
  width: 7px;
  height: 7px;
  background-color: #ff2a5f;
  border-radius: 50%;
  box-shadow: 0 0 8px #ff2a5f;
  animation: pulse-live 1.5s infinite;
}

.badge-discord {
  background: rgba(88, 101, 242, 0.18);
  color: #7983f5;
  border: 1px solid var(--border-discord);
}

.badge-x {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.badge-purple {
  background: rgba(168, 85, 247, 0.15);
  color: var(--neon-purple);
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.badge-stake {
  background: rgba(0, 231, 1, 0.12);
  color: var(--stake-green);
  border: 1px solid rgba(0, 231, 1, 0.3);
}

.badge-gold {
  background: rgba(251, 191, 36, 0.15);
  color: var(--cash-gold);
  border: 1px solid rgba(251, 191, 36, 0.35);
}

/* Animations */
@keyframes pulse-live {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
  100% { opacity: 1; transform: scale(1); }
}

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

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

.animate-float {
  animation: float 4s ease-in-out infinite;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-card);
  border: 1px solid var(--neon-purple);
  color: var(--text-primary);
  padding: 0.9rem 1.4rem;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 30px var(--neon-purple-glow);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  animation: slideInRight 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), fadeOut 0.3s ease 2.7s forwards;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.9); }
}

/* Section Header styling */
.section-title-wrap {
  text-align: center;
  margin-bottom: 3rem;
}

.section-subtitle {
  color: var(--neon-purple);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.section-title {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.section-description {
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto;
  font-size: 1rem;
}

/* Form controls */
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(18, 7, 32, 0.85);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-input:focus {
  border-color: var(--neon-purple);
  box-shadow: 0 0 14px var(--neon-purple-glow);
}

/* Slider Controls */
input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
}
input[type=range]:focus {
  outline: none;
}
input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 8px;
  cursor: pointer;
  background: #19092d;
  border-radius: 4px;
  border: 1px solid var(--border-light);
}
input[type=range]::-webkit-slider-thumb {
  height: 22px;
  width: 22px;
  border-radius: 50%;
  background: var(--neon-purple);
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: -7px;
  box-shadow: 0 0 14px var(--neon-purple);
  transition: transform 0.15s ease;
}
input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Responsive grid layouts */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; gap: 1rem; }
  
  /* Global typography scaling */
  .section-title { font-size: 1.75rem; }
  
  /* Container padding */
  .container { padding: 0 1rem; }
  
  /* Utilities */
  .btn { width: 100%; justify-content: center; margin-bottom: 0.5rem; }
  
  /* Add padding to bottom so content isn't hidden by bottom nav */
  body {
    padding-bottom: 70px;
  }
}

/* Bottom Nav Bar (Mobile App UI) */
.bottom-nav-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background: rgba(18, 7, 32, 0.95);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-top: 1px solid var(--border-purple);
  z-index: 1000;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-secondary);
  gap: 4px;
  width: 25%;
  height: 100%;
  transition: color var(--transition-fast);
}

.bottom-nav-item.active {
  color: var(--neon-purple);
}

.bottom-nav-icon {
  font-size: 1.4rem;
}

.bottom-nav-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
}

@media (max-width: 768px) {
  .bottom-nav-bar {
    display: flex;
  }
}
