/* Container */
.sdvp-container {
    max-width: 1000px;
    margin: 20px auto;
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

/* Header */
.sdvp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
}
.sdvp-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #eee;
}
.sdvp-status {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    background: #333;
    color: #aaa;
}
.sdvp-status.online { background: #2e7d32; color: #fff; }
.sdvp-status.offline { background: #c62828; color: #fff; }

/* Body Layout */
.sdvp-body {
    display: flex;
    flex-direction: row;
    height: 450px;
}
@media (max-width: 768px) {
    .sdvp-body { flex-direction: column; height: auto; }
}

/* Player */
.sdvp-player-wrapper {
    flex: 1; /* Take up all remaining space */
    background: #000;
    position: relative;
    min-width: 0; /* Prevent flex overflow */
}
.sdvp-player-frame {
    width: 100%;
    height: 100%;
}
.sdvp-player-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
}
@media (max-width: 768px) {
    .sdvp-player-wrapper {
        flex: none;
        width: 100%;
        aspect-ratio: 16/9;
    }
}

/* Playlist */
.sdvp-playlist-wrapper {
    width: 320px; /* Fixed width for desktop */
    flex-shrink: 0;
    background: #161616;
    overflow-y: auto;
    border-left: 1px solid #333;
}
@media (max-width: 768px) {
    .sdvp-playlist-wrapper {
        width: 100%;
        max-height: 350px; /* Enable scrolling on mobile */
        border-left: none;
        border-top: 1px solid #333;
    }
}
.sdvp-playlist-items {
    display: flex;
    flex-direction: column;
}

/* Playlist Item */
.sdvp-item {
    display: flex;
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid #222;
    transition: background 0.2s;
}
.sdvp-item:hover, .sdvp-item.active {
    background: #2a2a2a;
}
.sdvp-item-thumb {
    width: 120px;
    height: 68px;
    border-radius: 6px;
    object-fit: cover;
    margin-right: 12px;
}
html[dir="rtl"] .sdvp-item-thumb {
    margin-right: 0;
    margin-left: 12px;
}
.sdvp-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.sdvp-item-title {
    font-size: 13px;
    line-height: 1.4;
    font-weight: 500;
    color: #ddd;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sdvp-item:hover .sdvp-item-title, .sdvp-item.active .sdvp-item-title {
    color: #fff;
}

/* Loading Spinner */
.sdvp-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px 0;
    color: #888;
}
.sdvp-spinner {
    border: 3px solid #333;
    border-top: 3px solid #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: sdvp-spin 1s linear infinite;
    margin-bottom: 10px;
}
@keyframes sdvp-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Scrollbar */
.sdvp-playlist-wrapper::-webkit-scrollbar { width: 6px; }
.sdvp-playlist-wrapper::-webkit-scrollbar-track { background: #111; }
.sdvp-playlist-wrapper::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
.sdvp-playlist-wrapper::-webkit-scrollbar-thumb:hover { background: #555; }
