* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-dark: #340043;
    --color-light: #FF19E7;
    --color-third: #17E1BC;
    --color-green: #5E9148;
    --color-red: #9A1010;
    --color-grey: #887A7A;
    --color-yellow: #F2F68B;
    --color-pink: #D376D5;
    --color-lila: #8D6DFF;
    --color-background-grey: #CCBFD0;
    --color-dark-grey: #242424;
    --gap: 24px;
    --border-radius: 16px;
    --dur-move: 400ms;
    --dur-scale: 400ms;
    --ease: cubic-bezier(.25, .8, .25, 1);
}


body {
    font-family: 'League Gothic';
    background-color: var(--color-dark);
    background-image: url(../images/musicnotes.png);
    background-size: contain;
    background-repeat: repeat;
}

.third {
    color: var(--color-third);
}

.light {
    color: var(--color-light);
}

.dark {
    color: var(--color-dark);
}

.topNumber {
    font-family: 'Micro 5';
    font-size: 80px;
    color: var(--color-third);
    margin: 0;
    line-height: 0.7;
    list-style-position: inside;
}

header {
    position: sticky;
    top: 0;
    margin-top: 0px;
    z-index: 100;
    padding: 20px;
    background-color: #350043ee;
}

header a {
    text-decoration: none;
}

.logo {
    font-family: 'Lily Script One';
    font-size: 50px;
    color: var(--color-light);
    text-shadow:
        0 0 3px #ff19e881,
        0 0 6px #ff19e877,
        0 0 12px #ff19e876,
        0 0 15px rgba(255, 25, 231, 0.2),
        0 0 25px rgba(255, 25, 231, 0.1);
    animation: flicker 3s infinite;
}

.logo:hover {
    font-family: 'Lily Script One';
    font-size: 50px;
    color: var(--color-third);
    text-shadow:
        0 0 3px var(--color-third),
        0 0 6px var(--color-third),
        0 0 12px var(--color-third),
        0 0 15px rgba(255, 25, 231, 0.2),
        0 0 25px rgba(255, 25, 231, 0.1);
    animation: flicker 3s infinite;
}

#top5LastWeek {
    color: var(--color-light);
    padding: 20px;
}

.genre1 {
    font-family: 'League Gothic';
    letter-spacing: 1px;
    font-size: 35px;
}

#genresByWeather {
    background-color: var(--color-third);
    color: var(--color-light);
    padding: 20px;
}

#genreDevelopment {
    background-color: var(--color-background-grey);
    color: var(--color-light);
    padding: 20px;
}

footer {
    color: var(--color-light);
    text-align: center;
    padding: 20px;
    width: 100%;
    background-image: url(../images/audiowave_h.png);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: bottom;
    overflow: hidden;
}

footer h4 {
    margin: 5px 0;
}

h2 {
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.text {
    margin-bottom: 15px;
}

.button {
    font-family: 'League Gothic';
    font-size: 20px;
    color: var(--color-light);
    background-color: var(--color-dark);
    text-decoration: none;
    border: none;
    border-radius: 5px;
    padding: 5px 15px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: inline-block;
}

.detailinfo section {
    padding: 20px;
}

.info_header {
    color: var(--color-light);
}

#info_methodik {
    background-color: var(--color-light);
    color: var(--color-dark);
}

#info_weatherLastWeek {
    background-color: var(--color-dark);
    color: var(--color-third);
}

#info_GenresByWeather {
    background-color: var(--color-third);
    color: var(--color-dark);
}

#info_GenreDevelopment {
    background-color: var(--color-background-grey);
    color: var(--color-dark);
}

/* Animation für flackerndes Neonlicht */
@keyframes flicker {

    0%,
    18%,
    22%,
    25%,
    53%,
    57%,
    100% {
        opacity: 1;
        text-shadow:
            0 0 3px #ff19e881,
            0 0 6px #ff19e877,
            0 0 12px #ff19e876,
            0 0 25px rgba(255, 25, 231, 0.2),
            0 0 40px rgba(255, 25, 231, 0.1);
    }

    20%,
    24%,
    55% {
        opacity: 0.85;
        text-shadow:
            0 0 2px rgba(255, 25, 231, 0.4),
            0 0 5px rgba(255, 25, 231, 0.3);
    }
}

/* Der Wrapper füllt die volle Höhe der rechten Spalte und teilt sie 1/1 */
.sidewrap {
    display: grid;
    grid-template-rows: 1fr 1fr;
    /* halb/halb */
    gap: var(--gap);
    align-self: stretch;
    /* füllt die Höhe der einzigen Page-Reihe */
    min-height: 0;
}

.sidepanel__close {
    display: none;
}

