/* Mobile Responsive Improvements */

/* Hide sidebar on mobile, show hamburger menu instead */
@media (max-width: 768px) {
  /* Hide sidebar by default on mobile */
  .dashboard-grid-sidenav-left {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px !important;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    z-index: 101;
  }

  /* Show sidebar when active */
  .dashboard-grid-sidenav-left.active {
    transform: translateX(0);
  }

  /* Overlay when sidebar is open - NE COUVRE PAS LA SIDEBAR */
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 280px; /* Commence APRÈS la sidebar */
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
  }

  .sidebar-overlay.active {
    display: block;
  }

  /* Adjust main content to full width on mobile */
  .dashboard-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "navbar"
      "header"
      "content"
      "footer";
  }

  /* Add hamburger menu button */
  .mobile-menu-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin-right: 12px;
  }

  /* Header adjustments */
  .dashboard-grid-header {
    padding-left: 8px;
    padding-right: 8px;
  }

  /* Search form on mobile */
  #search-form {
    gap: 8px;
  }

  #search-input {
    font-size: 14px;
  }

  /* Hide some header buttons on very small screens */
  @media (max-width: 480px) {
    .external-links-mobile-hide {
      display: none;
    }
  }
}

/* Player footer improvements for mobile */
@media (max-width: 768px) {
  .dashboard-grid-footer {
    height: auto;
    min-height: 96px;
    padding: 12px 8px;
    flex-direction: column;
    gap: 12px;
  }

  /* Track info on mobile */
  .dashboard-grid-footer > div:first-child {
    width: 100%;
    min-width: 0;
  }

  #current-track-info {
    gap: 8px;
  }

  #current-track-info img {
    height: 48px;
    width: 48px;
  }

  #current-track-title,
  #current-track-artist {
    font-size: 13px;
  }

  /* Player controls on mobile */
  .dashboard-grid-footer > div:nth-child(2) {
    width: 100%;
    max-width: 100%;
  }

  /* Make control buttons smaller on mobile */
  #shuffle-button,
  #repeat-button {
    display: none;
  }

  @media (min-width: 480px) {
    #shuffle-button,
    #repeat-button {
      display: inline-flex;
      height: 36px;
      width: 36px;
    }
  }

  #prev-button,
  #next-button {
    height: 36px;
    width: 36px;
  }

  #play-button {
    height: 48px;
    width: 48px;
  }

  /* Progress bar on mobile */
  .dashboard-grid-footer .flex.items-center.gap-12 {
    gap: 6px;
  }

  #current-time,
  #duration {
    font-size: 10px;
    min-width: 32px;
  }

  /* Right controls on mobile */
  .dashboard-grid-footer > div:last-child {
    width: 100%;
    min-width: 0;
    justify-content: space-between;
  }

  #volume-button {
    height: 32px;
    width: 32px;
  }

  .volume-slider-container {
    width: 100px;
  }

  #toggle-queue {
    height: 32px;
    width: 32px;
  }
}

/* Very small screens (< 480px) */
@media (max-width: 480px) {
  .dashboard-grid-footer {
    padding: 8px 4px;
  }

  /* Stack player in 2 rows */
  .dashboard-grid-footer > div:first-child {
    order: 1;
  }

  .dashboard-grid-footer > div:nth-child(2) {
    order: 3;
    margin-top: 8px;
  }

  .dashboard-grid-footer > div:last-child {
    order: 2;
  }

  /* Hide like button on very small screens */
  #like-button {
    display: none;
  }

  /* Smaller control buttons */
  #prev-button,
  #next-button {
    height: 32px;
    width: 32px;
  }

  #play-button {
    height: 42px;
    width: 42px;
  }

  /* Volume control more compact */
  .volume-slider-container {
    width: 80px;
  }
}

/* Queue sidebar on mobile */
@media (max-width: 768px) {
  #queue-sidebar {
    width: 100%;
    max-width: 320px;
  }
}

/* Content adjustments */
@media (max-width: 768px) {
  .web-player-container {
    padding: 12px;
  }

  /* Adjust bottom padding for mobile player */
  .dashboard-grid-content {
    padding-bottom: 140px;
  }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
  .dashboard-grid-sidenav-left {
    width: 200px !important;
  }

  .dashboard-grid-footer > div:first-child,
  .dashboard-grid-footer > div:last-child {
    min-width: 150px;
  }
}