/* Custom styles for NPM Package Scanner */

/* File input drag and drop styling */
.border-dashed:has(input:focus) {
  border-color: #3b82f6;
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Loading spinner */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.spinner {
  animation: spin 1s linear infinite;
}

/* Custom scrollbar for dependency list */
#dependency-list::-webkit-scrollbar {
  width: 6px;
}

#dependency-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

#dependency-list::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

#dependency-list::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

/* Risk level colors */
.risk-high {
  background-color: #fef2f2;
  border-color: #fecaca;
}

.risk-medium {
  background-color: #fefce8;
  border-color: #fef08a;
}

.risk-low {
  background-color: #f0fdf4;
  border-color: #bbf7d0;
}

/* Button states */
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Pulse animation for loading states */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Card hover effect */
section {
  transition: box-shadow 0.2s ease-in-out;
}

section:hover {
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Code snippet styling */
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Checkbox styling */
input[type="checkbox"] {
  cursor: pointer;
}

input[type="checkbox"]:checked {
  accent-color: #2563eb;
}

/* htmx loading indicator */
.htmx-request .htmx-indicator {
  display: inline-block;
}

.htmx-indicator {
  display: none;
}

/* Transition for result sections */
#dependencies-section,
#download-section,
#scan-section {
  transition: all 0.3s ease-in-out;
}