/* ==========================================
   AboZienB CNC - Professional UI 2026
   ========================================== */

:root {
  /* Colors */
  --bg-primary: #0a0618;
  --bg-secondary: #120a26;
  --bg-tertiary: #1a1033;
  --bg-card: rgba(26, 16, 51, 0.6);
  --bg-glass: rgba(139, 92, 246, 0.05);

  --border: rgba(139, 92, 246, 0.15);
  --border-hover: rgba(139, 92, 246, 0.4);

  --primary: #8b5cf6;
  --primary-light: #a78bfa;
  --primary-dark: #6d28d9;
  --primary-glow: rgba(139, 92, 246, 0.5);

  --accent: #06b6d4;
  --accent-glow: rgba(6, 182, 212, 0.5);

  --text: #f1e8ff;
  --text-dim: #9b87c4;
  --text-muted: #6b5a8f;

  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;

  /* Fonts */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Effects */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(139, 92, 246, 0.15);
  --shadow-lg: 0 10px 40px rgba(139, 92, 246, 0.25);
  --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.4);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   Reset
   ========================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

/* ==========================================
   Animated Background - Particles
   ========================================== */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 20% 30%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(109, 40, 217, 0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: bgPulse 15s ease-in-out infinite;
}

@keyframes bgPulse {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(2px 2px at 20% 30%, rgba(139, 92, 246, 0.8), transparent),
    radial-gradient(1px 1px at 60% 70%, rgba(6, 182, 212, 0.6), transparent),
    radial-gradient(1px 1px at 40% 80%, rgba(167, 139, 250, 0.7), transparent),
    radial-gradient(2px 2px at 80% 20%, rgba(139, 92, 246, 0.5), transparent),
    radial-gradient(1px 1px at 10% 50%, rgba(6, 182, 212, 0.4), transparent),
    radial-gradient(1px 1px at 90% 60%, rgba(167, 139, 250, 0.6), transparent);
  background-size: 550px 550px, 350px 350px, 250px 250px, 550px 550px, 350px 350px, 250px 250px;
  background-position: 0 0, 40px 60px, 130px 270px, 70px 100px, 200px 50px, 300px 200px;
  pointer-events: none;
  z-index: 1;
  animation: particleFloat 120s linear infinite;
  opacity: 0.6;
}

@keyframes particleFloat {
  0% { transform: translate(0, 0); }
  100% { transform: translate(550px, 550px); }
}

/* ==========================================
   Screens
   ========================================== */
.screen {
  display: none;
  position: relative;
  z-index: 2;
}

.screen.active {
  display: block;
  animation: screenFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ==========================================
   Login Screen
   ========================================== */
#login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.login-box {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: loginBoxIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes loginBoxIn {
  from { opacity: 0; transform: scale(0.9) translateY(30px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.login-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.1), transparent);
  animation: shimmer 3s infinite;
  pointer-events: none;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.login-box .logo {
  width: 90px;
  height: 90px;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 0 20px var(--primary-glow));
  animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(2deg); }
}

.login-box h1 {
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
  animation: gradientShift 4s ease infinite;
}

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

.login-box .tagline {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 2rem;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ==========================================
   Form Elements
   ========================================== */
.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 0.6rem;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color var(--transition);
}

.form-group:focus-within label {
  color: var(--primary-light);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.9rem 1.1rem;
  background: rgba(10, 6, 24, 0.8);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font-main);
  transition: all var(--transition);
  outline: none;
}

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

.form-group input:focus,
.form-group select:focus {
  border-color: var(--primary);
  background: rgba(10, 6, 24, 1);
  box-shadow: 0 0 0 4px var(--primary-glow), 0 0 20px var(--primary-glow);
}

/* ==========================================
   Buttons
   ========================================== */
.btn-primary {
  width: 100%;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  background-size: 200% 200%;
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  font-family: var(--font-main);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.3);
}

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

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(139, 92, 246, 0.5);
  background-position: 100% 50%;
}

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

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

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ==========================================
   Error Message
   ========================================== */
