html {
  font-family: 'Segoe UI', sans-serif;
  background: #f4f7f9;
  color: #333;
  font-size: 15px;
}

body {
  margin: 0;
  padding: 0;
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: start;
}

h1 {
  font-size: 1.6rem;
  line-height: 1em;
  margin: auto;
  text-transform: uppercase;
}

button:not(.clear-input-btn):not(.pagination-button) {
  font-weight: 600;
  font-size: 1.05rem;
  background-color: var(--accent-color);
  color: var(--light-text-color);
  border: none;
  padding: 0 2.5rem;
  border-radius: var(--border-radius);
  transition: background-color 0.2s ease;
  cursor: pointer;
  box-sizing: border-box;
  height: 2.5rem;
  min-height: 2.5rem;
  min-width: 6rem;
}

button:hover:not(.clear-input-btn):not(.pagination-button) {
  background-color: var(--accent-color-hover);

}

.controls {
  position: relative;
  display: grid;
  flex-grow: 1;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1em;
}

.controls input,
.controls select {
  font-size: 1.05rem;
  padding: 0.3rem 2rem 0.3rem 0.5rem;
  height: 2.5rem;
  min-height: 2.5rem;
  border: 1px solid var(--border-color);
  box-sizing: border-box;
  transition: border-color 0.2s ease;
  border-radius: var(--border-radius);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.clear-input-btn {
  position: absolute;
  inset: 6px 6px 6px auto;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0px 4px;
  box-sizing: content-box;
  background-color: transparent;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.clear-input-btn:hover {
  background-color: unset;
}

.clear-input-btn.show {
  display: flex;
}

select~.clear-input-btn {
  inset: 6px 18px 6px auto;
}

.stations-scroll-container {
  background-color: var(--scroll-bg-color);
  flex-grow: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: start;
  transition: all 0.4s ease;
}

.stations-scroll {
  background-color: var(--scroll-bg-color);
  box-shadow: inset 0 4px 10px -4px rgba(0, 0, 0, 0.5);
  flex-grow: 1;
  overflow-y: auto;
}

.stations {
  padding: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25em;
  margin: 0 auto;
  max-width: 1680px;
}

.station {
  display: flex;
  flex-direction: column;
  justify-content: start;
  align-items: stretch;
  gap: 0.8em;
  background: #fff;
  border-radius: 10px;
  padding: 1em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  overflow: hidden;
  box-sizing: border-box;
  transition: all 0.25s ease;
  font-size: 0.9rem;
}

.station .playing-icon {
  display: none;
  width: 1.4em;
  height: 1.4em;
  max-height: 1.4em;
  min-height: 1.4em;
  min-width: 1.4em;
  max-width: 1.4em;
}

.station:hover:not(.active) {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), inset 0 0 0 1px var(--accent-color);
  background-color: var(--accent-color-soft);

}

.station.active {
  box-shadow: inset 0 0 0 3px var(--accent-color);
  background-color: var(--accent-color-hover);
  color: white;
  cursor: default;
}

.station.active .playing-icon {
  display: inline-block;
}

.station.active .station-icon {
  box-shadow: inset 0 0 0 1.5px var(--light-text-color);
  padding: 0.5px;
}

.station .station-info {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 0.5em;
}

.station>div.station-info:first-child {
  margin-bottom: 0.5em;
  min-height: 24px;
}

.station>div.station-info:first-child>div:first-of-type {
  align-items: start;
}

.station .station-info>div {
  display: flex;
  gap: 0.4em;
  flex-direction: row;
  justify-content: start;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.station .station-info>div span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.station h3 {
  margin: 0 !important;
  font-size: 1.18em;
  white-space: nowrap;
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
}

.station-icon {
  background-color: var(--header-bg-color);
  box-shadow: inset 0 0 0 1.5px var(--header-bg-color);
  padding: 0.5px;
  height: 24px;
  max-height: 24px;
  min-height: 24px;
  width: 24px;
  max-width: 24px;
  min-width: 24px;
  overflow: hidden;
  border-radius: 4px;
  float: left;
  margin-right: 0.5em;
  vertical-align: middle;
  object-fit: cover;
}

.info-img {
  width: 1em !important;
  height: 1em !important;
  max-height: 1em !important;
  min-height: 1em !important;
  object-fit: contain;
}

.station.active .info-img {
  filter: invert(1);
}

.station p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: break-all;
  margin: 0;
}

.footer {
  position: relative;
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
  color: var(--light-text-color);
  background-color: var(--header-bg-color);
}

.footer-content {
  display: flex;
  flex-direction: row;
  gap: 1.5em;
  align-items: center;
  justify-content: stretch;
  margin: 0 auto;
  padding: 1em;
  width: 100%;
  max-width: 1680px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#footer-station-icon {
  display: block;
  aspect-ratio: 1 / 1;
  height: 64px;
  max-height: 64px;
  min-height: 64px;
  width: 64px;
  max-width: 64px;
  min-width: 64px;
  border-radius: 8px;
  background-color: #000000;
  object-fit: cover;

  border: 0.5px solid var(--border-color);
  box-sizing: content-box;
}

#footer-station-icon:not([src="icons/app-icon.png"]) {
  cursor: pointer;
}

