/* beats.css - Custom stylesheet for Beat Listing Page */

/* 1. Header Page Banner */
.beats-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  padding: var(--space-12) 0;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 68px;
}

.beats-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(rgba(255, 70, 100, 0.15) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.3;
  pointer-events: none;
}

.beats-banner-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-2);
  color: #ffffff !important;
}

.beats-banner-desc {
  color: rgba(255, 255, 255, 0.75) !important;
  font-size: 1.1rem;
}

.beats-banner .text-white-50 {
  color: rgba(255, 255, 255, 0.6) !important;
}

/* 2. Main Page Layout */
.beats-container {
  padding: var(--space-8) 0;
}

.beats-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-6);
  align-items: start;
}

/* 3. Filter Sidebar */
.filter-sidebar {
  position: sticky;
  top: 90px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-normal);
}

.filter-sidebar:hover {
  box-shadow: var(--shadow-md);
}

.filter-group {
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--border-color);
}

.filter-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.filter-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-heading);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-left: var(--space-3);
  border-left: 3px solid var(--primary);
  line-height: 1.2;
}

/* Custom Checkbox/Radio Styling */
.filter-option {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-2);
  cursor: pointer;
  user-select: none;
  font-size: 0.9rem;
  color: var(--text-main);
  transition: var(--transition-fast);
}

.filter-option:last-child {
  margin-bottom: 0;
}

.filter-option:hover {
  color: var(--primary);
}

.filter-option input {
  display: none;
}

.filter-option .checkbox-box,
.filter-option .radio-box {
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e1;
  border-radius: 4px;
  margin-right: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  background-color: #ffffff;
  flex-shrink: 0;
}

.filter-option .radio-box {
  border-radius: 50%;
}

.filter-option input:checked+.checkbox-box {
  background-color: var(--primary);
  border-color: var(--primary);
}

.filter-option input:checked+.radio-box {
  background-color: #ffffff;
  border-color: var(--primary);
}

.filter-option .checkbox-box::after {
  content: '\F272';
  /* Bootstrap icons bi-check */
  font-family: 'bootstrap-icons';
  font-size: 0.75rem;
  color: #ffffff;
  font-weight: 900;
  display: none;
}

.filter-option .radio-box::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--primary);
  display: none;
}

.filter-option input:checked+.checkbox-box::after,
.filter-option input:checked+.radio-box::after {
  display: block;
}

.filter-option-count {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
  background-color: #f1f5f9;
  padding: 2px 6px;
  border-radius: 10px;
}

/* 4. Beats Content Toolbar */
.beats-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.result-count {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-heading);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sort-select {
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-main);
  background-color: #ffffff;
  outline: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.sort-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(255, 70, 100, 0.1);
}

.layout-toggles {
  display: flex;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  overflow: hidden;
  background-color: #f1f5f9;
}

.layout-toggle-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.layout-toggle-btn.active {
  background-color: #ffffff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Filter Tags (Selected Filters) */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.filter-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: #ffeef1;
  color: var(--primary);
  border: 1px solid rgba(255, 70, 100, 0.2);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.filter-tag-close {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.filter-tag-close:hover {
  color: var(--primary-dark);
}

.clear-all-filters {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px 8px;
  transition: var(--transition-fast);
  text-decoration: underline;
}

.clear-all-filters:hover {
  color: var(--primary);
}

/* 5. Grid View Layout */
.beats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
}

.beat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.beat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(255, 70, 100, 0.2);
}

.beat-card-artwork {
  position: relative;
  width: 100%;
  padding-top: 100%;
  /* 1:1 Aspect Ratio */
  overflow: hidden;
  background-color: #e2e8f0;
}

.beat-card-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-normal);
}

.beat-card:hover .beat-card-img {
  transform: scale(1.05);
}

.beat-card-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition-normal);
}

.beat-card:hover .beat-card-play-overlay {
  opacity: 1;
}

.beat-card-play-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--primary);
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: var(--shadow-glow);
  transform: scale(0.9);
  transition: var(--transition-normal);
}

.beat-card-play-btn:hover {
  transform: scale(1.05);
  background-color: var(--primary-dark);
}

/* Playing status on card */
.beat-card.active {
  border-color: var(--primary);
}

.beat-card.active .beat-card-play-overlay {
  opacity: 1;
  background-color: rgba(15, 23, 42, 0.6);
}

.beat-card.active .beat-card-play-btn {
  transform: scale(1);
  background-color: var(--primary);
}

.beat-card-badge {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 2;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.beat-card-info {
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.beat-card-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}

.beat-card-title:hover {
  color: var(--primary);
}

.beat-card-artist {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.beat-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: var(--space-3);
}

.beat-meta-tag {
  font-size: 0.7rem;
  background-color: #f1f5f9;
  color: var(--text-main);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

.beat-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: var(--space-2);
}

.beat-card-price {
  font-weight: 700;
  font-size: 0.95rem;
}

.beat-price-vnd {
  color: var(--primary);
}

.beat-price-usd {
  color: #10b981;
}

.beat-price-contact {
  color: var(--text-muted);
  font-style: italic;
  font-weight: 500;
}

.beat-card-actions {
  display: flex;
  gap: 4px;
}

.beat-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.beat-action-btn:hover {
  color: var(--primary);
  border-color: rgba(255, 70, 100, 0.3);
  background-color: #ffeef1;
}

/* 6. Table View overrides & extra classes */
.beats-table-wrapper {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.03);
}

