/* ==========================================================================
   VBoxHost Admin Master Stylesheet
   Based on AMOLED Glass / Neon Cyan Protocol
   ========================================================================== */

:root {
  /* Colors */
  --bg-primary: #0D0F12;
  --bg-secondary: #1A1D23;
  --bg-tertiary: #2A2E35;
  --bg-hover: #3A3E45;

  --accent-cyan: #00F0FF;
  --accent-teal: #00D4AA;
  --accent-cyan-glow: rgba(0, 240, 255, 0.15);
  --accent-teal-glow: rgba(0, 212, 170, 0.2);

  --text-primary: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.4);

  --danger: #FF4757;
  --warning: #FFA502;
  --success: #00E676;

  /* Glass Vars */
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);

  /* Layout */
  --sidebar-width: 260px;
  --header-height: 70px;
  --widget-gap: 20px;
  --border-radius: 12px;
}

/* Base Reset & Typography */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

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

/* ==========================================================================
   LOGIN LAYOUT (Scoped)
   ========================================================================== */
.login-layout {
  height: 100vh;
  overflow: hidden;
  display: grid;
  place-items: center;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(0, 240, 255, 0.05) 0%, transparent 20%),
    radial-gradient(circle at 90% 80%, rgba(0, 100, 255, 0.05) 0%, transparent 20%);
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 40px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  opacity: 0.8;
  box-shadow: 0 0 20px var(--accent-cyan);
}

/* Login Components */
.brand-logo-login {
  font-family: 'JetBrains Mono', monospace;
  text-align: center;
  margin-bottom: 32px;
  letter-spacing: -1px;
}

.brand-logo-login h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.brand-logo-login span {
  color: var(--accent-cyan);
}

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

.form-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: block;
  font-weight: 600;
}

.form-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  padding: 14px 16px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-cyan);
  border-radius: 8px;
  outline: none;
  transition: all 0.3s ease;
  text-align: center;
  font-size: 14px;
}

.form-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px var(--accent-glow);
  background: rgba(0, 0, 0, 0.5);
}

.form-input::placeholder {
  color: rgba(255, 255, 255, 0.2);
}

.btn-submit {
  width: 100%;
  background: var(--accent-cyan);
  color: #000;
  border: none;
  padding: 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
  margin-top: 8px;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px var(--accent-glow);
  background: #fff;
}

.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

#message {
  margin-top: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  height: 15px;
  color: #ff4757;
  text-align: center;
  text-shadow: 0 0 10px rgba(255, 71, 87, 0.3);
}

.security-badge {
  position: absolute;
  bottom: 20px;
  font-size: 10px;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  opacity: 0.5;
}


/* ==========================================================================
   DASHBOARD LAYOUT
   ========================================================================== */

.app-container {
  display: block;
  /* Removed grid to fix overlap with fixed sidebar */
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--bg-tertiary);
  padding: 24px 16px;
  position: fixed;
  width: var(--sidebar-width);
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
  padding: 0 8px;
}

.brand-logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-teal));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
  color: #000;
}

.brand-name {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: white;
}

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

.nav-item {
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

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

.nav-item.active .nav-link {
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.1), transparent);
  color: var(--accent-cyan);
  border-left: 3px solid var(--accent-cyan);
  margin-left: -16px;
  padding-left: 29px;
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top Bar */
.top-bar {
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-secondary);
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
}

.toolbar-btn {
  position: relative;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toolbar-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  border: 2px solid var(--bg-tertiary);
  color: white;
}

/* Dashboard Grid */
.dashboard-grid {
  flex: 1;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: var(--widget-gap);
  overflow-y: auto;
}

.grid-row {
  display: grid;
  gap: var(--widget-gap);
}

.row-primary {
  grid-template-columns: 2fr 1fr;
  min-height: 400px;
}

.row-secondary {
  grid-template-columns: 1fr 1fr 1fr;
  min-height: 200px;
}

