/* Import fonts */
@import url('//fonts.googleapis.com/css?family=PT+Sans+Narrow');
@import url('//fonts.googleapis.com/css?family=Open+Sans|Roboto');

/* Set global styles */
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: 'Open Sans', 'Roboto', sans-serif;
  font-size: clamp(14px, 2.5vw, 18px);
  line-height: 1.5;
  color: #F5F5F5;
  background-color: #2A2A2A;
}

/* Set header styles */
header {
  background-color: #3A3A3A;
  padding: 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
}

.header-content {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  flex-wrap: nowrap;
  flex-direction: row-reverse;
  height: auto;
}

.logo {
  height: auto;
  width: auto;
  min-width: 300px;
  max-width: 320px;
  flex-shrink: 0;
  transition: filter 0.3s ease-in-out;
  object-fit: cover;
  object-position: center;
}

.header-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px 30px;
  text-align: left;
  flex: 1;
  gap: 5px;
}

header h1 {
  font-size: clamp(28px, 5vw, 52px);
  margin: 0;
  padding: 0;
  line-height: 1.2;
  font-weight: bold;
  color: #D4A574;
}

header h2 {
  font-size: clamp(14px, 2.5vw, 24px);
  margin: 8px 0 0 0;
  padding: 0;
  letter-spacing: 0.5px;
  line-height: 1.3;
  font-weight: normal;
  color: #B8956A;
}

/* Set main content styles */
main {
  width: min(66%, 980px);
  margin: 0 auto;
  padding: 0 0 85px 0;
  text-align: center;
}

/* Set footer styles */
footer {
  position: fixed;
  left: 0;
  bottom: 0;
  display: block;
  width: auto;
  min-width: 100%;
  height: auto;
  min-height: 50px;
  max-height: 75px;
  background-color: #3A3A3A;
  border-top: 1px solid #B8956A;
  padding: 10px 15px;
  text-align: left;
  z-index: 10; /* ensure it's above other content */
  box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
}

footer p {
  margin: 0;
  color: #E8E8E8;
  font-size: clamp(11px, 1.8vw, 14px);
  width: 95%;
}

footer small {
  color: #999999;
  font-weight: bold;
  text-transform: uppercase;
  margin: 0;
  padding: 0;
  display: block;
  font-size: clamp(9px, 1.5vw, 12px);
}

/* Set heading styles */
h1, h2, h3, h4, h5, h6 {
  font-family: 'PT Sans Narrow', sans-serif;
  font-weight: bold;
  color: #E8E8E8;
}

h2 {
  font-size: clamp(20px, 4vw, 32px);
  letter-spacing: 1px;
}

h3 {
  font-size: clamp(16px, 3vw, 24px);
}

/* Set link styles */
a {
  color: #B8956A;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.logo-link {
  display: block;
  border: 0;
  text-decoration: none;
}

/* Set audio player styles */
audio {
  width: 100%;
}

/* Now Playing Info Section */
.now-playing-info {
  background-color: transparent;
  border: none;
  border-radius: 0;
  padding: 14px 0 0 0;
  margin: 0;
  opacity: 0.4;
  transition: opacity 0.3s ease-in-out;
}

.now-playing-info.visible {
  opacity: 1;
}

#now-playing-display {
  color: #D4A574;
  font-size: clamp(16px, 4.6vw, 30px);
  font-family: 'PT Sans Narrow', sans-serif;
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0.3px;
  line-height: 1.4;
}

#now-playing-display span {
  color: #ffffff;
}

/* Play/Pause Button Section */
.play-pause-section {
  display: flex;
  justify-content: center;
  margin: 0 0 5px 0;
  width: 100%;
}

.play-pause-section button {
  width: 100%;
  max-width: none;
  height: clamp(45px, 10vw, 65px);
  font-size: clamp(16px, 3vw, 22px);
  margin: 0;
  border-radius: 5px;
  border: none;
  background-color: #3A3A3A;
  color: #E8E8E8;
  font-weight: bold;
  box-shadow: inset 0 2px 4px rgba(212, 165, 116, 0.3), inset 0 -2px 4px rgba(0, 0, 0, 0.5), 0 4px 8px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: all 0.1s ease-in-out;
}

.play-pause-section button:hover {
  background-color: #424242;
  box-shadow: inset 0 2px 5px rgba(212, 165, 116, 0.4), inset 0 -2px 5px rgba(0, 0, 0, 0.6), 0 5px 10px rgba(0, 0, 0, 0.5);
}

