* {
    /* font-family: Verdana, Arial, Helvetica, sans-serif; */
    --prcolor: #C00318;
}

body {
    font-family: Arial, sans-serif;
    background-color: #222;
    color: white;
    text-align: center;
    padding: 20px;
    margin: 0;
    position: relative;
    overflow: auto; /* Allow scrolling */
    display: flex;
    justify-content: center; /* horizontal */
}

a {
    color: white;
    text-decoration: none;
}

a.button {
    background: rgba(51, 51, 51, 0.4);
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

a.button:hover {
    background: rgba(51, 51, 51, 0.8);
}

.background-blur {
    position: fixed; /* Fix the background */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: 120%;
    background-position: center;
    filter: blur(50px);
    z-index: -1; /* Ensure it stays behind other content */
    opacity: 0.4;
}

.container {
  display: grid;
  /* grid-template-columns:  1fr 1fr 1fr; drei Spalten */
  align-items: flex-start;
  justify-content: center;
  align-content: start;
  min-width: 300px;
  max-width: 100%;
  gap: 20px;
  /* grid-template-columns: repeat(auto-fit, minmax(300px, 0.5fr)); */
  grid-template-areas:
    "headline headline headline"
    "cover player links"
    "download player links"
    "info player links"
    "footer footer footer";
  margin: 0 auto; /* Centering für großen Viewport */
}

/* Zuweisung der Sections */
.headline { grid-area: headline; }
.cover    { grid-area: cover; }
.download { grid-area: download; }
.player   { grid-area: player; }
.links    { grid-area: links; }
.info     { grid-area: info; }
.footer   { grid-area: footer; }


/* Große Screens: 3 Spalten */
@media (min-width: 1600px) {
  .container {
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-areas:
      "headline headline headline"
      "cover player links"
      "download player links"
      "info player links"
      "footer footer footer";
  }
}

/* Mittlere Screens: 2 Spalten */
@media (max-width: 1599px) and (min-width: 1024px) {
  .container {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "headline headline"
      "cover player"
      "download player"
      "info player"
      "links player"
      "footer footer";
  }
}

/* Kleine Screens: 1 Spalte */
@media (max-width: 1023px) {
  .container {
    gap: 20px 0px;
    grid-template-columns: 1fr;
    grid-template-areas:
      "headline"
      "cover"
      "player"
      "links"
      "info"
      "download"
      "footer";
  }
}

/* Wenn .links nicht existiert, 2-Spalten Layout */
.container:not(:has(.links)) {
  /* grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); */
  grid-template-areas:
    "headline headline"
    "cover player"
    "download player"
    "info player"
    "footer footer";
}


/* Workaround für altes layout mit nur einer Section */
.container:only-child > .section,
.container:has(> .section):not(:has(> .section ~ .section)) {
    grid-template-areas:
        "headline"
        "cover"
        "download"
        "player"
        "links"
        "info"
        "footer";
    grid-template-columns: 1fr;
}


.section {
    /* width: 400px; */
    width: 100%;
    max-width: 480px;
    background: rgba(51, 51, 51, 0.4);
    padding: 20px;
    box-sizing: border-box;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
    margin: 0 auto;
}

.cover.section {
    padding: 0;
    margin:0;
    /* width: auto; */
    background: none;
}

.cover img{
    border-radius: 10px;
    display: block;
    max-width: 100%;
    width: 100%;;
    height: auto;
}

.track-info {
    position: relative;
}

.track-title {
    margin: 5px 0;
    font-size: 18px;
}

.artist-row {
    margin-top: 10px;
    position: relative;
}

.info span {
  font-weight: 700;
}

.progress-container {
    width: 100%;
    height: 6px;
    background: #555;
    margin: 10px 0;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    margin: 20px auto 10px;
    box-shadow: 0 0 10px rgba(240, 240, 240, 0.2);
}

.progress-bar {
    width: 0%;
    height: 6px;
    background: rgba(192, 3, 24, 0.7);
    border-radius: 3px;
    transition: width 0.1s linear;
}

.control-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-top: 10px;
    margin-bottom: 20px;
}

.control-row a {
    text-decoration: none;;
}

.info-left {
    position: absolute;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    /* border:#aaa solid 1px; */
    border-radius: 50px;
}

.info-right{
    position: absolute;
    right: 10%;
    transform: rotate(90deg);
}

.download-button {
    width: 40px;
    height: 40px;
}

button {
    /* background: #555; */
    background: none;
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    border-radius: 50%;
    font-size: 16px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px 10px rgb(255 255 255 / 10%);
    /* box-shadow: 0 0 10px rgba(85, 85, 85, 0.2); */
}

button:hover {
    background: #777;
}

