/* ==========================================================================
   MacroVPN Organization Admin Web Portal - Stylesheet
   Designed for High-Performance Tenant Administration & Fleet Oversight
   ========================================================================== */

:root {
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-success: #059669;
  --color-danger: #dc2626;
  --color-warning: #d97706;
}

/* Base resets & typography */
html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code, kbd, samp, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
.dark ::-webkit-scrollbar-thumb {
  background: #334155;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Glass Panels & Modern Surface Elevation */
.glass-panel {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
}
.dark .glass-panel {
  background-color: #0f172a;
  border-color: #1e293b;
}

/* Hero Network Mesh Background */
.mesh-grid-pattern {
  background-size: 32px 32px;
  background-image: 
    linear-gradient(to right, rgba(148, 163, 184, 0.12) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.12) 1px, transparent 1px);
}
.dark .mesh-grid-pattern {
  background-image: 
    linear-gradient(to right, rgba(51, 65, 85, 0.25) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(51, 65, 85, 0.25) 1px, transparent 1px);
}

.feature-card {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}
.feature-card:hover {
  transform: translateY(-3px);
  border-color: #3b82f6;
  box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.1), 0 8px 10px -6px rgba(37, 99, 235, 0.1);
}

/* Live Pulse Indicators */
.pulse-online {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.pulse-paused {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #f59e0b;
  border-radius: 50%;
}

.pulse-offline {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #94a3b8;
  border-radius: 50%;
}

/* Status Badges */
.badge-online {
  background-color: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.dark .badge-online {
  background-color: rgba(6, 78, 59, 0.4);
  color: #34d399;
  border-color: rgba(5, 150, 105, 0.5);
}

.badge-offline {
  background-color: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}
.dark .badge-offline {
  background-color: rgba(30, 41, 59, 0.6);
  color: #94a3b8;
  border-color: #334155;
}

.badge-paused {
  background-color: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}
.dark .badge-paused {
  background-color: rgba(120, 53, 15, 0.4);
  color: #fbbf24;
  border-color: rgba(180, 83, 9, 0.5);
}

.badge-admin {
  background-color: #e0e7ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}
.dark .badge-admin {
  background-color: rgba(49, 46, 129, 0.4);
  color: #818cf8;
  border-color: rgba(67, 56, 202, 0.5);
}

/* Stat Card Accents */
.stat-card-blue {
  border-left: 4px solid #2563eb;
}
.stat-card-green {
  border-left: 4px solid #10b981;
}
.stat-card-slate {
  border-left: 4px solid #64748b;
}
.stat-card-amber {
  border-left: 4px solid #f59e0b;
}

/* Smooth Navigation Tab Indicator */
.nav-tab.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  font-weight: 700;
}
.dark .nav-tab.active {
  color: #60a5fa;
  border-bottom-color: #60a5fa;
}

/* Tables Styling */
.custom-table th {
  letter-spacing: 0.05em;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.custom-table tr:hover td {
  background-color: rgba(241, 245, 249, 0.7);
}
.dark .custom-table tr:hover td {
  background-color: rgba(30, 41, 59, 0.5);
}

/* Toast System */
#toastContainer {
  pointer-events: none;
}
.toast-item {
  pointer-events: auto;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateY(12px);
  opacity: 0;
}
.toast-item.show {
  transform: translateY(0);
  opacity: 1;
}

/* Modal Animations */
.modal-backdrop {
  opacity: 0;
  transition: opacity 0.2s ease-out;
}
.modal-backdrop.show {
  opacity: 1;
}

.modal-content {
  transform: scale(0.97) translateY(8px);
  opacity: 0;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-content.show {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Loading Spinner */
.spin-loader {
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* QR Code Display Card */
#qrcodeContainer img {
  display: inline-block;
  margin: 0 auto;
  border: 8px solid #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
