/* ==========================================================================
   PRODUCTION SUITE STYLES (NORTH-005 HQ)
   Enterprise Security, Quick Command Bar, Toast Notifications & Diagnostics
   ========================================================================== */

/* 1. Global Toast Notifications */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 380px;
  width: calc(100% - 40px);
}

.toast-item {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--bg-card, #161b26);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3);
  color: var(--text-main, #f1f5f9);
  font-size: 13px;
  line-height: 1.4;
  opacity: 0;
  transform: translateX(30px);
  animation: toastSlideIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast-item.toast-hiding {
  opacity: 0;
  transform: translateX(30px);
}

@keyframes toastSlideIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 2px;
  color: var(--text-main, #f1f5f9);
}

.toast-message {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  word-break: break-word;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted, #94a3b8);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  margin-left: 4px;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.toast-close:hover {
  opacity: 1;
  color: #fff;
}

.toast-success {
  border-left: 4px solid #10b981;
}
.toast-success .toast-title { color: #10b981; }

.toast-error {
  border-left: 4px solid #ef4444;
}
.toast-error .toast-title { color: #ef4444; }

.toast-warning {
  border-left: 4px solid #f59e0b;
}
.toast-warning .toast-title { color: #f59e0b; }

.toast-info {
  border-left: 4px solid #3b82f6;
}
.toast-info .toast-title { color: #3b82f6; }


/* 2. Command Palette (Ctrl + K) */
#command-palette-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 99999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

#command-palette-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.command-palette-modal {
  width: 90%;
  max-width: 620px;
  background: var(--bg-card, #131722);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
  border-radius: 12px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(-10px) scale(0.98);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#command-palette-backdrop.active .command-palette-modal {
  transform: translateY(0) scale(1);
}

.command-search-header {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  gap: 12px;
}

.command-search-header i, .command-search-header span.cmd-icon {
  font-size: 18px;
  color: var(--primary, #3b82f6);
}

.command-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 15px;
  font-family: inherit;
  color: var(--text-main, #f1f5f9);
}

.command-search-input::placeholder {
  color: var(--text-muted, #64748b);
}

.command-esc-badge {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--text-muted, #94a3b8);
  font-family: monospace;
}

.command-results-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 8px;
}

.command-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted, #64748b);
  padding: 6px 10px 4px;
}

.command-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s ease;
  color: var(--text-main, #f1f5f9);
}

.command-item:hover, .command-item.selected {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.command-item-icon {
  font-size: 16px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.command-item-info {
  flex: 1;
  min-width: 0;
}

.command-item-title {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.command-item-sub {
  font-size: 11.5px;
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.command-item-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-gold, #f59e0b);
}

.command-palette-footer {
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted, #64748b);
}

.command-palette-footer kbd {
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 10px;
  color: #cbd5e1;
}


/* 3. Inactivity Lock Screen Modal */
#session-lock-modal {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 18, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 9999999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#session-lock-modal.active {
  opacity: 1;
  visibility: visible;
}

.session-lock-card {
  width: 90%;
  max-width: 400px;
  background: var(--bg-card, #131824);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
  border-radius: 14px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.7);
}

.session-lock-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

.session-lock-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main, #f8fafc);
  margin-bottom: 4px;
}

.session-lock-sub {
  font-size: 12.5px;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 22px;
}

.session-lock-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
  font-size: 13px;
  font-weight: 600;
}


/* 4. Diagnostics & 1-Click Repair Modal */
#diagnostics-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

#diagnostics-modal.active {
  opacity: 1;
  visibility: visible;
}

.diagnostics-modal-card {
  width: 92%;
  max-width: 780px;
  max-height: 85vh;
  background: var(--bg-card, #131722);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.diagnostics-modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.diagnostics-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.diagnostics-nav-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.diag-summary-pill {
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.diag-pill-status-ok {
  color: #10b981;
  font-weight: 700;
  font-size: 12px;
}

.diag-pill-status-warn {
  color: #f59e0b;
  font-weight: 700;
  font-size: 12px;
}

.diag-pill-status-err {
  color: #ef4444;
  font-weight: 700;
  font-size: 12px;
}
