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

:root {
  --bg-primary: #050816;
  --bg-secondary: #0a0f1e;
  --bg-card: rgba(13, 18, 36, 0.75);
  --bg-card-hover: rgba(20, 27, 50, 0.85);
  --border-color: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(99, 102, 241, 0.35);
  --border-focus: rgba(99, 102, 241, 0.6);
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: rgba(99, 102, 241, 0.15);
  --accent-glow: rgba(99, 102, 241, 0.25);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --gradient-cyan: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

.hidden {
  display: none !important;
}

/* ============================
   ANIMATED BACKGROUND
   ============================ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 800px 600px at 20% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 600px 500px at 80% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 500px 400px at 50% 50%, rgba(6, 182, 212, 0.04) 0%, transparent 60%);
  z-index: 0;
  pointer-events: none;
  animation: bgShift 20s ease-in-out infinite alternate;
}

@keyframes bgShift {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}

/* Floating orb decorations */
.floating-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
  pointer-events: none;
  z-index: 0;
  animation: orbFloat 15s ease-in-out infinite alternate;
}

.floating-orb-1 {
  width: 400px;
  height: 400px;
  background: var(--accent);
  top: -100px;
  left: -100px;
  animation-duration: 18s;
}

.floating-orb-2 {
  width: 300px;
  height: 300px;
  background: #8b5cf6;
  bottom: -80px;
  right: -80px;
  animation-duration: 22s;
  animation-delay: -5s;
}

.floating-orb-3 {
  width: 250px;
  height: 250px;
  background: #06b6d4;
  top: 50%;
  left: 50%;
  animation-duration: 25s;
  animation-delay: -10s;
}

@keyframes orbFloat {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 30px) scale(0.95); }
  100% { transform: translate(10px, -10px) scale(1.02); }
}

/* ============================
   SIDEBAR
   ============================ */
aside {
  z-index: 40 !important;
  background: rgba(8, 12, 25, 0.92) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border-right: 1px solid rgba(99, 102, 241, 0.1) !important;
}

/* ============================
   GLASSMORPHISM PANELS
   ============================ */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.glass-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, transparent 50%, rgba(139, 92, 246, 0.1) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.glass-panel:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  box-shadow:
    0 8px 32px rgba(99, 102, 241, 0.08),
    0 0 0 1px rgba(99, 102, 241, 0.05);
  transform: translateY(-2px);
}

.glass-panel:hover::before {
  opacity: 1;
}

/* ============================
   METRIC CARDS (overview stats)
   ============================ */
.metric-card {
  position: relative;
  overflow: hidden;
}

.metric-card .metric-icon-bg {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  opacity: 0.08;
  transition: all 0.5s ease;
}

.metric-card:hover .metric-icon-bg {
  opacity: 0.15;
  transform: scale(1.2);
}

.metric-value {
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================
   FEATURE STATUS CARDS
   ============================ */
.feature-card {
  position: relative;
  overflow: hidden;
}

.feature-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-card:hover::after {
  transform: scaleX(1);
}

.feature-icon-wrapper {
  position: relative;
  overflow: hidden;
}

.feature-icon-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.feature-card:hover .feature-icon-wrapper::after {
  opacity: 0.15;
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); opacity: 0.15; }
  50% { transform: scale(1.1); opacity: 0.25; }
}

/* ============================
   CUSTOM SCROLLBAR
   ============================ */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.2);
  border-radius: 10px;
  transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.5);
}

/* ============================
   PULSING STATUS BADGES
   ============================ */
.pulse-green {
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
}

/* ============================
   INPUTS & SELECTS
   ============================ */
.custom-input, .custom-select {
  width: 100%;
  background: rgba(8, 12, 30, 0.7);
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
}

.custom-input::placeholder {
  color: var(--text-dim);
}

.custom-input:hover, .custom-select:hover {
  border-color: rgba(99, 102, 241, 0.2);
  background: rgba(12, 18, 38, 0.8);
}

.custom-input:focus, .custom-select:focus {
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px var(--accent-glow),
    0 0 20px rgba(99, 102, 241, 0.1);
  background: rgba(12, 18, 38, 0.9);
}

.custom-select option {
  background-color: #0f172a;
  color: #fff;
  padding: 8px;
}

