/* ============================================
   BotRanks Premium UI - Dark Finance Theme
   ============================================ */

/* ============ CSS Variables ============ */
:root {
  /* Primary Colors */
  --premium-primary: #3B82F6;
  --premium-secondary: #8B5CF6;
  --premium-accent: #06B6D4;

  /* Status Colors */
  --premium-success: #10B981;
  --premium-error: #EF4444;
  --premium-warning: #F59E0B;

  /* Background Layers */
  --premium-bg-base: #0A0F1C;
  --premium-bg-card: #111827;
  --premium-bg-elevated: #1F2937;
  --premium-bg-glass: rgba(17, 24, 39, 0.8);

  /* Border Colors */
  --premium-border: rgba(255, 255, 255, 0.08);
  --premium-border-glow: rgba(59, 130, 246, 0.3);

  /* Text Colors */
  --premium-text-primary: #F9FAFB;
  --premium-text-secondary: #9CA3AF;
  --premium-text-muted: #6B7280;

  /* Gradients */
  --gradient-brand: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 50%, #06B6D4 100%);
  --gradient-card: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 100%);
  --gradient-glow: radial-gradient(ellipse at center, rgba(59, 130, 246, 0.15) 0%, transparent 70%);
}

/* ============ Animations ============ */

/* Fade In Up */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Pulse Glow */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
  }
  50% {
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.4);
  }
}

/* Shimmer */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Float */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Gradient Shift */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Number Count Up */
@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Blink */
@keyframes blink {
  0%, 50%, 100% { opacity: 1; }
  25%, 75% { opacity: 0.4; }
}

/* Spin Slow */
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ============ Utility Classes ============ */

/* Animations - DISABLED for performance */
.animate-fade-in-up {
  opacity: 1;
}

.animate-fade-in {
  opacity: 1;
}

.animate-pulse-glow {
  /* disabled */
}

.animate-float {
  /* disabled */
}

.animate-shimmer {
  /* disabled */
}

.animate-gradient {
  /* disabled */
}

/* Animation Delays - DISABLED */
.delay-100 { }
.delay-200 { }
.delay-300 { }
.delay-400 { }
.delay-500 { }

/* ============ Gradient Classes ============ */

.gradient-brand {
  background: var(--gradient-brand);
}

