/* ==========================================================================
   MacroVPN Enterprise Console - Hard Colors & Precision Sharp Edges
   Aesthetic: High-Contrast Technical Cyber / Industrial Command Center
   Constraint: NO CURVES ANYWHERE ON ANY CARD OR COMPONENT (100% Flat Sharp Edges)
   ========================================================================== */

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

:root {
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  /* Hard Saturated Color Palette */
  --hard-indigo: #4f46e5;
  --hard-blue: #2563eb;
  --hard-cyan: #0891b2;
  --hard-emerald: #059669;
  --hard-amber: #d97706;
  --hard-rose: #e11d48;
  --hard-slate: #475569;
}

/* ==========================================================================
   ZERO CURVES ENFORCEMENT - 100% SHARP PRECISION CORNERS EVERYWHERE
   ========================================================================== */
*,
*::before,
*::after,
html,
body,
div,
span,
aside,
header,
main,
footer,
section,
nav,
button,
input,
select,
textarea,
kbd,
table,
thead,
tbody,
tr,
th,
td,
label,
form,
img,
svg,
.glass-panel,
.glow-card,
.org-card,
.nav-item,
#deviceDetailsDrawer,
#commandPaletteContent,
.modal-dialog,
.modal-overlay,
.switch,
.slider,
.slider:before,
#toast {
  border-radius: 0 !important;
  -webkit-border-radius: 0 !important;
  -moz-border-radius: 0 !important;
}

* {
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

html {
  font-family: var(--font-sans);
  scroll-behavior: smooth;
}

/* ==========================================================================
   1. HARD AMBIENT TECH LIGHT
   ========================================================================== */
.ambient-glow-wrapper {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.glow-orb {
  position: absolute;
  filter: blur(120px);
  opacity: 0.35;
  transition: opacity 0.5s ease;
  will-change: transform, opacity;
}

.glow-orb-indigo {
  top: -10%;
  left: -5%;
  width: 50vw;
  height: 50vw;
  max-width: 650px;
  max-height: 650px;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.45) 0%, rgba(79, 70, 229, 0) 70%);
}

.glow-orb-cyan {
  top: 15%;
  right: -5%;
  width: 45vw;
  height: 45vw;
  max-width: 600px;
  max-height: 600px;
  background: radial-gradient(circle, rgba(8, 145, 178, 0.35) 0%, rgba(8, 145, 178, 0) 70%);
}

.glow-orb-emerald {
  bottom: -10%;
  left: 20%;
  width: 50vw;
  height: 50vw;
  max-width: 700px;
  max-height: 700px;
  background: radial-gradient(circle, rgba(5, 150, 105, 0.32) 0%, rgba(5, 150, 105, 0) 70%);
}

.glow-orb-purple {
  bottom: 15%;
  right: -5%;
  width: 40vw;
  height: 40vw;
  max-width: 500px;
  max-height: 500px;
  background: radial-gradient(circle, rgba(147, 51, 234, 0.3) 0%, rgba(147, 51, 234, 0) 70%);
}

/* Light mode ambient adjustments */
html:not(.dark) .glow-orb-indigo {
  opacity: 0.18;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.35) 0%, rgba(79, 70, 229, 0) 70%);
}
html:not(.dark) .glow-orb-cyan {
  opacity: 0.15;
  background: radial-gradient(circle, rgba(8, 145, 178, 0.28) 0%, rgba(8, 145, 178, 0) 70%);
}
html:not(.dark) .glow-orb-emerald {
  opacity: 0.14;
  background: radial-gradient(circle, rgba(5, 150, 105, 0.25) 0%, rgba(5, 150, 105, 0) 70%);
}

