/* ============================================
   GitHub Repo Scanner — Custom Styles
   Tailwind CSS handles the bulk of styling.
   This file covers what Tailwind can't easily do.
   ============================================ */

/* --- Dark-mode transition smoothing --- */

:root {
  color-scheme: light dark;
}

body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- Custom scrollbar (dark mode) --- */

@media (prefers-color-scheme: dark) {
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  ::-webkit-scrollbar-track {
    background: #1e1e2e;
  }
  ::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: #555;
  }
}

.dark ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.dark ::-webkit-scrollbar-track {
  background: #1e1e2e;
}
.dark ::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 4px;
}
.dark ::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* --- Sort indicators for table headers --- */

.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 1.25em;
}

.sortable::after {
  content: "▲▼";
  position: absolute;
  right: 0.25em;
  font-size: 0.55em;
  opacity: 0.3;
  letter-spacing: -0.15em;
  display: inline-flex;
  flex-direction: column;
  line-height: 1;
}

.sortable.asc::after {
  content: "▲";
  opacity: 0.9;
  font-size: 0.7em;
}

.sortable.desc::after {
  content: "▼";
  opacity: 0.9;
  font-size: 0.7em;
}

/* --- Spinner / loading animation --- */

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(128, 128, 128, 0.25);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- Toast notifications --- */

.toast {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  animation: toast-in 0.35s ease forwards;
}

.toast.toast-out {
  animation: toast-out 0.4s ease forwards;
}

@keyframes toast-in {
  from {
    top: -100px;
    opacity: 0;
  }
  to {
    top: 1rem;
    opacity: 1;
  }
}

@keyframes toast-out {
  from {
    top: 1rem;
    opacity: 1;
  }
  to {
    top: -100px;
    opacity: 0;
  }
}

/* --- Progress bar indeterminate shimmer --- */

.progress-bar-fill.indeterminate {
  width: 100% !important;
  background: linear-gradient(
    90deg,
    rgba(99, 102, 241, 0.15) 0%,
    rgba(139, 92, 246, 0.7) 50%,
    rgba(99, 102, 241, 0.15) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }

}

/* --- Progress bar glow effect --- */
.progress-bar-fill:not(.indeterminate) {
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

/* --- Table row hover highlight --- */

.repo-table tbody tr {
  transition: background-color 0.15s ease;
}

.repo-table tbody tr:hover {
  background-color: rgba(99, 102, 241, 0.08);
}

.dark .repo-table tbody tr:hover {
  background-color: rgba(99, 102, 241, 0.15);
}

/* --- Filter panel expand / collapse --- */

.filter-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.filter-panel.open {
  max-height: 600px;
  opacity: 1;
}

/* --- PAT input --- */

input.pat-input {
  font-family: monospace;
}

/* --- Visibility & status badges --- */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  line-height: 1.25rem;
}

.badge-public {
  background-color: #dcfce7;
  color: #166534;
}

.badge-private {
  background-color: #fef9c3;
  color: #854d0e;
}

.badge-archived {
  background-color: #fee2e2;
  color: #991b1b;
}

.dark .badge-public {
  background-color: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.dark .badge-private {
  background-color: rgba(234, 179, 8, 0.2);
  color: #fde047;
}

.dark .badge-archived {
  background-color: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}
