/* ============================================================
   AssetEye Scanner — Global Design System
   app.css — loaded from base.html
   ============================================================ */

/* ---- Custom Properties ---- */
:root {
  --color-bg-deep:    #020617;  /* slate-950 */
  --color-bg-panel:  #0f172a;  /* slate-900 */
  --color-bg-card:   #1e293b;  /* slate-800 */
  --color-border:    #334155;  /* slate-700 */
  --color-accent:    #22d3ee;  /* cyan-400  */
  --color-accent2:   #818cf8;  /* indigo-400 */
  --color-text-muted:#94a3b8;  /* slate-400 */
  --sidebar-width:   16rem;
  --topbar-height:   3.5rem;
  --toast-z:         1000;
}

/* ---- Scrollbar ---- */
* {
  scrollbar-width: thin;
  scrollbar-color: #334155 #0f172a;
}
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track  { background: #0f172a; }
*::-webkit-scrollbar-thumb  { background: #334155; border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: #475569; }

/* ---- Base ---- */
body {
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--color-bg-deep);
  color: #e2e8f0;
}

/* ---- Gradient Text ---- */
.gradient-text {
  background: linear-gradient(135deg, #22d3ee 0%, #818cf8 50%, #c084fc 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 5s ease-in-out infinite;
}
@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
}

/* ---- Glass Panels ---- */
.glass-panel {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(51, 65, 85, 0.5);
}

.glass-card {
  background: rgba(30, 41, 59, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(51, 65, 85, 0.4);
  transition: all 0.2s ease;
}
.glass-card:hover {
  background: rgba(30, 41, 59, 0.65);
  border-color: rgba(71, 85, 105, 0.65);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px -8px rgba(0,0,0,0.4);
}

/* ---- Sidebar Nav Links ---- */
.nav-link {
  position: relative;
  transition: all 0.2s ease;
}
.nav-link::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 0;
  background: linear-gradient(180deg, #22d3ee, #818cf8);
  border-radius: 0 2px 2px 0;
  transition: height 0.2s ease;
}
.nav-link:hover::before,
.nav-link.active::before { height: 65%; }

/* ---- Primary Button ---- */
.btn-primary {
  background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  color: #e2e8f0; /* ensure readable text on dark gradient */
  transition: all 0.2s ease;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px -8px rgba(6, 182, 212, 0.5);
}

/* ---- Table Row Hover ---- */
.table-row-hover:hover { background: rgba(51, 65, 85, 0.3); }

/* ============================================================
   Skeleton Loader
   ============================================================ */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(30,41,59,0.6) 25%,
    rgba(51,65,85,0.5) 50%,
    rgba(30,41,59,0.6) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   Toast Notifications
   ============================================================ */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: var(--toast-z);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  border: 1px solid;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 0.875rem;
  font-weight: 500;
  max-width: 22rem;
  box-shadow: 0 20px 60px -10px rgba(0,0,0,0.5);
  pointer-events: all;
  animation: toast-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.toast.removing {
  animation: toast-out 0.25s ease-in forwards;
}
.toast-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}
.toast-error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}
.toast-info {
  background: rgba(6, 182, 212, 0.1);
  border-color: rgba(6, 182, 212, 0.3);
  color: #67e8f9;
}
.toast-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(100%) scale(0.9); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to   { opacity: 0; transform: translateX(100%) scale(0.9); }
}

/* ============================================================
   Page / Content Transition
   ============================================================ */
.section-enter {
  animation: section-fade-in 0.35s ease-out forwards;
}
@keyframes section-fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Severity Bars (animated)
   ============================================================ */
.sev-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transform-origin: left;
  animation: bar-grow 0.8s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
}
@keyframes bar-grow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* ============================================================
   SVG Donut / Ring Chart
   ============================================================ */
.donut-ring {
  transform: rotate(-90deg);
  transform-origin: center;
}
.donut-segment {
  fill: none;
  stroke-width: 16;
  transition: stroke-dasharray 0.6s cubic-bezier(0.34, 1.2, 0.64, 1);
}

/* ============================================================
   Metric Card Count-Up Number
   ============================================================ */
.count-num {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  transition: all 0.3s;
}

/* ============================================================
   Tab Navigation (Settings Page)
   ============================================================ */
.tab-nav {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  padding-bottom: 0;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem 0.5rem 0 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #94a3b8;
  border: 1px solid transparent;
  border-bottom: none;
  position: relative;
  bottom: -1px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  background: transparent;
}
.tab-btn:hover {
  color: #e2e8f0;
  background: rgba(30,41,59,0.4);
}
.tab-btn.active {
  color: #22d3ee;
  background: rgba(15, 23, 42, 0.75);
  border-color: rgba(51, 65, 85, 0.5);
  border-bottom-color: rgba(15, 23, 42, 0.75);
}
.tab-btn.active svg { color: #22d3ee; }

/* Settings page: split tabs equally across full row on desktop */
@media (min-width: 1024px) {
  .settings-tab-nav {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    overflow-x: visible;
  }
  .settings-tab-nav .settings-tab-btn {
    width: 100%;
    justify-content: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

/* ============================================================
   Quick-Filter Pills
   ============================================================ */
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid rgba(51, 65, 85, 0.5);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.15s ease;
  background: rgba(30,41,59,0.3);
}
.filter-pill:hover {
  border-color: rgba(34,211,238,0.4);
  color: #22d3ee;
  background: rgba(34,211,238,0.05);
}
.filter-pill.active {
  border-color: rgba(34,211,238,0.6);
  color: #22d3ee;
  background: rgba(34,211,238,0.1);
}

/* ============================================================
   Running Scan Pulse Row
   ============================================================ */
.row-running {
  animation: row-pulse 2.5s ease-in-out infinite;
}
@keyframes row-pulse {
  0%, 100% { background: transparent; }
  50%       { background: rgba(34,211,238,0.04); }
}

/* ============================================================
   Accordion (Expand Row Details)
   ============================================================ */
.accordion-content {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}
.accordion-content[aria-hidden="true"] {
  max-height: 0 !important;
  opacity: 0;
}
.accordion-content[aria-hidden="false"] {
  opacity: 1;
}

/* ============================================================
   Copy Button
   ============================================================ */
.copy-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  color: #64748b;
  transition: color 0.15s, background 0.15s;
  cursor: pointer;
  background: transparent;
  border: none;
}
.copy-btn:hover {
  color: #22d3ee;
  background: rgba(34, 211, 238, 0.08);
}
.copy-btn.copied { color: #34d399; }

/* ============================================================
   Desktop Top Bar
   ============================================================ */
#topbar {
  height: var(--topbar-height);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
}

/* ============================================================
   Stat Card Metric
   ============================================================ */
.stat-card {
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--card-accent, #22d3ee);
  opacity: 0.7;
}

/* ============================================================
   HTMX Loading Indicator
   ============================================================ */
#htmx-loading {
  position: fixed;
  top: 1rem; right: 1rem;
  z-index: 9999;
}
