/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Sticky Search Enhancements */
#search-bar.fixed {
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.98);
}

/* Mobile responsive adjustments for sticky search */
@media (max-width: 1023px) {
  #search-bar.fixed {
    margin-left: 0 !important;
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Modern Kaminari Pagination Styling */
.pagination {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  background: white;
  border-radius: 0.75rem;
  padding: 0.25rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  border: 1px solid #e5e7eb;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  background-color: transparent;
  color: #6b7280;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.pagination a:hover {
  background-color: #f3f4f6;
  color: #374151;
  transform: translateY(-1px);
}

.pagination .current {
  background-color: #3b82f6;
  color: white;
  box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.25);
  font-weight: 600;
}

.pagination .current:hover {
  background-color: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px 0 rgba(59, 130, 246, 0.35);
}

.pagination .gap {
  padding: 0;
  color: #9ca3af;
  border: none;
  background: none;
  cursor: default;
  font-weight: 400;
}

.pagination .prev, 
.pagination .next {
  color: #4b5563;
  font-weight: 500;
}

.pagination .prev:hover, 
.pagination .next:hover {
  color: #111827;
  background-color: #f9fafb;
}

.pagination .first, 
.pagination .last {
  color: #6b7280;
  font-size: 0.8125rem;
}

.pagination .first:hover, 
.pagination .last:hover {
  color: #374151;
  background-color: #f3f4f6;
}

/* Disabled state styling */
.pagination span.prev,
.pagination span.next,
.pagination span.first,
.pagination span.last {
  color: #d1d5db;
  cursor: not-allowed;
}

.pagination span.prev:hover,
.pagination span.next:hover,
.pagination span.first:hover,
.pagination span.last:hover {
  background-color: transparent;
  transform: none;
}

.pagination-container a, .mobile-pagination-btn {
  position: relative;
  transition: all 0.2s ease;
}

.pagination-container a:hover, .mobile-pagination-btn:hover {
  background-color: #f3f4f6;
}

.pagination-container a.loading, .mobile-pagination-btn.loading {
  opacity: 0.6;
  pointer-events: none;
}

.pagination-container a.loading::after, .mobile-pagination-btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid #e5e7eb;
  border-top: 2px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Details/Summary custom styling for collapsible sections */
.replacement-details[open] .replacement-chevron {
  transform: rotate(180deg);
}

.tooltip-container {
  position: relative;
}
.tooltip-container:hover .tooltip {
  visibility: visible;
  opacity: 1;
}
.tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 125%;
  left: 0;
  background-color: #1f2937;
  color: white;
  text-align: left;
  padding: 12px 16px;
  border-radius: 8px;
  white-space: normal;
  z-index: 1000;
  min-width: 300px;
  max-width: 500px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  font-size: 0.875rem;
  line-height: 1.5;
  transition: opacity 0.2s ease;
}
.tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 20px;
  border-width: 6px;
  border-style: solid;
  border-color: #1f2937 transparent transparent transparent;
}

/* Mobile responsive tooltip adjustments */
@media (max-width: 640px) {
  .tooltip {
    min-width: 200px;
    max-width: calc(100vw - 2rem);
    left: auto;
    right: 0;
    padding: 10px 12px;
    font-size: 0.8125rem;
  }

  .tooltip::after {
    left: auto;
    right: 20px;
  }
}
