/* ==========================================================================
   BEATSHOUSE — Design System v7.0
   ANALOG HEAT — Amber gold on deep warm-dark. Studio warmth.
   ========================================================================== */

/* Fonts loaded via wp_enqueue_style('beatshouse-fonts') — no @import needed */

:root {
  /* ── Base surfaces — warm near-black with violet depth ── */
  --bh-bg:            #000;
  --bh-bg-2:          #080808;
  --bh-bg-3:          #100D18;
  --bh-bg-4:          #17131F;
  --bh-bg-card:       rgba(16, 13, 24, 0.94);

  /* ── Signature amber accent ── */
  --bh-amber-hot:     #FF6B1A;
  --bh-amber:         #C8FF00;
  --bh-amber-soft:    #F5B84A;
  --bh-amber-dim:     rgba(200,255,0, 0.14);
  --bh-amber-glow:    rgba(200,255,0, 0.30);

  /* ── Legacy neon aliases → amber ── */
  --bh-neon-teal:     #C8FF00;
  --bh-neon-teal-dim: rgba(200,255,0, 0.12);
  --bh-neon-teal-glow:rgba(200,255,0, 0.28);
  --bh-neon-purple:   #c8a96e;
  --bh-neon-purple-dim:rgba(200,255,0, 0.10);
  --bh-neon-magenta:  #C8FF00;
  --bh-neon-cyan:     #F5B84A;

  /* ── Borders — amber-tinted warmth ── */
  --bh-border:        rgba(200,255,0, 0.08);
  --bh-border-hover:  rgba(200,255,0, 0.22);
  --bh-border-strong: rgba(200,255,0, 0.45);

  /* ── Text ── */
  --bh-text:          #F2EDE4;
  --bh-text-soft:     #C4B89A;
  --bh-text-muted:    #7A6E5E;
  --bh-text-faint:    #3A3228;

  /* ── Primary accent (alias → amber) ── */
  --bh-accent:        #C8FF00;
  --bh-accent-dim:    rgba(200,255,0, 0.14);
  --bh-accent-glow:   rgba(200,255,0, 0.30);

  /* ── Semantic ── */
  --bh-green:         #4ADE80;
  --bh-green-dim:     rgba(74, 222, 128, 0.12);
  --bh-red:           #FF5252;
  --bh-red-dim:       rgba(255, 82, 82, 0.12);

  /* ── Typography ── */
  --bh-font-ui:       'Manrope', system-ui, -apple-system, sans-serif;
  --bh-font-display:  'Syne', system-ui, sans-serif;
  --bh-font-mono:     'DM Mono', 'Space Mono', ui-monospace, monospace;
  --bh-font-cyber:    'Syne', 'Manrope', system-ui, sans-serif;

  /* ── Spacing / Radius ── */
  --bh-r-xs:   4px;
  --bh-r-sm:   8px;
  --bh-r-md:   12px;
  --bh-r-lg:   16px;
  --bh-r-xl:   22px;
  --bh-r-pill: 999px;

  /* ── Motion ── */
  --bh-ease:   0.18s cubic-bezier(0.23, 1, 0.32, 1);

  /* ── Shadows — tinted to background hue, not pure black ── */
  --bh-shadow-sm: 0 0 0 1px rgba(255,255,255,0.04), 0 2px 8px rgba(5,3,12,0.55);
  --bh-shadow-md: 0 0 0 1px rgba(255,255,255,0.04), 0 6px 24px rgba(5,3,12,0.65);
  --bh-shadow-lg: 0 0 0 1px rgba(255,255,255,0.06), 0 16px 48px rgba(5,3,12,0.75);
  --bh-glow-teal:   0 0 20px rgba(200,255,0, 0.18), 0 0 60px rgba(200,255,0, 0.06);
  --bh-glow-purple: 0 0 20px rgba(200,255,0, 0.12), 0 0 60px rgba(200,255,0, 0.04);
}

/* ==========================================================================
   GLOBAL BASE
   ========================================================================== */

