@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ═══════════════════════════════════════════════
   CSS DESIGN TOKENS
   ═══════════════════════════════════════════════ */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(20, 20, 35, 0.7);
  --bg-card-hover: rgba(30, 30, 50, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-input: rgba(255, 255, 255, 0.05);

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(124, 58, 237, 0.3);
  --border-glow: rgba(124, 58, 237, 0.5);

  --text-primary: #f0f0f5;
  --text-secondary: #8b8ba3;
  --text-muted: #5a5a72;
  --text-accent: #a78bfa;

  --accent-purple: #7c3aed;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-amber: #f59e0b;
  --accent-pink: #ec4899;

  --gradient-main: linear-gradient(135deg, #7c3aed 0%, #3b82f6 50%, #06b6d4 100%);
  --gradient-glow: linear-gradient(135deg, rgba(124,58,237,0.15) 0%, rgba(59,130,246,0.15) 50%, rgba(6,182,212,0.15) 100%);
  --gradient-card: linear-gradient(145deg, rgba(124,58,237,0.08) 0%, rgba(20,20,35,0.95) 100%);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--border-subtle);
  --shadow-glow: 0 0 30px rgba(124, 58, 237, 0.15);
  --shadow-button: 0 4px 15px rgba(124, 58, 237, 0.3);

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════
   ANIMATED BACKGROUND
   ═══════════════════════════════════════════════ */
.bg-effects {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.25;
  animation: orbFloat 20s ease-in-out infinite;
}

.bg-orb--1 {
  width: 600px; height: 600px;
  background: var(--accent-purple);
  top: -200px; left: -100px;
  animation-delay: 0s;
}

.bg-orb--2 {
  width: 500px; height: 500px;
  background: var(--accent-blue);
  bottom: -150px; right: -100px;
  animation-delay: -7s;
  animation-duration: 25s;
}

.bg-orb--3 {
  width: 400px; height: 400px;
  background: var(--accent-cyan);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
  animation-duration: 30s;
  opacity: 0.12;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(60px, -40px) scale(1.05); }
  50% { transform: translate(-30px, 50px) scale(0.95); }
  75% { transform: translate(40px, 20px) scale(1.02); }
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  animation: gridScroll 40s linear infinite;
}

@keyframes gridScroll {
  0% { transform: translate(0, 0); }
  100% { transform: translate(60px, 60px); }
}

/* ═══════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════ */
.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* ═══════════════════════════════════════════════
   HEADER / NAV
   ═══════════════════════════════════════════════ */
.header {
  padding: 20px 0;
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(10, 10, 15, 0.6);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
}

.logo-icon {
  width: 42px; height: 42px;
  background: var(--gradient-main);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-button);
  transition: transform var(--transition-normal);
}

.logo:hover .logo-icon { transform: rotate(-8deg) scale(1.05); }

.logo-text {
  font-size: 20px;
  font-weight: 700;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.nav-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  border-radius: var(--radius-lg);
  padding: 4px;
  border: 1px solid var(--border-subtle);
}

.nav-tab {
  padding: 8px 20px;
  border-radius: var(--radius-md);
  border: none;
  background: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-tab:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }

.nav-tab.active {
  color: var(--text-primary);
  background: var(--accent-purple);
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.3);
}

.header-hwid {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  max-width: 220px;
  overflow: hidden;
}

.header-hwid:hover {
  border-color: var(--border-accent);
  color: var(--text-secondary);
}

.header-hwid .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}

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

/* ═══════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════ */
main {
  flex: 1;
  padding: 32px 0 60px;
}

.page { display: none; animation: pageIn 0.4s ease-out; }
.page.active { display: block; }

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

.page-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 32px;
}

/* ═══════════════════════════════════════════════
   STAT CARDS
   ═══════════════════════════════════════════════ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--gradient-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.stat-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-main);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.stat-card:hover::before { opacity: 1; }

.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-icon {
  position: absolute;
  top: 16px; right: 16px;
  font-size: 24px;
  opacity: 0.3;
}

/* ═══════════════════════════════════════════════
   CARDS & PANELS
   ═══════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all var(--transition-normal);
}

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

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

.card-title {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title .emoji { font-size: 20px; }

/* ═══════════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════════ */
.form-group {
  margin-bottom: 16px;
}

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

.form-input, .form-select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: all var(--transition-fast);
}

.form-input:focus, .form-select:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

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

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 20px;
  padding-right: 40px;
}

.form-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ═══════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn:hover::after { opacity: 1; }

.btn-primary {
  background: var(--gradient-main);
  color: white;
  box-shadow: var(--shadow-button);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

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

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  border-color: var(--border-accent);
  background: rgba(255,255,255,0.08);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
  background: rgba(16, 185, 129, 0.25);
}

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }

.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

/* Loading state */
.btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn.loading .btn-text { visibility: hidden; }

.btn.loading::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ═══════════════════════════════════════════════
   CONFIG LIST
   ═══════════════════════════════════════════════ */
.config-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.config-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.config-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--gradient-main);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.config-item:hover {
  border-color: var(--border-accent);
  transform: translateX(4px);
  box-shadow: var(--shadow-glow);
}

.config-item:hover::before { opacity: 1; }

