/* ===========================================
   KYOTRIX DASHBOARD - GLASSMORPHISM DESIGN SYSTEM
   Inspired by bleed.bot - Dark, Glossy, Animated
   =========================================== */

/* ============ CSS VARIABLES ============ */
:root {
  /* Colors */
  --bg-primary: #050507;
  --bg-secondary: #0a0a0f;
  --bg-tertiary: #12121a;
  --bg-card: rgba(20, 20, 30, 0.6);
  --bg-card-hover: rgba(30, 30, 45, 0.7);
  
  /* Accent Colors */
  --accent-primary: #7c3aed;
  --accent-secondary: #a855f7;
  --accent-tertiary: #c084fc;
  --accent-cyan: #06b6d4;
  --accent-pink: #ec4899;
  --accent-red: #fe394a;
  
  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
  
  /* Glass Effects */
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.1);
  
  /* Shadows & Glows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.5);
  --glow-purple: 0 0 40px rgba(124, 58, 237, 0.3);
  --glow-cyan: 0 0 40px rgba(6, 182, 212, 0.3);
  
  /* Borders */
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --border-radius-xl: 24px;
  --border-radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Plus Jakarta Sans', var(--font-primary);
}

/* ============ RESET & BASE ============ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Animated Background Gradient */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 20%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse 50% 30% at 50% 80%, rgba(236, 72, 153, 0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
  animation: backgroundPulse 15s ease-in-out infinite;
}

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

/* ============ TYPOGRAPHY ============ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: clamp(1.25rem, 2vw, 1.5rem); }

p { color: var(--text-secondary); }

a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-secondary);
}

/* ============ GLASS CARD ============ */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    var(--glass-highlight) 50%, 
    transparent 100%);
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--glow-purple);
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--border-radius-full);
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.2), 
    transparent);
  transition: left 0.5s ease;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  color: white;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 30px rgba(124, 58, 237, 0.5);
}

.btn-secondary {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: var(--glass-highlight);
  border-color: var(--accent-primary);
}

.btn-discord {
  background: #5865F2;
  color: white;
  box-shadow: 0 4px 20px rgba(88, 101, 242, 0.4);
}

.btn-discord:hover {
  background: #4752C4;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(88, 101, 242, 0.5);
}

.btn-glow {
  animation: buttonGlow 2s ease-in-out infinite;
}

@keyframes buttonGlow {
  0%, 100% { box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4); }
  50% { box-shadow: 0 4px 40px rgba(124, 58, 237, 0.6), 0 0 60px rgba(124, 58, 237, 0.3); }
}

/* ============ NAVBAR ============ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: all var(--transition-normal);
}

.navbar.scrolled {
  background: rgba(5, 5, 7, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
}

.navbar-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
}

.navbar-brand img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.navbar-brand span {
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-tertiary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-link {
  padding: 10px 18px;
  color: var(--text-secondary);
  font-weight: 500;
  border-radius: var(--border-radius-full);
  transition: all var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--glass-bg);
}

.nav-link.active {
  color: var(--text-primary);
  background: var(--glass-highlight);
}

/* Mobile Nav */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: all var(--transition-fast);
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  
  .navbar-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--glass-border);
    padding: 16px;
    display: none;
  }
  
  .navbar-nav.active { display: flex; }
}

/* ============ HERO SECTION ============ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 80px;
  position: relative;
}

.hero-content {
  max-width: 900px;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-full);
  font-size: 0.875rem;
  color: var(--accent-tertiary);
  margin-bottom: 24px;
  animation: fadeInUp 0.6s ease;
}

.hero-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

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

.hero-title {
  margin-bottom: 24px;
  animation: fadeInUp 0.6s ease 0.1s both;
}

.hero-title .highlight {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
  animation: fadeInUp 0.6s ease 0.2s both;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 0.6s ease 0.3s both;
}

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

/* ============ STATS BAR ============ */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
  margin-top: 80px;
  animation: fadeInUp 0.6s ease 0.4s both;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-tertiary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ============ FEATURES SECTION ============ */
.features {
  padding: 120px 24px;
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 64px;
}

.section-title {
  margin-bottom: 16px;
}

