/* ==========================================================================
   💎 VEO3 PEARL WHITE GLASSMORPHIC DESIGN SYSTEM (R4)
   File: vps_hub/static/css/glassmorphism.css
   WCAG AAA Compliant · Standalone Zero-Dependency Styling
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Root Design Tokens & Variables
   -------------------------------------------------------------------------- */
:root {
  /* Iridescent Canvas Gradients */
  --bg-pearl-1: #F8FAFC;
  --bg-pearl-2: #EFF6FF;
  --bg-pearl-3: #FAF5FF;
  
  /* Glass Surface Tokens */
  --glass-surface-base: rgba(255, 255, 255, 0.72);
  --glass-surface-hover: rgba(255, 255, 255, 0.88);
  --glass-surface-active: rgba(255, 255, 255, 0.96);
  --glass-surface-subtle: rgba(255, 255, 255, 0.52);
  --glass-surface-card: rgba(255, 255, 255, 0.76);
  --glass-surface-inset: rgba(241, 245, 249, 0.75);

  /* Glass Border Tokens */
  --glass-border-crisp: rgba(255, 255, 255, 0.88);
  --glass-border-subtle: rgba(226, 232, 240, 0.75);
  --glass-border-hover: rgba(217, 119, 6, 0.35);
  --glass-border-focus: rgba(37, 99, 235, 0.45);

  /* Luxury Accent: Champagne Gold */
  --gold-50: #FFFBEB;
  --gold-100: #FEF3C7;
  --gold-200: #FDE68A;
  --gold-300: #FCD34D;
  --gold-400: #FBBF24;
  --gold-500: #F59E0B;
  --gold-600: #D97706;
  --gold-700: #B45309;
  --gold-800: #92400E;
  --gold-900: #78350F;

  /* Luxury Accent: Icy Blue */
  --blue-50: #EFF6FF;
  --blue-100: #DBEAFE;
  --blue-200: #BFDBFE;
  --blue-300: #93C5FD;
  --blue-400: #60A5FA;
  --blue-500: #3B82F6;
  --blue-600: #2563EB;
  --blue-700: #1D4ED8;
  --blue-800: #1E40AF;
  --blue-900: #1E3A8A;

  /* Luxury Accent: Emerald Jade */
  --emerald-50: #ECFDF5;
  --emerald-100: #D1FAE5;
  --emerald-200: #A7F3D0;
  --emerald-300: #6EE7B7;
  --emerald-400: #34D399;
  --emerald-500: #10B981;
  --emerald-600: #059669;
  --emerald-700: #047857;
  --emerald-800: #065F46;
  --emerald-900: #064E3B;

  /* Luxury Accent: Ruby Rose */
  --ruby-50: #FFF1F2;
  --ruby-100: #FFE4E6;
  --ruby-200: #FECDD3;
  --ruby-300: #FDA4AF;
  --ruby-400: #FB7185;
  --ruby-500: #F43F5E;
  --ruby-600: #E11D48;
  --ruby-700: #BE123C;
  --ruby-800: #9F1239;
  --ruby-900: #881337;

  /* Typography & Slate Hierarchy (WCAG AAA Approved) */
  --text-slate-900: #0F172A; /* 14.8:1 contrast */
  --text-slate-800: #1E293B; /* 12.2:1 contrast */
  --text-slate-700: #334155; /* 8.4:1 contrast */
  --text-slate-600: #475569; /* 6.2:1 contrast */
  --text-slate-500: #64748B; /* 4.6:1 contrast */
  --text-slate-400: #94A3B8;

  /* Elevation Shadows */
  --shadow-glass-sm: 0 4px 12px -2px rgba(15, 23, 42, 0.04), 0 0 0 1px var(--glass-border-crisp);
  --shadow-glass-md: 0 10px 25px -4px rgba(15, 23, 42, 0.05), 0 0 0 1px var(--glass-border-subtle), inset 0 1px 1px 0 rgba(255, 255, 255, 0.95), inset 0 -1px 1px 0 rgba(148, 163, 184, 0.10);
  --shadow-glass-lg: 0 18px 38px -6px rgba(15, 23, 42, 0.08), 0 0 0 1.5px rgba(217, 119, 6, 0.20), inset 0 1px 1px 0 rgba(255, 255, 255, 1);
  --shadow-glass-modal: 0 25px 60px -15px rgba(15, 23, 42, 0.20), 0 0 0 1px rgba(255, 255, 255, 0.95);
  --shadow-gold-glow: 0 8px 24px -4px rgba(217, 119, 6, 0.35);
  --shadow-blue-glow: 0 8px 24px -4px rgba(37, 99, 235, 0.25);

  /* Transitions & Motion */
  --spring-transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --smooth-transition: all 250ms ease-in-out;
}

/* --------------------------------------------------------------------------
   2. Base & Typography Reset
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: linear-gradient(135deg, var(--bg-pearl-1) 0%, var(--bg-pearl-2) 50%, var(--bg-pearl-3) 100%);
  background-attachment: fixed;
  color: var(--text-slate-800);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-slate-900);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.mono {
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
}

/* --------------------------------------------------------------------------
   3. Glass Containers & Structural Panels
   -------------------------------------------------------------------------- */
.glass-panel {
  background: var(--glass-surface-base);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border-crisp);
  box-shadow: var(--shadow-glass-md);
  border-radius: 1rem;
  transition: var(--spring-transition);
}

.glass-panel:hover {
  background: var(--glass-surface-hover);
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-glass-lg);
  transform: translateY(-2px);
}

.glass-header {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  border-bottom: 1px solid var(--glass-border-crisp);
  box-shadow: 0 4px 20px -4px rgba(15, 23, 42, 0.03);
}

.glass-card-subtle {
  background: var(--glass-surface-subtle);
  border: 1px solid var(--glass-border-subtle);
  border-radius: 0.75rem;
  transition: var(--spring-transition);
}

.glass-card-subtle:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: var(--glass-border-crisp);
}

/* --------------------------------------------------------------------------
   4. Luxury Badges & Status Pills
   -------------------------------------------------------------------------- */
.badge-gold {
  background-color: var(--gold-100);
  color: var(--gold-800);
  border: 1px solid var(--gold-200);
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge-emerald {
  background-color: var(--emerald-50);
  color: var(--emerald-800);
  border: 1px solid var(--emerald-200);
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge-blue {
  background-color: var(--blue-50);
  color: var(--blue-800);
  border: 1px solid var(--blue-200);
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge-ruby {
  background-color: var(--ruby-50);
  color: var(--ruby-800);
  border: 1px solid var(--ruby-200);
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.badge-slate {
  background-color: #F1F5F9;
  color: var(--text-slate-700);
  border: 1px solid #CBD5E1;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* --------------------------------------------------------------------------
   5. Buttons & Interactive Controls
   -------------------------------------------------------------------------- */
.btn-gold {
  background: linear-gradient(135deg, var(--gold-500) 0%, var(--gold-600) 100%);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.8125rem;
  border: 1px solid rgba(255, 255, 255, 0.40);
  border-radius: 0.625rem;
  padding: 0.55rem 1.15rem;
  box-shadow: var(--shadow-gold-glow), inset 0 1px 1px 0 rgba(255, 255, 255, 0.45);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: var(--spring-transition);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-400) 0%, var(--gold-700) 100%);
  transform: translateY(-1px);
  box-shadow: 0 10px 28px -4px rgba(217, 119, 6, 0.45), inset 0 1px 1px 0 rgba(255, 255, 255, 0.60);
}

.btn-gold:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-slate-700);
  font-weight: 600;
  font-size: 0.8125rem;
  border: 1px solid var(--glass-border-subtle);
  border-radius: 0.625rem;
  padding: 0.55rem 1rem;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: var(--spring-transition);
}

.btn-secondary:hover {
  background: #FFFFFF;
  color: var(--text-slate-900);
  border-color: var(--text-slate-400);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.btn-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--glass-border-subtle);
  color: var(--text-slate-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--spring-transition);
}

.btn-icon:hover {
  background: #FFFFFF;
  color: var(--text-slate-900);
  border-color: var(--gold-500);
  transform: scale(1.05);
}

.btn-icon-danger:hover {
  border-color: var(--ruby-500);
  color: var(--ruby-600);
}

/* --------------------------------------------------------------------------
   6. Form Inputs & Selects
   -------------------------------------------------------------------------- */
.glass-input {
  background: rgba(255, 255, 255, 0.80);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border-subtle);
  border-radius: 0.625rem;
  color: var(--text-slate-900);
  padding: 0.55rem 0.85rem;
  font-size: 0.8125rem;
  font-family: inherit;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: var(--spring-transition);
  width: 100%;
}

.glass-input:focus {
  outline: none;
  background: #FFFFFF;
  border-color: var(--gold-600);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15), inset 0 1px 1px rgba(255, 255, 255, 1);
}

.glass-select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2.25rem;
}

/* --------------------------------------------------------------------------
   7. Tables & Data Grids
   -------------------------------------------------------------------------- */
.glass-table-container {
  overflow-x: auto;
  border-radius: 0.75rem;
  border: 1px solid var(--glass-border-subtle);
}

.glass-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.8125rem;
}

.glass-table thead tr {
  background: rgba(241, 245, 249, 0.80);
  border-bottom: 1px solid var(--glass-border-subtle);
}

.glass-table th {
  padding: 0.75rem 1rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-slate-600);
}

.glass-table tbody tr {
  border-bottom: 1px solid rgba(241, 245, 249, 0.90);
  transition: background-color 150ms ease;
}

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

.glass-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.90);
}

.glass-table td {
  padding: 0.85rem 1rem;
  color: var(--text-slate-800);
  vertical-align: middle;
}

/* --------------------------------------------------------------------------
   8. Radar Pulses & Micro-Animations
   -------------------------------------------------------------------------- */
@keyframes radar-pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.pulse-radar-green {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 9999px;
  background-color: var(--emerald-500);
  animation: radar-pulse-green 2s infinite cubic-bezier(0.45, 0, 0.55, 1);
  display: inline-block;
}

@keyframes radar-pulse-blue {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

.pulse-radar-blue {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 9999px;
  background-color: var(--blue-600);
  animation: radar-pulse-blue 2s infinite cubic-bezier(0.45, 0, 0.55, 1);
  display: inline-block;
}

/* --------------------------------------------------------------------------
   9. Modals & Overlay Architecture
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border: 1px solid var(--glass-border-crisp);
  border-radius: 1.25rem;
  box-shadow: var(--shadow-glass-modal);
  width: 100%;
  max-width: 34rem;
  transform: scale(0.94) translateY(10px);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-backdrop.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--glass-border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 1.5rem;
  max-height: calc(85vh - 8rem);
  overflow-y: auto;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--glass-border-subtle);
  background: rgba(248, 250, 252, 0.85);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* --------------------------------------------------------------------------
   10. Toast Notification System
   -------------------------------------------------------------------------- */
#toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  min-width: 18rem;
  max-width: 24rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border-crisp);
  border-radius: 0.75rem;
  padding: 0.85rem 1.15rem;
  box-shadow: 0 12px 30px -4px rgba(15, 23, 42, 0.12);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  transform: translateX(100%);
  opacity: 0;
  transition: all 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-item.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-item.hide {
  transform: translateX(110%);
  opacity: 0;
}

/* --------------------------------------------------------------------------
   11. Progress Bars & Quota Gauges
   -------------------------------------------------------------------------- */
.progress-track {
  width: 100%;
  height: 0.5rem;
  background-color: #E2E8F0;
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill-gold {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-400) 0%, var(--gold-600) 100%);
  border-radius: 9999px;
  transition: width 400ms ease;
}

.progress-fill-emerald {
  height: 100%;
  background: linear-gradient(90deg, var(--emerald-400) 0%, var(--emerald-600) 100%);
  border-radius: 9999px;
  transition: width 400ms ease;
}

/* --------------------------------------------------------------------------
   12. Media Queries & Accessibility Reductions
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .pulse-radar-green, .pulse-radar-blue {
    animation: none;
  }
}

@media (max-width: 768px) {
  .glass-panel {
    border-radius: 0.75rem;
  }
  .modal-content {
    max-width: 95vw;
  }
}
