/* ---------------------------------------------------------
   SunshineWave Player – Sunrise Gradient Edition
   Split layout: Player / Lyrics / Listlyrics
   Keeps original behavior and original visual style
   --------------------------------------------------------- */

:root {
    --sw-bg-1: #FFB86C;
    --sw-bg-2: #FF6E7F;
    --sw-bg-3: #FF3CAC;

    --sw-text: #ffffff;
    --sw-text-dim: rgba(255,255,255,0.75);

    --sw-border: rgba(255,255,255,0.25);
    --sw-panel: rgba(255,255,255,0.15);

    --sw-radius: 14px;
    --sw-shadow: 0 4px 18px rgba(0,0,0,0.25);
}

/* Outer split layout */
#swp-layout {
    width: 100%;
    max-width: 1760px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 520px 420px 420px;
    gap: 18px;
    /* MODIFICARE 1: Schimbat din start in stretch pentru ca listele sa urmeze inaltimea versurilor */
    align-items: stretch; 
    box-sizing: border-box;
}

/* Container general */
#swp-player {
    width: 100%;
    padding: 20px;
    border-radius: var(--sw-radius);
    background: linear-gradient(135deg, var(--sw-bg-1), var(--sw-bg-2), var(--sw-bg-3));
    color: var(--sw-text);
    font-family: "Poppins", "Inter", sans-serif;
    box-shadow: var(--sw-shadow);
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-sizing: border-box;
    /* MODIFICARE 2: Adaugat align-self: start ca playerul sa ramana compact sus, nu sa se lungeasca */
    align-self: start; 
}

/* Hide audio element visually */
#swp-audio {
    display: none;
}

/* ------------------------------
   BUTOANELE ORIGINALE
   ------------------------------ */

#swp-top {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    flex-wrap: wrap;
}

#swp-top select,
#swp-top button {
    flex: 1;
    padding: 10px 12px;
    border-radius: var(--sw-radius);
    border: 1px solid var(--sw-border);
    background: var(--sw-panel);
    color: var(--sw-text);
    cursor: pointer;
    font-size: 0.95rem;
    transition: 0.15s ease;
    box-sizing: border-box;
}

#swp-top button:hover,
#swp-top select:hover {
    background: rgba(255,255,255,0.25);
}

/* Now playing */
#swp-nowplaying {
    text-align: left;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--sw-text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

#swp-nowplaying-text {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

/* Container pentru butoanele din dreapta */
#swp-controls {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    align-items: center;
}

/* Butoane Back / Stop / Next */
.swp-ctrl-btn,
#swp-shuffle {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--sw-border);
    background: rgba(255,255,255,0.25);
    color: var(--sw-text);
    cursor: pointer;
    font-size: 1rem;
    transition: 0.15s ease;
    box-sizing: border-box;
}

.swp-ctrl-btn:hover,
#swp-shuffle:hover {
    background: rgba(255,255,255,0.4);
}

/* Cover */
#swp-cover {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: var(--sw-radius);
    object-fit: cover;
    background: rgba(255,255,255,0.1);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.25);
}

/* Hide empty cover */
#swp-cover[src=""],
#swp-cover:not([src]) {
    display: none;
}

/* ------------------------------
   LYRICS PANEL
   Show only when lyrics has content
   ------------------------------ */

#swp-lyrics-panel {

grid-column: 2;
    /* Eliminăm align-self: start; (dacă îl pusesei anterior) ca să lăsăm 
       grid-ul să calculeze înălțimea rândului după acest panou */
    align-self: stretch; 
    height: auto;

    display: none;
    width: 100%;
    /*   min-height: 640px; */
 /*    align-self: start; ACEASTA ESTE CHEIA */
    /* MODIFICARE 3: Scoatere max-height si overflow:hidden pentru a fi extensibil */
    border-radius: var(--sw-radius);
    background: linear-gradient(135deg, var(--sw-bg-1), var(--sw-bg-2), var(--sw-bg-3));
    box-shadow: var(--sw-shadow);
    box-sizing: border-box;
}

#swp-lyrics-panel:has(#swp-lyrics:not(:empty)) {
    display: block;
}

/* Lyrics */
#swp-lyrics {
    width: 100%;
 /*   min-height: 640px; */
    /* MODIFICARE 4: Scoatere max-height si overflow-y:auto ca sa intre tot continutul fara scroll propriu */
    white-space: pre-line;
    padding: 18px;
    background: var(--sw-panel);
    border-radius: 0;
color: #ffffff !important;
font-family: "Poppins", "Inter", sans-serif;
    font-weight: 400;
    font-size: 2rem;
    line-height: 1.6;
    text-align: center;
    backdrop-filter: blur(4px);
    box-sizing: border-box;
}

#swp-lyrics::-webkit-scrollbar {
    width: 6px;
}
#swp-lyrics::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.35);
    border-radius: 3px;
}

