/* --- MODAL SPECIFIK CSS FÖR SKAPA EGEN SPELLISTA --- */

.modalPlaylist-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.80);
    z-index: 20000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 10px 10px;
    overflow-y: auto;
    box-sizing: border-box;
}

.modalPlaylist-content.container {
    position: relative;
    margin: 20px auto;
    width: 100%;
    max-width: 650px;
    animation: modalPlaylistFadeIn 0.3s ease-out;
    box-sizing: border-box;
    border: 1px solid #333;
    padding: 20px 40px 20px 20px;
    background-color: rgba(20, 20, 20, 0.95);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.modalPlaylist-close-x {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}
.modalPlaylist-close-x:hover {
    color: #fff;
}

@keyframes modalPlaylistFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modalPlaylist-content h1 {
    font-family: Arial, sans-serif;
    font-size: 1.2rem; 
    font-weight: normal;
    color: #ed0606;
    text-align: center;
    margin-top: 5px;
}

.modalPlaylist-content p {
    font-family: Arial, sans-serif;
    font-size: 1.0rem;
    color: #fff;
    text-align: center;
    margin-bottom: 15px;
}

.modalPlaylist-action-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.modalPlaylist-btn {
    padding: 10px 20px;
    font-size: 0.9rem; 
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: normal;
    transition: background 0.2s, opacity 0.2s;
    text-transform: uppercase;
}

.modalPlaylist-btn-save { 
    background-color: #2230ef; 
    color: #fff; 
    min-width: 100px;
    min-height: 50px;
}
.modalPlaylist-btn-save:hover { background-color: #4753f1; }

.modalPlaylist-btn-play { background-color: #149214; 
    color: #fff; 
    min-width: 100px;
    min-height: 50px;
}
.modalPlaylist-btn-play:hover { background-color: #2caa2c; }

.modalPlaylist-playback-status {
    background: #4a1554;
    /* border-left: 30px solid #9a1cb3; */
    border: 1px solid #9a1cb3;
    padding-top: 5px;
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    text-align: center;
    transition: opacity 0.3s ease, filter 0.3s ease;
}

/* 8) REGEL FÖR ATT DIMMA UT SPELAREN NÄR MAN VISAR ALLA LÅTAR */
.disabled-panel {
    opacity: 0.55 !important;
    filter: grayscale(30%);
    pointer-events: none !important; /* Gör kontrollerna helt o-klickbara */
}

.modalPlaylist-player-controls {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.modalPlaylist-btn-ctrl {
    /* background-color #9a1cb3; */
    background-color:#F57C00; 
    color: #fff;
    font-size: 1.4rem; 
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    min-width: 70px;
    min-height: 50px;
    text-align: center;
    margin: 10px;
}
.modalPlaylist-btn-ctrl:hover { 
    /* background-color: #850b9e; */
    background-color:#F57C00; 
}

.modalPlaylist-song-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* REGLER FÖR ELEMENT INUTI RADEN */
.modalPlaylist-song-item {
    display: flex;
    align-items: center;
    background: #252525; 
    border: 1px solid #3a3a3a;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 4px;
    box-sizing: border-box;
    
    /* Stäng av textmarkering så det inte krockar med dragmomentet */
    user-select: none !important;
    -webkit-user-select: none !important;
    touch-action: none !important;
}

/* 4) Gör raden visuellt indikerad som gripbar i spellisteläget */
.modalPlaylist-playing-mode .modalPlaylist-song-item {
    cursor: grab !important;
}
.modalPlaylist-playing-mode .modalPlaylist-song-item:active { 
    cursor: grabbing !important; 
}

/* Visuell effekt under pågående flytt */
.modalPlaylist-song-item.dragging { 
    opacity: 0.3 !important; 
    background: #e21a1a !important; 
    border: 2px dashed #ff0000 !important;
}

.modalPlaylist-song-item input[type="checkbox"] {
    margin-right: 15px;
    transform: scale(1.3);
    cursor: pointer;
}

/* 3) GÖM SONGID MEN BEHÅLL I DOM:EN */
.modalPlaylist-song-id {
    display: none !important;
}

.modalPlaylist-song-item span {
    pointer-events: none; /* Låter pointerevents passera igenom till LI-raden för stabilare drag */
}

.modalPlaylist-song-title { 
    font-weight: normal; 
    color: #eee; 
    font-size: 0.9rem; 
    flex-grow: 1; 
    word-break: break-word;
}

.modalPlaylist-song-style { 
    font-weight: normal; 
    color: #eee; 
    font-style: italic; 
    font-size: 0.9rem; 
    width: 35%; 
    text-align: right;
    word-break: break-word;
}

/* TOAST PANELER */
.modalPlaylist-custom-alert {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #128212;
    color: #fff;
    padding: 12px 25px;
    border-radius: 25px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    font-weight: normal;
    z-index: 29999; 
    animation: modalPlaylistfadeInUp 0.3s ease-out;
}

@keyframes modalPlaylistfadeInUp {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.modalPlaylist-hidden { display: none !important; }