body.beatshouse-theme {
  background: var(--bh-bg);
  color: var(--bh-text);
  font-family: var(--bh-font-ui);
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  /* No overflow on body — overflow-x:clip computes overflow-y:clip too per spec,
     blocking vertical scroll on Chrome mobile. Horizontal bleed is contained
     per-section (.bh-ch already has overflow-x:clip; .bh-home-v5 added below). */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Subtle warm noise grain */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

body.beatshouse-theme *,
body.beatshouse-theme *::before,
body.beatshouse-theme *::after {
  box-sizing: border-box;
}

body.beatshouse-theme a {
  color: var(--bh-text-soft);
  text-decoration: none;
  transition: color var(--bh-ease);
}

body.beatshouse-theme a:hover {
  color: var(--bh-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

body.beatshouse-theme main {
  margin: 0;
  max-width: none;
  padding: 0;
}

body.beatshouse-theme img,
body.beatshouse-theme video,
body.beatshouse-theme iframe,
body.beatshouse-theme svg {
  max-width: 100%;
  height: auto;
}

/* ==========================================================================
   HEADINGS
   ========================================================================== */

body.beatshouse-theme h1,
body.beatshouse-theme h2,
body.beatshouse-theme h3,
body.beatshouse-theme h4 {
  font-family: var(--bh-font-display);
  color: var(--bh-text);
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  line-height: 1.1;
  text-wrap: balance;
}

body.beatshouse-theme h1 { letter-spacing: -0.04em; line-height: 1.05; }
body.beatshouse-theme h2 { letter-spacing: -0.03em; line-height: 1.1; }
body.beatshouse-theme h3 { letter-spacing: -0.02em; }

/* ==========================================================================
   LAYOUT CONTAINERS
   ========================================================================== */

.beatshouse-theme .bh-container {
  margin: auto;
  max-width: 1100px;
  padding: 24px 20px;
  width: 100%;
}

.beatshouse-theme .bh-box,
.beatshouse-theme .bh-card,
.beatshouse-theme .bh-panel,
.beatshouse-theme .bh-surface {
  background: var(--bh-bg-3);
  border: 1px solid var(--bh-border);
  border-radius: var(--bh-r-lg);
  box-shadow: var(--bh-shadow-sm);
  transition: border-color var(--bh-ease), box-shadow var(--bh-ease);
}

@media (hover: hover) and (pointer: fine) {
  .beatshouse-theme .bh-box:hover,
  .beatshouse-theme .bh-card:hover {
    border-color: var(--bh-border-hover);
    box-shadow: var(--bh-shadow-md);
  }
}

.beatshouse-theme .bh-box {
  padding: 16px;
}

.beatshouse-theme .bh-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.beatshouse-theme .bh-btn,
.beatshouse-theme .neon-btn,
.beatshouse-theme .player-btn,
.beatshouse-theme .button-comment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  min-height: 40px;
  border: 1px solid var(--bh-border-hover);
  border-radius: var(--bh-r-md);
  background: var(--bh-bg-4);
  color: var(--bh-text);
  font-family: var(--bh-font-ui);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--bh-ease), border-color var(--bh-ease), color var(--bh-ease);
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  .beatshouse-theme .bh-btn:hover,
  .beatshouse-theme .neon-btn:hover,
  .beatshouse-theme .player-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--bh-border-strong);
    color: #fff;
    text-decoration: none;
  }
}

.beatshouse-theme .bh-btn:active,
.beatshouse-theme .neon-btn:active,
.beatshouse-theme .player-btn:active,
.beatshouse-theme .bh-btn-primary:active,
.beatshouse-theme .bh-btn.primary:active,
.beatshouse-theme .bh-btn-ghost:active {
  transform: scale(0.97);
}

/* Primary CTA — amber button */
.beatshouse-theme .bh-btn-primary,
.beatshouse-theme .bh-btn.primary {
  background: var(--bh-amber);
  color: #000;
  border-color: transparent;
  font-weight: 800;
  box-shadow: 0 0 20px rgba(200,255,0, 0.25);
}

@media (hover: hover) and (pointer: fine) {
  .beatshouse-theme .bh-btn-primary:hover,
  .beatshouse-theme .bh-btn.primary:hover {
    background: var(--bh-amber-soft);
    color: #000;
    border-color: transparent;
    box-shadow: 0 0 28px rgba(200,255,0, 0.4);
  }
}

/* Ghost button */
.beatshouse-theme .bh-btn-ghost {
  background: transparent;
  border-color: var(--bh-border);
}

