/* Custom styles beyond Tailwind */

/* Active nav link */
.nav-link { color: rgba(191, 219, 254, 0.8); }
.nav-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-link.active { background: rgba(255,255,255,0.12); color: #fff; }

/* Drag-drop zone */
.drop-zone {
  border: 2px dashed #cbd5e1;
  transition: border-color 0.2s, background 0.2s;
}
.drop-zone.dragover {
  border-color: #3b82f6;
  background: #eff6ff;
}
.drop-zone .file-name {
  animation: fadeIn 0.2s ease;
}

/* Badge colors */
.badge-covered       { background: #dcfce7; color: #166534; }
.badge-partial       { background: #fef3c7; color: #92400e; }
.badge-not-covered   { background: #fee2e2; color: #991b1b; }
.badge-high          { background: #fee2e2; color: #991b1b; }
.badge-medium        { background: #fef3c7; color: #92400e; }
.badge-low           { background: #dbeafe; color: #1e40af; }

/* Spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 40px; height: 40px;
  border: 4px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.dark .spinner {
  border-color: #374151;
  border-top-color: #60a5fa;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Table row hover */
.findings-row:hover { background: #f8fafc; }
.dark .findings-row:hover { background: #1f2937; }

/* Inline action-status select (badge-style dropdown) */
.inline-select-action {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  background-size: 12px;
  min-width: 90px;
  transition: background-color 0.15s, color 0.15s;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* Progress step connector */
.progress-line { transition: background-color 0.3s ease; }

/* Collapsible sidebar */
.sb {
  transition: width 0.25s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.sb .sb-text {
  transition: opacity 0.2s ease, width 0.2s ease;
  white-space: nowrap;
}

/* Collapsed state */
.sb.sb-collapsed {
  width: 68px !important;
}
.sb.sb-collapsed .sb-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}
.sb.sb-collapsed .sb-header {
  justify-content: center;
  padding-left: 1rem;
  padding-right: 1rem;
}
.sb.sb-collapsed nav {
  padding-left: 0.625rem;
  padding-right: 0.625rem;
}
.sb.sb-collapsed nav a {
  justify-content: center;
  gap: 0;
}
.sb.sb-collapsed #sb-chevron {
  transform: rotate(180deg);
}

/* ---- Dark mode overrides ---- */
.dark .bg-white { background-color: #1f2937 !important; }
.dark .bg-gray-50 { background-color: #111827 !important; }
.dark .bg-gray-100 { background-color: #1f2937 !important; }
.dark .bg-green-50 { background-color: rgba(34,197,94,0.1) !important; }
.dark .bg-yellow-50 { background-color: rgba(234,179,8,0.1) !important; }
.dark .bg-red-50 { background-color: rgba(239,68,68,0.1) !important; }

.dark .text-gray-900 { color: #f3f4f6 !important; }
.dark .text-gray-800 { color: #e5e7eb !important; }
.dark .text-gray-700 { color: #d1d5db !important; }
.dark .text-gray-600 { color: #9ca3af !important; }
.dark .text-gray-500 { color: #9ca3af !important; }
.dark .text-gray-400 { color: #6b7280 !important; }

.dark .border-gray-200 { border-color: #374151 !important; }
.dark .border-gray-100 { border-color: #1f2937 !important; }
.dark .border-gray-300 { border-color: #4b5563 !important; }

/* Cards & surfaces */
.dark .shadow-sm { box-shadow: 0 1px 2px rgba(0,0,0,0.3) !important; }
.dark .hover\:shadow-md:hover { box-shadow: 0 4px 6px rgba(0,0,0,0.4) !important; }
.dark .hover\:border-brand-200:hover { border-color: #3b82f6 !important; }

/* Inputs */
.dark input, .dark select, .dark textarea {
  background-color: #374151 !important;
  border-color: #4b5563 !important;
  color: #e5e7eb !important;
}
.dark input::placeholder { color: #6b7280 !important; }

/* Drop zone */
.dark .drop-zone { border-color: #4b5563; background: #1f2937; }
.dark .drop-zone.dragover { border-color: #3b82f6; background: rgba(59,130,246,0.1); }

/* Table */
.dark thead { background-color: #1f2937 !important; }
.dark .findings-row:hover { background: #283548 !important; }
.dark .divide-gray-100 > :not([hidden]) ~ :not([hidden]) { border-color: #374151; }

/* Badges */
.dark .badge-covered { background: rgba(34,197,94,0.15); color: #86efac; }
.dark .badge-partial { background: rgba(234,179,8,0.15); color: #fde047; }
.dark .badge-not-covered { background: rgba(239,68,68,0.15); color: #fca5a5; }
.dark .badge-high { background: rgba(239,68,68,0.15); color: #fca5a5; }
.dark .badge-medium { background: rgba(234,179,8,0.15); color: #fde047; }
.dark .badge-low { background: rgba(59,130,246,0.15); color: #93c5fd; }

/* Action status badges */
.dark .bg-blue-100 { background-color: rgba(59,130,246,0.15) !important; }
.dark .text-blue-700 { color: #93c5fd !important; }
.dark .bg-yellow-100 { background-color: rgba(234,179,8,0.15) !important; }
.dark .text-yellow-700 { color: #fde047 !important; }
.dark .bg-green-100 { background-color: rgba(34,197,94,0.15) !important; }
.dark .text-green-700 { color: #86efac !important; }
.dark .bg-gray-100 { background-color: rgba(156,163,175,0.15) !important; }

/* Filter buttons */
.dark .border-brand-500 { border-color: #3b82f6 !important; }
.dark .bg-brand-50 { background-color: rgba(59,130,246,0.15) !important; }
.dark .text-brand-700 { color: #93c5fd !important; }

/* Pagination bar */
.dark .bg-gray-50.text-sm { background-color: #1a2332 !important; }

/* Chart container */
.dark canvas { filter: none; }

/* Progress stepper */
.dark .bg-brand-600 { background-color: #2563eb !important; }

/* Gradient hero card stays as-is since it's brand-colored */

/* Scrollbar in dark mode */
.dark ::-webkit-scrollbar-thumb { background: #4b5563; }

/* ---- Print styles ---- */
@media print {
  /* Hide sidebar, mobile header, export buttons */
  #sidebar, .md\:hidden, [href*="pdf"], [href*="csv"], [href="#/new"],
  button, input, .spinner { display: none !important; }

  /* Remove layout constraints */
  body { background: #fff; }
  #main-content { padding-top: 0 !important; }
  #page { max-width: 100%; padding: 0; }

  /* Show all findings (remove scroll/overflow) */
  .overflow-x-auto { overflow: visible !important; }
  table { font-size: 9pt; }

  /* Expand all detail rows */
  .findings-row + tr.hidden { display: table-row !important; }

  /* Avoid page breaks inside cards */
  .rounded-xl { break-inside: avoid; }

  /* Make charts fit */
  canvas { max-height: 200px !important; }
}
