/* Music Box - Playlists Module Styles */

.mb-playlists-container {
    color: #333;
    overflow: visible;
    position: relative;
}

.mb-playlists-block-container {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.mb-playlists-header {
    margin-bottom: 20px;
}

.mb-playlists-title {
    margin: 0 0 10px 0;
    color: #39CCA8;
    font-size: 1.5em;
    font-weight: 600;
}

.mb-playlists-description {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.mb-playlists-meta {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
    color: #888;
}

.mb-playlists-song-count,
.mb-playlists-privacy {
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
}

.mb-playlists-songs {
    margin-bottom: 20px;
}

.mb-playlists-songs h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.2em;
}

.mb-playlists-songs-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mb-playlists-song-item {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.mb-playlists-song-item:last-child {
    border-bottom: none;
}

.mb-playlists-song-link {
    color: #39CCA8;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.mb-playlists-song-link:hover {
    color: #2a9d7f;
    text-decoration: underline;
}

.mb-playlists-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.mb-playlists-action-btn {
    padding: 8px 16px;
    border: 2px solid #39CCA8;
    background: #fff;
    color: #39CCA8;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.mb-playlists-action-btn:hover {
    background: #39CCA8;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(57, 204, 168, 0.3);
}

.mb-playlists-block-error,
.mb-playlists-block-private {
    padding: 20px;
    text-align: center;
    color: #666;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin: 20px 0;
}

.mb-playlists-block-error {
    color: #d32f2f;
    background: #ffebee;
    border-color: #ffcdd2;
}

.mb-playlists-block-private {
    color: #f57c00;
    background: #fff3e0;
    border-color: #ffcc02;
}

/* Message System */
.mb-playlists-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 6px;
    color: #fff;
    font-weight: 500;
    z-index: 9999;
    max-width: 300px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.mb-playlists-message.show {
    transform: translateX(0);
}

.mb-playlists-message.success {
    background: #4caf50;
    border-left: 4px solid #2e7d32;
}

.mb-playlists-message.error {
    background: #f44336;
    border-left: 4px solid #c62828;
}

.mb-playlists-message.info {
    background: #2196f3;
    border-left: 4px solid #1565c0;
}

/* Lock background scroll when modal open */
html.mb-playlists-modal-open,
body.mb-playlists-modal-open {
    overflow: hidden !important;
    height: 100%;
}

/* Playlist Popup */
.mb-playlists-playlist-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 99999;
    display: none;
}

.mb-playlists-playlist-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(92vw, 520px);
    max-height: 80vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mb-playlists-playlist-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
}

.mb-playlists-playlist-popup-header h3 {
    margin: 0;
    font-size: 18px;
}

.mb-playlists-playlist-popup-close {
    border: none;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
}

.mb-playlists-playlist-popup-body {
    padding: 14px 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1 1 auto;
    overflow: hidden;
}

.mb-playlists-playlist-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    flex: 1 1 auto;
    overflow: auto;
    padding-right: 6px;
}

/* Subtle thin scrollbar for long lists */
.mb-playlists-playlist-list::-webkit-scrollbar {
    width: 8px;
}
.mb-playlists-playlist-list::-webkit-scrollbar-track {
    background: transparent;
}
.mb-playlists-playlist-list::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 6px;
}
.mb-playlists-playlist-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.25);
}

.mb-playlists-playlist-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
}

.mb-playlists-pl-info {
    display: flex;
    flex-direction: column;
}

.mb-playlists-pl-title {
    font-weight: 600;
    color: #2c3e50;
}

.mb-playlists-pl-badge {
    display: inline-block;
    margin-left: 6px;
    font-size: 12px;
    color: #5a6268;
    background: #f1f3f5;
    border-radius: 999px;
    padding: 2px 8px;
}

.mb-playlists-pl-meta {
    font-size: 12px;
    color: #6c757d;
}

.mb-playlists-pl-actions button {
    padding: 6px 12px;
    border-radius: 8px;
    border: 2px solid #39CCA8;
    background: #fff;
    color: #39CCA8;
    cursor: pointer;
}

.mb-playlists-playlist-row.in-list .mb-playlists-pl-actions button {
    background: #39CCA8;
    color: #fff;
}

.mb-playlists-quick-create {
    border-top: 1px solid #eee;
    padding-top: 14px;
    flex: 0 0 auto;
}

.mb-playlists-quick-create h4 {
    margin: 0 0 10px 0;
    font-size: 15px;
}

#mb-playlists-quick-create-form {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
}

#mb-playlists-quick-create-form input,
#mb-playlists-quick-create-form select {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px 10px;
}

#mb-playlists-quick-create-form button[type="submit"] {
    padding: 8px 14px;
}

/* Button States */
.mb-playlists-action-btn.saved {
    background: #4caf50 !important;
    border-color: #4caf50 !important;
    color: #fff !important;
}

