/* ===========================================
   TURNTBL DESKTOP STYLES
   Only applies at 1024px+ via media attribute
   =========================================== */

/* --- LAYOUT: 3-Column Structure --- */
body {
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* --- LEFT SIDEBAR --- */
.desktop-sidebar {
  display: flex !important;
  width: 220px;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background: #12121a;
  border-right: 1px solid rgba(48, 179, 184, 0.2);
  padding: 24px;
  flex-direction: column;
  z-index: 100;
}

.sidebar-logo {
  font-size: 28px;
  font-weight: 800;
  color: #30B3B8;
  margin-bottom: 40px;
  letter-spacing: -0.5px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.sidebar-link:hover {
  background: rgba(48, 179, 184, 0.1);
  color: white;
}

.sidebar-link.active {
  background: rgba(48, 179, 184, 0.2);
  color: #30B3B8;
}

.sidebar-profile {
  margin-top: auto;
}

/* --- RIGHT PLAYER PANEL --- */
.desktop-player-panel {
  display: block !important;
  width: 320px;
  height: 100vh;
  position: fixed;
  right: 0;
  top: 0;
  background: #1a1a2e;
  border-left: 1px solid rgba(48, 179, 184, 0.2);
  padding: 24px;
  overflow-y: auto;
  z-index: 100;
}

.player-panel-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.panel-now-playing {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 20px;
  width: 100%;
}

.panel-cover {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  object-fit: cover;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.panel-title {
  font-size: 18px;
  font-weight: 700;
  color: white;
  text-align: center;
  margin-bottom: 6px;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-artist {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  margin-bottom: 24px;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Progress Bar */
.panel-progress {
  width: 100%;
  margin-bottom: 20px;
}

.panel-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  cursor: pointer;
  margin-bottom: 8px;
  overflow: hidden;
}

.panel-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #30B3B8, #E91E8C);
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s linear;
}

.panel-times {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

/* Controls */
.panel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 32px;
}

.panel-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.panel-btn:hover {
  background: rgba(48, 179, 184, 0.2);
  transform: scale(1.05);
}

.panel-btn.panel-play {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #30B3B8, #E91E8C);
  font-size: 24px;
  box-shadow: 0 4px 16px rgba(48, 179, 184, 0.4);
}

.panel-btn.panel-play:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(48, 179, 184, 0.5);
}

/* Queue Section */
.panel-queue {
  width: 100%;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 24px;
}

.panel-queue-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 16px;
}

.panel-queue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel-queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.panel-queue-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.panel-queue-item img {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
}

.panel-queue-item-info {
  flex: 1;
  min-width: 0;
}

.panel-queue-item-title {
  font-size: 14px;
  font-weight: 500;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel-queue-item-artist {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- MAIN CONTENT AREA --- */
.view {
  margin-left: 220px;
  margin-right: 320px;
  padding: 32px 48px;
  min-height: 100vh;
  width: calc(100% - 540px);
}

.view:not(.active) {
  display: none !important;
}

/* --- HIDE MOBILE ELEMENTS --- */
.bottom-nav,
.player-bar {
  display: none !important;
}

/* --- LIBRARY PAGE SPECIFIC --- */

/* Library Header - larger */
.library-header-new {
  margin-bottom: 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.library-title {
  font-size: 36px;
  font-weight: 700;
}

/* Hide mobile shuffle button */
#shuffle-btn-library-new {
  display: none;
}

/* Following section - horizontal row */
#following-section {
  margin-bottom: 32px;
}

.following-carousel {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.following-artist {
  flex-shrink: 0;
  width: 80px;
  text-align: center;
}

.following-artist img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 8px;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.following-artist:hover img {
  border-color: #30B3B8;
  transform: scale(1.05);
}

.following-artist span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

/* Song list - table layout */
#songs-list-library {
  display: block !important;
}

#songs-grid-library {
  display: none;
}

/* List view improvements */
.list-item {
  display: grid;
  grid-template-columns: 60px 1fr 100px 120px;
  gap: 16px;
  padding: 12px 16px;
  align-items: center;
  border-radius: 8px;
  transition: background 0.2s;
}

.list-item:hover {
  background: rgba(48, 179, 184, 0.1);
}

.list-item:nth-child(odd) {
  background: rgba(48, 179, 184, 0.03);
}

.list-item:nth-child(odd):hover {
  background: rgba(48, 179, 184, 0.12);
}

.list-cover {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
}

.list-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.list-title {
  font-size: 15px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-artist {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-duration {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

.list-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.list-play-btn,
.list-remove-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.list-play-btn {
  background: rgba(48, 179, 184, 0.2);
  color: #30B3B8;
  font-size: 16px;
}

.list-play-btn:hover {
  background: #30B3B8;
  color: white;
  transform: scale(1.1);
}

.list-remove-btn {
  background: rgba(233, 30, 140, 0.2);
  color: #E91E8C;
  font-size: 18px;
}

.list-remove-btn:hover {
  background: #E91E8C;
  color: white;
  transform: scale(1.1);
}

/* Controls bar */
.controls-bar-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
}

/* View toggle button desktop enhancement */
.view-toggle-btn-new {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(48, 179, 184, 0.15);
  border: 1px solid rgba(48, 179, 184, 0.3);
  color: #30B3B8;
}

.view-toggle-btn-new:hover {
  background: rgba(48, 179, 184, 0.25);
}

/* Shuffle button desktop style */
.shuffle-btn-large {
  padding: 12px 28px;
  font-size: 15px;
  border-radius: 50px;
  background: linear-gradient(135deg, #F67854, #E91E8C);
  box-shadow: 0 4px 16px rgba(246, 120, 84, 0.3);
}

.shuffle-btn-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(246, 120, 84, 0.4);
}

/* --- TABS ENHANCEMENT --- */
.library-tabs-header {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 16px;
}

.library-tab-btn {
  font-size: 16px;
  padding: 8px 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.library-tab-btn:hover {
  color: white;
}

.library-tab-btn.active {
  color: #30B3B8;
}

.library-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -17px;
  left: 0;
  right: 0;
  height: 2px;
  background: #30B3B8;
}

/* --- SEARCH VIEW --- */
#search-view .search-container {
  max-width: 800px;
  margin: 0 auto;
}

/* --- PROFILE VIEW --- */
#profile-view {
  padding-top: 40px;
}

.profile-header {
  display: flex;
  gap: 40px;
  margin-bottom: 48px;
}

.profile-avatar {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(48, 179, 184, 0.3);
}

/* --- DISCOVER/STAGE VIEW --- */
#discover-view {
  padding: 0;
  margin-left: 220px;
  margin-right: 320px;
}

/* Adjust video player for desktop */
.stage-video-container {
  max-height: calc(100vh - 100px);
}

/* --- RESPONSIVE ADJUSTMENTS --- */

/* Large screens: wider content area */
@media (min-width: 1400px) {
  .view {
    padding: 40px 64px;
  }

  .list-item {
    grid-template-columns: 70px 1fr 120px 150px;
  }
}

/* Extra large screens */
@media (min-width: 1800px) {
  .desktop-sidebar {
    width: 260px;
  }

  .desktop-player-panel {
    width: 380px;
  }

  .view {
    margin-left: 260px;
    margin-right: 380px;
    width: calc(100% - 640px);
  }
}