@media (hover: hover) and (pointer: fine) {
  .beatshouse-theme .bh-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--bh-border-hover);
  }
}

/* Danger */
.beatshouse-theme .bh-btn-danger {
  color: var(--bh-red);
  border-color: rgba(255, 255, 255, 0.2);
  background: var(--bh-red-dim);
}

.beatshouse-theme .bh-btn-danger:active {
  transform: scale(0.97);
}

/* ==========================================================================
   FORM ELEMENTS
   ========================================================================== */

.beatshouse-theme input,
.beatshouse-theme select,
.beatshouse-theme textarea,
.beatshouse-theme .profile-form input,
.beatshouse-theme .profile-form select,
.beatshouse-theme .profile-form textarea,
.beatshouse-theme .bh-profile-form input,
.beatshouse-theme .bh-profile-form select,
.beatshouse-theme .bh-profile-form textarea {
  width: 100%;
  background: var(--bh-bg-3);
  color: var(--bh-text);
  border: 1px solid var(--bh-border);
  border-radius: var(--bh-r-sm);
  padding: 10px 14px;
  font-family: var(--bh-font-ui);
  font-size: 14px;
  appearance: none;
  box-sizing: border-box;
  transition: border-color var(--bh-ease), box-shadow var(--bh-ease);
  outline: none;
}

.beatshouse-theme input:focus,
.beatshouse-theme select:focus,
.beatshouse-theme textarea:focus,
.beatshouse-theme .profile-form input:focus,
.beatshouse-theme .profile-form select:focus,
.beatshouse-theme .profile-form textarea:focus {
  border-color: var(--bh-amber);
  box-shadow: 0 0 0 3px rgba(200,255,0, 0.12);
}

.beatshouse-theme input::placeholder,
.beatshouse-theme textarea::placeholder {
  color: var(--bh-text-faint);
}

/* ==========================================================================
   PILLS / CHIPS / TABS
   ========================================================================== */

.beatshouse-theme .bh-chip,
.beatshouse-theme .bh-pill,
.beatshouse-theme .pill,
.beatshouse-theme .vault-tab {
  border: 1px solid var(--bh-border);
  background: transparent;
  color: var(--bh-text-muted);
  border-radius: var(--bh-r-pill);
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: border-color var(--bh-ease), color var(--bh-ease), background var(--bh-ease);
  cursor: pointer;
}

.beatshouse-theme .bh-chip.is-active,
.beatshouse-theme .bh-pill.active,
.beatshouse-theme .pill.active,
.beatshouse-theme .vault-tab.active {
  border-color: var(--bh-amber);
  color: var(--bh-amber);
  background: var(--bh-amber-dim);
}

.beatshouse-theme .bh-chip:active,
.beatshouse-theme .bh-pill:active,
.beatshouse-theme .pill:active,
.beatshouse-theme .vault-tab:active {
  transform: scale(0.97);
}

