/* ============================================================
   GLOBAL.CSS — Cyber-Gold Forensic Enterprise Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ─────────────────────────────────────────
   CSS VARIABLES — PURE OBSIDIAN BLACK & GOLD PALETTE
───────────────────────────────────────── */
:root {
  /* Pure Obsidian Black & Deep Charcoal Surface Layering */
  --bg-body:         #030407;
  --bg-surface:      #0B0E14;
  --bg-card:         #111622;
  --bg-card-hover:   #181F2F;
  --bg-glass:        rgba(11, 14, 20, 0.9);
  --bg-glass-card:   rgba(17, 22, 34, 0.94);

  --border-color:    #1A2130;
  --border-light:    #2A354A;
  --border-gold:     rgba(234, 179, 8, 0.35);
  --border-cyan:     rgba(56, 189, 248, 0.35);

  /* Champagne Metallic Gold & Titanium Accents */
  --gold-primary:    #EAB308;
  --gold-metallic:   #D4AF37;
  --gold-dark:       #A16207;
  --gold-light:      #FEF08A;
  --gold-bg:         rgba(234, 179, 8, 0.08);
  --gold-glow:       0 0 20px rgba(234, 179, 8, 0.22);

  /* Tactical Cyan & Telemetry Accents */
  --cyan-primary:    #38BDF8;
  --cyan-dark:       #0284C7;
  --cyan-bg:         rgba(56, 189, 248, 0.08);
  --cyan-glow:       0 0 20px rgba(56, 189, 248, 0.22);

  --text-primary:    #F8FAFC;
  --text-secondary:  #94A3B8;
  --text-muted:      #64748B;

  /* Status Colors */
  --red-danger:      #F43F5E;
  --red-bg:          rgba(244, 63, 94, 0.12);
  --red-border:      rgba(244, 63, 94, 0.4);

  --green-safe:      #10B981;
  --green-bg:        rgba(16, 185, 129, 0.12);
  --green-border:    rgba(16, 185, 129, 0.4);

  --yellow-warn:     #F59E0B;
  --yellow-bg:       rgba(245, 158, 11, 0.12);
  --yellow-border:   rgba(245, 158, 11, 0.4);

  --purple-recovered:#A855F7;
  --purple-bg:       rgba(168, 85, 247, 0.12);

  --blue-info:       #3B82F6;
  --blue-bg:         rgba(59, 130, 246, 0.12);

  /* Spacing */
  --space-xs:   4px;
  --space-sm:   8px;
  --space-md:   16px;
  --space-lg:   24px;
  --space-xl:   32px;
  --space-2xl:  48px;

  /* Radius */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --radius-full:9999px;

  /* Shadows */
  --shadow-sm:   0 2px 4px rgba(0, 0, 0, 0.6);
  --shadow-md:   0 6px 18px rgba(0, 0, 0, 0.7);
  --shadow-lg:   0 16px 40px rgba(0, 0, 0, 0.85);
  --shadow-gold: 0 4px 20px rgba(234, 179, 8, 0.2);
  --shadow-cyan: 0 4px 20px rgba(56, 189, 248, 0.2);

  /* Transitions */
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─────────────────────────────────────────
   RESET & AMBIENT ANIMATED BACKGROUND
───────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-body);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(245, 158, 11, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.06) 0%, transparent 45%),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 40px 40px, 40px 40px;
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Floating Ambient Orbs */
.ambient-orb-1, .ambient-orb-2 {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}
.ambient-orb-1 {
  width: 350px;
  height: 350px;
  background: rgba(245, 158, 11, 0.15);
  top: -100px;
  left: -100px;
  animation: floatOrb1 14s ease-in-out infinite alternate;
}
.ambient-orb-2 {
  width: 400px;
  height: 400px;
  background: rgba(6, 182, 212, 0.12);
  bottom: -150px;
  right: -150px;
  animation: floatOrb2 18s ease-in-out infinite alternate;
}