.play-pause-section button:active {
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.8), inset 0 -1px 2px rgba(212, 165, 116, 0.2), 0 2px 4px rgba(0, 0, 0, 0.3);
  background-color: #2A2A2A;
  transform: scale(0.98) translateY(1px);
}

/* Format Selection Section - Car Stereo Style */
.format-section {
  margin: 0 0 20px 0;
  width: 100%;
}

.format-buttons {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
  gap: 5px;
}

.format-buttons li {
  width: calc(100% / 5);
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
}

.format-buttons button {
  width: 100%;
  height: clamp(40px, 8vw, 56px);
  padding: 0;
  font-size: clamp(11px, 1.8vw, 16px);
  margin: 0;
  border-radius: 5px;
  border: none;
  background-color: #3A3A3A;
  color: #E8E8E8;
  cursor: pointer;
  box-shadow: inset 0 2px 4px rgba(212, 165, 116, 0.3), inset 0 -2px 4px rgba(0, 0, 0, 0.5), 0 3px 6px rgba(0, 0, 0, 0.3);
  transition: all 0.1s ease-in-out;
}

.format-buttons button.active {
  color: #D4A574;
}

.format-buttons button:hover {
  background-color: #424242;
  box-shadow: inset 0 2px 5px rgba(212, 165, 116, 0.4), inset 0 -2px 5px rgba(0, 0, 0, 0.6), 0 4px 8px rgba(0, 0, 0, 0.4);
}

.format-buttons button:active {
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.8), inset 0 -1px 2px rgba(212, 165, 116, 0.2), 0 2px 4px rgba(0, 0, 0, 0.3);
  background-color: #2A2A2A;
  transform: scale(0.98) translateY(1px);
}

.format-note {
  margin: 8px 0 0 0;
  color: #999999;
  font-size: clamp(10px, 1.6vw, 13px);
}

