/* ============================================
   GGGuardBot — Dark Dashboard Design System
   Font: Space Grotesk | Accent: Twitch Purple
   ============================================ */

/* ---- Animated Background ---- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-color: #080a14;
  background-image:
    radial-gradient(ellipse at 15% 80%, rgba(139, 92, 246, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(139, 92, 246, 0.04) 0%, transparent 70%);
}

.bg-grid::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}

/* ---- Toggle Switch ---- */
.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input { display: none; }

.toggle .track {
  position: absolute;
  inset: 0;
  background: #2a2d3e;
  border-radius: 24px;
  border: 1px solid #353850;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle .track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #64748b;
  border-radius: 50%;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle input:checked + .track {
  background: #8B5CF6;
  border-color: #8B5CF6;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.35);
}

.toggle input:checked + .track::after {
  transform: translateX(20px);
  background: #fff;
}

/* ---- Modal / Sheet ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-panel {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  background: #12141f;
  border: 1px solid #252840;
  border-radius: 16px;
  padding: 28px;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.modal-overlay.visible .modal-panel {
  transform: scale(1) translateY(0);
}

/* ---- Toast ---- */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 20px;
  background: #1a1d2e;
  border: 1px solid #252840;
  border-radius: 10px;
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  animation: toastIn 0.3s ease-out, toastOut 0.25s 2.5s ease-in forwards;
}

.toast.success { border-left: 3px solid #22c55e; }
.toast.success::before { content: '\F26E'; font-family: 'bootstrap-icons'; color: #22c55e; }
.toast.error { border-left: 3px solid #ef4444; }
.toast.error::before { content: '\F622'; font-family: 'bootstrap-icons'; color: #ef4444; }

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

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

/* ---- Tab Indicator ---- */
.tab-nav { position: relative; }

.tab-indicator {
  position: absolute;
  bottom: 0;
  height: 2px;
  background: #8B5CF6;
  border-radius: 1px;
  transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}

/* ---- Glow Effects ---- */
.glow-purple {
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.15);
}

.glow-line {
  position: relative;
}

.glow-line::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, #8B5CF6, #3B82F6);
  border-radius: 3px;
  opacity: 0;
  transition: opacity 0.2s;
}

.glow-line:hover::before {
  opacity: 1;
}

/* ---- Pulse Dot ---- */
.pulse-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  position: relative;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.3);
  animation: pulse 2s ease-in-out infinite;
}

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

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #252840; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #353850; }

/* ---- Responsive Tab Bar ---- */
@media (max-width: 640px) {
  .tab-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: #0d0f1a;
    border-top: 1px solid #1a1d2e;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    display: flex;
    justify-content: space-around;
  }

  .tab-indicator { display: none; }

  .tab-btn {
    flex-direction: column !important;
    gap: 2px !important;
    padding: 6px 12px !important;
    font-size: 10px !important;
  }

  .tab-btn i { font-size: 20px !important; }

  .content-area { padding-bottom: 90px !important; }
}