/* Widgets */
.widget {
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  border: 1px solid var(--bg-tertiary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.2s;
}

.widget-lg {
  height: 100%;
}

.glass-panel {
  background: rgba(33, 33, 33, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--bg-tertiary);
}

.widget-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.widget-body {
  flex: 1;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

/* Maps & Charts */
.map-container {
  width: 100%;
  height: 100%;
}

.world-map {
  width: 100%;
  height: 100%;
}

.map-node {
  fill: var(--accent-cyan);
  filter: drop-shadow(0 0 8px var(--accent-cyan));
  animation: pulse 2s infinite;
}

.map-connection {
  stroke: var(--accent-cyan);
  stroke-width: 1;
  opacity: 0.3;
  stroke-dasharray: 5, 5;
  animation: dash 20s linear infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.6;
    transform: scale(1.2);
  }
}

@keyframes dash {
  to {
    stroke-dashoffset: -100;
  }
}

/* Trust Score */
.circular-chart {
  width: 200px;
  height: 200px;
  margin: 0 auto;
  position: relative;
}

.progress-ring {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.progress-ring-bg {
  fill: none;
  stroke: var(--bg-tertiary);
  stroke-width: 8;
}

.progress-ring-fill {
  fill: none;
  stroke: var(--accent-cyan);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 50;
  filter: drop-shadow(0 0 10px var(--accent-cyan));
  transition: stroke-dashoffset 1s ease;
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.score-value {
  display: block;
  font-size: 48px;
  font-weight: 700;
  color: var(--accent-cyan);
  line-height: 1;
}

.score-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 4px;
  display: block;
}

/* Stat Cards */
.stat-card {
  background: linear-gradient(145deg, var(--bg-secondary), var(--bg-tertiary));
  padding: 24px;
  border-radius: var(--border-radius);
  text-align: center;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.stat-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-4px);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 8px 0;
}

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

/* Loading */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s;
}

.loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--bg-tertiary);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Responsiveness */
@media (max-width: 1200px) {

  .row-primary,
  .row-secondary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-container {
    grid-template-columns: 1fr;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .main-content {
    margin-left: 0;
  }
}

/* ==========================================================================
   vBoxMaster — IPX Dashboard Components
   ========================================================================== */

/* ── Section Layout ────────────────────────────────────────────────────────── */
.ipx-section {
  margin-bottom: 8px;
}

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

.ipx-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ipx-section-title h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.ipx-section-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.2);
  padding: 4px 12px;
  border-radius: 20px;
}

/* ── Metric Cards Grid ─────────────────────────────────────────────────────── */
.ipx-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.ipx-metric-card {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ipx-metric-card:hover {
  border-color: rgba(0, 240, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.ipx-metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ipx-metric-data {
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 1;
}

.ipx-metric-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-cyan);
  line-height: 1.1;
  font-family: 'JetBrains Mono', monospace;
}

.ipx-sync-value {
  font-size: 1.1rem !important;
}

.ipx-metric-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

/* Glow backgrounds */
.ipx-metric-glow {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.ipx-metric-card:hover .ipx-metric-glow {
  opacity: 1;
}

.ipx-glow-cyan { background: radial-gradient(circle, rgba(0, 240, 255, 0.15), transparent 70%); }
.ipx-glow-red { background: radial-gradient(circle, rgba(255, 71, 87, 0.15), transparent 70%); }
.ipx-glow-orange { background: radial-gradient(circle, rgba(255, 165, 2, 0.15), transparent 70%); }
.ipx-glow-green { background: radial-gradient(circle, rgba(0, 230, 118, 0.15), transparent 70%); }

/* ── Tables ────────────────────────────────────────────────────────────────── */
.ipx-table-wrap {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  overflow: hidden;
  margin-bottom: 24px;
}

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

.ipx-table-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.ipx-table-scroll {
  overflow-x: auto;
}

.ipx-table {
  width: 100%;
  border-collapse: collapse;
}

.ipx-table thead th {
  background: rgba(0, 0, 0, 0.3);
  padding: 12px 16px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--glass-border);
}

.ipx-table tbody td {
  padding: 14px 16px;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}

.ipx-table tbody tr {
  transition: background 0.15s ease;
}

.ipx-table tbody tr:hover {
  background: rgba(0, 240, 255, 0.02);
}

.ipx-table tbody tr:last-child td {
  border-bottom: none;
}

/* IP cell */
.ipx-ip-cell {
  color: var(--accent-cyan);
  font-size: 13px;
}

/* ── Score Badges ──────────────────────────────────────────────────────────── */
.ipx-score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.ipx-score-green {
  color: #00E676;
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid rgba(0, 230, 118, 0.2);
}

.ipx-score-yellow {
  color: #FFEB3B;
  background: rgba(255, 235, 59, 0.1);
  border: 1px solid rgba(255, 235, 59, 0.2);
}

.ipx-score-orange {
  color: #FFA502;
  background: rgba(255, 165, 2, 0.1);
  border: 1px solid rgba(255, 165, 2, 0.2);
}

.ipx-score-red {
  color: #FF4757;
  background: rgba(255, 71, 87, 0.1);
  border: 1px solid rgba(255, 71, 87, 0.2);
}

/* ── Status Pills ──────────────────────────────────────────────────────────── */
.ipx-status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ipx-status-clean {
  color: #00E676;
  background: rgba(0, 230, 118, 0.1);
}

.ipx-status-watch {
  color: #FFA502;
  background: rgba(255, 165, 2, 0.1);
}

.ipx-status-blocked {
  color: #FF4757;
  background: rgba(255, 71, 87, 0.1);
}

.ipx-status-whitelisted {
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.1);
}

