/*
 * Component styles
 * This file contains styling for reusable UI components like navigation, cards, badges, etc.
 */

/* Navigation bar */
nav {
  /* Base navigation styles are handled by utility classes */
}

/* Navigation links with icons */
nav a,
nav button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Navigation logout button - reset Rails button_to default styles */
.nav-logout-button,
.nav-logout-button[type="submit"] {
  background: none !important;
  background-image: none !important;
  border: none !important;
  padding: 0 !important;
  cursor: pointer;
  transform: none !important;
  box-shadow: none !important;
}

.nav-logout-button:hover,
.nav-logout-button[type="submit"]:hover {
  background: none !important;
  background-image: none !important;
  transform: none !important;
  box-shadow: none !important;
}

.nav-logout-button:focus,
.nav-logout-button[type="submit"]:focus {
  background: none !important;
  background-image: none !important;
  box-shadow: none !important;
  outline: none;
}

/* Feature cards */
.feature-card {
  background-color: #1f2937;
  border: 1px solid #374151;
  border-radius: 0.5rem;
  padding: 1rem;
  text-align: center;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover {
  border-color: #4b5563;
  transform: translateY(-2px);
}

/* Result cards */
.result-card {
  background-color: #1f2937;
  border: 1px solid #374151;
  border-radius: 0.5rem;
  padding: 1.5rem;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.result-card:hover {
  border-color: #4b5563;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

/* Filter badges */
.filter-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.filter-badge-active {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.filter-badge-inactive {
  background-color: #374151;
  color: #e5e7eb;
  border: 1px solid #4b5563;
}

.filter-badge-inactive:hover {
  background-color: #4b5563;
}

/* Download button */
.download-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(to right, #0891b2, #2563eb);
  color: white;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.download-button:hover {
  background: linear-gradient(to right, #0e7490, #1d4ed8);
  transform: scale(1.05);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.download-button:focus {
  outline: none;
  box-shadow: 0 0 0 2px #111827, 0 0 0 5px rgba(6, 182, 212, 0.5);
}

/* Info badge */
.info-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  background-color: rgba(31, 41, 55, 0.5);
  border: 1px solid #374151;
  border-radius: 9999px;
  font-size: 0.75rem;
  color: #9ca3af;
}

/* Stat card */
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background-color: rgba(31, 41, 55, 0.3);
  border: 1px solid #374151;
  border-radius: 0.375rem;
  padding: 0.75rem 1rem;
}

.stat-card-label {
  font-size: 0.75rem;
  color: #9ca3af;
}

.stat-card-value {
  font-size: 1.125rem;
  font-weight: 600;
  color: #67e8f9;
}

/* Alert/notification styles */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.alert-info {
  background-color: rgba(6, 182, 212, 0.1);
  border: 1px solid #0891b2;
  color: #67e8f9;
}

.alert-success {
  background-color: rgba(16, 185, 129, 0.1);
  border: 1px solid #10b981;
  color: #6ee7b7;
}

.alert-warning {
  background-color: rgba(245, 158, 11, 0.1);
  border: 1px solid #f59e0b;
  color: #fbbf24;
}

.alert-error {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid #ef4444;
  color: #fca5a5;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(103, 232, 249, 0.2);
  border-top-color: #67e8f9;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Table styles */
table {
  width: 100%;
  border-collapse: collapse;
}

table thead {
  background-color: #1f2937;
  border-bottom: 2px solid #374151;
}

table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

table td {
  padding: 1rem;
  border-bottom: 1px solid #374151;
}

table tbody tr {
  transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

table tbody tr:hover {
  background-color: rgba(31, 41, 55, 0.5);
}

/* Code block styling */
code {
  background-color: #1f2937;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-family: 'Courier New', monospace;
  font-size: 0.875em;
  color: #67e8f9;
}

pre {
  background-color: #1f2937;
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  border: 1px solid #374151;
}

pre code {
  background-color: transparent;
  padding: 0;
}

/* Divider */
.divider {
  height: 1px;
  background-color: #374151;
  margin: 1.5rem 0;
}

/* Pagination with gradient buttons */
.pagy-nav {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.pagy-nav .page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.pagy-nav .page:not(.disabled) {
  background: linear-gradient(to right, #2563eb, #9333ea);
  color: white;
  border: none;
}

.pagy-nav .page:not(.disabled):hover {
  background: linear-gradient(to right, #1d4ed8, #7e22ce);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.pagy-nav .page.active {
  background: linear-gradient(to right, #0891b2, #06b6d4) !important;
  color: white !important;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.3);
  font-weight: 700;
  transform: scale(1.1);
}

.pagy-nav .page.disabled {
  background: #374151;
  color: #6b7280;
  cursor: not-allowed;
  opacity: 0.5;
}

/* Legacy pagy class support */
.pagy {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.pagy a:not([role="separator"]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  padding: 0.5rem 1rem;
  background: linear-gradient(to right, #2563eb, #9333ea) !important;
  color: white !important;
  border: none !important;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.pagy a[href]:hover {
  background: linear-gradient(to right, #1d4ed8, #7e22ce) !important;
  color: white !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

.pagy a[aria-current] {
  background: linear-gradient(to right, #0891b2, #06b6d4) !important;
  color: white !important;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.3) !important;
  font-weight: 700;
  transform: scale(1.1);
}

.pagy a[role="link"]:not([aria-current]) {
  opacity: 0.85;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: #9ca3af;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #d1d5db;
  margin-bottom: 0.5rem;
}

.empty-state-description {
  font-size: 0.875rem;
}

.text-box {
  padding: 1.0rem;
}

.pagy-nav {
  padding: 1.0rem;
}
