/* ================================================================
   KYLERBEATS — RESPONSIVE FIXES
   Voeg dit toe als <link rel="stylesheet" href="responsive-fixes.css" />
   ná style.css en brand-menu.css in je HTML <head>
   ================================================================ */

/* ── BASE / RESET ─────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── FLUID TYPE SCALE ─────────────────────────────────────────── */
:root {
  --sidebar: 245px;
  --player: 98px;
  --topbar-height: 76px;
}

/* ── SIDEBAR ──────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ── APP SHELL ────────────────────────────────────────────────── */
.app-shell {
  margin-left: var(--sidebar);
  padding: 24px 42px calc(var(--player) + 38px);
  min-width: 0;
}

/* ── TOPBAR ───────────────────────────────────────────────────── */
.topbar {
  flex-wrap: wrap;
  row-gap: 10px;
}

/* ── CARDS GRIDS ──────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}

.album-strip,
.artist-grid,
.recent-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}

.all-songs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
}

.legal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

/* ── PLAYER ───────────────────────────────────────────────────── */
.player {
  left: var(--sidebar);
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(320px, 1.4fr) minmax(220px, 1fr);
  align-items: center;
  gap: 16px;
  padding: 14px 32px;
}

/* ── SEARCH ───────────────────────────────────────────────────── */
.search-wrap {
  flex: 1 1 200px;
  max-width: 500px;
  min-width: 0;
}

.search-wrap:focus-within {
  max-width: 580px;
}

/* ── LANGUAGE MENU POSITIE ────────────────────────────────────── */
.language-menu {
  max-height: min(390px, 60vh);
}

/* ── RELEASE / QUEUE PANELS ───────────────────────────────────── */
.release-panel,
.queue-panel {
  max-height: min(480px, 70vh);
  overflow-y: auto;
}

/* ── HERO ─────────────────────────────────────────────────────── */
.hero {
  min-height: clamp(380px, 50vw, 610px);
}

/* ──────────────────────────────────────────────────────────────
   ≤ 1400px  (grote laptops)
─────────────────────────────────────────────────────────────── */
@media (max-width: 1400px) {
  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

/* ──────────────────────────────────────────────────────────────
   ≤ 1280px  (laptops)
─────────────────────────────────────────────────────────────── */
@media (max-width: 1280px) {
  :root { --sidebar: 220px; }

  .app-shell {
    padding-inline: 28px;
  }

  .player {
    padding-inline: 24px;
    gap: 12px;
  }

  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 18px;
  }
}