.beatshouse-theme .pill.reset {
  color: var(--bh-red);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   DIVIDERS & LABELS
   ========================================================================== */

.beatshouse-theme .bh-divider {
  height: 1px;
  background: var(--bh-border);
  margin: 16px 0;
}

.beatshouse-theme .bh-badge,
.beatshouse-theme .badge,
.beatshouse-theme .bh-label {
  font-family: var(--bh-font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bh-text-muted);
}

/* ==========================================================================
   PROFILE
   ========================================================================== */

.beatshouse-theme .profile-card,
.beatshouse-theme .bh-profile-header {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.avatar-img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 1px solid var(--bh-border-hover);
  object-fit: cover;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }

.neon-title {
  font-family: var(--bh-font-display);
  font-size: 2.2rem;
  margin: 0;
  color: var(--bh-text);
  letter-spacing: 0.03em;
}

.neon-subtext,
.stats {
  font-size: 0.9rem;
  color: var(--bh-text-muted);
  margin-top: 4px;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

/* ==========================================================================
   PLAYER
   ========================================================================== */

.player-container,
.download-list {
  background: var(--bh-bg-3);
  border: 1px solid var(--bh-border);
  padding: 20px;
  border-radius: var(--bh-r-lg);
  color: var(--bh-text);
  margin: 32px auto;
  max-width: 600px;
}

.download-list a {
  color: var(--bh-text-soft);
  text-decoration: underline;
  font-weight: 700;
}

.download-list a:hover { color: #fff; }

#waveform { margin-bottom: 20px; height: 80px; }

.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

#volumeSlider {
  width: 90px;
  accent-color: var(--bh-text-muted);
}

/* ==========================================================================
   GENRE GRID
   ========================================================================== */

.beats-genres-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px;
  text-align: center;
}

.beats-genres-title {
  font-size: 36px;
  color: var(--bh-text);
  margin-bottom: 32px;
  font-family: var(--bh-font-display);
  letter-spacing: 0.04em;
}

.genres-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.genre-box {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100px;
  background: var(--bh-bg-3);
  border: 1px solid var(--bh-border);
  border-radius: var(--bh-r-lg);
  color: var(--bh-text-muted);
  font-size: 14px;
  font-family: var(--bh-font-display);
  letter-spacing: 0.05em;
  transition: background var(--bh-ease), border-color var(--bh-ease),
              color var(--bh-ease), transform var(--bh-ease);
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .genre-box:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--bh-text);
    border-color: var(--bh-border-hover);
    transform: translateY(-2px);
    text-decoration: none;
  }
}

.genre-box:active {
  transform: scale(0.97);
}

/* ==========================================================================
   GENRE CARDS (VERTICAL LIST)
   ========================================================================== */

.beats-vertical-wrap { gap: 10px; }

.beats-genre-card {
  font-family: var(--bh-font-ui);
  font-weight: 700;
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0.8em 1.2em;
  border-radius: var(--bh-r-md);
  background: var(--bh-bg-3);
  border: 1px solid var(--bh-border);
  transition: border-color var(--bh-ease);
}

@media (hover: hover) and (pointer: fine) {
  .beats-genre-card:hover { border-color: var(--bh-border-hover); }
}

.beats-genre-card:active { transform: scale(0.97); }

.beats-genre-card .genre-label {
  font-size: 1em;
  line-height: 1;
  display: flex;
  align-items: center;
  height: 2em;
}

/* ==========================================================================
   LAYOUT UTILITIES
   ========================================================================== */

.beatshouse-theme .bh-app,
.beatshouse-theme .bst-main,
.beatshouse-theme .bh-home-v5 {
  width: 100%;
  overflow-x: clip; /* clip per-container — avoids body overflow-x:clip which computes Y:clip too */
}

.beatshouse-theme .entry-content,
.beatshouse-theme .site-content,
.beatshouse-theme .site-main {
  width: 100%;
  max-width: none;
  padding: 0;
}

.beatshouse-theme .bh-section { padding: 32px 0; }

.beatshouse-theme .bh-grid { display: grid; gap: 16px; }

.beatshouse-theme .bh-text-small {
  font-size: 12px;
  color: var(--bh-text-muted);
}

/* ==========================================================================
   AVATAR UPLOAD
   ========================================================================== */

.beatshouse-theme .avatar-upload {
  font-size: 12px;
  padding: 7px 14px;
  border-radius: var(--bh-r-sm);
  border: 1px solid var(--bh-border-hover);
  background: rgba(255, 255, 255, 0.04);
  color: var(--bh-text);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--bh-ease), border-color var(--bh-ease);
}

@media (hover: hover) and (pointer: fine) {
  .beatshouse-theme .avatar-upload:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--bh-border-strong);
  }
}

.beatshouse-theme .avatar-upload:active {
  transform: scale(0.97);
}

/* Submit buttons in forms */
.beatshouse-theme .edit-profile-section button[type="submit"] {
  background: var(--bh-amber);
  color: #000;
  font-weight: 800;
  border: none;
  padding: 12px 20px;
  border-radius: var(--bh-r-md);
  font-family: var(--bh-font-ui);
  font-size: 14px;
  width: 100%;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: background var(--bh-ease), box-shadow var(--bh-ease);
}

@media (hover: hover) and (pointer: fine) {
  .beatshouse-theme .edit-profile-section button[type="submit"]:hover {
    background: var(--bh-amber-soft);
    box-shadow: 0 0 24px rgba(200,255,0, 0.35);
  }
}