.config-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.config-name {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.config-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.config-meta-item {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.config-meta-item span { color: var(--text-secondary); }

/* Status badges */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status--active {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.status--error {
  background: rgba(239, 68, 68, 0.12);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.status--pending {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.status--disabled {
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.status .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status--active .dot { animation: pulse 2s ease-in-out infinite; }

/* ═══════════════════════════════════════════════
   SUBSCRIPTION PAGE
   ═══════════════════════════════════════════════ */
.sub-hero {
  text-align: center;
  padding: 48px 0 32px;
}

.sub-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  animation: fadeSlideDown 0.5s ease-out;
}

.sub-hero h1 {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 12px;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeSlideDown 0.6s ease-out 0.1s both;
}

.sub-hero p {
  color: var(--text-secondary);
  font-size: 16px;
  max-width: 500px;
  margin: 0 auto;
  animation: fadeSlideDown 0.6s ease-out 0.2s both;
}

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

.sub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
  animation: fadeSlideDown 0.6s ease-out 0.3s both;
}

@media (max-width: 768px) {
  .sub-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .header .container { flex-wrap: wrap; gap: 12px; }
  .nav-tabs { overflow-x: auto; max-width: 100%; padding: 4px; }
  .header-hwid { max-width: 140px; }
}

/* Link display box */
.link-box {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  transition: all var(--transition-fast);
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
}

.link-box:hover {
  border-color: var(--accent-purple);
  background: rgba(124, 58, 237, 0.05);
}

.link-box code {
  flex: 1;
  font-size: 13px;
  color: var(--text-accent);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  word-break: break-all;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  line-height: 1.4;
}

/* Proxy Key Rows */
.proxy-key-row {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 100%;
  overflow: hidden;
  transition: all var(--transition-fast);
}

.proxy-key-row:hover {
  border-color: var(--border-accent);
  background: rgba(255, 255, 255, 0.06);
}

.proxy-key-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0; /* flex overflow containment */
}

.proxy-key-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.proxy-key-remark {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.proxy-key-code {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  word-break: break-all;
  overflow-wrap: anywhere;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
}

.proxy-key-copy-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .proxy-key-row {
    flex-direction: column;
    align-items: stretch;
  }
  .proxy-key-copy-btn {
    width: 100%;
    justify-content: center;
  }
}

.link-box .copy-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  transition: color var(--transition-fast);
}

.link-box .copy-btn:hover { color: var(--accent-purple); }

/* Settings panel in subscription page */
.settings-panel {
  margin-top: 8px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.setting-row:last-child { border-bottom: none; }

.setting-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.setting-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.setting-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* Toggle switch */
.toggle {
  position: relative;
  width: 48px;
  height: 26px;
}

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

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 100px;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: 1px solid var(--border-subtle);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background: white;
  border-radius: 50%;
  transition: all var(--transition-normal);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

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

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

/* ═══════════════════════════════════════════════
   HWID LIST
   ═══════════════════════════════════════════════ */
.hwid-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.hwid-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.hwid-item:hover {
  border-color: var(--border-accent);
}

.hwid-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hwid-name {
  font-size: 14px;
  font-weight: 500;
}

.hwid-code {
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
}

.hwid-date {
  font-size: 11px;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.modal-backdrop.active { display: flex; }

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

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
  animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* ═══════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  min-width: 280px;
}

.toast.toast-out { animation: toastOut 0.3s ease-in forwards; }

.toast--success { border-left: 3px solid var(--accent-green); }
.toast--error { border-left: 3px solid var(--accent-red); }
.toast--info { border-left: 3px solid var(--accent-blue); }

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

@keyframes toastOut {
  to { opacity: 0; transform: translateX(100%) scale(0.9); }
}

/* ═══════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .emoji {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

.empty-state p {
  font-size: 15px;
  max-width: 300px;
  margin: 0 auto 20px;
}

/* ═══════════════════════════════════════════════
   REFRESH ANIMATION
   ═══════════════════════════════════════════════ */
.refreshing {
  animation: spin 1s linear infinite;
  display: inline-block;
}

/* ═══════════════════════════════════════════════
   SERVER INFO SECTION
   ═══════════════════════════════════════════════ */
.server-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.server-info-item {
  padding: 12px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.server-info-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.server-info-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-accent);
  font-family: 'JetBrains Mono', monospace;
  word-break: break-all;
}

/* ═══════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ═══════════════════════════════════════════════
   EXTRA ANIMATIONS
   ═══════════════════════════════════════════════ */
.shimmer {
  background: linear-gradient(
    90deg,
    var(--bg-input) 0%,
    rgba(255,255,255,0.05) 50%,
    var(--bg-input) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

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

/* Floating particles effect for sub page */
.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--accent-purple);
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat linear infinite;
}

@keyframes particleFloat {
  0% { opacity: 0; transform: translateY(100vh) scale(0); }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(-10vh) scale(1); }
}

/* Back button */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 20px;
  cursor: pointer;
  transition: color var(--transition-fast);
  background: none;
  border: none;
  font-family: inherit;
}

.back-btn:hover { color: var(--text-accent); }

/* Countdown timer */
.countdown {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
}

.countdown .countdown-value {
  color: var(--text-accent);
  font-weight: 600;
}
