/* ============================================================
   Faceless Beats – Main Stylesheet
   Mobile-first, Bootstrap 5 overrides, custom components
   ============================================================ */

/* ---------- CSS Variables / Brand ---------- */
:root {
  --fb-primary:   #7c3aed;
  --fb-primary-rgb: 124, 58, 237;
  --fb-dark:      #0f0f13;
  --fb-dark-2:    #1a1a22;
  --fb-light:     #f8f9fa;
  --fb-accent:    #f97316;
  --fb-gradient:  linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #6366f1 100%);
  --fb-radius:    12px;
  --fb-transition: 0.25s ease;
}

/* ---------- Base ---------- */
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
}
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--fb-dark);
  color: #e2e8f0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
  width: 100%;
  max-width: 100vw;
}

/* Prevent Bootstrap row negative margins from causing overflow */
.container,
.container-fluid {
  overflow-x: hidden;
}

img, video, iframe, embed, object {
  max-width: 100%;
  height: auto;
}

a { color: var(--fb-primary); }
a:hover { color: #a78bfa; }

/* ---------- Logo ---------- */
.logo-img {
  border-radius: 8px;
  vertical-align: middle;
  object-fit: contain;
}

/* ---------- Typography ---------- */
.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }

/* Override Bootstrap's .text-muted for dark theme visibility */
.text-muted {
  color: #b4a4d4 !important;
}

/* ---------- Buttons ---------- */
.btn-primary {
  background: var(--fb-gradient);
  border: none;
  font-weight: 600;
  border-radius: 8px;
  transition: transform var(--fb-transition), box-shadow var(--fb-transition);
}
.btn-primary:hover,
.btn-primary:focus {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(124,58,237,0.4);
  background: var(--fb-gradient);
}
.btn-outline-primary {
  border-color: var(--fb-primary);
  color: var(--fb-primary);
  border-radius: 8px;
}
.btn-outline-primary:hover {
  background: var(--fb-primary);
  border-color: var(--fb-primary);
  color: #fff;
}

/* ---------- Navbar ---------- */
.navbar {
  background: rgba(15, 15, 19, 0.92) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  overflow: visible !important;
}
/* Prevent the site-header wrapper from ever gaining a scrollbar */
.site-header {
  overflow: visible !important;
}
/* Navbar inner container must allow the dropdown to overflow naturally */
.navbar > .container {
  overflow: visible !important;
}
.logo-link {
  font-size: 1.3rem;
  background: var(--fb-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.navbar .nav-link {
  font-weight: 500;
  color: #a1a1aa !important;
  transition: color var(--fb-transition);
}
.navbar .nav-link:hover,
.navbar .nav-link.active {
  color: #fff !important;
}

/* Cart badge */
.cart-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  background: var(--fb-accent);
  color: #fff;
  font-size: 0.65rem;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  border-radius: 50%;
  text-align: center;
  padding: 0 4px;
}

/* Currency dropdown */
.currency-dropdown .dropdown-toggle {
  font-weight: 500;
  color: #a1a1aa !important;
  transition: color var(--fb-transition);
}
.currency-dropdown .dropdown-toggle:hover {
  color: #fff !important;
}
.currency-dropdown .dropdown-toggle::after {
  vertical-align: 0.15em;
  font-size: 0.7rem;
}
.currency-dropdown .dropdown-menu {
  min-width: auto;
  background: var(--fb-dark-2);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 0.35rem 0;
  /* Prevent dropdown from causing scrollbars on parent */
  position: absolute;
}
.currency-dropdown .dropdown-item {
  color: #a1a1aa;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background var(--fb-transition), color var(--fb-transition);
}
.currency-dropdown .dropdown-item:hover {
  background: rgba(124,58,237,0.12);
  color: #fff;
}
.currency-dropdown .dropdown-item.active {
  background: rgba(124,58,237,0.2);
  color: #fff;
}
.currency-symbol {
  display: inline-block;
  width: 1.3rem;
  text-align: center;
  font-weight: 700;
  color: var(--fb-primary);
}

/* Currency nav – always visible outside the collapse */
.navbar-currency-nav {
  margin-left: auto;
}
/* On desktop, push currency to the far right after the nav links */
@media (min-width: 992px) {
  .navbar-currency-nav {
    order: 2;
    margin-left: 0;
  }
  #mainNav {
    order: 1;
  }
}