.beatshouse-theme .edit-profile-section button[type="submit"]:active {
  transform: scale(0.97);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
  main.wp-block-group {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .wp-block-columns { flex-direction: column !important; gap: 1.5rem !important; }
  .wp-block-column  { width: 100% !important; max-width: 100% !important; }

  .wp-block-woocommerce-related-products .products-block-post-template {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 600px) {
  .beatshouse-theme .profile-card { flex-direction: column; text-align: center; }
  .avatar-img                     { width: 80px; height: 80px; }
  .neon-title                     { font-size: 1.8rem; }
  .beats-genres-title             { font-size: 26px; }
  .genre-box                      { font-size: 13px; height: 80px; }
  .actions                        { justify-content: center; }
}

/* ==========================================================================
   GSAP ANIMATION SYSTEM
   GPU hints, 3D perspective, glow follower, canvas nebula
   ========================================================================== */

/* GPU-promoted layers */
.bh-home-bg-layer,
.bh-home-featured,
.bh-dock-container,
.bh-app-main-player,
.vault-header {
  will-change: transform, opacity;
}

/* 3D tilt perspective containers */
.bh-home-featured,
.bh-premium-card,
.bh-home-trackrow,
.track-row {
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

/* Track rows — smooth tilt reset */
.track-row,
.bh-home-trackrow {
  will-change: transform;
  transition: box-shadow var(--bh-duration-base) var(--bh-ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .track-row:hover,
  .bh-home-trackrow:hover {
    box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 4px 24px rgba(5,3,12,0.45), inset 0 0 0 1px rgba(244,244,245,0.04);
  }
}

/* Play button GPU + hover glow */
.master-play {
  will-change: transform;
  transition: box-shadow var(--bh-duration-fast) var(--bh-ease-out);
}

.master-play:active {
  transform: scale(0.97);
}

@media (hover: hover) and (pointer: fine) {
  .master-play:hover {
    box-shadow: 0 0 20px rgba(244,244,245,0.15);
  }
}

/* Dock items — spring ready */
.bh-dock-item {
  will-change: transform;
  transform-origin: center bottom;
}

/* Canvas nebula — fill hero */
.bh-nebula-canvas {
  mix-blend-mode: screen;
}

/* Glow follower — hide on touch devices by default */
@media (hover: none) {
  .bh-glow-follower {
    display: none !important;
  }
}

/* Featured card — glass reflection on hover */
.bh-home-featured {
  transition: box-shadow var(--bh-duration-slow) var(--bh-ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .bh-home-featured:hover {
    box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 8px 40px rgba(5,3,12,0.55), 0 0 60px rgba(244,244,245,0.03);
  }
}

/* CTA buttons — hover shadow */
@media (hover: hover) and (pointer: fine) {
  .btn-action:hover,
  .bh-home-actions a:hover,
  .bh-btn--accent:hover {
    box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 4px 16px rgba(5,3,12,0.45);
  }
}

/* CTA buttons — active press */
.btn-action:active,
.bh-home-actions a:active,
.bh-btn--accent:active {
  transform: scale(0.97);
}

/* ==========================================================================
   TYPOGRAPHY SCALE — v8.0
   Global Syne headings across plugin contexts (overrides WP theme !important)
   ========================================================================== */

/* Override WP theme #main h1-h4 !important via higher specificity */
body #main .bh-home-v5 h1,
body #main .bh-home-v5 h2,
body #main .bh-home-v5 h3,
body #main .bh-home-v5 h4,
body #main .bh-library-v3 h1,
body #main .bh-library-v3 h2,
body #main .bh-library-v3 h3,
body #main .bh-library-v3 h4,
body #main .bh-single-beat h1,
body #main .bh-single-beat h2,
body #main .bh-single-beat h3 {
  font-family: 'Syne', system-ui, sans-serif !important;
  letter-spacing: -.02em !important;
}

/* Body text: Manrope, 15px/1.6, warm cream */
body #main .bh-home-v5 p,
body #main .bh-library-v3 p,
body #main .bh-single-beat p {
  font-family: 'Manrope', system-ui, sans-serif !important;
  font-size: 15px !important;
  line-height: 1.6 !important;
  color: rgba(242,237,228,.75) !important;
}