/* ============================
   TAB ACTIVE STYLES
   ============================ */
.nav-item {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gradient-primary);
  border-radius: 0 4px 4px 0;
  transform: scaleY(0);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-item:hover::before {
  transform: scaleY(0.5);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.02) 100%) !important;
  color: #fff !important;
  border-left: none !important;
}

.nav-item.active::before {
  transform: scaleY(1);
}

.nav-item:hover {
  background: rgba(99, 102, 241, 0.08) !important;
}

/* Subtle shimmer on active nav */
.nav-item.active::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(99, 102, 241, 0.05) 50%, transparent 100%);
  animation: navShimmer 3s ease-in-out infinite;
}

@keyframes navShimmer {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

/* ============================
   BUTTONS
   ============================ */
.btn-primary {
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 10px 22px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow:
    0 4px 15px rgba(99, 102, 241, 0.3),
    0 0 0 1px rgba(99, 102, 241, 0.1) inset;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

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

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 8px 25px rgba(99, 102, 241, 0.4),
    0 0 40px rgba(99, 102, 241, 0.15);
}

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

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.btn-secondary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

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

/* ============================
   TOAST NOTIFICATIONS
   ============================ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 14px 22px;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: white;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  backdrop-filter: blur(20px);
}

.toast.success {
  background: linear-gradient(135deg, rgba(6, 78, 59, 0.9) 0%, rgba(4, 120, 87, 0.8) 100%);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.toast.error {
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.9) 0%, rgba(153, 27, 27, 0.8) 100%);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

@keyframes toastSlideIn {
  from {
    transform: translateX(120%) scale(0.8);
    opacity: 0;
  }
  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

/* ============================
   SECTION TITLE DECORATIONS
   ============================ */
.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ============================
   STAT NUMBER COUNTER ANIMATION
   ============================ */
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.stat-number {
  animation: countUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ============================
   DISCORD PREVIEW ENHANCED
   ============================ */
.discord-preview-box {
  background: #313338;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.3);
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  transition: all 0.3s ease;
}

.discord-preview-box:hover {
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(99, 102, 241, 0.1) inset;
}

/* ============================
   LABEL & DESCRIPTION STYLES
   ============================ */
.setting-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #d1d5db;
  margin-bottom: 8px;
}

.setting-hint {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 6px;
  line-height: 1.4;
}

/* ============================
   PAGE LOAD ANIMATION
   ============================ */
@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tab-content:not(.hidden) {
  animation: pageEnter 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ============================
   GRID CARD STAGGER ANIMATION
   ============================ */
.glass-panel {
  animation: cardEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Stagger child cards */
.grid > .glass-panel:nth-child(1) { animation-delay: 0.05s; }
.grid > .glass-panel:nth-child(2) { animation-delay: 0.1s; }
.grid > .glass-panel:nth-child(3) { animation-delay: 0.15s; }
.grid > .glass-panel:nth-child(4) { animation-delay: 0.2s; }

/* ============================
   HEADER STYLES
   ============================ */
.dashboard-header {
  position: relative;
}

.version-badge {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  font-size: 0.7rem;
  padding: 2px 10px;
  border-radius: 100px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

/* ============================
   SIDEBAR FOOTER INFO
   ============================ */
.sidebar-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.sidebar-info-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* ============================
   RESPONSIVE TWEAKS
   ============================ */
@media (max-width: 1024px) {
  aside {
    width: 220px !important;
  }
  main {
    margin-left: 220px !important;
  }
}

@media (max-width: 768px) {
  aside {
    display: none !important;
  }
  main {
    margin-left: 0 !important;
    padding: 16px !important;
  }
}

/* ============================
   USER DROPDOWN & GLOWS
   ============================ */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: rgba(10, 15, 30, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 14px;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 45px -12px rgba(0, 0, 0, 0.7), 0 0 25px rgba(99, 102, 241, 0.18);
  z-index: 60;
  animation: userDropdownIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes userDropdownIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.glow-discord {
  box-shadow: 0 0 20px rgba(88, 101, 242, 0.35);
}

.glow-discord:hover {
  box-shadow: 0 0 30px rgba(88, 101, 242, 0.6);
  transform: translateY(-1px);
}