@keyframes floatOrb1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(120px, 80px) scale(1.15); }
}
@keyframes floatOrb2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-100px, -90px) scale(1.2); }
}

.mono {
  font-family: 'JetBrains Mono', monospace;
}

a {
  color: var(--gold-primary);
  text-decoration: none;
  transition: var(--transition);
}
a:hover { color: var(--gold-light); }

.lucide {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  vertical-align: middle;
  transition: transform 0.2s ease;
}

/* ─────────────────────────────────────────
   TYPOGRAPHY
───────────────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.6rem, 3vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 2.2vw, 1.75rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }

.text-gold    { color: var(--gold-primary); text-shadow: 0 0 16px rgba(245, 158, 11, 0.3); }
.text-cyan    { color: var(--cyan-primary); text-shadow: 0 0 16px rgba(6, 182, 212, 0.3); }
.text-muted   { color: var(--text-secondary); }
.text-danger  { color: var(--red-danger); }
.text-safe    { color: var(--green-safe); }
.text-warn    { color: var(--yellow-warn); }
.text-purple  { color: var(--purple-recovered); }
.text-sm      { font-size: 0.875rem; }
.text-xs      { font-size: 0.75rem; }

.label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ─────────────────────────────────────────
   SCROLLBAR
───────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--gold-primary); box-shadow: var(--gold-glow); }

/* ─────────────────────────────────────────
   BUTTONS WITH SHIMMER & RIPPLE
───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
}

/* Button Shimmer Sweep Effect */
.btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent 30%,
    rgba(255, 255, 255, 0.25) 50%,
    transparent 70%
  );
  transform: rotate(30deg) translateX(-100%);
  transition: transform 0.6s ease;
}

.btn:hover::after {
  transform: rotate(30deg) translateX(100%);
}

.btn:active { transform: translateY(1px) scale(0.98); }
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Gold Primary Button */
.btn-gold {
  background: linear-gradient(135deg, #F59E0B 0%, #D4AF37 100%);
  color: #070A11;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.35);
}
.btn-gold:hover {
  background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.55);
  transform: translateY(-2px);
}