.error-msg {
  color: var(--error);
  font-size: 0.85rem;
  margin-top: 1rem;
  min-height: 20px;
  font-weight: 500;
  animation: errorShake 0.4s ease;
}

@keyframes errorShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ==========================================
   Footer Text
   ========================================== */
.footer-text {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 2rem;
  font-family: var(--font-mono);
  letter-spacing: 1px;
}

/* ==========================================
   Dashboard
   ========================================== */
#dashboard-screen {
  min-height: 100vh;
}

/* Topbar */
.topbar {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-left .logo-small {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 0 12px var(--primary-glow));
  animation: logoFloat 3s ease-in-out infinite;
}

.brand {
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.85rem;
}

.user-name {
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
}

.user-role {
  color: var(--primary-light);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}

.btn-logout {
  padding: 0.6rem 1.3rem;
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all var(--transition);
  font-family: var(--font-main);
}

.btn-logout:hover {
  background: var(--error);
  border-color: var(--error);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

/* ==========================================
   Layout
   ========================================== */
.dashboard-container {
  display: flex;
  min-height: calc(100vh - 74px);
  position: relative;
  z-index: 2;
}

/* Sidebar */
.sidebar {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  width: 220px;
  padding: 2rem 0;
  flex-shrink: 0;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 1rem;
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  text-align: left;
  padding: 0.9rem 1.2rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all var(--transition);
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-btn::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  transform: scaleY(0);
  transition: transform var(--transition);
}

.nav-btn:hover {
  background: rgba(139, 92, 246, 0.08);
  color: var(--text);
  transform: translateX(4px);
}

.nav-btn.active {
  background: rgba(139, 92, 246, 0.12);
  color: var(--primary-light);
  box-shadow: inset 0 0 20px rgba(139, 92, 246, 0.1);
}

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

/* Content Area */
.content {
  flex: 1;
  padding: 2.5rem;
  overflow-x: auto;
}

.tab {
  display: none;
}

.tab.active {
  display: block;
  animation: tabFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.content h2 {
  color: var(--text);
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
  letter-spacing: -0.5px;
  position: relative;
}

.content h2::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  box-shadow: 0 0 15px var(--primary-glow);
  animation: lineExpand 1s ease-out;
}

@keyframes lineExpand {
  from { width: 0; }
  to { width: 60px; }
}

/* ==========================================
   Stats Cards
   ========================================== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.stat-card:hover::before {
  transform: scaleX(1);
}

.stat-label {
  color: var(--text-dim);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}

.stat-value {
  color: var(--primary-light);
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  letter-spacing: -1px;
}

/* ==========================================
   Attack Form
   ========================================== */
.attack-form {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 800px;
  box-shadow: var(--shadow-md);
}

.form-row {
  display: flex;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

.form-row .form-group.small {
  flex: 0 0 160px;
}

/* ==========================================
   History Items
   ========================================== */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.history-item {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  transition: all var(--transition);
}

.history-item:hover {
  border-color: var(--border-hover);
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

.history-method {
  color: var(--primary-light);
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.history-target {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-top: 4px;
}

.history-status {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: var(--font-mono);
}

.status-running {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid var(--warning);
  animation: pulse 2s infinite;
}

.status-completed {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid var(--success);
}

.status-failed {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
  border: 1px solid var(--error);
}

.status-stopped {
  background: rgba(107, 90, 143, 0.15);
  color: var(--text-muted);
  border: 1px solid var(--text-muted);
}

.status-pending {
  background: rgba(139, 92, 246, 0.15);
  color: var(--primary-light);
  border: 1px solid var(--primary);
}

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

.muted {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

/* ==========================================
   Loading Animation
   ========================================== */
.muted::after {
  content: '...';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

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

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

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-light);
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 768px) {
  .topbar {
    padding: 0.8rem 1rem;
  }

  .brand {
    font-size: 1.1rem;
  }

  .user-info {
    display: none;
  }

  .dashboard-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
  }

  .sidebar nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 0;
    padding: 0 0.5rem;
  }

  .nav-btn {
    padding: 0.75rem 1rem;
    white-space: nowrap;
    border-radius: 0;
  }

  .nav-btn::before {
    display: none;
  }

  .content {
    padding: 1.5rem 1rem;
  }

  .content h2 {
    font-size: 1.4rem;
  }

  .login-box {
    padding: 2rem 1.5rem;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .form-row .form-group {
    margin-bottom: 1.2rem;
  }

  .form-row .form-group.small {
    flex: 1;
  }
}

/* ==========================================
   Utilities
   ========================================== */
.fade-in {
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ==========================================
   FIX: Force screen display control
   ========================================== */
.screen {
  display: none !important;
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 100vh;
  transition: opacity 0.4s ease;
}

.screen.active {
  display: block !important;
  visibility: visible;
  opacity: 1;
  position: relative;
  animation: screenIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Ensure dashboard is hidden when login is active */
#login-screen.active ~ #dashboard-screen {
  display: none !important;
}

/* ==========================================
   Animation: Cards staggered entrance
   ========================================== */
.stat-card {
  animation: cardIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================
   Animation: Tabs staggered
   ========================================== */
.nav-btn {
  animation: tabIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.nav-btn:nth-child(1) { animation-delay: 0.05s; }
.nav-btn:nth-child(2) { animation-delay: 0.10s; }
.nav-btn:nth-child(3) { animation-delay: 0.15s; }
.nav-btn:nth-child(4) { animation-delay: 0.20s; }
.nav-btn:nth-child(5) { animation-delay: 0.25s; }

@keyframes tabIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ==========================================
   Animation: Content fade in
   ========================================== */
.content h2 {
  animation: titleIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes titleIn {
  from {
    opacity: 0;
    transform: translateY(-15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================
   Animation: Topbar slide in
   ========================================== */
.topbar {
  animation: topbarIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes topbarIn {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================
   Animation: Button pulse on hover
   ========================================== */
.btn-primary:hover {
  animation: btnPulse 1.5s ease-in-out infinite;
}

@keyframes btnPulse {
  0%, 100% {
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.5);
  }
  50% {
    box-shadow: 0 8px 40px rgba(139, 92, 246, 0.8);
  }
}

/* ==========================================
   Animation: Icon pulse
   ========================================== */
.nav-btn.active img {
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% {
    transform: scale(1);
    filter: invert(70%) sepia(50%) saturate(500%) hue-rotate(220deg) drop-shadow(0 0 4px rgba(139, 92, 246, 0.5));
  }
  50% {
    transform: scale(1.1);
    filter: invert(70%) sepia(50%) saturate(500%) hue-rotate(220deg) drop-shadow(0 0 8px rgba(139, 92, 246, 0.9));
  }
}

/* ==========================================
   Animation: Live indicator
   ========================================== */
.status-running::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 6px;
  animation: liveDot 1s ease-in-out infinite;
}

@keyframes liveDot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(1.4);
  }
}

/* ==========================================
   Animation: Floating particles
   ========================================== */
@keyframes floatUp {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) scale(1);
    opacity: 0;
  }
}


/* ==========================================
   ADMIN PANEL
   ========================================== */
.admin-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border);
  overflow-x: auto;
}

.admin-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 0.8rem 1.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  position: relative;
  transition: all var(--transition);
  font-family: var(--font-main);
  white-space: nowrap;
}

.admin-nav-btn::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transition: transform var(--transition);
}

.admin-nav-btn:hover {
  color: var(--text);
}

.admin-nav-btn.active {
  color: var(--primary-light);
}

.admin-nav-btn.active::after {
  transform: scaleX(1);
}

.admin-section {
  display: none;
  animation: tabFadeIn 0.3s ease;
}

.admin-section.active {
  display: block;
}

.admin-toolbar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.admin-toolbar .btn-primary {
  width: auto;
  padding: 0.8rem 1.5rem;
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 0.8rem 1rem;
  background: rgba(10, 6, 24, 0.8);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 0.9rem;
  outline: none;
  transition: all var(--transition);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Users List */
.users-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-row {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  display: grid;
  grid-template-columns: 40px 1fr auto auto auto;
  gap: 1rem;
  align-items: center;
  transition: all var(--transition);
}

.user-row:hover {
  border-color: var(--border-hover);
  transform: translateX(4px);
}

.user-id {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.user-info-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.user-username {
  color: var(--primary-light);
  font-weight: 700;
  font-size: 0.95rem;
  font-family: var(--font-mono);
}

.user-meta {
  color: var(--text-dim);
  font-size: 0.75rem;
}

.user-role-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.role-owner { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid #ef4444; }
.role-admin { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid #f59e0b; }
.role-vip { background: rgba(139, 92, 246, 0.15); color: var(--primary-light); border: 1px solid var(--primary); }
.role-user { background: rgba(107, 90, 143, 0.15); color: var(--text-dim); border: 1px solid var(--text-muted); }

.user-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
}

.status-active { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.status-banned { background: rgba(239, 68, 68, 0.15); color: var(--error); }

.user-actions {
  display: flex;
  gap: 6px;
}

.btn-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-size: 0.9rem;
}

.btn-icon:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  transform: scale(1.1);
}

.btn-icon.danger:hover {
  background: var(--error);
  border-color: var(--error);
}

/* ==========================================
   SIDE PANEL
   ========================================== */
.side-panel {
  position: fixed;
  top: 0;
  right: -500px;
  width: 100%;
  max-width: 500px;
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.side-panel.open {
  right: 0;
}

.side-panel-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: var(--bg-secondary);
  z-index: 10;
}

.side-panel-header h3 {
  color: var(--primary-light);
  font-size: 1.3rem;
  font-weight: 700;
}

.panel-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 2rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.panel-close:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
  transform: rotate(90deg);
}

.side-panel-body {
  padding: 2rem;
  flex: 1;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ==========================================
   METHODS LIST (Admin)
   ========================================== */
.method-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.method-name {
  color: var(--primary-light);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
}

.method-group {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-left: 8px;
}

.toggle-switch {
  position: relative;
  width: 50px;
  height: 26px;
  background: var(--text-muted);
  border-radius: 13px;
  cursor: pointer;
  transition: background var(--transition);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition);
}

.toggle-switch.on {
  background: var(--success);
}

.toggle-switch.on::after {
  transform: translateX(24px);
}

/* ==========================================
   LOGS LIST (Admin)
   ========================================== */
.log-item {
  background: var(--bg-card);
  border-left: 3px solid var(--primary);
  border-radius: 6px;
  padding: 0.8rem 1.2rem;
  margin-bottom: 8px;
  display: flex;
  gap: 1rem;
  align-items: center;
  font-size: 0.85rem;
}

.log-time {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  min-width: 140px;
}

.log-action {
  color: var(--primary-light);
  font-weight: 700;
  min-width: 120px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.log-details {
  color: var(--text-dim);
  flex: 1;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 768px) {
  .user-row {
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
  }

  .user-id { display: none; }

  .user-role-badge,
  .user-status {
    font-size: 0.65rem;
  }

  .side-panel {
    max-width: 100%;
  }

  .log-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }
}

/* ==========================================
   METHODS SELECTOR (for User Form)
   ========================================== */
.methods-selector {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  background: rgba(10, 6, 24, 0.4);
}

.methods-header {
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.8rem;
}

.method-group-block {
  margin-bottom: 1rem;
}

.method-group-title {
  color: var(--primary-light);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(139, 92, 246, 0.1);
  margin-bottom: 0.5rem;
}

.method-group-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.4rem;
  padding-left: 0.5rem;
}

.method-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-dim);
  transition: all var(--transition);
  user-select: none;
}

.method-checkbox:hover {
  background: rgba(139, 92, 246, 0.08);
  color: var(--text);
}

.method-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.method-checkbox input[type="checkbox"]:checked + span {
  color: var(--primary-light);
  font-weight: 600;
}

/* Side panel form textarea */
.form-group textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(10, 6, 24, 0.8);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 0.9rem;
  resize: vertical;
  outline: none;
  transition: all var(--transition);
}

.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Scrollbar in methods selector */
.methods-selector::-webkit-scrollbar {
  width: 6px;
}

.methods-selector::-webkit-scrollbar-track {
  background: transparent;
}

.methods-selector::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 3px;
}