/* Mobile menu overlay */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1020;
}
.mobile-menu-overlay.show { display: block; }

/* ---------- Hero Section ---------- */
.hero-section {
  position: relative;
  padding: 100px 0 80px;
  background: radial-gradient(ellipse at 50% 0%, rgba(124,58,237,0.15) 0%, transparent 60%),
              var(--fb-dark);
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%237c3aed' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  animation: heroFloat 30s linear infinite;
}
@keyframes heroFloat {
  from { transform: translate(0, 0); }
  to   { transform: translate(-60px, -60px); }
}
.hero-section .container { position: relative; z-index: 1; }
.hero-title {
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
}
.hero-gradient {
  background: var(--fb-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-wave {
  position: absolute;
  bottom: 0; left: 0; width: 100%;
  fill: var(--fb-dark-2);
}

/* ---------- Beat Cards ---------- */
.beat-card {
  background: var(--fb-dark-2);
  border-radius: var(--fb-radius);
  overflow: hidden;
  transition: transform var(--fb-transition), box-shadow var(--fb-transition);
}
.beat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
.beat-card-cover {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  background: #1e1e2a;
  overflow: hidden;
}
.beat-card-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.beat-card:hover .beat-card-cover img { transform: scale(1.05); }
.cover-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity var(--fb-transition);
  color: #fff;
}
.beat-card:hover .cover-overlay { opacity: 1; }
.cover-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3f3f55;
}
.beat-card-title {
  color: #e2e8f0;
  font-weight: 600;
}
.beat-card-meta .badge {
  font-size: 0.7rem;
  font-weight: 500;
}
.beat-card-stats {
  font-size: 0.78rem;
  color: #c4b5fd !important;
}

/* ---------- Audio Player Bar ---------- */
.audio-player-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(26,26,34,0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,0.08);
  z-index: 1050;
}
.audio-progress {
  height: 4px;
  cursor: pointer;
}
.audio-progress::-webkit-slider-thumb {
  width: 14px; height: 14px;
  background: var(--fb-primary);
  border-radius: 50%;
  cursor: pointer;
  -webkit-appearance: none;
}

/* ---------- Cart Sidebar ---------- */
.cart-sidebar {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 100%; max-width: 400px;
  background: var(--fb-dark-2);
  z-index: 1060;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -8px 0 30px rgba(0,0,0,0.5);
}
.cart-sidebar.open { transform: translateX(0); }
.cart-sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1055;
  display: none;
}
.cart-sidebar-overlay.show { display: block; }
.cart-sidebar-body { flex: 1; overflow-y: auto; }
.cart-item-img {
  flex-shrink: 0;
}

/* ---------- Native <dialog> styling ---------- */
.license-dialog {
  border: none;
  border-radius: var(--fb-radius);
  background: var(--fb-dark-2);
  color: #e2e8f0;
  padding: 0;
  max-width: 500px;
  width: 90vw;
}
.license-dialog::backdrop {
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}
.license-option {
  cursor: pointer;
  border-color: rgba(255,255,255,0.08) !important;
  transition: background var(--fb-transition), border-color var(--fb-transition);
}
.license-option:hover {
  background: rgba(124,58,237,0.08);
  border-color: var(--fb-primary) !important;
}

/* ---------- Page Sections ---------- */
.section-title {
  font-weight: 800;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  margin-bottom: 0.5rem;
}
.section-subtitle {
  color: #a1a1aa;
  font-size: 1rem;
}

/* Filter bar */
.filter-bar {
  background: var(--fb-dark-2);
  border-radius: var(--fb-radius);
  padding: 1rem;
}
.filter-bar select,
.filter-bar input {
  background: var(--fb-dark);
  color: #e2e8f0;
  border-color: rgba(255,255,255,0.08);
  border-radius: 8px;
  font-size: 0.875rem;
}
.filter-bar select:focus,
.filter-bar input:focus {
  background: var(--fb-dark);
  color: #e2e8f0;
  border-color: var(--fb-primary);
  box-shadow: 0 0 0 0.15rem rgba(124,58,237,0.25);
}