/* Prevent hover overflow on table corners */
.beats-table-wrapper tr:first-child th:first-child,
.beats-table-wrapper tr:first-child td:first-child {
  border-top-left-radius: var(--radius-md);
}

.beats-table-wrapper tr:first-child th:last-child,
.beats-table-wrapper tr:first-child td:last-child {
  border-top-right-radius: var(--radius-md);
}

.beats-table-wrapper tr:last-child td:first-child {
  border-bottom-left-radius: var(--radius-md);
}

.beats-table-wrapper tr:last-child td:last-child {
  border-bottom-right-radius: var(--radius-md);
}

.beats-table-wrapper .table {
  margin-bottom: 0;
  width: 100%;
  border-collapse: collapse;
}

.beats-table-wrapper th {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-color);
  padding: var(--space-4) !important;
  vertical-align: middle;
  background-color: #fafbfc;
}

.beats-table-wrapper td {
  padding: var(--space-4) !important;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-color);
}

.beats-table-wrapper tr.track-row {
  transition: var(--transition-fast);
}

.beats-table-wrapper tr.track-row:hover {
  background-color: #fafbfc;
}

.beats-table-wrapper tr.track-row.active {
  background-color: rgba(255, 70, 100, 0.05);
}

/* Premium Tone Badge styling */
.beat-tone-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #4f46e5;
  /* Indigo */
  background-color: #f5f3ff;
  border: 1px solid rgba(79, 70, 229, 0.15);
  border-radius: 20px;
  text-transform: capitalize;
  letter-spacing: 0.01em;
}

.beat-tone-badge.tone-nam {
  color: #0284c7;
  /* Sky */
  background-color: #f0f9ff;
  border-color: rgba(2, 132, 199, 0.15);
}

.beat-tone-badge.tone-nu {
  color: #db2777;
  /* Pink */
  background-color: #fdf2f8;
  border-color: rgba(219, 39, 119, 0.15);
}

/* Circular Spotify-like play button inside index column */
.beats-table-wrapper .track-index-col {
  width: 60px !important;
  position: relative;
  text-align: center;
}

.beats-table-wrapper .track-play-btn {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(255, 70, 100, 0.3);
  transition: var(--transition-fast);
}

.beats-table-wrapper .track-play-btn:hover {
  transform: translate(-50%, -50%) scale(1.1);
  background-color: var(--primary-dark);
}

.beats-table-wrapper .track-row:hover .track-index-num,
.beats-table-wrapper .track-row.active .track-index-num {
  visibility: hidden;
}

.beats-table-wrapper .track-row:hover .track-play-btn,
.beats-table-wrapper .track-row.active .track-play-btn {
  display: flex !important;
}

/* Cart & Favorite action button enhancements */
.beats-table-wrapper .track-btn-favorite:hover {
  color: var(--primary);
  transform: scale(1.1);
}

.beats-table-wrapper .track-btn-cart:hover {
  color: #10b981;
  transform: scale(1.1);
}

/* Mobile responsive constraints */
@media (max-width: 767.98px) {

  .beats-table-wrapper th:nth-child(3),
  .beats-table-wrapper td:nth-child(3),
  .beats-table-wrapper th:nth-child(5),
  .beats-table-wrapper td:nth-child(5) {
    display: none;
  }
}

/* Pagination / Load More */
.beats-pagination {
  margin-top: var(--space-6);
  display: flex;
  justify-content: center;
}

/* 7. Mobile Responsive and Offcanvas filter */
@media (max-width: 991.98px) {
  .beats-banner {
    margin-top: 54px;
  }

  .beats-layout {
    grid-template-columns: 1fr;
  }

  .filter-sidebar {
    display: none;
    /* hidden on desktop column, shown inside offcanvas instead */
  }

  .offcanvas-filter-body {
    padding: var(--space-4);
  }

  .mobile-filter-trigger {
    display: flex !important;
    align-items: center;
    gap: var(--space-2);
  }
}

.mobile-filter-trigger {
  display: none;
}

/* Premium Price Range Slider */
.filter-price-slider-container {
  padding: var(--space-2) 0;
}

#price-slider-val,
#price-slider-val-mobile {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary) !important;
}

/* Custom track and thumb styles for the HTML5 range input */
.custom-price-range {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border-color);
  outline: none;
  margin: var(--space-3) 0;
}

.custom-price-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid var(--bg-card);
  box-shadow: 0 2px 6px rgba(255, 70, 100, 0.4);
  transition: transform var(--transition-fast);
}

.custom-price-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.custom-price-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid var(--bg-card);
  box-shadow: 0 2px 6px rgba(255, 70, 100, 0.4);
  transition: transform var(--transition-fast);
}

.custom-price-range::-moz-range-thumb:hover {
  transform: scale(1.2);
}