/* Modern Song Search Styles */
:root {
  --search-primary: #120037;
  --search-accent: #6c5ce7;
  --search-bg-light: #f8f9fa;
  --search-border: #dee2e6;
  --search-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --search-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.search-page-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1rem;
  font-family: var(--search-font);
}

/* Apply font to all elements in search page */
.search-page-container * {
  font-family: inherit;
}

.page-header {
  margin-bottom: 1rem;
}

.page-header h2 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--search-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.page-header h2 i {
  font-size: 1.5rem;
  color: var(--search-accent);
}

/* Modern Search Card */
.modern-search-card {
  background: white;
  border-radius: 8px;
  box-shadow: var(--search-shadow);
  border: 1px solid var(--search-border);
  margin-bottom: 1rem;
}

.modern-search-card .card-body {
  padding: 1rem;
}

.search-input-group {
  display: flex;
  align-items: stretch;
}

.search-input-group .form-control {
  border-radius: 6px;
  border: 1px solid var(--search-border);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: all 0.2s ease;
  height: auto;
}

.search-input-group .form-control:focus {
  border-color: var(--search-accent);
  box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.1);
}

.search-input-group .btn {
  border-radius: 6px;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  height: auto;
}

.btn-search-primary {
  background: var(--search-primary);
  border: 1px solid var(--search-primary);
  color: white;
}

.btn-search-primary:hover {
  background: var(--search-accent);
  border-color: var(--search-accent);
}

.search-result-count {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.375rem 0.75rem;
  background: #f8f9fa;
  border: 1px solid var(--search-border);
  border-radius: 6px;
  color: var(--search-primary);
  font-size: 0.875rem;
  font-weight: 600;
}

/* Modern Filter Card */
.modern-filter-card {
  background: white;
  border-radius: 8px;
  box-shadow: var(--search-shadow);
  border: 1px solid var(--search-border);
  margin-bottom: 1rem;
  overflow: hidden;
}

.modern-filter-card .card-header {
  background: var(--search-primary);
  border: none;
  padding: 0;
}

.modern-filter-card .btn-link {
  color: white;
  text-decoration: none;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modern-filter-card .btn-link:hover {
  color: white;
  opacity: 0.9;
}

.modern-filter-card .card-body {
  padding: 1rem;
}

.filter-group {
  background: white;
  border-radius: 6px;
  padding: 0.75rem;
  border: 1px solid var(--search-border);
}

.filter-group label.font-weight-bold {
  color: var(--search-primary);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.form-check-input:checked {
  background-color: var(--search-accent);
  border-color: var(--search-accent);
}

.form-check {
  padding-left: 1.5rem;
  margin-bottom: 0.25rem;
}

.form-check-label {
  font-size: 0.875rem;
}

.filter-group .btn-search-primary,
.filter-group .btn-secondary {
  padding: 0.5rem;
  font-size: 0.875rem;
  border-radius: 6px;
}

/* Modern Table */
.modern-table-card {
  background: white;
  border-radius: 8px;
  box-shadow: var(--search-shadow);
  border: 1px solid var(--search-border);
  overflow: hidden;
}

.table {
  margin-bottom: 0;
  font-size: 0.875rem;
  table-layout: fixed;
  width: 100%;
}

.thead-ps-dark {
  background: var(--search-primary);
}

.thead-ps-dark th {
  color: white;
  font-weight: 600;
  border: none;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  white-space: nowrap;
}

.table-hover tbody tr:hover {
  background: rgba(108, 92, 231, 0.03);
}

.table tbody td {
  padding: 0.5rem 0.75rem;
  vertical-align: middle;
  border-color: #f0f0f0;
  font-size: 0.875rem;
}

.table tbody td a {
  color: var(--search-accent);
  font-weight: 600;
  text-decoration: none;
}

.table tbody td a:hover {
  color: var(--search-primary);
  text-decoration: underline;
}

.badge-pill {
  padding: 0.25rem 0.5rem;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.7rem;
  margin: 0.125rem;
  background: var(--search-accent);
  display: inline-block;
  white-space: nowrap;
}

/* Desktop column widths - full width distribution */
.table tr {
  display: flex;
  width: 100%;
}

/* Song Name - 36% */
.table .col-4 {
  flex: 0 0 36%;
  max-width: 36%;
}

/* Key, Tempo, Time, Used, Last Used - 9% each */
.table .col-1 {
  flex: 0 0 9%;
  max-width: 9%;
}

/* Theme - 19% */
.table .col-3 {
  flex: 0 0 19%;
  max-width: 19%;
}

/* Total: 36 + (9×5) + 19 = 100% */

/* Ensure no gaps */
.table thead tr,
.table tbody tr {
  margin: 0;
}

/* Modern Pagination */
.modern-pagination {
  margin: 1rem 0;
}

.pagination .page-link {
  border-radius: 4px;
  margin: 0 0.125rem;
  border: 1px solid var(--search-border);
  color: var(--search-primary);
  font-weight: 500;
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
}

.pagination .page-link:hover {
  background: var(--search-accent);
  color: white;
  border-color: var(--search-accent);
}

.pagination .page-item.active .page-link {
  background: var(--search-primary);
  border-color: var(--search-primary);
}

.pagination-controls {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--search-border);
}

.pagination-controls .btn-search-primary {
  padding: 0.375rem 1rem;
  font-size: 0.875rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .search-page-container {
    padding: 0.5rem;
  }

  .page-header h2 {
    font-size: 1.5rem;
  }

  .modern-search-card .card-body,
  .modern-filter-card .card-body {
    padding: 0.75rem;
  }

  .search-input-group .form-control {
    font-size: 0.9rem;
    padding: 0.625rem 0.75rem;
  }

  .search-input-group .btn {
    padding: 0.625rem 1rem;
    font-size: 0.9rem;
  }

  .table {
    font-size: 0.8rem;
  }

  .badge-pill {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
  }

  .table tbody td {
    padding: 0.375rem 0.5rem;
  }

  .thead-ps-dark th {
    padding: 0.5rem;
    font-size: 0.8rem;
  }

  /* Hide Last Used column on mobile and redistribute space */
  .table thead tr th:last-child,
  .table tbody tr td:last-child {
    display: none;
  }

  /* Redistribute column widths when last column is hidden - 6 columns total */
  /* Song Name - expand to 40% */
  .table .col-4 {
    flex: 0 0 40%;
    max-width: 40%;
  }

  /* Key, Tempo, Time - 10% each */
  .table .col-1 {
    flex: 0 0 10%;
    max-width: 10%;
  }

  /* Theme - expand to 22% */
  .table .col-3 {
    flex: 0 0 22%;
    max-width: 22%;
  }

  /* Used (2nd to last col-1) - keep at 8% */
  .table thead tr th:nth-last-child(2).col-1,
  .table tbody tr td:nth-last-child(2).col-1 {
    flex: 0 0 8%;
    max-width: 8%;
  }

  /* Total: 40 + 10 + 10 + 10 + 22 + 8 = 100% */
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.table-responsive {
  width: 100%;
  padding: 0;
  margin: 0;
}