/* ──────────────────────────────────────────────────────────────
   ≤ 1100px  (kleine laptops / grote tablets landscape)
─────────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  :root {
    --sidebar: 200px;
    --player: 106px;
  }

  .app-shell {
    padding-inline: 22px;
  }

  .player {
    grid-template-columns: 1fr 1.3fr;
    grid-template-rows: auto auto;
    padding-inline: 20px;
    min-height: var(--player);
  }

  .player-actions {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .volume {
    width: 120px;
  }

  .brand-btn .brand-btn-text {
    display: none;
  }

  .search-wrap {
    flex: 1 1 160px;
  }
}

/* ──────────────────────────────────────────────────────────────
   ≤ 900px  (tablets portrait / kleine laptops)
─────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root {
    --sidebar: 236px;
    --player: 160px;
  }

  /* Sidebar wordt een overlay drawer */
  .sidebar {
    transform: translateX(-100%);
    position: fixed;
    z-index: 30;
    box-shadow: 4px 0 40px rgba(0,0,0,0.5);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .backdrop.show {
    display: block;
  }

  .app-shell {
    margin-left: 0;
    padding: 16px 20px calc(var(--player) + 28px);
  }

  /* Player gaat naar 1 kolom */
  .player {
    left: 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 10px;
    padding: 12px 20px;
    min-height: var(--player);
  }

  .player-center {
    order: -1;
  }

  .now-playing {
    justify-content: center;
  }

  .player-actions {
    justify-content: space-between;
    width: 100%;
  }

  /* Hamburger zichtbaar */
  .hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
  }

  /* Topbar */
  .topbar {
    padding-bottom: 16px;
    gap: 10px;
  }

  .search-wrap,
  .search-wrap:focus-within {
    width: 100%;
    max-width: none;
    flex: 1 1 auto;
  }

  /* Hero */
  .hero {
    min-height: clamp(320px, 60vw, 520px);
    padding: 36px 28px;
    border-radius: 24px;
  }

  .hero h1 {
    font-size: clamp(2.6rem, 10vw, 4.8rem);
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
    max-width: 260px;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* Grids */
  .cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
  }

  .album-strip,
  .artist-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
  }

  .recent-list {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .all-songs-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }

  .legal-grid {
    grid-template-columns: 1fr;
  }

  /* Artist profile */
  .artist-profile {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .artist-portrait img {
    width: 140px;
    height: 140px;
  }

  /* Section heading */
  .section-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* Queue panel */
  .queue-panel {
    left: 0;
    right: 0;
    bottom: 48px;
    width: 100%;
    max-width: none;
    border-radius: 18px 18px 0 0;
  }

  /* Release panel */
  .release-panel {
    right: -4px;
    width: min(340px, calc(100vw - 24px));
  }

  /* Language menu */
  .language-menu {
    right: 0;
    width: min(280px, calc(100vw - 24px));
  }

  /* Contact */
  .contact-panel {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .contact-mail {
    width: 100%;
    justify-content: center;
  }

  /* Volume */
  .volume {
    width: 100px;
  }

  /* Profile label */
  .profile span { display: none; }

  /* Language knop label */
  .language-btn strong { display: none; }
  .top-actions { gap: 8px; }

  /* Toast */
  .toast-stack {
    left: 16px;
    right: 16px;
    bottom: calc(var(--player) + 14px);
  }
}

/* ──────────────────────────────────────────────────────────────
   ≤ 600px  (telefoons)
─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  :root {
    --player: 168px;
  }

  .app-shell {
    padding-inline: 14px;
    padding-top: 12px;
  }

  /* Topbar: search op volledige breedte, 2e rij */
  .topbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: 10px 10px;
    align-items: center;
  }

  .hamburger {
    grid-column: 1;
    grid-row: 1;
  }

  .search-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: none;
  }

  .top-actions {
    grid-column: 2 / -1;
    grid-row: 1;
    justify-content: flex-end;
    margin-left: 0;
  }

  /* Hero */
  .hero {
    padding: 28px 18px;
    border-radius: 18px;
    min-height: 300px;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 12vw, 3.8rem);
    margin-top: 20px;
    margin-bottom: 18px;
  }

  .hero p {
    font-size: 0.92rem;
  }

  .hero-actions {
    max-width: 100%;
    gap: 10px;
  }

  .btn {
    min-height: 48px;
    font-size: 0.88rem;
  }

  /* Cards */
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .album-strip,
  .artist-grid,
  .recent-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .all-songs-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
  }

  /* Collab kaarten: altijd 1 kolom op heel kleine schermen */
  #collabGrid {
    grid-template-columns: 1fr;
  }

  /* Song card intern */
  .song-card {
    padding: 12px;
  }

  .card-body {
    gap: 8px;
    padding-top: 10px;
  }

  .song-title {
    font-size: 0.85rem;
  }

  .bpm-badge {
    font-size: 0.68rem;
    padding: 4px 8px;
  }

  /* Mini song card */
  .mini-info {
    padding: 6px 8px 8px;
  }

  .mini-title {
    font-size: 0.72rem;
  }

  /* Player */
  .player {
    padding: 10px 14px;
    gap: 8px;
  }

  .now-playing img {
    width: 46px;
    height: 46px;
  }

  .now-playing h3 {
    font-size: 0.84rem;
  }

  .play-main {
    width: 46px !important;
    height: 46px !important;
  }

  .timeline {
    grid-template-columns: 36px 1fr 36px;
    gap: 6px;
    font-size: 0.68rem;
  }

  .player button {
    width: 30px;
    height: 30px;
  }

  .controls { gap: 8px; }

  .volume {
    width: 88px;
  }

  .buy-mini {
    padding-inline: 10px;
    font-size: 0.68rem;
    min-height: 38px;
  }

  /* Artist profile */
  .artist-portrait img {
    width: 120px;
    height: 120px;
  }

  .artist-copy h2 {
    font-size: clamp(2rem, 12vw, 3.2rem);
  }

  .artist-stats,
  .social-row {
    gap: 8px;
  }

  .artist-stats span,
  .social-row a {
    font-size: 0.74rem;
    padding: 0 10px;
    min-height: 38px;
  }

  /* License */
  .license-hero {
    padding: 22px 18px;
  }

  .license-hero h2 {
    font-size: clamp(1.8rem, 10vw, 3.6rem);
  }

  .legal-card {
    min-height: auto;
    padding: 18px;
  }

  /* Section headings */
  .section-heading h2 {
    font-size: clamp(1.2rem, 6vw, 1.6rem);
  }

  /* Queue panel */
  .queue-panel {
    border-radius: 14px 14px 0 0;
  }

  /* Album modal */
  .album-modal-content {
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
    margin-top: auto;
    margin-bottom: 0;
  }

  .album-modal {
    align-items: flex-end;
    padding: 0;
  }

  .album-track-row {
    grid-template-columns: 44px 1fr auto;
    padding: 8px 10px;
  }

  .album-track-row img {
    width: 44px;
    height: 44px;
  }

  /* Brand menu */
  .brand-menu {
    right: -8px;
    width: min(260px, calc(100vw - 20px));
  }

  /* Release panel */
  .release-panel {
    right: -8px;
    width: calc(100vw - 20px);
    max-width: 340px;
  }
}

