/* CSS Variables */
:root {
  --metallic-gradient: linear-gradient(
    to bottom,
    #ffffff 0%,
    #f2f2f2 15%,
    #e6e6e8 25%,
    #d1d2d4 40%,
    #b8babc 50%,
    #c8cacc 60%,
    #e2e3e5 75%,
    #f8f8fa 100%
  );
  --button-shadow: inset 0 -3px 8px rgba(0, 0, 0, 0.1),
    inset 0 2px 4px rgba(255, 255, 255, 0.8), 0 3px 8px rgba(0, 0, 0, 0.15);
  --hover-shadow: inset 0 -3px 8px rgba(0, 0, 0, 0.1),
    inset 0 2px 4px rgba(255, 255, 255, 0.8), 0 4px 10px rgba(0, 0, 0, 0.2);
  --screen-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5),
    inset -2px -2px 6px rgba(0, 0, 0, 0.4), inset 2px 2px 6px rgba(0, 0, 0, 0.4),
    inset 0 1px 2px rgba(255, 255, 255, 0.2), 0 0 2px rgba(0, 0, 0, 0.3);
}

/* Reset and Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #333;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Common Container Styles */
.player-container {
  max-width: 350px;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}

.player-container {
  margin-top: 25px;
  box-shadow: 0 1px 1px hsl(0deg 0% 0% / 0.075),
    0 2px 2px hsl(0deg 0% 0% / 0.075), 0 4px 4px hsl(0deg 0% 0% / 0.075),
    0 8px 8px hsl(0deg 0% 0% / 0.075), 0 16px 16px hsl(0deg 0% 0% / 0.075);
}

/* Player Sections */
.player-top {
  background: radial-gradient(
      circle at top left,
      rgba(237, 249, 255, 0.8) 10%,
      rgba(237, 249, 255, 0.6) 20%,
      transparent
    ),
    linear-gradient(45deg, #71b6f7, #1d4e80);
  padding: 35px;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.screen {
  background-color: #1a4070;
  height: 100%;
  border-radius: 20px;
  color: white;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  box-shadow: var(--screen-shadow);
}

/* Text Elements */
.podcast-artist {
  margin-top: 8px;
  padding-bottom: 8px;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
}

.podcast-title {
  font-size: 15px;
  text-align: center;
  white-space: nowrap;
  position: relative;
  padding: 0 3px;
  height: 34px;
  width: 100%;
  /* Clamp the text to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

/* Controls Section */
.player-bottom {
  background: linear-gradient(to bottom, #82ed6a, #3d8a27);
  border-top: 1px solid rgba(64, 133, 58, 0.1);
  padding: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.controls {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

.controls button {
  width: 50px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: transform 0.15s ease-out;
  border: 1px solid #999;
  background: var(--metallic-gradient);
  box-shadow: var(--button-shadow);
}

.controls button:first-child {
  border-top-left-radius: 50%;
  border-bottom-left-radius: 15%;
}

.controls button:last-child {
  border-top-right-radius: 50%;
  border-bottom-right-radius: 15%;
}

.controls button:hover {
  box-shadow: var(--hover-shadow);
}

.controls button:active {
  transform: translateY(0.6px);
}

/* Track List */
#track-list {
  background: linear-gradient(to bottom, #f8f8f8, #e0e0e0);
  padding: 16px;
  margin: 16px;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.9),
    0 2px 4px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.1);
  max-width: 350px;
  border-radius: 20px;
}

/* Track List Header */
.track-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px;
  background: linear-gradient(to bottom, #ffffff, #f0f0f0);
  border-radius: 12px;
  cursor: pointer;
  position: sticky;
  top: 0;
}

.toggle-button {
  background: none;
  border: none;
  font-size: 20px;
  color: #666;
  cursor: pointer;
  transition: transform 0.3s ease;
}

/* Track Items */
.track {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(to bottom, #ffffff, #f0f0f0);
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 13px;
  margin: 13px 0;
  transition: transform 0.2s ease-out;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.track:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.track:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.1);
}

.track img {
  width: 60px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.track-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.track-info b {
  font-size: 15px;
  color: #333;
}

.track-info div:last-child {
  color: #666;
  font-size: 13px;
}

.track-played {
  text-decoration: line-through;
}

/* Track List  */
#track-list {
  width: 350px;
}

#track-list-content {
  transition: max-height 0.3s ease-out;
  opacity: 1;
  display: block;
}

#track-list.collapsed #track-list-content {
  max-height: 0;
  opacity: 0;
  display: none;
}

#track-list.collapsed .toggle-button {
  transform: rotate(-90deg);
}