#footer-station-icon.hidden {
  display: none;
}

.player-metadata {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: start;
  gap: 0.25em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  flex-grow: 1;
}

#nowPlayingSong,
#nowPlayingArtist,
#stationPlaying {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#nowPlayingSong {
  font-weight: 500;
  font-size: 1.1em;
  margin-bottom: -0.3rem;
}

#nowPlayingArtist {
  font-weight: 800;
}

#stationPlaying {
  font-weight: 400;
  font-size: 0.95rem;
}

.footer audio {
  height: 40px;
  max-height: 40px;
  min-height: 40px;
  max-width: 300px;
  min-width: 145px;
  margin: 0;
  /* flex-grow: 1; */
  border: none;
  overflow: hidden;
  box-sizing: content-box;
}

.pagination {
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1em;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  transition: all 0.4s ease;
}

.pagination.enabled {
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.1);
  pointer-events: auto;
  margin-bottom: 0px;
}

.pagination.disabled {
  box-shadow: none;
  pointer-events: none;
  margin-bottom: -40px;
}

.pagination-button {
  border-radius: 0;
  background-color: transparent;
  border: none;
  box-sizing: content-box;
  padding: 0.5em 1em;
  cursor: pointer;
}

.pagination-button img {
  transition: transform 0.15s ease;
}

.pagination-button:hover img {
  transform: scale(1.2, 1.2);
}

.reverse-x {
  transform: rotateY(180deg);
}

.pagination-button:hover img.reverse-x {
  transform: rotateY(180deg) scale(1.2, 1.2);
}

.pagination-button.disabled {
  pointer-events: none;
  opacity: 0.1;
}

.pagination-button:hover {
  background-color: transparent;
}

.player-metadata-group {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: start;
  /* justify-self: stretch; */
  /* flex-grow: 1; */
  flex: 3;
  gap: 1em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-audio-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  justify-self: flex-end;
  flex: 2;
  gap: 1em;
  /* overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap; */
}

.info-btn {
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--text-color);
  background-color: var(--scroll-bg-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  max-width: 40px;
  max-height: 40px;
  min-width: 40px;
  min-height: 40px;
  line-height: 1em;
  font-weight: 600;
  font-style: italic;
  cursor: pointer;
  box-sizing: content-box;
  transition: background-color 0.2s ease;
}

.info-btn:hover {
  background-color: #d7dae6;
}

.info-btn.green {
  color: var(--light-text-color);
  background-color: var(--green-accent)
}

.info-btn.green:hover {
  color: var(--light-text-color);
  background-color: var(--green-accent-hover);
}

.hor-line {
  width: 100%;
  height: 1px;
  background-color: var(--border-color);
  margin: 0;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  z-index: 999;
}