/* Set list styles */
ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.stream-buttons,
.playlist-buttons {
  list-style: none;
  padding: 0;
  margin: 0 0 30px 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

li {
  width: calc(17% - 10px);
  margin-bottom: 20px;
  text-align: center;
}

.stream-buttons li,
.playlist-buttons li {
  display: flex;
  justify-content: center;
}

/* Direct URLs Section Styles */
.direct-urls,
.playlist-urls {
  background-color: #333333;
  border-left: 4px solid #B8956A;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  display: grid;
  gap: 15px;
}

.url-item {
  display: flex;
  flex-direction: column;
  padding: 12px;
  background-color: #2A2A2A;
  border-radius: 6px;
  transition: background-color 0.3s ease-in-out;
}

.url-item:hover {
  background-color: #3A3A3A;
}

.url-label {
  color: #D4A574;
  font-weight: bold;
  font-size: clamp(12px, 1.5vw, 16px);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.url-link {
  color: #B8956A;
  text-decoration: none;
  font-size: clamp(10px, 1.3vw, 13px);
  word-break: break-all;
  padding: 8px;
  background-color: rgba(212, 165, 116, 0.1);
  border-radius: 4px;
  border: 1px solid rgba(212, 165, 116, 0.2);
  transition: all 0.3s ease-in-out;
  font-family: 'Courier New', monospace;
}

.url-link:hover {
  color: #D4A574;
  background-color: rgba(212, 165, 116, 0.15);
  border-color: rgba(212, 165, 116, 0.4);
  text-decoration: underline;
}

/* Set button styles */
button {
  display: block;
  width: 100%;
  height: clamp(60px, 12vw, 90px);
  margin-bottom: 10px;
  background-color: #3A3A3A;
  color: #E8E8E8;
  font-size: clamp(18px, 3.5vw, 28px);
  font-weight: bold;
  text-align: center;
  border-radius: 8px;
  border: none;
  box-shadow: inset 0 2px 4px rgba(212, 165, 116, 0.25), inset 0 -2px 4px rgba(0, 0, 0, 0.5), 0 5px 12px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

button:hover {
  background-color: #424242;
  box-shadow: inset 0 2px 4px rgba(212, 165, 116, 0.3), inset 0 -2px 4px rgba(0, 0, 0, 0.5), 0 6px 14px rgba(0, 0, 0, 0.6);
}

button:active {
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.8), inset 0 -1px 2px rgba(212, 165, 116, 0.2), 0 2px 4px rgba(0, 0, 0, 0.3);
  transform: translateY(1px);
}

/* Set small text styles */
small {
  font-size: clamp(10px, 1.6vw, 13px);
  color: #B8956A;
}

/* Set responsive styles */
/* Mobile First - Extra Small Devices (< 480px) */
@media (max-width: 480px) {
  .play-pause-section {
    margin: 0 0 5px 0;
  }

  .play-pause-section button {
    width: 100%;
  }

  .format-buttons {
    flex-wrap: nowrap;
    gap: 5px;
  }

  .format-buttons li {
    width: calc(100% / 5);
  }

  header {
    padding: 0;
  }

  .header-content {
    gap: 0;
    flex-direction: column;
  }

  .header-text {
    padding: 8px 12px;
    text-align: center;
  }

  .logo {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  main {
    width: 95%;
    padding: 0 0 120px 0;
  }

  .format-section h3 {
    margin-bottom: 12px;
  }

  li {
    width: 48%;
    margin-bottom: 15px;
  }

  .stream-buttons li,
  .playlist-buttons li {
    width: 48%;
    margin-bottom: 15px;
  }

  button {
    margin-bottom: 8px;
  }

  footer {
    padding: 4px 8px;
    min-height: 0;
    max-height: none;
  }

  ul {
    justify-content: center;
  }

  .stream-buttons,
  .playlist-buttons {
    justify-content: center;
  }

  audio {
    max-width: 100%;
  }

  .direct-urls,
  .playlist-urls {
    padding: 15px;
    gap: 12px;
  }

  .url-item {
    padding: 10px;
  }
}

/* Small Devices (480px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  .play-pause-section {
    margin: 0 0 5px 0;
  }

  .format-buttons {
    flex-wrap: nowrap;
    gap: 5px;
  }

  .format-buttons li {
    width: calc(100% / 5);
  }

  header {
    padding: 0;
  }

  .header-content {
    gap: 0;
    flex-direction: column;
  }

  .header-text {
    padding: 10px 16px;
    text-align: center;
  }

  .logo {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  main {
    width: 90%;
    padding: 0 0 120px 0;
  }

  li {
    width: calc(50% - 10px);
    margin-bottom: 15px;
  }

  .stream-buttons li,
  .playlist-buttons li {
    width: calc(50% - 10px);
    margin-bottom: 15px;
  }

  footer {
    padding: 5px 10px;
    min-height: 0;
    max-height: none;
  }

  ul {
    justify-content: space-around;
  }

  .stream-buttons,
  .playlist-buttons {
    justify-content: space-around;
  }

  .direct-urls,
  .playlist-urls {
    padding: 18px;
    gap: 14px;
  }

  .url-item {
    padding: 11px;
  }
}

/* Medium Devices (768px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  main {
    width: 85%;
    padding: 0 0 90px 0;
  }

  .play-pause-section {
    margin: 0 0 5px 0;
  }

  .format-buttons {
    flex-wrap: nowrap;
    gap: 5px;
  }

  .format-buttons li {
    width: calc(100% / 5);
  }

  header {
    padding: 0;
  }

  .header-text {
    padding: 10px 15px;
  }

  .logo {
    min-width: 280px;
    max-width: 310px;
  }

  .direct-urls,
  .playlist-urls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    padding: 20px;
    gap: 15px;
  }
}

/* Large Devices (1024px and up) */
@media (min-width: 1025px) {
  main {
    width: 66%;
    padding: 0 0 85px 0;
  }

  .play-pause-section {
    margin: 0 0 5px 0;
  }

  .format-buttons {
    flex-wrap: nowrap;
    gap: 5px;
  }

  .format-buttons li {
    width: calc(100% / 5);
  }

  .logo {
    min-width: 320px;
    max-width: 360px;
  }

  .direct-urls,
  .playlist-urls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    padding: 20px;
    gap: 15px;
  }
}

/* Super Large Devices (1440px and up) */
@media (min-width: 1440px) {
  .logo {
    min-width: 360px;
    max-width: 420px;
  }

  #now-playing-display {
    font-size: clamp(22px, 2.2vw, 44px);
  }
}

/* Ultra Large Devices (1920px and up) */
@media (min-width: 1920px) {
  #now-playing-display {
    font-size: clamp(26px, 2.4vw, 52px);
  }
}

/* Emergency fallback for old media query */
@media (max-width: 768px) {
  /* Already covered above */
}
