/* Custom styles for Bundle Recommender */

/* Animations */
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

.animate-fade-in {
  animation: fade-in 0.3s ease-out;
}

.animate-fade-out {
  animation: fade-out 0.3s ease-out;
}

/* Enhanced badge and pill spacing */
.badge, .pill, .tag {
  padding: 0.25rem 0.75rem !important; /* Increased from default */
  min-height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.5rem;
}

.badge-sm {
  padding: 0.5rem 1rem !important;
  min-height: 2rem;
}

.badge-lg {
  padding: 0.75rem 1.5rem !important;
  min-height: 3rem;
  font-size: 1.125rem;
}

/* Number badges with extra spacing */
.number-badge {
  padding: 0.75rem 1.25rem !important;
  min-width: 3rem;
  min-height: 2.75rem;
  border-radius: 9999px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Category and status badges */
.category-badge, .status-badge {
  padding: 0.25rem 1rem !important;
  border-radius: 9999px;
  font-weight: 500;
  letter-spacing: 0.025em;
}

/* Gradient backgrounds */
.gradient-header {
  background: linear-gradient(135deg, #af27dc 10%,#e442a9 60%, #ed4306 100%);
}

.gradient-blue {
  background: linear-gradient(135deg, #55aae0 40%, #460ce7 100%);
}

.gradient-purple {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Card hover effects */
.card-hover {
  transition: all 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Table styles */
.table-hover tbody tr {
  transition: background-color 0.2s ease;
}

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

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Loading spinner */
.spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

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

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fade-in 0.2s ease-out;
}

.modal-overlay.hidden {
  display: none;
}

.modal-content {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-width: 42rem;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  animation: fade-in 0.3s ease-out;
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 2px solid #e5e7eb;
}

.modal-body {
  padding: 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 2px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background-color: #f9fafb;
  border-bottom-left-radius: 1rem;
  border-bottom-right-radius: 1rem;
}

/* ===============================
   Combined Mobile-Friendly Layout
   =============================== */
@media (max-width: 768px) {
  /* General mobile scaling */
  body {
    font-size: 0.9rem;
    padding: 0;
    overflow-x: hidden;
  }

  header h1 {
    font-size: 1.25rem;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  main {
    padding: 1rem 0;
  }

  /* Compact nav bar */
  nav {
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
  }

  nav::-webkit-scrollbar {
    display: none;
  }

  nav a {
    padding: 0.75rem 0.75rem;
    font-size: 0.9rem;
    display: inline-block;
  }

  /* Compact card layout */
  .card-hover {
    padding: 1rem !important;
  }

  /* Stack grid sections vertically */
  .grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* Horizontal scroll row for stats or wide content */
  .scroll-row {
    display: flex;
    overflow-x: auto;
    gap: 1rem;
    scroll-snap-type: x mandatory;
    padding-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
  }

  .scroll-row > * {
    flex: 0 0 80%;
    scroll-snap-align: center;
  }

  /* Hide scrollbars for cleaner look */
  .scroll-row::-webkit-scrollbar {
    display: none;
  }

  /* Adjust modal layout for mobile */
  .modal-content {
    width: 95%;
    max-height: 95vh;
  }

  .modal-body {
    max-height: 70vh;
  }
}