.section-description {
  font-size: 1.125rem;
}

.features-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.feature-card {
  padding: 32px;
  text-align: left;
}

.feature-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  border-radius: var(--border-radius-md);
  font-size: 1.5rem;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.3);
}

.feature-title {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.feature-description {
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Feature card hover state icon animation */
.feature-card:hover .feature-icon {
  transform: scale(1.1) rotate(5deg);
  transition: transform var(--transition-normal);
}

/* ============ SERVERS SHOWCASE ============ */
.servers-showcase {
  padding: 80px 0;
  overflow: hidden;
}

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

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

@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.server-card {
  flex-shrink: 0;
  width: 200px;
  padding: 20px;
  text-align: center;
}

.server-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin-bottom: 12px;
  object-fit: cover;
}

.server-name {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.server-members {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============ FOOTER ============ */
.footer {
  padding: 64px 24px 32px;
  border-top: 1px solid var(--glass-border);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 48px;
  margin-bottom: 48px;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.footer-description {
  font-size: 0.95rem;
  max-width: 300px;
}

.footer-title {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
  color: var(--text-muted);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 32px;
  border-top: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ============ DASHBOARD LAYOUT ============ */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
  padding-top: 72px;
}

/* Sidebar */
.sidebar {
  width: 280px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--glass-border);
  padding: 24px 16px;
  position: fixed;
  top: 72px;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  transition: transform var(--transition-normal);
}

.sidebar-section {
  margin-bottom: 32px;
}

.sidebar-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 0 12px;
  margin-bottom: 12px;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  border-radius: var(--border-radius-md);
  transition: all var(--transition-fast);
  font-weight: 500;
}

.sidebar-link:hover {
  color: var(--text-primary);
  background: var(--glass-bg);
}

.sidebar-link.active {
  color: var(--text-primary);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.2) 0%, rgba(168, 85, 247, 0.1) 100%);
  border: 1px solid rgba(124, 58, 237, 0.3);
}

.sidebar-link svg,
.sidebar-link i {
  width: 20px;
  height: 20px;
  opacity: 0.8;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 32px;
  min-height: calc(100vh - 72px);
}

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 100;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
}

/* ============ SERVER CARDS ============ */
.servers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.server-manage-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
}

.server-manage-card .server-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 16px;
  border: 3px solid var(--glass-border);
  box-shadow: var(--shadow-md);
}

.server-manage-card .server-name {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.server-manage-card .server-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.server-manage-card .btn {
  width: 100%;
}

/* ============ SETTINGS FORMS ============ */
.settings-card {
  padding: 32px;
  margin-bottom: 24px;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--glass-border);
}

.settings-title {
  font-size: 1.25rem;
}

.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

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

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

/* Toggle Switch */
.toggle-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--glass-border);
}

.toggle-info {
  flex: 1;
}

.toggle-label {
  font-weight: 500;
  margin-bottom: 4px;
}

.toggle-description {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.toggle {
  position: relative;
  width: 52px;
  height: 28px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-full);
  transition: all var(--transition-fast);
}

.toggle-slider::before {
  position: absolute;
  content: '';
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 3px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.toggle input:checked + .toggle-slider {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(24px);
  background: white;
}

/* ============ ALERTS & NOTIFICATIONS ============ */
.alert {
  padding: 16px 20px;
  border-radius: var(--border-radius-md);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #22c55e;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #f59e0b;
}

/* ============ LOADING STATES ============ */
.skeleton {
  background: linear-gradient(90deg, 
    var(--bg-tertiary) 25%, 
    var(--glass-bg) 50%, 
    var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--border-radius-md);
}

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

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--glass-border);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============ UTILITY CLASSES ============ */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

.text-center { text-align: center; }
.text-gradient {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mb-4 { margin-bottom: 16px; }
.mb-8 { margin-bottom: 32px; }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 16px; }

/* ============ PAGE TRANSITIONS ============ */
.page-enter {
  opacity: 0;
  transform: translateY(20px);
}

.page-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.4s ease;
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: var(--border-radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ============ SELECTION ============ */
::selection {
  background: rgba(124, 58, 237, 0.3);
  color: var(--text-primary);
}