.playlist {
    text-align: left;
    margin-top: 10px;
}

.work-container {
    box-shadow: 0 0 10px rgba(240, 240, 240, 0.1);
    border-radius: 10px;
    /* padding: 5px; */
    margin-bottom: 10px;
}

.work-title {
    font-weight: bold;
    margin-bottom: 5px;
    padding-top: 5px;
    padding-left: 45px;
}

.work-composer, .work-arranger {
    font-style: italic;
    margin-bottom: 5px;
    padding-top: 5px;
    padding-left: 45px;
}

.playlist-item {
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0px;
}

.playlist-item:hover {
    background: rgba(85, 85, 85, 0.8);
}

.playlist-item.active {
    outline: 1px solid #fff; /* Use outline instead of border */
}

.not-available {
    opacity: 0.5;
    cursor: not-allowed;
}

.album-title {
    font-size: 24px;
    margin: 10px 0;
}

.album-artist {
    font-size: 18px;
    margin: 10px 0;
}

.player-title {
    font-size: 18px;
    margin: 5px 0;
}

.track-number {
    width: 30px;
    text-align: center;
    font-weight: bold;
    flex-shrink: 0;
}

.track-center {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.track-title {
    flex-grow: 1;
    padding: 0 10px;
}

.track-additional-info {
    font-size: 16px;
    font-style: italic;
    padding: 0 10px;
    display: none;
    opacity: 0;
}

.track-additional-info.show {
    display: block;
    opacity: 1;
}

.track-duration {
    max-width: 50px;
    text-align: right;
    color: #aaa;
}

.time-container {
    display: flex;
    justify-content: space-between;
    margin: auto;
    margin-top: 10px;
}

.streaming-links {
    margin-top: 0;
    margin: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    align-items: start;
    justify-items: center;
    gap: 20px 0px;
}

.streaming-links a {
    text-decoration: none;
    /* color: white; */
}


.format-selector {
    margin: 10px 0 20px 0;
    width: 100%;
    display: flex;
    justify-content: center;
}

.dropdown {
    position: relative;
    width: 200px;
    font-size: 15px;
}

.dropdown-selected {
    padding: 10px;
    background: #222;
    border: 1px solid #444;
    border-radius: 6px;
    cursor: pointer;
    color: #fff;
    text-align: center;
}

.dropdown-options {
    display: none;
    position: absolute;
    width: 100%;
    background: #222;
    border: 1px solid #444;
    border-radius: 6px;
    margin-top: 5px;
    z-index: 50;
}

.dropdown-options .dropdown-option {
    padding: 10px;
    cursor: pointer;
    color: #fff;
}

.dropdown-options .dropdown-option:hover {
    background: #333;
}

.dropdown.open .dropdown-options {
    display: block;
}



footer {
    text-align: center;
    margin-top: 20px;
    padding: 5px;
    box-sizing: border-box;
    color: white;
    width: 100%;
}

footer p {
    margin: 0;
    font-size: 14px;
}

#errorMessage {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
}

/* Media query for mobile devices */
@media only screen and (max-width: 600px) {
    .section {
        width: 100%;
        margin: 0 0;
    }
    /* .section {
        padding: 20px 0;
        border-radius: 10px;
        box-shadow: none;
        background: none;
        width: 90%;
    }
    .container > .section > .cover {
        width: 90%;
        margin: auto;
    }
    .progress-container {
        width: 90%;
        box-shadow: 0 0 10px rgba(85, 85, 85, 0.2);
    }
    .time-container {
        width: 90%;
    }
    body {
        padding: 10px;
        background-color: #333;
    } 

     .container {
        max-width: 90%;
     }*/
}

/* Media query for light mode */
@media (prefers-color-scheme: light) {
    body {
        background-color: #fff;
        color: #000;
    }

    a {
        color: #000;
    }

    a.button {
        background: rgba(240, 240, 240, 0.4);
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    }

    a.button:hover {
        background: rgba(240, 240, 240, 0.8);
    }

    .section {
        background: rgba(240, 240, 240, 0.4);
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    }
    .progress-container {
        background: rgba(204, 204, 204, 0.5);
        box-shadow: 0 0 10px rgba(85, 85, 85, 0.2);
    }
    .progress-bar {
        /* background: #f39c12; */
        background: rgba(192, 3, 24, 0.7);
    }
    .work-container {
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    }
    button {
        background: #ccc;
        color: #000;
    }
    button:hover {
        background: #bbb;
    }
    .playlist-item:hover {
        background: rgba(221, 221, 221, 0.5);
    }
    .playlist-item.active {
        outline: 1px solid #000; /* Use outline instead of border */
    }
    .track-duration {
        color: #555;
    }
    footer {
        color: #000;
    }
}