/* High-Tech Grid Pattern */
.dot-grid-bg {
  background-image: linear-gradient(to right, rgba(148, 163, 184, 0.08) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 32px 32px;
}
html.dark .dot-grid-bg {
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
                    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* ==========================================================================
   2. SHARP PANELS & HARD COLOR METRIC CARDS
   ========================================================================== */
.glass-panel {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

html.dark .glass-panel {
  background: #0d1322;
  border: 1px solid #1e293b;
  box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.4);
}

/* Hard Metric Cards with Crisp Left Accent Bars */
.card-hard-indigo {
  border-left: 4px solid #4f46e5 !important;
}
.card-hard-indigo:hover {
  border-color: #6366f1;
  box-shadow: 0 0 15px -3px rgba(79, 70, 229, 0.25);
}

.card-hard-cyan {
  border-left: 4px solid #0891b2 !important;
}
.card-hard-cyan:hover {
  border-color: #06b6d4;
  box-shadow: 0 0 15px -3px rgba(8, 145, 178, 0.25);
}

.card-hard-emerald {
  border-left: 4px solid #059669 !important;
}
.card-hard-emerald:hover {
  border-color: #10b981;
  box-shadow: 0 0 15px -3px rgba(5, 150, 105, 0.25);
}

.card-hard-slate {
  border-left: 4px solid #64748b !important;
}
.card-hard-slate:hover {
  border-color: #94a3b8;
  box-shadow: 0 0 15px -3px rgba(100, 116, 139, 0.2);
}

.card-hard-amber {
  border-left: 4px solid #d97706 !important;
}
.card-hard-amber:hover {
  border-color: #f59e0b;
  box-shadow: 0 0 15px -3px rgba(217, 119, 6, 0.25);
}

/* Sharp Org Card */
.org-card {
  border: 1px solid #cbd5e1;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
html.dark .org-card {
  border: 1px solid #1e293b;
}
.org-card:hover {
  border-color: #4f46e5 !important;
}
html.dark .org-card:hover {
  border-color: #6366f1 !important;
  box-shadow: 0 4px 20px -2px rgba(79, 70, 229, 0.15);
}

/* ==========================================================================
   3. SQUARE STATUS PULSE & HARD BADGES
   ========================================================================== */
.square-pulse-online {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.85);
  animation: square-pulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes square-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.8);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.hard-badge-online {
  background: #064e3b;
  color: #34d399;
  border: 1px solid #059669;
}
html:not(.dark) .hard-badge-online {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #10b981;
}

.hard-badge-paused {
  background: #78350f;
  color: #fde047;
  border: 1px solid #d97706;
}
html:not(.dark) .hard-badge-paused {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #f59e0b;
}

.hard-badge-offline {
  background: #1e293b;
  color: #94a3b8;
  border: 1px solid #475569;
}
html:not(.dark) .hard-badge-offline {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #94a3b8;
}

.hard-badge-admin {
  background: #312e81;
  color: #c7d2fe;
  border: 1px solid #4f46e5;
}
html:not(.dark) .hard-badge-admin {
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #6366f1;
}

/* ==========================================================================
   4. NAVIGATION SIDEBAR (SHARP & BOLD)
   ========================================================================== */
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #64748b;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
  cursor: pointer;
  user-select: none;
}

html.dark .nav-item {
  color: #94a3b8;
}

.nav-item:hover {
  color: #0f172a;
  background: #e2e8f0;
  border-left-color: #94a3b8;
}

html.dark .nav-item:hover {
  color: #ffffff;
  background: #1e293b;
  border-left-color: #64748b;
}

.nav-item.active {
  color: #4f46e5;
  background: #eef2ff;
  border-left: 3px solid #4f46e5 !important;
}

html.dark .nav-item.active {
  color: #a5b4fc;
  background: #1e1b4b;
  border-left: 3px solid #6366f1 !important;
}

/* ==========================================================================
   5. SHARP SLIDE-OVER DEVICE DRAWER
   ========================================================================== */
#deviceDetailsDrawer {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
  border-left: 2px solid #4f46e5 !important;
}

#deviceDetailsDrawer.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

#drawerBackdrop {
  transition: opacity 0.2s ease;
  opacity: 0;
  pointer-events: none;
}

#drawerBackdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   6. SHARP COMMAND PALETTE MODAL
   ========================================================================== */
#commandPaletteModal {
  transition: opacity 0.15s ease;
  opacity: 0;
  pointer-events: none;
}

#commandPaletteModal.open {
  opacity: 1;
  pointer-events: auto;
}

#commandPaletteContent {
  border: 2px solid #4f46e5 !important;
}

/* ==========================================================================
   7. MODAL DIALOGS
   ========================================================================== */
.modal-overlay {
  transition: opacity 0.2s ease;
  opacity: 0;
  pointer-events: none;
}

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

.modal-dialog {
  border: 2px solid #4f46e5 !important;
}

/* ==========================================================================
   8. ACCORDION ANIMATION
   ========================================================================== */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
  opacity: 0;
}

.accordion-content.open {
  max-height: 4000px;
  opacity: 1;
}

.chevron-icon {
  transition: transform 0.2s ease;
}

.chevron-icon.rotated {
  transform: rotate(180deg);
}

/* ==========================================================================
   9. PRECISION SHARP SWITCH (HARDWARE INDUSTRIAL TOGGLE)
   ========================================================================== */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #64748b;
  border: 1px solid #475569;
  transition: background-color 0.15s ease;
}

html.dark .slider {
  background-color: #1e293b;
  border: 1px solid #334155;
}

.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

input:checked + .slider {
  background-color: #059669;
  border-color: #10b981;
}

input:checked + .slider:before {
  transform: translateX(22px);
  background-color: #ffffff;
}

input:disabled + .slider {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==========================================================================
   10. SCROLLBARS, TOAST NOTIFICATIONS & UTILITIES
   ========================================================================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #64748b;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}
html.dark ::-webkit-scrollbar-thumb {
  background: #334155;
}
html.dark ::-webkit-scrollbar-thumb:hover {
  background: #4f46e5;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.font-mono-code {
  font-family: var(--font-mono);
}

#toast {
  transform: translateY(120px);
  opacity: 0;
  pointer-events: none;
  border: 2px solid #4f46e5 !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@media (max-width: 640px) {
  .touch-target {
    min-height: 44px;
    min-width: 44px;
  }
}
