/* Synapse Edge Proxy - Global Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Orbitron:wght@400;700;900&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Variables ── */
:root {
  --bg-primary:    #05080A;
  --bg-secondary:  #0B0F14;
  --bg-card:       #0D1117;
  --accent:        #00D6B4;
  --accent-glow:   rgba(0, 214, 180, 0.25);
  --accent-hover:  #00F0C9;
  --danger:        #FF3B3B;
  --warning:       #D29922;
  --text-primary:  #E6EDF3;
  --text-muted:    #8B949E;
  --border:        #20262C;
  --border-accent: #00D6B430;
  --radius:        12px;
  --radius-lg:     20px;
  --shadow:        0 8px 40px rgba(0,0,0,0.6);
  --glow:          0 0 30px rgba(0, 214, 180, 0.15);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-hover); }

/* ── Background Orbs (ambient glow) ── */
.bg-orbs {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
}
.bg-orbs::before {
  content: '';
  position: absolute; top: -20%; left: -10%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(0,214,180,0.08) 0%, transparent 70%);
  border-radius: 50%; animation: orbFloat 15s ease-in-out infinite;
}
.bg-orbs::after {
  content: '';
  position: absolute; bottom: -20%; right: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(31,111,235,0.07) 0%, transparent 70%);
  border-radius: 50%; animation: orbFloat 20s ease-in-out infinite reverse;
}
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(40px, -40px) scale(1.05); }
  66%       { transform: translate(-30px, 30px) scale(0.95); }
}

/* ── Particle Canvas ── */
#particles-canvas {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.4;
}

/* ── Main Wrapper ── */
.app-wrapper { position: relative; z-index: 1; }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.card:hover { border-color: var(--border-accent); box-shadow: var(--glow); }

/* ── Logo SE ── */
.se-logo {
  font-family: 'Orbitron', monospace;
  font-weight: 900; font-size: 3rem;
  color: var(--accent);
  text-shadow: 0 0 20px var(--accent), 0 0 60px rgba(0,214,180,0.3);
  letter-spacing: 4px;
  animation: logoPulse 3s ease-in-out infinite;
}
@keyframes logoPulse {
  0%, 100% { text-shadow: 0 0 20px var(--accent), 0 0 60px rgba(0,214,180,0.3); }
  50%       { text-shadow: 0 0 40px var(--accent), 0 0 100px rgba(0,214,180,0.5); }
}

.brand-name {
  font-family: 'Orbitron', monospace; font-weight: 700;
  font-size: 1.1rem; letter-spacing: 3px;
  color: var(--text-primary); text-align: center;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius); border: none;
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: 0.9rem;
  cursor: pointer; transition: all 0.25s ease; text-decoration: none;
  position: relative; overflow: hidden;
}
.btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0; transition: opacity 0.25s;
}
.btn:hover::before { opacity: 1; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #00a896);
  color: #000; box-shadow: 0 4px 20px rgba(0,214,180,0.3);
}
.btn-primary:hover {
  transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,214,180,0.5);
}
.btn-primary:active { transform: translateY(0); }

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #cc0000);
  color: #fff; box-shadow: 0 4px 20px rgba(255,59,59,0.3);
}
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(255,59,59,0.5); }

.btn-ghost {
  background: rgba(255,255,255,0.05); color: var(--accent);
  border: 1px solid var(--border-accent);
}
.btn-ghost:hover { background: rgba(0,214,180,0.1); transform: translateY(-1px); }

.btn-outline {
  background: transparent; color: var(--accent);
  border: 1px solid var(--accent);
}
.btn-outline:hover { background: rgba(0,214,180,0.1); }

.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

.btn-full { width: 100%; }

/* ── Form Inputs ── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-size: 0.78rem; font-weight: 600;
  color: var(--accent); text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 8px;
}
.form-control {
  width: 100%; padding: 12px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-primary);
  font-family: 'Inter', sans-serif; font-size: 0.95rem;
  outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,214,180,0.1);
}
.form-control::placeholder { color: var(--text-muted); }

select.form-control { appearance: none; cursor: pointer; }
select.form-control option {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  padding: 10px;
}

/* ── Status Indicators ── */
.status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block; background: #555;
  transition: background 0.4s, box-shadow 0.4s;
}
.status-dot.online  {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent), 0 0 20px rgba(0,214,180,0.4);
  animation: statusPulse 2s ease-in-out infinite;
}
.status-dot.warning {
  background: var(--warning);
  box-shadow: 0 0 8px var(--warning);
  animation: statusPulse 1s ease-in-out infinite;
}
.status-dot.danger  { background: var(--danger); }

@keyframes statusPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.3); opacity: 0.7; }
}

/* ── Alerts ── */
.alert {
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 0.88rem; font-weight: 500;
  display: none; margin-top: 12px;
  animation: slideDown 0.3s ease;
}
.alert.show { display: flex; align-items: center; gap: 8px; }
.alert-error   { background: rgba(255,59,59,0.1);  border: 1px solid rgba(255,59,59,0.3);  color: #ff6b6b; }
.alert-success { background: rgba(0,214,180,0.1); border: 1px solid rgba(0,214,180,0.3); color: var(--accent); }
.alert-warning { background: rgba(210,153,34,0.1); border: 1px solid rgba(210,153,34,0.3); color: var(--warning); }

@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 600; }
td { font-size: 0.88rem; color: var(--text-primary); }
tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Badge ── */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-success { background: rgba(0,214,180,0.15); color: var(--accent); }
.badge-danger  { background: rgba(255,59,59,0.15); color: var(--danger); }
.badge-warning { background: rgba(210,153,34,0.15); color: var(--warning); }
.badge-info    { background: rgba(31,111,235,0.15); color: #5a9cf8; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.8); backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg); padding: 40px; max-width: 480px; width: 90%;
  box-shadow: 0 30px 80px rgba(0,0,0,0.8), var(--glow);
  transform: scale(0.9) translateY(20px); transition: transform 0.3s;
  text-align: center;
}
.modal-overlay.show .modal { transform: scale(1) translateY(0); }

/* ── Loader ── */
.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Utility ── */
.text-accent  { color: var(--accent); }
.text-muted   { color: var(--text-muted); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-center  { text-align: center; }
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8    { gap: 8px; }
.gap-16   { gap: 16px; }
.mt-8     { margin-top: 8px; }
.mt-16    { margin-top: 16px; }
.mt-24    { margin-top: 24px; }
.mb-8     { margin-bottom: 8px; }
.mb-16    { margin-bottom: 16px; }
.mb-24    { margin-bottom: 24px; }
.w-full   { width: 100%; }
.hidden   { display: none !important; }

/* ── Section Header ── */
.section-title {
  font-family: 'Orbitron', monospace;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; color: var(--text-muted);
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

/* ── Glow Ring Animation ── */
@keyframes glowRing {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,214,180,0.4); }
  50%       { box-shadow: 0 0 0 10px rgba(0,214,180,0); }
}

/* ── Page Fade In ── */
@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.animate-in { animation: pageFadeIn 0.5s ease forwards; }

/* ── Tooltip ── */
[data-tip] { position: relative; cursor: pointer; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: #1a1f26; color: var(--text-primary);
  padding: 5px 10px; border-radius: 6px; font-size: 0.75rem; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity 0.2s;
}
[data-tip]:hover::after { opacity: 1; }