/* Cyan Button */
.btn-cyan {
  background: linear-gradient(135deg, #06B6D4 0%, #0891B2 100%);
  color: #070A11;
  box-shadow: 0 4px 18px rgba(6, 182, 212, 0.35);
}
.btn-cyan:hover {
  background: linear-gradient(135deg, #22D3EE 0%, #06B6D4 100%);
  box-shadow: 0 6px 24px rgba(6, 182, 212, 0.55);
  transform: translateY(-2px);
}

/* Outlined */
.btn-outline {
  background: rgba(15, 23, 42, 0.7);
  color: var(--text-primary);
  border-color: var(--border-color);
  backdrop-filter: blur(10px);
}
.btn-outline:hover {
  background: var(--bg-card-hover);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
  box-shadow: var(--shadow-gold);
  transform: translateY(-1px);
}

/* Danger */
.btn-danger {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  color: #FFF;
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.35);
}
.btn-danger:hover {
  background: linear-gradient(135deg, #F87171 0%, #EF4444 100%);
  box-shadow: 0 6px 24px rgba(239, 68, 68, 0.55);
  transform: translateY(-2px);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.btn-sm { padding: 8px 16px; font-size: 0.8125rem; }

/* ─────────────────────────────────────────
   FORM INPUTS
───────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9375rem;
  transition: var(--transition);
  outline: none;
}

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

.form-control:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px var(--gold-bg), var(--gold-glow);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' 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 12px center;
  background-size: 16px;
  padding-right: 40px;
}

/* ─────────────────────────────────────────
   CARDS & GLASS WITH HOVER LIFT
───────────────────────────────────────── */
.card {
  background: var(--bg-glass-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
  z-index: 1;
}

.card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-gold-glow {
  border-color: var(--border-gold);
  box-shadow: 0 4px 28px rgba(245, 158, 11, 0.15);
}
.card-gold-glow:hover {
  box-shadow: 0 8px 36px rgba(245, 158, 11, 0.3);
}

.card-cyan-glow {
  border-color: var(--border-cyan);
  box-shadow: 0 4px 28px rgba(6, 182, 212, 0.15);
}
.card-cyan-glow:hover {
  box-shadow: 0 8px 36px rgba(6, 182, 212, 0.3);
}

/* ─────────────────────────────────────────
   BADGES & RISK INDICATORS
───────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: transform 0.2s ease;
}
.badge:hover { transform: scale(1.04); }

.badge-active    { background: var(--green-bg); color: var(--green-safe); border: 1px solid var(--green-border); box-shadow: 0 0 10px rgba(16, 185, 129, 0.2); }
.badge-risk      { background: var(--yellow-bg); color: var(--yellow-warn); border: 1px solid var(--yellow-border); box-shadow: 0 0 10px rgba(245, 158, 11, 0.2); }
.badge-frozen    { background: var(--red-bg); color: var(--red-danger); border: 1px solid var(--red-border); box-shadow: 0 0 10px rgba(239, 68, 68, 0.2); }
.badge-recovered { background: var(--purple-bg); color: var(--purple-recovered); border: 1px solid rgba(139, 92, 246, 0.4); box-shadow: 0 0 10px rgba(139, 92, 246, 0.2); }
.badge-admin     { background: var(--gold-bg); color: var(--gold-primary); border: 1px solid var(--border-gold); }
.badge-advisor   { background: var(--bg-surface); color: var(--text-secondary); border: 1px solid var(--border-color); }

.risk-score-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 700;
}
.risk-score-badge.risk-low    { background: var(--green-bg); color: var(--green-safe); border: 1px solid var(--green-border); }
.risk-score-badge.risk-medium { background: var(--yellow-bg); color: var(--yellow-warn); border: 1px solid var(--yellow-border); }
.risk-score-badge.risk-high   { background: var(--red-bg); color: var(--red-danger); border: 1px solid var(--red-border); animation: pulseDanger 2s infinite alternate; }

@keyframes pulseDanger {
  0% { box-shadow: 0 0 0 rgba(239, 68, 68, 0.4); }
  100% { box-shadow: 0 0 16px rgba(239, 68, 68, 0.7); }
}

/* ─────────────────────────────────────────
   MODALS WITH SMOOTH FLUID SCALE
───────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 17, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-lg), var(--gold-glow);
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.modal-close:hover { color: var(--gold-primary); background: var(--bg-card-hover); }

.modal-body { display: flex; flex-direction: column; gap: var(--space-md); }

.modal-footer {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-color);
}

/* ─────────────────────────────────────────
   TABLES
───────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-glass-card);
  backdrop-filter: blur(12px);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead tr {
  background: rgba(3, 4, 7, 0.98);
  border-bottom: 1px solid var(--border-color);
}

thead th {
  padding: 14px 18px;
  text-align: left;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

tbody tr:hover { background: var(--bg-card-hover); }
tbody tr:last-child { border-bottom: none; }
tbody td { padding: 14px 18px; vertical-align: middle; }

/* ─────────────────────────────────────────
   TOASTS
───────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), var(--gold-glow);
  font-size: 0.875rem;
  font-weight: 600;
  min-width: 290px;
  animation: slideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.toast-success i { color: var(--green-safe); }
.toast.toast-error i   { color: var(--red-danger); }
.toast.toast-warning i { color: var(--yellow-warn); }
.toast.toast-info i    { color: var(--cyan-primary); }

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

/* ─────────────────────────────────────────
   ANIMATION UTILITIES
───────────────────────────────────────── */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }

.w-full { width: 100%; }
.h-full { height: 100%; }
.hidden { display: none !important; }
.text-center { text-align: center; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fadeIn { animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }


