/* ============================================================
   CodeGuard — Dashboard Styles
   ============================================================ */

/* Severity badges */
.badge-critical { @apply bg-red-900/60 text-red-300 border border-red-700 px-2 py-0.5 rounded text-xs font-bold uppercase; }
.badge-high     { @apply bg-orange-900/60 text-orange-300 border border-orange-700 px-2 py-0.5 rounded text-xs font-bold uppercase; }
.badge-medium   { @apply bg-yellow-900/60 text-yellow-300 border border-yellow-700 px-2 py-0.5 rounded text-xs font-bold uppercase; }
.badge-low      { @apply bg-blue-900/60 text-blue-300 border border-blue-700 px-2 py-0.5 rounded text-xs font-bold uppercase; }
.badge-info     { @apply bg-gray-800 text-gray-400 border border-gray-600 px-2 py-0.5 rounded text-xs font-bold uppercase; }

/* Status badges */
.status-open          { @apply bg-red-900/40 text-red-300 px-2 py-0.5 rounded text-xs; }
.status-acknowledged  { @apply bg-yellow-900/40 text-yellow-300 px-2 py-0.5 rounded text-xs; }
.status-false_positive{ @apply bg-gray-800 text-gray-400 px-2 py-0.5 rounded text-xs; }
.status-fixed         { @apply bg-green-900/40 text-green-300 px-2 py-0.5 rounded text-xs; }

/* Run status */
.run-pending   { @apply text-yellow-400; }
.run-running   { @apply text-blue-400 animate-pulse; }
.run-completed { @apply text-green-400; }
.run-failed    { @apply text-red-400; }
.run-cancelled { @apply text-gray-400; }

/* Cards */
.card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  transition: border-color 0.2s ease;
}
.card:hover { border-color: rgba(14, 165, 233, 0.3); }

/* Sidebar */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 8px;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  font-size: 0.9rem;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: #e2e8f0; }
.nav-item.active { background: rgba(14,165,233,0.15); color: #38bdf8; border-left: 3px solid #0ea5e9; }

/* Table */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.875rem;
  color: #cbd5e1;
}
.data-table tr:hover td { background: rgba(255,255,255,0.03); }

/* Stat cards */
.stat-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 20px;
}
.stat-card .value { font-size: 2.25rem; font-weight: 700; line-height: 1; }
.stat-card .label { font-size: 0.8rem; color: #64748b; margin-top: 4px; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: #0f172a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 24px;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
}

/* Button variants */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; font-size: 0.875rem; font-weight: 500; cursor: pointer; transition: all 0.15s ease; border: none; }
.btn-primary { background: #0ea5e9; color: white; }
.btn-primary:hover { background: #0284c7; }
.btn-secondary { background: rgba(255,255,255,0.08); color: #cbd5e1; border: 1px solid rgba(255,255,255,0.12); }
.btn-secondary:hover { background: rgba(255,255,255,0.12); }
.btn-danger { background: rgba(239,68,68,0.15); color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-success { background: rgba(34,197,94,0.15); color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.btn-success:hover { background: rgba(34,197,94,0.25); }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; }

/* Form inputs */
.form-input {
  width: 100%;
  background: #1e293b;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  padding: 10px 14px;
  color: #e2e8f0;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.form-input:focus { border-color: #0ea5e9; background: #1e293b; }
.form-input::placeholder { color: #475569; }

/* Select — custom chevron + dark dropdown list */
select.form-input {
  appearance: none;
  -webkit-appearance: none;
  background-color: #1e293b;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
  color-scheme: dark;
}
select.form-input:focus { border-color: #0ea5e9; }

/* Option elements — dark background for the popup list (Chrome/Firefox on Windows) */
select.form-input option {
  background-color: #1e293b;
  color: #e2e8f0;
  padding: 8px 12px;
}
select.form-input option:hover,
select.form-input option:focus,
select.form-input option:checked {
  background-color: #0f4c81;
  color: #ffffff;
}
select.form-input option:disabled {
  color: #475569;
}

.form-label { font-size: 0.8rem; font-weight: 500; color: #94a3b8; margin-bottom: 6px; display: block; }

/* Toast notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  animation: slideIn 0.3s ease;
  min-width: 260px;
}
.toast-success { background: rgba(34,197,94,0.2); border: 1px solid rgba(34,197,94,0.4); color: #4ade80; }
.toast-error   { background: rgba(239,68,68,0.2); border: 1px solid rgba(239,68,68,0.4); color: #f87171; }
.toast-info    { background: rgba(14,165,233,0.2); border: 1px solid rgba(14,165,233,0.4); color: #38bdf8; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* Pulse loader */
.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #0ea5e9; display: inline-block;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Scanner badges */
.scanner-sast    { @apply bg-purple-900/40 text-purple-300 border border-purple-700/50; }
.scanner-sca     { @apply bg-blue-900/40 text-blue-300 border border-blue-700/50; }
.scanner-ai      { @apply bg-teal-900/40 text-teal-300 border border-teal-700/50; }
.scanner-secrets { @apply bg-red-900/40 text-red-300 border border-red-700/50; }
.scanner-dast    { @apply bg-orange-900/40 text-orange-300 border border-orange-700/50; }

/* ── Run Progress Bar ─────────────────────────────────────────── */
@keyframes progressIndeterminate {
  0%   { transform: translateX(-100%); width: 50%; }
  50%  { transform: translateX(100%);  width: 50%; }
  100% { transform: translateX(200%);  width: 50%; }
}

/* ── Schedule Pill Picker ─────────────────────────────────────── */
.sched-pill {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid #334155;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  line-height: 1.4;
}
.sched-pill:hover {
  border-color: #3b82f6;
  color: #93c5fd;
  background: rgba(59,130,246,0.08);
}
.sched-pill-active {
  background: #1d4ed8;
  border-color: #3b82f6;
  color: #fff;
}
.sched-pill-active:hover {
  background: #1e40af;
  border-color: #60a5fa;
}

/* ── Pentest inline report — markdown prose styles ─────────────────────────── */
.pentest-report-prose { color: #cbd5e1; font-size: 0.85rem; line-height: 1.7; }
.pentest-report-prose h1 { font-size: 1.3rem; font-weight: 700; color: #f1f5f9; margin: 1.4rem 0 0.6rem; border-bottom: 1px solid rgba(255,255,255,0.08); padding-bottom: 0.4rem; }
.pentest-report-prose h2 { font-size: 1.05rem; font-weight: 600; color: #e2e8f0; margin: 1.2rem 0 0.5rem; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 0.3rem; }
.pentest-report-prose h3 { font-size: 0.95rem; font-weight: 600; color: #e2e8f0; margin: 1rem 0 0.4rem; }
.pentest-report-prose h4 { font-size: 0.875rem; font-weight: 600; color: #94a3b8; margin: 0.8rem 0 0.3rem; text-transform: uppercase; letter-spacing: 0.04em; }
.pentest-report-prose p { margin: 0.5rem 0; }
.pentest-report-prose ul, .pentest-report-prose ol { padding-left: 1.4rem; margin: 0.5rem 0; }
.pentest-report-prose li { margin: 0.2rem 0; }
.pentest-report-prose strong { color: #f1f5f9; font-weight: 600; }
.pentest-report-prose em { color: #94a3b8; }
.pentest-report-prose code { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 0.8rem; background: rgba(15,23,42,0.8); color: #7dd3fc; padding: 1px 5px; border-radius: 4px; border: 1px solid rgba(255,255,255,0.08); }
.pentest-report-prose pre { background: rgba(15,23,42,0.9); border: 1px solid rgba(255,255,255,0.08); border-radius: 8px; padding: 0.9rem 1rem; overflow-x: auto; margin: 0.7rem 0; }
.pentest-report-prose pre code { background: none; border: none; padding: 0; color: #e2e8f0; font-size: 0.78rem; }
.pentest-report-prose table { width: 100%; border-collapse: collapse; margin: 0.8rem 0; font-size: 0.82rem; }
.pentest-report-prose th { background: rgba(255,255,255,0.05); color: #94a3b8; font-weight: 600; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.05em; padding: 8px 12px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.1); }
.pentest-report-prose td { padding: 7px 12px; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: top; }
.pentest-report-prose tr:hover td { background: rgba(255,255,255,0.02); }
.pentest-report-prose blockquote { border-left: 3px solid #0ea5e9; padding: 0.4rem 0.9rem; margin: 0.7rem 0; background: rgba(14,165,233,0.06); border-radius: 0 6px 6px 0; color: #94a3b8; font-style: italic; }
.pentest-report-prose hr { border: none; border-top: 1px solid rgba(255,255,255,0.08); margin: 1rem 0; }
.pentest-report-prose a { color: #38bdf8; text-decoration: underline; }
.pentest-report-prose a:hover { color: #7dd3fc; }
/* Severity badge colouring inside the report */
.pentest-report-prose strong:has(+ *) { }
/* Wide modal variant — used by pentest report viewer */
.modal-wide { max-width: min(90vw, 900px) !important; width: 90% !important; }