.mb-playlists-action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* --- Song page quick actions (Favorilere Ekle / Listeye Ekle) --- */
.mb-playlists-song-buttons {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9998;
    background: #ffffff;
    border: 1px solid #e9ecef;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-radius: 14px;
    padding: 12px;
    animation: mb-playlists-appear 600ms cubic-bezier(.2,.7,.3,1) 1;
}

@keyframes mb-playlists-appear {
    0%   { transform: translateY(10px); opacity: 0; }
    100% { transform: translateY(0);    opacity: 1; }
}

.mb-playlists-song-buttons .mb-playlists-song-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
    width: min(86vw, 328px);
}

.mb-playlists-song-buttons .mb-playlists-add-to-favorites,
.mb-playlists-song-buttons .mb-playlists-open-playlists {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 44px;
    padding: 0 12px;
    font-weight: 700;
    font-size: 14px;
    border-radius: 10px;
/* Ensure inner wrapper column stretches fully */
.mb-playlists-song-buttons .mb-playlists-add-to-playlist {
    display: flex;
    width: 100%;
    min-width: 0;
}

.mb-playlists-song-buttons .mb-playlists-add-to-favorites { min-width: 0; }
.mb-playlists-song-buttons .mb-playlists-open-playlists { min-width: 0; }
    border: 2px solid #39CCA8;
    color: #39CCA8;
    background: #fff;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}

.mb-playlists-song-buttons .mb-playlists-add-to-favorites:hover,
.mb-playlists-song-buttons .mb-playlists-open-playlists:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(57, 204, 168, 0.25);
    background: #39CCA8;
    border-color: #39CCA8;
    color: #ffffff;
}

/* Icons using pseudo-elements to avoid markup changes */
.mb-playlists-song-buttons .mb-playlists-add-to-favorites::before {
    content: '★';
    font-size: 16px;
    margin-right: 8px;
}
.mb-playlists-song-buttons .mb-playlists-open-playlists::before {
    content: '+';
    font-size: 18px;
    margin-right: 8px;
    line-height: 1;
}

/* Filled state for favorites when already added */
.mb-playlists-song-buttons .mb-playlists-add-to-favorites.added {
    background: #39CCA8;
    color: #fff;
    border-color: #39CCA8;
}
.mb-playlists-song-buttons .mb-playlists-add-to-favorites.added:hover {
    background: #f44336;
    border-color: #f44336;
    color: #fff;
    box-shadow: 0 8px 18px rgba(244, 67, 54, 0.28);
}

/* Change icon to outlined star on remove-intent */
.mb-playlists-song-buttons .mb-playlists-add-to-favorites.added:hover::before {
    content: '☆';
    margin-right: 8px;
    display: inline-block;
}

/* Subtle attention ring (once on load) */
.mb-playlists-song-buttons::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 16px;
    box-shadow: 0 0 0 0 rgba(57, 204, 168, 0.0);
    pointer-events: none;
    animation: mb-playlists-attn 1600ms ease-out 1;
}

@keyframes mb-playlists-attn {
    0%   { box-shadow: 0 0 0 0 rgba(57, 204, 168, 0.22); }
    70%  { box-shadow: 0 0 0 18px rgba(57, 204, 168, 0.06); }
    100% { box-shadow: 0 0 0 0 rgba(57, 204, 168, 0.0); }
}

/* Mobile adjustments */
@media (max-width: 1024) {
    /* Position panel above bottom nav; far right; only round top-left */
    .mb-playlists-song-buttons {
        right: 0px;
        left: auto;
        bottom: 60px;
        padding: 8px;
        border-radius: 14px 0 0 0;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: none;
        animation: none;
    }
    .mb-playlists-song-buttons::after { animation: none; box-shadow: none; }
    .mb-playlists-song-buttons .mb-playlists-song-actions {
        width: auto;
        grid-template-columns: repeat(2, 44px);
        gap: 6px;
    }
    /* Icon-only square buttons */
    .mb-playlists-song-buttons .mb-playlists-add-to-favorites,
    .mb-playlists-song-buttons .mb-playlists-open-playlists {
        width: 44px;
        height: 44px;
        padding: 0;
        border-radius: 10px;
        font-size: 0; /* hide label text */
        box-shadow: none;
        transition: none;
        background: #fff;
    }
    .mb-playlists-song-buttons .mb-playlists-add-to-favorites::before,
    .mb-playlists-song-buttons .mb-playlists-open-playlists::before {
        margin: 0;
        font-size: 20px; /* readable icon size */
        line-height: 1;
    }
    /* Remove hover effects on mobile */
    .mb-playlists-song-buttons .mb-playlists-add-to-favorites:hover,
    .mb-playlists-song-buttons .mb-playlists-open-playlists:hover,
    .mb-playlists-song-buttons .mb-playlists-add-to-favorites.added:hover {
        transform: none;
        box-shadow: none;
        background: #fff;
        color: inherit;
        border-color: #39CCA8;
    }
}