/* ── Quick Block Button ────────────────────────────────────────────────────── */
.ipx-btn-block {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(255, 71, 87, 0.1);
  border: 1px solid rgba(255, 71, 87, 0.3);
  border-radius: 6px;
  color: #FF4757;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

.ipx-btn-block:hover {
  background: rgba(255, 71, 87, 0.2);
  border-color: #FF4757;
  box-shadow: 0 0 12px rgba(255, 71, 87, 0.2);
}

.ipx-btn-block:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ipx-btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 71, 87, 0.3);
  border-top-color: #FF4757;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ── Add Site Button ───────────────────────────────────────────────────────── */
.ipx-btn-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--accent-cyan);
  color: #000;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

.ipx-btn-add:hover {
  background: #fff;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
  transform: translateY(-1px);
}

/* ── Icon Buttons ──────────────────────────────────────────────────────────── */
.ipx-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.ipx-btn-icon:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.ipx-btn-danger:hover {
  background: rgba(255, 71, 87, 0.1);
  border-color: rgba(255, 71, 87, 0.4);
  color: #FF4757;
}

.ipx-action-group {
  display: flex;
  gap: 6px;
}

/* ── Domain Cell ───────────────────────────────────────────────────────────── */
.ipx-domain-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ipx-domain-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ipx-dot-active {
  background: #00E676;
  box-shadow: 0 0 8px rgba(0, 230, 118, 0.5);
}

.ipx-dot-inactive {
  background: var(--bg-hover);
}

/* ── Priority Badge ────────────────────────────────────────────────────────── */
.ipx-priority-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 2px 8px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 4px;
  color: var(--accent-cyan);
  font-size: 12px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

/* ── Toggle Switch ─────────────────────────────────────────────────────────── */
.ipx-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  cursor: pointer;
}

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

.ipx-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-tertiary);
  border-radius: 22px;
  transition: all 0.25s ease;
  border: 1px solid var(--glass-border);
}

.ipx-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  bottom: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.25s ease;
}

.ipx-toggle input:checked + .ipx-toggle-slider {
  background: rgba(0, 230, 118, 0.2);
  border-color: rgba(0, 230, 118, 0.4);
}

.ipx-toggle input:checked + .ipx-toggle-slider::before {
  transform: translateX(18px);
  background: #00E676;
  box-shadow: 0 0 6px rgba(0, 230, 118, 0.5);
}

/* ── Modal ─────────────────────────────────────────────────────────────────── */
.ipx-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.ipx-modal-overlay.ipx-modal-open {
  opacity: 1;
  visibility: visible;
}

.ipx-modal {
  width: 100%;
  max-width: 520px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  transform: translateY(20px) scale(0.96);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.ipx-modal-open .ipx-modal {
  transform: translateY(0) scale(1);
}

.ipx-modal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  opacity: 0.6;
}

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

.ipx-modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.ipx-modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ipx-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.15);
}

/* ── Form Elements ─────────────────────────────────────────────────────────── */
.ipx-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ipx-form-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-secondary);
  font-weight: 600;
}

.ipx-form-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  padding: 12px 14px;
  color: var(--text-primary);
  border-radius: 8px;
  outline: none;
  transition: all 0.2s ease;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
}

.ipx-form-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.1);
  background: rgba(0, 0, 0, 0.4);
}

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

.ipx-mono-input {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.ipx-form-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.ipx-input-group {
  display: flex;
  gap: 8px;
}

.ipx-input-group .ipx-form-input {
  flex: 1;
}

/* ── Generate Button ───────────────────────────────────────────────────────── */
.ipx-btn-generate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 8px;
  color: var(--accent-cyan);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
}

.ipx-btn-generate:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.15);
}

/* ── Modal Buttons ─────────────────────────────────────────────────────────── */
.ipx-btn-cancel {
  padding: 10px 20px;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

.ipx-btn-cancel:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.ipx-btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  background: var(--accent-cyan);
  color: #000;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

.ipx-btn-submit:hover {
  background: #fff;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

.ipx-btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ── Toast Notification ────────────────────────────────────────────────────── */
.ipx-toast {
  position: fixed;
  bottom: 32px;
  right: 32px;
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #000;
  z-index: 2000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.ipx-toast-show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.ipx-toast-success {
  background: var(--accent-cyan);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.ipx-toast-error {
  background: var(--danger);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ── Responsive: IPX Grid ──────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .ipx-metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .ipx-metric-grid {
    grid-template-columns: 1fr;
  }

  .ipx-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}