/* Hide empty lyrics */
#swp-lyrics:empty,
#swp-lyrics:not(:has(*)):not(:has(text)) {
    display: none;
}

/* ------------------------------
   LIST PANEL
   Show only when On Demand or My List is visible
   ------------------------------ */

#swp-list-panel {

grid-column: 3;
    background: var(--sw-gradient);
    border-radius: var(--sw-radius);
    /* TRUCUL: Îi spunem să nu împingă înălțimea (height: 0), 
       dar să se întindă până la 100% din cât sunt versurile de înalte */
    height: 0;
    min-height: 640px;
display: none;
    flex-direction: column;

    /*    display: none;
*    width: 100%;
*  MODIFICARE 5: Inlocuit max-height:78vh cu inaltime completa pentru stretch */
    border-radius: var(--sw-radius);
    background: linear-gradient(135deg, var(--sw-bg-1), var(--sw-bg-2), var(--sw-bg-3));
    box-shadow: var(--sw-shadow);
    overflow: hidden;
    box-sizing: border-box;
}

#swp-list-panel:has(#swp-ondemand-panel:not(.swp-hidden)),
#swp-list-panel:has(#swp-playlist-panel:not(.swp-hidden)) {
    display: block;
}

/* Panels */
.swp-hidden {
    display: none !important;
}

#swp-ondemand-panel,
#swp-playlist-panel {
    width: 100%;
    /* MODIFICARE 6: Scoatere max-height si adaugare height:100% pentru scroll intern functional */
    height: 100%;
    background: var(--sw-panel);
    padding: 14px;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
    box-sizing: border-box;
}

/* Search */
#swp-search {
    width: 100%;
    padding: 10px;
    border-radius: var(--sw-radius);
    border: 2px solid var(--sw-border);
    background: rgba(255,255,255,0.2);
    color: var(--sw-text);
    font-size: 2rem;
    font-family: "Poppins", "Inter", sans-serif;
    box-sizing: border-box;
}

#swp-search::placeholder {
    color: var(--sw-text-dim);
}

/* Scroll area */
#swp-results,
#swp-playlist {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-right: 4px;
}

#swp-results::-webkit-scrollbar,
#swp-playlist::-webkit-scrollbar {
    width: 6px;
}

#swp-results::-webkit-scrollbar-thumb,
#swp-playlist::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.35);
    border-radius: 3px;
}

/* Original-style rows */
#swp-results > div,
#swp-playlist > div {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(255,255,255,0.15);
    border-radius: var(--sw-radius);
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    box-sizing: border-box;
}

#swp-results > div:last-child,
#swp-playlist > div:last-child {
    margin-bottom: 0;
}

#swp-results .swp-song-title,
#swp-playlist .swp-song-title {
    flex: 1;
    min-width: 0;
    word-break: break-word;
    font-size: 2rem;
    font-weight: 400;
    color: var(--sw-text);
    font-family: "Poppins", "Inter", sans-serif;
    line-height: 1.45;
}


#swp-results button,
#swp-playlist button {
    padding: 6px 10px;
    border-radius: var(--sw-radius);
    border: 1px solid var(--sw-border);
    background: rgba(255,255,255,0.25);
    color: var(--sw-text);
    cursor: pointer;
    transition: 0.15s ease;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: "Poppins", "Inter", sans-serif;
    flex-shrink: 0;
    box-sizing: border-box;
}

#swp-results button:hover,
#swp-playlist button:hover {
    background: rgba(255,255,255,0.4);
}

/* Responsive */
@media (max-width: 1400px) {
    #swp-layout {
        grid-template-columns: 1fr;
        max-width: 760px;
    }

    #swp-player,
    #swp-lyrics-panel,
    #swp-list-panel {
        min-height: auto;
        max-height: none;
        height: auto;
    }

    #swp-lyrics,
    #swp-ondemand-panel,
    #swp-playlist-panel {
        min-height: auto;
        max-height: none;
        height: auto;
    }

    #swp-results,
    #swp-playlist {
        max-height: 420px;
    }
}

@media (max-width: 480px) {
    #swp-player {
        padding: 16px;
    }

    #swp-nowplaying {
        font-size: 1rem;
        flex-direction: column;
        align-items: flex-start;
    }

    #swp-top button,
    #swp-top select {
        font-size: 0.85rem;
        padding: 8px;
    }

/* 1. Forțează culoarea pe container și pe orice element din interiorul lui */
#swp-lyrics, 
#swp-lyrics * {
    color: #ffffff !important; /* Aici poți schimba culoarea (ex: gold, #ccc, etc.) */
    line-height: 1.6;
    font-family: "Poppins", "Inter", sans-serif;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important; /* Umbră ca să se vadă albul pe fundal portocaliu */
}

/* 2. Asigură-te că opacitatea este maximă */
#swp-lyrics {
    opacity: 1 !important;
}

    #swp-controls {
        flex-wrap: wrap;
    }
}