/* --- 1. GRUNDINSTÄLLNINGAR & BAKGRUND --- */
body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #121212;
    color: #ffffff;
    margin: 0;
    padding: 0;
    padding-bottom: 100px; /* Plats för spelaren */
    min-height: 100vh;
    overflow-x: hidden;
}

/* Helskärmsbakgrund */
.fullscreen-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: -1;
    background-color: #121212;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    transition: opacity 1s ease-in-out;
}

/* Mörkt filter över bakgrunden */
.fullscreen-bg::after {
    content: '';
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.65); 
    backdrop-filter: blur(3px); 
}

body.login-page .fullscreen-bg::after {
    background: rgba(0, 0, 0, 0.3); 
    backdrop-filter: none;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.1); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.4); }

h1, h2, h3, h4 { margin-top: 0; font-weight: 700; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,0.8); }
a { color: #1db954; text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- 2. INLOGGNINGSSIDA --- */
.login-container {
    max-width: 800px; margin: 10vh auto; padding: 40px; text-align: center;
    background: rgba(0, 0, 0, 0.1); border-radius: 20px; backdrop-filter: blur(3px);
}
.login-container h1 { font-size: 3rem; margin-bottom: 10px; letter-spacing: 2px; text-transform: uppercase; }
.forms-wrapper { display: flex; justify-content: center; gap: 40px; margin-top: 40px; flex-wrap: wrap; }
.form-box {
    background: rgba(0, 0, 0, 0.5); padding: 30px; border-radius: 15px; width: 300px; text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.15); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px); transition: transform 0.2s;
}
.form-box:hover { transform: translateY(-5px); background: rgba(0, 0, 0, 0.6); }
.register-box { border: 1px solid #1db954; }
.form-box input { background: rgba(255, 255, 255, 0.1) !important; border: 1px solid rgba(255, 255, 255, 0.2) !important; color: white !important; }

/* --- 3. DASHBOARD LAYOUT --- */
.dashboard-container { 
    display: flex; gap: 20px; padding: 20px; box-sizing: border-box;
    height: calc(100vh - 150px); overflow: hidden;
}
.column {
    background: transparent; padding: 0; border-radius: 8px;
    display: flex; flex-direction: column; gap: 20px;
    overflow-y: auto; height: 100%;
    scrollbar-width: thin; scrollbar-color: #555 transparent;
}
.player-column { flex: 3; min-width: 300px; }
.admin-column { flex: 2; min-width: 300px; }

/* KORTEN */
.card {
    background: rgba(20, 20, 20, 0.45); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    padding: 20px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 30px rgba(0,0,0,0.3); transition: all 0.3s ease;
}
.card-header {
    display: flex; justify-content: space-between; align-items: center; cursor: pointer;
    padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.card-header:hover { border-bottom-color: rgba(255,255,255,0.3); }
.card-header h3 { margin: 0; font-size: 1.1rem; pointer-events: none; }
.minimize-btn { color: #ccc; font-weight: bold; transition: transform 0.3s; }
.card.minimized .card-body { display: none; }
.card.minimized .minimize-btn { transform: rotate(-90deg); }
.card.minimized { padding-bottom: 10px; }

/* --- 4. KOMPONENTER --- */
input[type="text"], input[type="email"], input[type="password"], input[type="file"], select, textarea {
    width: 100%; padding: 10px; margin: 5px 0 15px 0;
    background: rgba(0, 0, 0, 0.3) !important; border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: white; border-radius: 6px; box-sizing: border-box; font-family: inherit; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: #1db954 !important; background: rgba(0, 0, 0, 0.5) !important; }
button {
    width: 100%; padding: 10px; background: rgba(255, 255, 255, 0.1); color: white;
    border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 25px; font-weight: bold;
    cursor: pointer; transition: all 0.2s;
}
button:hover { background: rgba(255, 255, 255, 0.25); }
.btn-primary { background-color: rgba(29, 185, 84, 0.8); color: white; border: none; }
.btn-primary:hover { background-color: #1ed760; }

/* --- 5. TOPPMENY & SPELARE --- */
nav {
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(15px);
    padding: 15px 30px; display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.logout-btn { width: auto; padding: 5px 15px; border-color: rgba(255,255,255,0.3); color: #ddd; }
.profile-btn { width: auto; padding: 5px 15px; margin-right: 10px; background: rgba(255,255,255,0.1); border: none; }

#fixedPlayer {
    position: fixed; bottom: 0; left: 0; width: 100%; height: 90px;
    background: rgba(10, 10, 10, 0.8); backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: space-between;
    padding: 0 30px; box-sizing: border-box; z-index: 1000; box-shadow: 0 -5px 30px rgba(0,0,0,0.5);
}
.player-info { width: 30%; display: flex; flex-direction: column; }
.player-info strong { font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.player-info span { font-size: 0.8rem; color: #ddd; }
.player-controls { width: 40%; display: flex; flex-direction: column; align-items: center; }
.player-controls audio { width: 100%; height: 35px; margin-top: 5px; opacity: 0.9; }
.ctrl-buttons { display: flex; gap: 15px; }
.ctrl-btn { background: none; border: none; color: #ccc; font-size: 1.2rem; cursor: pointer; width: auto; padding: 0; transition: color 0.3s; font-weight: normal; }
.ctrl-btn:hover { color: white; transform: scale(1.1); }
.ctrl-btn.active { color: #1db954 !important; font-weight: bold; text-shadow: 0 0 10px rgba(29, 185, 84, 0.8); }
.player-extra { width: 30%; text-align: right; color: #888; font-size: 0.8rem; font-family: monospace; }
.info-btn {
    background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.3); color: #fff;
    border-radius: 50%; width: 24px; height: 24px; cursor: pointer; margin-left: 8px;
    font-size: 0.8rem; display: inline-flex; align-items: center; justify-content: center;
}

/* STOR PLAY-KNAPP */
.big-play-btn {
    font-size: 1.8rem !important; width: 55px !important; height: 55px !important;
    border-radius: 50%; background: #ffffff !important; color: #000000 !important;
    display: flex; align-items: center; justify-content: center; margin: 0 20px;
    padding: 0 !important; padding-left: 4px !important; box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.big-play-btn:hover { transform: scale(1.1); background: #f0f0f0 !important; }
.big-play-btn.is-playing { padding-left: 0 !important; }

/* --- 6. LISTOR --- */
.song-list { list-style: none; padding: 0; margin: 0; flex-grow: 1; }
.song-list li {
    padding: 10px; border-bottom: 1px solid rgba(255,255,255,0.05);
    cursor: pointer; display: flex; justify-content: space-between; align-items: center;
    border-radius: 4px; transition: 0.2s;
}
.song-list li:hover { background: rgba(255, 255, 255, 0.15); }
.song-list li.active-song { background: rgba(29, 185, 84, 0.3); border-left: 3px solid #1db954; }
.song-row-left { display: flex; flex-direction: column; overflow: hidden; }
.song-row-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Artist Header */
.artist-group-header {
    display: flex; align-items: center; padding: 20px 10px 10px 10px; margin-top: 10px;
    border-bottom: 1px solid #1db954; color: #fff; background: linear-gradient(to right, rgba(29, 185, 84, 0.1), transparent);
    border-radius: 4px 4px 0 0;
}
.artist-group-header img { width: 50px; height: 50px; border-radius: 50%; margin-right: 15px; object-fit: cover; background: #333; border: 2px solid #1db954; }
.artist-group-header span { font-size: 1.2rem; font-weight: bold; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }

/* Spellistor */
.playlist-item {
    display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; margin-bottom: 6px;
    border-radius: 6px; cursor: pointer; background: rgba(255, 255, 255, 0.05); border-left: 3px solid transparent;
}
.playlist-item:hover { background: rgba(255, 255, 255, 0.15); }
.playlist-item.active-pl { background: rgba(29, 185, 84, 0.25); border-left-color: #1db954; color: white; }
.pl-name { flex-grow: 1; margin-right: 15px; font-weight: 500; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-meta { flex-shrink: 0; display: flex; align-items: center; gap: 10px; min-width: 50px; justify-content: flex-end; }
.pl-count { font-size: 0.75rem; color: #aaa; background: rgba(0,0,0,0.4); padding: 2px 8px; border-radius: 10px; min-width: 20px; text-align: center; }

/* Knappar */
.delete-btn { color: #888; cursor: pointer; font-size: 1.1rem; opacity: 0; transition:0.2s; }
.edit-btn { color: #888; cursor: pointer; font-size: 1rem; opacity: 0; transition:0.2s; }
.pl-delete { color: #666; font-weight: bold; font-size: 1.2rem; line-height: 1; cursor: pointer; transition: color 0.2s; }
.song-list li:hover .delete-btn, .song-list li:hover .edit-btn { opacity: 1; }
.delete-btn:hover, .pl-delete:hover, .remove-btn:hover { color: #e74c3c; }
.edit-btn:hover { color: #f1c40f; }
.add-btn { font-weight: bold; cursor: pointer; font-size: 1.2rem; color: #bbb; } .add-btn:hover { color: #1db954; }
.sort-btn { width: auto; padding: 0 12px; border-radius: 4px; background: rgba(255,255,255,0.1); color: #ccc; border: 1px solid transparent; font-size: 0.8rem; margin-right: 2px; }
.sort-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }
.sort-btn.active { background: rgba(29, 185, 84, 0.3); color: #1db954; border-color: #1db954; font-weight: bold; }
.song-hidden { opacity: 0.5; background: repeating-linear-gradient(45deg, rgba(0,0,0,0.2), rgba(0,0,0,0.2) 10px, rgba(20,20,20,0.2) 10px, rgba(20,20,20,0.2) 20px) !important; }
.song-hidden strong::after { content: " (Dold)"; font-size: 0.7rem; color: #e74c3c; font-weight: normal; font-style: italic; margin-left: 5px; }
.visibility-btn { color: #888; cursor: pointer; font-size: 1rem; margin-right: 5px; opacity: 0; transition: 0.2s; }
.song-list li:hover .visibility-btn { opacity: 1; } .visibility-btn:hover { color: #fff; }

/* --- 7. MODALER --- */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 2000; justify-content: center; align-items: center; backdrop-filter: blur(8px); }
.modal-content { background: rgba(30, 30, 30, 0.85); padding: 30px; border-radius: 15px; width: 90%; max-width: 500px; border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 10px 40px rgba(0,0,0,0.5); position: relative; }
.close-modal { position: absolute; top: 10px; right: 15px; font-size: 1.5rem; cursor: pointer; color: #aaa; }
.close-modal:hover { color: #fff; }
.artist-bio-img { width: 120px; height: 120px; object-fit: cover; border-radius: 50%; border: 3px solid #1db954; margin: 0 auto 15px auto; display: block; }
.artist-bio-text { font-size: 0.9rem; color: #eee; line-height: 1.5; white-space: pre-wrap; }
.bio-placeholder { width: 120px; height: 120px; border-radius: 50%; background: rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: center; color: #aaa; margin: 0 auto 15px auto; border: 1px dashed #555; }
.breakdown-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 0.9rem; color: #ccc; }
.breakdown-table th { text-align: left; border-bottom: 1px solid #555; padding: 5px; color: #f1c40f; }
.breakdown-table td { padding: 5px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.breakdown-sum { font-weight: bold; color: #fff; }
.guestbook-container { max-height: 300px; overflow-y: auto; margin-bottom: 15px; padding: 10px; border: 1px solid rgba(255,255,255,0.1); background: rgba(0,0,0,0.2); border-radius: 6px; }
.guestbook-entry { background: rgba(255,255,255,0.05); padding: 8px 12px; border-radius: 15px; margin-bottom: 10px; border-left: 3px solid #1db954; }
.gb-reply-container { margin-left: 20px; margin-top: 5px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,0.1); }
.gb-reply { background: rgba(255,255,255,0.03); padding: 8px; border-radius: 6px; margin-bottom: 5px; font-size: 0.9em; }
.gb-header { display: flex; justify-content: space-between; margin-bottom: 5px; font-size: 0.75rem; color: #888; }
.gb-user { font-weight: bold; color: #1db954; }
.gb-body { color: #ddd; font-size: 0.9rem; line-height: 1.4; white-space: pre-wrap; }
.gb-actions { margin-top: 8px; display: flex; gap: 10px; justify-content: flex-end; }
.gb-action-btn { background: transparent; border: none; color: #666; font-size: 0.75rem; cursor: pointer; padding: 2px 5px; border-radius: 4px; }
.gb-action-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }

/* ... (Tidigare kod) ... */

/* ... (Behåll allt ovanför) ... */

/* --- MOBIL HELSKÄRMSSPELARE (Overlay - Clean Version) --- */
.mobile-player-overlay {
    display: none; 
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(20px);
    z-index: 5000;
    
    /* Centrera allt mitt på skärmen igen */
    display: none; /* Ändras till flex via JS */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    padding: 30px;
    box-sizing: border-box;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.mp-image, .mp-image-placeholder {
    width: 80vw;
    height: 80vw;
    max-width: 350px; max-height: 350px;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    object-fit: cover;
    margin-bottom: 40px;
    border: 1px solid rgba(255,255,255,0.1);
}

.mp-image { display: none; }

.mp-image-placeholder {
    display: none;
    background: #222;
    color: #666;
    align-items: center;
    justify-content: center;
    font-style: italic;
    font-size: 0.9rem;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.mp-info { text-align: center; margin-bottom: 40px; width: 100%; }
.mp-title { 
    font-size: 1.8rem; 
    font-weight: bold; 
    color: #fff; 
    margin-bottom: 10px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
}
.mp-artist { font-size: 1.2rem; color: #1db954; cursor: pointer; }

.mp-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    width: 100%;
}

.mp-btn {
    background: none; border: none; color: #ddd; cursor: pointer;
    font-size: 2.5rem; transition: transform 0.2s; display: flex; align-items: center;
}
.mp-btn:active { color: #1db954; transform: scale(0.9); }

.mp-play {
    font-size: 3rem;
    width: 90px; height: 90px;
    background: #fff; color: #000;
    border-radius: 50%;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(255,255,255,0.3);
}
.mp-play:active { background: #ccc; }

.mp-close {
    position: absolute; top: 20px; left: 20px;
    font-size: 2rem; color: #666; background: none; border: none; padding: 10px;
}

#mpShuffleBtn {
    font-size: 1rem; font-weight: normal; letter-spacing: 1px; text-transform: uppercase;
}

/* --- MOBIL-SPECIFIKT (Responsive) --- */
@media (max-width: 768px) {
    body { padding-bottom: 80px; }
    .dashboard-container { flex-direction: column; padding: 10px; height: auto; }
    .admin-column { display: none; } 
    .player-column { width: 100%; height: auto; overflow: visible; }
    
    .song-row-right small { display: none; }
    
    #fixedPlayer { 
        height: 70px; padding: 0 15px; background: #222; border-top: 1px solid #333; 
        bottom: 0; flex-direction: row; justify-content: space-between; 
    }
    .player-extra, #pInfoBtn, #pEditBtn { display: none !important; }
    
    .player-info { width: 70%; align-items: flex-start; pointer-events: none; }
    .player-info strong { font-size: 0.9rem; } 
    .player-info span { font-size: 0.8rem; color: #aaa; }
    
    .player-controls { width: auto; flex-direction: row; }
    .ctrl-buttons { display: flex; gap: 0; }
    #shuffleBtn, .ctrl-buttons button[title="Föregående"], .ctrl-buttons button[title="Nästa"] { display: none; }
    
    .big-play-btn { 
        width: 45px !important; height: 45px !important; font-size: 1.2rem !important; 
        margin: 0 !important; background: transparent !important; color: #fff !important; 
        box-shadow: none !important; border: 2px solid #fff !important; 
    }
}

/* ... (Befintlig kod) ... */

/* ChromeCast-knappen (Text) */
#castBtn {
    font-size: 0.9rem;
    font-weight: normal;
    text-transform: uppercase; /* Snyggare med versaler */
    letter-spacing: 1px;
    color: #666; /* Grå som standard (inaktiv) */
    margin-right: 15px;
    transition: color 0.3s, text-shadow 0.3s;
    background: none;
    border: none;
    cursor: pointer;
}

/* När den är aktiv (ansluten) */
#castBtn.active {
    color: #1db954 !important; /* Grön */
    font-weight: bold;
    text-shadow: 0 0 10px rgba(29, 185, 84, 0.6);
}

#castBtn:hover {
    color: #fff; /* Vit vid hover */
}