.modal[show] {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-window {
  position: relative;
  width: 50%;
  min-width: 540px;
  max-width: 800px;
  height: auto;
  max-height: 90%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  margin: 0;
  overflow: hidden;
  border-radius: calc(var(--border-radius) * 2);
}

.modal-header,
.modal-footer {
  display: flex;
  flex-direction: row;
  color: var(--light-text-color);
  background-color: var(--header-bg-color);
  padding: 2em;
  gap: 2em;
  align-items: stretch;
  justify-content: stretch;
  max-width: 100%;
}

.modal-header {
  padding: 0;
  gap: 0;
}

.modal-footer {
  align-items: center;
  justify-content: center;
}

.modal-header img {
  overflow: hidden;
  object-fit: cover;
  width: 200px;
  min-width: 200px;
  height: 200px;
  min-height: 200px;
  cursor: pointer;
}

.modal-content {
  display: flex;
  flex-direction: column;
  width: 100%;

  flex: 1;
  overflow-y: auto;
  background-color: var(--scroll-bg-color);
}

.modal-content h5 {
  padding: 2em 0 0.5em 0;
  margin: 0;
  text-align: center;
}

.modal-content p {
  flex: 1;
  overflow-y: auto;
  padding: 1em 4em 2em 4em;
  margin: 0;
  white-space: pre-line;
}

.modal-footer button {
  margin: 0 auto;
}

.modal-header h3 {
  margin: 0 0 0.5em 0;
  font-size: 1.5rem;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-header h4 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 400;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-header p {
  margin: 0;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-header-metadata {
  display: flex;
  flex-direction: column;
  gap: 1em;
  padding: 2.5em 2.5em;
  align-items: stretch;
  justify-content: space-between;
  width: 100%;
  max-width: 100%;
  flex-grow: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#favorites-button {
  background-color: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  width: auto;
  min-width: 0;
  width: 2em;
  height: 2em;
  max-height: 2em;
  min-height: 2em;
  max-width: 2em;
  min-width: 2em;
}

#favorites-button .fav-icon {
  object-fit: contain;
  width: 100%;
  height: 100%;
  color: #a0a0a080;
  transition: color 0.15s ease;
}

#favorites-button:hover .fav-icon {
  color: #a0a0a0d0;
}

#favorites-button.green .fav-icon {
  color: var(--green-accent);
}

#favorites-button.green:hover .fav-icon {
  color: var(--green-accent-hover);
}

.station .fav-icon {
  color: var(--accent-color);
  width: 1em;
  height: 1em;
  max-height: 1em;
  min-height: 1em;
  max-width: 1em;
  min-width: 1em;
  object-fit: contain;
}

.station.active .fav-icon {
  color: white;
}

.copy-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.5em;
  cursor: pointer;
}

#cover-art-modal {
  overflow: hidden;
  touch-action: none;
}

#cover-art-image {
  cursor: grab;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: none;
  user-select: none;
  will-change: transform;
  touch-action: none;
  background-color: #000000;
}

.info-btn.close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-weight: 800;
  font-style: normal;
}



@media screen and (max-width: 1366px) {
  .footer audio {
    max-width: 20svw;
  }

  .modal-window {
    width: 80vw;
    min-width: unset;
    max-width: 720px;
    height: auto;
    max-height: 90%;
  }

  .modal-footer {
    padding: 1rem;
    gap: 1rem;
  }

  .modal-header {
    padding: 0;
    gap: 0;
  }

  .modal-header h3 {
    font-size: 1.2rem;
    margin: 0;
  }

  .modal-header h4 {
    font-size: 1.1rem;
    margin: 0;
  }

  .modal-header-metadata {
    gap: 0;
    padding: 1rem 2rem 1rem 1rem;
  }

  .modal-header img {
    width: 8em;
    min-width: 8em;
    max-width: 8em;
    height: 8em;
    min-height: 8em;
    max-height: 8em;
  }

  .modal-content p {
    padding: 0.5em 2em 1em 2em;
  }

  .modal-content h5 {
    padding: 1em 0 0.25em 0;
  }
}