/* Genre quick-filter pills */
.genre-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.genre-pill {
  background: var(--fb-dark-2);
  color: #b4a4d4;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 50px;
  padding: 0.35rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--fb-transition);
  white-space: nowrap;
  user-select: none;
}
.genre-pill:hover {
  border-color: var(--fb-primary);
  color: #e2e8f0;
  background: rgba(124,58,237,0.12);
}
.genre-pill.active {
  background: var(--fb-gradient);
  color: #fff;
  border-color: transparent;
}

/* ---- Autosuggest Dropdown ---- */
.search-autosuggest-wrapper {
  position: relative;
}
.autosuggest-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--fb-dark-2);
  border: 1px solid rgba(255,255,255,0.1);
  border-top: none;
  border-radius: 0 0 var(--fb-radius) var(--fb-radius);
  z-index: 100;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.autosuggest-dropdown.open {
  display: block;
}
.autosuggest-item {
  padding: 0.65rem 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: #c4c4d0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: background var(--fb-transition), color var(--fb-transition);
}
.autosuggest-item:hover,
.autosuggest-item.active {
  background: rgba(124,58,237,0.15);
  color: #fff;
}
.autosuggest-icon {
  font-size: 0.7rem;
  color: #5a5a6e;
  flex-shrink: 0;
}
.autosuggest-item:hover .autosuggest-icon,
.autosuggest-item.active .autosuggest-icon {
  color: var(--fb-primary);
}
.autosuggest-highlight {
  background: rgba(124,58,237,0.3);
  color: #fff;
  border-radius: 2px;
  padding: 0 1px;
}
.autosuggest-loading,
.autosuggest-empty {
  cursor: default;
  color: #71717a;
  font-style: italic;
}
.autosuggest-loading:hover,
.autosuggest-empty:hover {
  background: transparent;
  color: #71717a;
}