/* Rechte Spalte: standardmässig schmal, nur Titel sichtbar */
.sidepanel {
    padding: .25rem 0;
    display: flex;
    align-items: stretch;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.sidepanel h2 {
    margin: 0;
}

.sidepanel__content {
    max-height: 0;
    overflow: clip;
    transition: max-height .35s ease;
}

.detailinfo {
    display: none;
}

.chart-tooltip {
    position: absolute;
    display: flex;
    flex-direction: column;
    text-align: center;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 9999;
    color: var(--color-dark);
}

.chart-tooltip .weather-data {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-tooltip .date {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
}

.chart-tooltip img {
    width: 35px;
    height: 35px;
    margin: 4px 0;
}

.chart-tooltip .temps {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    flex-direction: column;
}

.chart-tooltip .temps .max {
    color: #FFFFFF;
}

.chart-tooltip .temps .min {
    color: var(--color-dark-grey);
}

#weatherLastWeek {
    display: flex;
    justify-content: space-between;
    max-width: 420px;
    margin-bottom: 10px;
}

.weatherDay {
    display: flex;
    justify-content: center;
    align-items: center;
}

.weatherIcon {
    position: relative;
    width: 40px;
    height: 40px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dayLabel {
    position: absolute;
    font-size: 16px;
    color: white;
    text-align: center;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
}

.links {
    float: left;
}

.rechts {
    float: right;
}

.weather-nav {
    display: flex;
    gap: 20px;
    overflow: visible;
    height: 80px;
    margin-bottom: 10px;
}

.weather-btn {
    width: 50px;
    display: flex;
    justify-content: start;
    align-items: center;
    cursor: pointer;
    overflow: visible;
}

.weather-btn img {
    transition: 0.2s ease;
    width: 100%;
    height: auto;
    overflow: visible;
}

.weather-btn:hover img {
    filter: drop-shadow(0 0 5px var(--color-light));
}

.weather-btn.active img {
    filter: drop-shadow(0 0 10px var(--color-light));
}

.wrap {
    all: unset;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.main-box,
.side-box {
    position: static;
    width: 100%;
    transition: none;
    cursor: default;
}

.main-box {
    z-index: 1;
    background-color: var(--color-light);
    color: var(--color-dark);
    padding: 20px;
    height: 20%;
}

.side-box {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 3;
    overflow: hidden;
    height: 100%;
}

.side-box__text {
    opacity: 1;
    transition: opacity 250ms ease;
    text-align: center;
    padding: 16px;
    user-select: none;
}

/* Positionierung & Rotation */
.side-box__label.vertical {
    display: none;
}

.side-box.top {
    background: var(--color-third);
    top: 0;
}

.side-box.bottom {
    background: var(--color-background-grey);
    bottom: 0;
}

.info_section {
    padding: 20px;
}

/* Desktop: Detailinfos sichtbar, zweispaltig wie im Screen */
@media (min-width: 992px) {

    :root {
        --gap: 1.2rem;
    }

    .page {
        display: grid;
        gap: var(--gap);
        grid-template-columns: 1.5fr 2.2fr;
        grid-template-areas: "left middle right";
        grid-template-rows: auto;
        align-items: stretch;
        transition: grid-template-columns .35s ease;
        padding: 50px;
        height: 100%;
        overflow: hidden;
        align-items: stretch;
    }

    /* Wenn ein Panel geöffnet wird: Mitte verschwindet, rechte Spalte wird breit */
    .page.--expand {
        grid-template-columns: 1.5fr 0fr 2.4fr;
    }

    .page.--expand #info {
        display: none;
    }

    .page.--expand #weatherAndGenres {
        grid-column: 2 / 4;
    }

    /* Die nicht aktive Kachel im Expand-Zustand ausblenden */
    .page.--expand .sidewrap>.sidepanel:not(.--open) {
        display: none;
    }

    .detailinfo {
        display: block;
        column-count: 2;
        column-gap: calc(var(--gap) * 1.5);
        margin-top: 1rem;
    }

    .detailinfo section {
        break-inside: avoid;
        background: transparent !important;
        padding: 0;
    }

    #info_methodik {
        break-inside: auto;
    }

    .detailinfo section h2 {
        color: var(--color-third);
    }

    p {
        color: var(--color-dark);
        line-height: 1.1;
    }

    html,
    body {
        height: 100%;
    }

    body {
        min-height: 100vh;
        display: grid;
        grid-template-rows: 10vh 80vh 10vh;
    }

    .info_header {
        color: var(--color-third);
    }

    #weatherAndGenres {
        grid-area: right;
    }

    #top5LastWeek {
        grid-area: left;
    }

    header {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        background-color: transparent;
        height: 10%;
    }

    footer {
        padding-bottom: 35px;
    }

    .logo {
        font-size: 35px;
        margin: 0 auto;
        text-align: center;
        padding-top: 50px;
    }

    .logo:hover {
        font-size: 35px;
        color: var(--color-third);
        text-shadow:
            0 0 3px var(--color-third),
            0 0 6px var(--color-third),
            0 0 12px var(--color-third),
            0 0 15px rgba(25, 228, 255, 0.2),
            0 0 25px rgba(25, 205, 255, 0.1);
        animation: flicker 3s infinite;
    }

    /* rechter Wrapper soll die volle Main-Höhe nutzen und halb/halb teilen */
    #weatherAndGenres.sidewrap {
        height: 100%;
        grid-template-rows: 1fr 1fr;
        /* halb / halb */
        min-height: 0;
        /* kein Aufblasen */
    }

    /* Hauptbox */
    .main-box {
        position: absolute;
        left: 0;
        top: 0;
        border-radius: var(--border-radius);
        height: 100%;
        width: 87%;
    }

    .button {
        display: none;
    }

    .side-box {
        position: absolute;
        left: calc(87% + var(--gap));
        width: 80px;
        height: 49%;
        border-radius: var(--border-radius);
        cursor: pointer;
        transition:
            left var(--dur-move) var(--ease),
            width var(--dur-move) var(--ease),
            height var(--dur-scale) var(--ease),
            border-radius var(--dur-scale) var(--ease);
    }

    .sidepanel__trigger {
        inline-size: 100%;
        block-size: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        writing-mode: vertical-rl;
        transform: rotate(180deg);
        background: none;
        border: 0;
        color: inherit;
        font: inherit;
        cursor: pointer;
        padding: 0;
    }

    /* Panels dürfen schrumpfen und scrollen intern bei Bedarf */
    .sidepanel {
        min-height: 0;
    }

    .sidepanel__content {
        overflow: auto;
    }

    .side-box__text {
        opacity: 0;
    }

    /* Vertikaler Titel (sichtbar, wenn geschlossen) */
    .side-box__label {
        position: absolute;
        transition: opacity 300ms ease;
        transform-origin: center;
        white-space: nowrap;
        user-select: none;
    }

    /* Animation Desktop */
    .side-box.open.move {
        left: 0;
        width: 87%;
    }

    .side-box.open.expand-top,
    .side-box.open.expand-bottom {
        height: 100%;
        border-radius: var(--border-radius);
    }

    .side-box.open .side-box__label {
        opacity: 0;
    }

    /* Positionierung & Rotation */
    .side-box__label.vertical {
        /* innerhalb der side-box zentrieren */
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        writing-mode: vertical-rl;
        transform: rotate(180deg);
        pointer-events: none;
        /* Klicks gehen an die Box, nicht den Text */
    }

    .side-box.show-text .side-box__text {
        opacity: 1;
    }

    .side-box:not(.open) .side-box__label,
    .side-box:not(.open) .side-box__text {
        pointer-events: none;
    }

    /* Close-Button oben rechts – nur bei geöffnetem Panel sichtbar */
    .sidepanel__close {
        display: block;
        position: absolute;
        top: .75rem;
        right: .75rem;
        background: none;
        border: 0;
        font-size: 4rem;
        line-height: 1;
        cursor: pointer;
        color: var(--color-light);
        opacity: 0.9;
        transition:
            transform 0.2s ease,
            filter 0.2s ease,
            opacity 0.2s ease;
    }

    .sidepanel__close:hover {
        opacity: 1;
        transform: scale(1.1);
        filter: drop-shadow(0 0 6px var(--color-light)) drop-shadow(0 0 12px rgba(255, 25, 231, 0.6));
    }

    .sidepanel.--open {
        padding-top: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
    }

    .sidepanel.--open h2 {
        position: sticky;
        top: 0;
        z-index: 2;
        margin: 0;
        padding: .5rem 2rem .75rem .25rem;
        background: inherit;
    }


    .sidepanel.--open .sidepanel__trigger {
        position: static;
        display: inline-flex;
        block-size: auto !important;
        align-items: center;
        justify-content: flex-start;
        writing-mode: horizontal-tb;
        transform: none;
        padding: 0;
    }

    .sidepanel.--open .sidepanel__content {
        flex: 1 1 auto;
        min-height: 0;
        overflow: auto;
        max-height: none;
    }

    .wrap {
        position: relative;
    }
}

@media (min-width: 1750px) {
    .weatherIcon {
        width: 60px;
        height: 60px;
        margin-right: 10px;
    }

    .weather-btn {
        width: 60px;
    }

    .dayLabel {
        font-size: 19px;
    }

    h1,
    .logo {
        font-size: 75px;
        padding-top: 100px;
    }

    h2 {
        font-size: 42px;
    }

    h3 {
        font-size: 30px;
    }

    h4 {
        font-size: 20px;
    }

    p {
        font-size: 19px;
    }
}

/*Für grosse Displays*/
@media (min-width: 2500px) {

    h1,
    .logo {
        font-size: 100px;
        padding-top: 150px;
    }

    h2 {
        font-size: 60px;
    }

    h3,
    .genre1 {
        font-size: 42px;
    }

    h4,
    .dayLabel {
        font-size: 32px
    }

    p {
        font-size: 22px
    }

    footer {
        font-size: 22px;
    }

    .weatherIcon {
        width: 80px;
        height: 80px;
        margin-right: 15px;
    }

    .weather-btn {
        width: 80px;
    }
}