@media screen and (max-width: 991px) and (orientation: landscape) {
  .controls {
    /* flex-direction: column; */
    /* flex-wrap: nowrap; */
    grid-template-columns: 1fr 1fr;
    margin: 0;
    padding: 0;
    gap: 0.5em;
    /* justify-content: start; */
    max-width: none;
  }

  .stations-scroll-container {
    overflow: hidden;
    overflow-y: auto;
  }

  .stations-scroll {
    padding: 0;
    flex-grow: unset;
    overflow-y: unset;
  }

  .controls input,
  .controls select {
    min-height: 2.4em;
    max-height: 2.4em;
    max-width: 100%;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stations {
    padding: 0.5em;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5em;
    margin: 0;
    max-width: unset;
  }

  .footer-content {
    gap: 0.5em;
    margin: 0;
    padding: 0.5em;
    max-width: none;
  }

  .footer audio {
    max-width: 18svw;
  }

  .player-metadata-group {
    gap: .5em
  }

  .player-audio-group {
    gap: 0.5em;
  }

}

/* PHONE */
@media screen and (max-width: 539px) {

  html {
    font-size: 3.6vw;
  }

  body {
    height: 100svh;
    min-height: 100svh;
    max-height: 100svh;
  }

  h1 {
    font-size: 1.2rem;
    margin: 0;
  }

  .controls {
    /* flex-direction: column; */
    /* flex-wrap: nowrap; */
    grid-template-columns: 1fr 1fr;
    margin: 0;
    padding: 0;
    gap: 0.5em;
    /* justify-content: start; */
    max-width: none;
  }

  #search-button {
    margin: 0;
    width: 100%;
    padding: 0;
    max-height: 2.4em;
    height: 2.4em;
  }

  .controls input,
  .controls select {
    /* width: 100%;
    min-width: calc((100dvw - 1.5em) / 2); */
    min-height: 0;
    max-height: 2.4em;
    max-width: 100%;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .stations {
    padding: 0;
    grid-template-columns: repeat(auto-fill, minmax(calc((100dvw - 1.5em) / 2), 1fr));
    gap: 0;
    margin: 0;
    max-width: unset;
  }

  .stations-scroll-container {
    overflow: hidden;
    overflow-y: auto;
  }

  .stations-scroll {
    padding: 0;
    flex-grow: unset;
    overflow-y: unset;
    box-shadow: none;
  }

  .station {
    padding: 0.75em;
    gap: 0.5em;
    box-shadow: inset 0 0 0 0.75px var(--border-color);
    border-radius: 0;
    font-size: 0.85rem;
  }

  .station:hover {
    box-shadow: none;
    background-color: #fff;
  }

  .station.active {
    box-shadow: inset 0 0 0 1.5px var(--accent-color);
    background-color: var(--accent-color-hover);
  }

  .station .playing-icon {
    width: 0.85em;
    height: 0.85em;
    max-height: 0.85em;
    min-height: 0.85em;
    min-width: 0.85em;
    max-width: 0.85em;
  }

  .station-icon {
    height: 1.5em;
    max-height: 1.5em;
    min-height: 1.5em;
    width: 1.5em;
    max-width: 1.5em;
    min-width: 1.5em;
    border-radius: 3px;
    margin-right: 0.3em;
  }

  .station h3 {
    font-size: 1.05em;
  }

  .station .station-info {
    gap: 0.3em;
  }

  .station>div.station-info:first-child {
    margin-bottom: 0.2em;
    min-height: 1.5em;
  }

  .pagination {
    overflow: hidden;
    font-size: 0.9rem;
    gap: 1em;
    height: 3em;
    min-height: 3em;
    max-height: 3em;
    border-top: 1px solid var(--border-color);
  }

  .pagination.enabled {
    margin-bottom: 0em;
  }

  .pagination.disabled {
    margin-bottom: -3em;
  }

  .footer-content {
    gap: 1em;
    margin: 0;
    padding: 1em;
    max-width: none;
    flex-direction: column;
  }

  #footer-station-icon {
    height: 4em;
    max-height: 4em;
    min-height: 4em;
    width: 4em;
    max-width: 4em;
    min-width: 4em;
    border-radius: 0.4em;
  }

  .player-metadata {
    gap: 0;
  }

  #nowPlayingSong,
  #nowPlayingArtist,
  #stationPlaying {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }

  #nowPlayingSong {
    font-weight: 500;
    font-size: 1.1rem;
    margin-bottom: -0.4em;
  }

  #nowPlayingArtist {
    font-weight: 800;
    font-size: 1rem;
  }

  #stationPlaying {
    font-weight: 400;
    font-size: 0.9rem;
  }

  .footer audio {
    max-height: 1.5em;
    width: 100%;
    max-width: 100%;
  }

  .player-metadata-group {
    width: 100%;
    flex-grow: 1;
    gap: .75em
  }

  .player-audio-group {
    justify-content: stretch;
    gap: 1em;
    width: 100%;
  }

  .info-btn {
    width: 2em;
    height: 2em;
    max-height: 2em;
    min-height: 2em;
    max-width: 2em;
    min-width: 2em;
  }

  .copy-btn {
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.4rem;
  }

  .modal-window {
    width: 91.11vw;
    min-width: unset;
    max-width: unset;
    height: auto;
    max-height: 90%;
  }

  /*TAILWIND STYLE MOBILE CLASSES*/
  .flex-row.mobile-column {
    flex-direction: column;
  }

  .gap-1em {
    gap: 0.5em;
  }
}