/* ──────────────────────────────────────────────────────────────
   ≤ 380px  (heel kleine telefoons: SE, Galaxy A)
─────────────────────────────────────────────────────────────── */
@media (max-width: 380px) {
  :root { --player: 172px; }

  .app-shell {
    padding-inline: 10px;
  }

  .cards-grid,
  .album-strip,
  .artist-grid,
  .recent-list {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .all-songs-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .hero h1 {
    font-size: clamp(1.9rem, 13vw, 3rem);
  }

  .player-actions {
    gap: 6px;
  }

  .volume { display: none; }

  .song-title { font-size: 0.8rem; }

  .artist-name, .duration {
    font-size: 0.68rem;
  }
}

/* ──────────────────────────────────────────────────────────────
   LANDSCAPE TELEFOON (kort & breed)
─────────────────────────────────────────────────────────────── */
@media (max-height: 480px) and (orientation: landscape) {
  :root { --player: 80px; }

  .hero {
    min-height: 260px;
    padding: 24px 28px;
  }

  .hero h1 {
    font-size: clamp(1.6rem, 6vw, 2.8rem);
    margin-block: 12px;
  }

  .hero p { display: none; }

  .player {
    grid-template-columns: 1fr 1.2fr 1fr;
    grid-template-rows: auto;
    min-height: var(--player);
    padding: 8px 16px;
  }

  .player-center { gap: 4px; }

  .controls { gap: 6px; }

  .timeline { display: none; }

  .player-actions { grid-column: unset; }
}

/* ──────────────────────────────────────────────────────────────
   TOUCH-DEVICE OPTIMALISATIES
─────────────────────────────────────────────────────────────── */
@media (pointer: coarse) {
  /* Vergroot klikgebied voor knoppen */
  .nav-link,
  .config-btn,
  .round-action,
  .queue-actions button,
  .favorite,
  .language-option,
  .brand-menu-item {
    min-height: 48px;
  }

  .mini-play-btn {
    opacity: 1 !important; /* Altijd zichtbaar op touch */
  }

  .card-overlay {
    opacity: 1 !important;
  }

  /* Vergroot schuifregelaars */
  input[type="range"] {
    height: 20px;
    cursor: pointer;
  }
}

/* ──────────────────────────────────────────────────────────────
   PRINT (bonus)
─────────────────────────────────────────────────────────────── */
@media print {
  .sidebar,
  .player,
  .topbar,
  .loader {
    display: none !important;
  }

  .app-shell {
    margin: 0;
    padding: 0;
  }
}
