/* ═══════════════════════════════════════════════════════
   CORMOD DESIGN SYSTEM
   Canonical source: portal/app/cormod.css — keep both in sync.
   For modules that can't take a runtime dependency on an external domain
   (segmented/air-gapped networks, e.g. the NVR module): vendor this file
   locally instead of linking to it live.
═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* CorMod palette — matches VS Code Dark+ editor colors */
  --color-cormod-bg:          #1e1e1e;   /* editor.background */
  --color-cormod-surface:     #252526;   /* sideBar.background */
  --color-cormod-surface2:    #2d2d2d;   /* list.hoverBackground-ish */
  --color-cormod-surface3:    #37373d;   /* list.activeSelectionBackground-ish */
  --color-cormod-surface-mid: #222222;   /* exact average of surface (#252526) and bg (#1e1e1e) */
  --color-cormod-accent:      #0078d4;   /* focusBorder / VS Code blue */
  --color-cormod-accent-dim:  rgba(0, 120, 212, 0.14);
  --color-cormod-accent-glow: rgba(0, 120, 212, 0.28);
  --color-cormod-border:      #3c3c3c;
  --color-cormod-border-soft: rgba(255, 255, 255, 0.06);
  --color-cormod-text-main:   #cccccc;   /* foreground */
  --color-cormod-text-sub:    #9d9d9d;   /* descriptionForeground */
  --color-cormod-text-muted:  #6b6b6b;
  --color-cormod-danger:      #f14c4c;
  --color-cormod-success:     #4ec9b0;
  --color-cormod-warning:     #cca700;

  --sidebar-w:           256px;
  --sidebar-w-collapsed:  64px;
  --header-h:             56px;
  --radius-card:          12px;
  --radius-slot:          10px;
  --radius-btn:           8px;
  --transition:           0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-card:          0 1px 2px rgba(0,0,0,0.50), 0 2px 8px rgba(0,0,0,0.30);
  --shadow-hover:         0 4px 16px rgba(0,0,0,0.55), 0 12px 32px rgba(0,0,0,0.35);
}

* , *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--color-cormod-bg);
  color: var(--color-cormod-text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-cormod-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-cormod-text-muted); }

/* ═══════════════════════════════════════════════════════
   LIGHT THEME
═══════════════════════════════════════════════════════ */
[data-theme="light"] {
  /* VS Code Light+ editor colors */
  --color-cormod-bg:          #ffffff;
  --color-cormod-surface:     #f3f3f3;
  --color-cormod-surface2:    #e8e8e8;
  --color-cormod-surface3:    #e2e6ec;
  --color-cormod-surface-mid: #f9f9f9;
  --color-cormod-accent:      #005fb8;
  --color-cormod-accent-dim:  rgba(0, 95, 184, 0.09);
  --color-cormod-accent-glow: rgba(0, 95, 184, 0.18);
  --color-cormod-border:      rgba(0, 0, 0, 0.10);
  --color-cormod-border-soft: rgba(0, 0, 0, 0.05);
  --color-cormod-text-main:   #1e1e1e;
  --color-cormod-text-sub:    #3b3b3b;
  --color-cormod-text-muted:  #6b6b6b;
  --shadow-card:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-hover: 0 4px 16px rgba(0,0,0,0.12), 0 8px 32px rgba(0,0,0,0.07);
}

html[data-sidebar2-collapsed="true"] .cormod-col2-header,
html[data-sidebar2-collapsed="true"] .cormod-col2-body {
  width: 3.5rem !important;
  min-width: 3.5rem !important;
  padding-left: 0.25rem !important;
  padding-right: 0.25rem !important;
}

html[data-sidebar2-collapsed="true"] .cormod-col2-text {
  display: none !important;
}

html[data-sidebar2-collapsed="true"] .cormod-col2-header {
  justify-content: center;
}

/* ═══════════════════════════════════════════════════════
   CONFIRM MODAL — shared pattern for any "are you sure?" action
   (logout, delete, stop/restart, revoke, etc.) across every module.
═══════════════════════════════════════════════════════ */
.cormod-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.cormod-modal {
  width: 320px;
  max-width: calc(100vw - 32px);
  background: var(--color-cormod-surface3);
  border: 1px solid var(--color-cormod-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-hover);
  padding: 24px;
  text-align: center;
}

.cormod-modal-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.cormod-modal-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--color-cormod-text-main);
  margin-bottom: 4px;
}

.cormod-modal-body {
  font-size: 13px;
  color: var(--color-cormod-text-sub);
  margin-bottom: 20px;
}

.cormod-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.cormod-modal-actions button,
.cormod-modal-actions a {
  flex: 1;
  padding: 8px 16px;
  border-radius: var(--radius-btn);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-block;
}

.cormod-modal-btn-cancel {
  background: var(--color-cormod-surface2);
  border-color: var(--color-cormod-border);
  color: var(--color-cormod-text-sub);
}
.cormod-modal-btn-cancel:hover {
  color: var(--color-cormod-text-main);
}

.cormod-modal-btn-confirm {
  background: var(--color-cormod-accent);
  color: #fff;
}
.cormod-modal-btn-confirm:hover {
  filter: brightness(1.1);
}