/* ---------- Beat Detail ---------- */
.beat-detail-header {
  padding: 3rem 0;
  background: radial-gradient(ellipse at top left, rgba(124,58,237,0.12) 0%, transparent 50%);
}
.beat-detail-cover {
  border-radius: var(--fb-radius);
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.beat-detail-cover-placeholder {
  border-radius: var(--fb-radius);
  aspect-ratio: 1/1;
  background: var(--fb-dark-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #3f3f55;
}

/* ---------- Checkout ---------- */
.checkout-section {
  padding: 3rem 0;
}
.checkout-summary {
  background: var(--fb-dark-2);
  border-radius: var(--fb-radius);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* ---------- Empty State ---------- */
.empty-state {
  padding: 3rem 1rem;
  text-align: center;
  color: #71717a;
}
.empty-state i { color: #3f3f55; }

/* ---------- Toast custom ---------- */
#toast-container { z-index: 2000; }
#toast-container .toast {
  background: var(--fb-dark-2);
  color: #e2e8f0;
  border-radius: var(--fb-radius);
}

/* ---------- Skeleton Loading ---------- */
.skeleton {
  background: linear-gradient(90deg, #1e1e2a 25%, #2a2a38 50%, #1e1e2a 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .hero-section { padding: 80px 0 60px; }
  .navbar-collapse {
    background: rgba(15,15,19,0.98);
    position: fixed;
    top: 72px; left: 0; right: 0;
    padding: 1.5rem;
    z-index: 1030;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    max-height: calc(100vh - 72px);
    overflow-y: auto;
  }
  /* Let the currency dropdown break out of the scroll container */
  .navbar-collapse .dropdown-menu {
    position: fixed;
  }
  .cart-sidebar { max-width: 100%; }
}

@media (min-width: 769px) {
  .hero-section { padding: 140px 0 100px; }
}

/* ============================================================
   Admin Dashboard
   ============================================================ */

/* Login page */
.admin-login-section {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 0;
}
.admin-login-card {
  background: var(--fb-dark-2);
  border-radius: var(--fb-radius);
  padding: 2.5rem 2rem;
  border: 1px solid rgba(255,255,255,0.06);
}
.admin-login-icon {
  background: var(--fb-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.admin-login-card .form-control {
  background: var(--fb-dark);
  color: #e2e8f0;
  border-color: rgba(255,255,255,0.08);
  border-radius: 8px;
  font-size: 0.9rem;
}
.admin-login-card .form-control:focus {
  border-color: var(--fb-primary);
  box-shadow: 0 0 0 0.15rem rgba(124,58,237,0.25);
  background: var(--fb-dark);
  color: #e2e8f0;
}

/* Dashboard layout */
.admin-dashboard {
  min-height: calc(100vh - 200px);
}

/* Tab pills */
.admin-tabs .nav-link {
  color: #a1a1aa;
  border-radius: 8px;
  padding: 0.5rem 1.2rem;
  font-weight: 500;
  transition: all var(--fb-transition);
}
.admin-tabs .nav-link:hover {
  color: #e2e8f0;
  background: rgba(124,58,237,0.1);
}
.admin-tabs .nav-link.active {
  background: var(--fb-gradient);
  color: #fff;
}

/* Stat cards */
.admin-stat-card {
  background: var(--fb-dark-2);
  border-radius: var(--fb-radius);
  padding: 1.5rem;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.04);
  transition: transform var(--fb-transition);
}
.admin-stat-card:hover {
  transform: translateY(-2px);
}
.admin-stat-icon {
  font-size: 1.5rem;
  color: var(--fb-primary);
  margin-bottom: 0.5rem;
}
.admin-stat-value {
  font-size: 1.75rem;
  font-weight: 800;
}
.admin-stat-label {
  color: #71717a;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Generic admin card */
.admin-card {
  background: var(--fb-dark-2);
  border-radius: var(--fb-radius);
  border: 1px solid rgba(255,255,255,0.04);
  overflow: hidden;
}
.admin-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.admin-card-body {
  padding: 1.25rem;
}

/* Admin table */
.admin-table {
  color: #e2e8f0;
  margin-bottom: 0;
}
.admin-table th {
  color: #71717a;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 0.75rem 1rem;
  white-space: nowrap;
}
.admin-table td {
  padding: 0.75rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.admin-table tbody tr:hover {
  background: rgba(124,58,237,0.04);
}
.admin-beat-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

/* Admin dialog (native <dialog>) */
.admin-dialog {
  border: none;
  border-radius: var(--fb-radius);
  background: var(--fb-dark-2);
  color: #e2e8f0;
  padding: 0;
  max-width: 650px;
  width: 92vw;
  max-height: 90vh;
}
.admin-dialog::backdrop {
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}
.admin-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.admin-dialog-body {
  padding: 1.5rem;
  max-height: calc(90vh - 70px);
  overflow-y: auto;
}
.admin-dialog .form-control,
.admin-dialog .form-select {
  background: var(--fb-dark);
  color: #e2e8f0;
  border-color: rgba(255,255,255,0.08);
  border-radius: 8px;
  font-size: 0.875rem;
}
.admin-dialog .form-control:focus,
.admin-dialog .form-select:focus {
  border-color: var(--fb-primary);
  box-shadow: 0 0 0 0.15rem rgba(124,58,237,0.25);
  background: var(--fb-dark);
  color: #e2e8f0;
}
.admin-dialog textarea.form-control {
  resize: vertical;
}

/* License row */
.admin-license-row {
  background: var(--fb-dark);
  border-radius: 8px;
  padding: 0.5rem;
}

/* Form switches */
.admin-dialog .form-check-input:checked {
  background-color: var(--fb-primary);
  border-color: var(--fb-primary);
}

/* ============================================================
   Testimonials – "What Artists Say"
   ============================================================ */

.testimonials-section {
  background: var(--fb-dark);
}

.testimonial-card {
  background: var(--fb-dark-2);
  border-radius: var(--fb-radius);
  padding: 2rem;
  height: 100%;
  border: 1px solid rgba(255,255,255,0.04);
  transition: transform var(--fb-transition), box-shadow var(--fb-transition);
}

.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.testimonial-stars {
  color: #f59e0b;
  font-size: 0.9rem;
  letter-spacing: 2px;
}

.testimonial-quote {
  color: #c4c4d0;
  font-size: 0.925rem;
  line-height: 1.65;
  font-style: italic;
  margin-bottom: 1.25rem;
  position: relative;
}

.testimonial-quote::before {
  content: '\201C';
  font-size: 3rem;
  font-weight: 800;
  color: rgba(124,58,237,0.15);
  position: absolute;
  top: -1rem;
  left: -0.5rem;
  line-height: 1;
  font-style: normal;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.testimonial-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(124,58,237,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fb-primary);
  font-size: 1rem;
  flex-shrink: 0;
}

.testimonial-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: #e2e8f0;
}

.testimonial-role {
  font-size: 0.78rem;
  color: #71717a;
}