.gradient-brand-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-border {
  position: relative;
  background: var(--premium-bg-card);
  border-radius: 16px;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.5), rgba(139, 92, 246, 0.5), rgba(6, 182, 212, 0.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* ============ Glassmorphism ============ */

.glass {
  background: var(--premium-bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--premium-border);
}

.glass-card {
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
}

/* Dropdown menus need more opacity for readability */
.dropdown-content.glass-card,
ul.glass-card[tabindex] {
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.glass-navbar {
  background: rgba(10, 15, 28, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* ============ Glow Effects ============ */

.glow-sm {
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.15);
}

.glow-md {
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
}

.glow-lg {
  box-shadow: 0 0 50px rgba(59, 130, 246, 0.25);
}

.glow-success {
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.glow-error {
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.text-glow-success {
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
}

.text-glow-error {
  text-shadow: 0 0 20px rgba(239, 68, 68, 0.6);
}

.text-glow-primary {
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.6);
}

/* ============ Premium Cards ============ */

.premium-card {
  background: var(--premium-bg-card);
  border: 1px solid var(--premium-border);
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.premium-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);
}

.premium-card:hover {
  transform: translateY(-4px);
  border-color: var(--premium-border-glow);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 0 40px rgba(59, 130, 246, 0.1);
}

/* Stat Card */
.premium-stat-card {
  background: linear-gradient(180deg, rgba(31, 41, 55, 0.8) 0%, rgba(17, 24, 39, 0.9) 100%);
  border: 1px solid var(--premium-border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.premium-stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: var(--gradient-glow);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.premium-stat-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
  transform: translateY(-2px);
}

.premium-stat-card:hover::after {
  opacity: 1;
}

/* ============ Premium Buttons ============ */

.btn-premium {
  background: var(--gradient-brand);
  border: none;
  color: white;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-premium::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.btn-premium:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
}

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

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

.btn-glass {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ============ Premium Inputs ============ */

.input-premium {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.875rem 1rem;
  color: var(--premium-text-primary);
  transition: all 0.3s ease;
}

.input-premium:focus {
  outline: none;
  border-color: var(--premium-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

.input-premium::placeholder {
  color: var(--premium-text-muted);
}

/* ============ Status Indicators ============ */

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot-active {
  background: var(--premium-success);
  box-shadow: 0 0 10px var(--premium-success);
  animation: blink 2s infinite;
}

.status-dot-stopped {
  background: var(--premium-text-muted);
}

.status-dot-error {
  background: var(--premium-error);
  box-shadow: 0 0 10px var(--premium-error);
}

/* ============ Data Display ============ */

.data-value {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.data-value-lg {
  font-size: 2rem;
  line-height: 1;
}

.data-value-positive {
  color: var(--premium-success);
}

.data-value-negative {
  color: var(--premium-error);
}

.data-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.data-change-positive {
  background: rgba(16, 185, 129, 0.15);
  color: var(--premium-success);
}

.data-change-negative {
  background: rgba(239, 68, 68, 0.15);
  color: var(--premium-error);
}

/* ============ Navigation ============ */

.nav-link-premium {
  position: relative;
  color: var(--premium-text-secondary);
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: color 0.3s ease;
}

.nav-link-premium:hover {
  color: var(--premium-text-primary);
}

.nav-link-premium::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--gradient-brand);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link-premium:hover::after,
.nav-link-premium.active::after {
  width: 100%;
}

.nav-link-premium.active {
  color: var(--premium-text-primary);
}

/* ============ Tables ============ */

.premium-table {
  width: 100%;
  border-collapse: collapse;
}

.premium-table th {
  text-align: left;
  padding: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--premium-text-muted);
  border-bottom: 1px solid var(--premium-border);
}

.premium-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--premium-border);
  color: var(--premium-text-primary);
}

.premium-table tr {
  transition: background 0.2s ease;
}

.premium-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* ============ Badges ============ */

.badge-premium {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
}

.badge-rank-1 {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #1F2937;
}

.badge-rank-2 {
  background: linear-gradient(135deg, #9CA3AF, #6B7280);
  color: #1F2937;
}

.badge-rank-3 {
  background: linear-gradient(135deg, #CD7F32, #A0522D);
  color: white;
}

/* ============ Progress Bars ============ */

.progress-premium {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-premium-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 1s ease;
}

.progress-premium-bar-primary {
  background: var(--gradient-brand);
}

.progress-premium-bar-success {
  background: linear-gradient(90deg, #10B981, #34D399);
}

.progress-premium-bar-warning {
  background: linear-gradient(90deg, #F59E0B, #FBBF24);
}

/* ============ Chart Containers ============ */

.chart-container {
  background: var(--premium-bg-card);
  border: 1px solid var(--premium-border);
  border-radius: 16px;
  padding: 1.5rem;
  position: relative;
}

.chart-container::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: var(--gradient-glow);
  opacity: 0.5;
  pointer-events: none;
}

/* ============ Scrollbar ============ */

.premium-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.premium-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.premium-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.premium-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ============ Responsive ============ */

@media (max-width: 768px) {
  .premium-card {
    border-radius: 12px;
  }

  .premium-stat-card {
    padding: 1rem;
  }

  .data-value-lg {
    font-size: 1.5rem;
  }

  /* Disable hover effects on touch devices */
  .premium-card:hover {
    transform: none;
  }
}

/* ============ Mobile Navigation ============ */

#mobile-menu {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(10, 15, 28, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

#mobile-menu-overlay {
  transition: opacity 0.3s ease;
}

/* Mobile menu scrollbar */
#mobile-menu nav {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

#mobile-menu nav::-webkit-scrollbar {
  width: 4px;
}

#mobile-menu nav::-webkit-scrollbar-track {
  background: transparent;
}

#mobile-menu nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

/* ============ Mobile Content Adjustments ============ */

@media (max-width: 640px) {
  /* Smaller padding on mobile */
  main.px-6 {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Smaller text on mobile */
  h1 {
    font-size: 1.75rem !important;
  }

  h2 {
    font-size: 1.25rem !important;
  }

  /* Adjust button sizes */
  .btn-premium {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
  }

  /* Compact cards on mobile */
  .premium-card {
    padding: 1rem;
  }

  /* Footer adjustments */
  footer .grid {
    gap: 1.5rem;
  }
}

/* ============ Tablet Adjustments ============ */

@media (min-width: 641px) and (max-width: 1023px) {
  /* Medium screens - 2 column layouts */
  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============ Safe Area Insets for Notched Devices ============ */

@supports (padding: env(safe-area-inset-bottom)) {
  #mobile-menu {
    padding-bottom: env(safe-area-inset-bottom);
  }

  footer {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ============ HTMX Indicators ============ */

/* Show/hide elements during HTMX requests */
.htmx-request .htmx-hide-on-request {
  display: none !important;
}

.htmx-request .htmx-show-on-request {
  display: inline-flex !important;
}

/* Button disabled state during request */
.htmx-btn.htmx-request {
  opacity: 0.7;
  pointer-events: none;
}

/* Spin animation for loading icon */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* ============ Dark Theme Overrides for DaisyUI ============ */

[data-theme="dark"] {
  --b1: 10 15 28;
  --b2: 17 24 39;
  --b3: 31 41 55;
  --bc: 249 250 251;
  --p: 59 130 246;
  --pf: 37 99 235;
  --pc: 255 255 255;
  --s: 139 92 246;
  --sf: 124 58 237;
  --sc: 255 255 255;
  --a: 6 182 212;
  --af: 8 145 178;
  --ac: 255 255 255;
  --su: 16 185 129;
  --er: 239 68 68;
  --wa: 245 158 11;
  --in: 59 130 246;
}
