/**
 * MiMusicA - Personal Music Player
 * DARK PURPLE THEME - Updated Design
 * 
 * @author    Ricardo Chandia (eShape)
 * @copyright Copyright © 2025 Ricardo Chandia. All Rights Reserved.
 * @license   Proprietary - Unauthorized copying or distribution prohibited
 * @version   4.0.0
 * @link      https://mimusica.ca
 */

/* === MiMusicA Player (Dark Theme) === */

#vmp-root {
    background: #0a0a0a !important;
    border-radius: 16px;
    padding: 15px;
    max-width: 1400px !important;
    width: 100% !important;
    margin: 20px auto !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #ffffff;
    box-sizing: border-box !important;
    position: relative;
    overflow-x: hidden !important;
    border: 1px solid rgba(139, 92, 246, 0.1);
}

/* ---------------------------------
    USER HEADER - DARK GRADIENT
    --------------------------------- */
#vmp-root > div:first-child {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(167, 139, 250, 0.15) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: white;
    padding: 20px 24px;
    border-radius: 12px;
    margin: -10px -12px 0 -12px;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.2);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

#vmp-root > div:first-child::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    pointer-events: none;
}

#vmp-root > div:first-child span {
    color: #ffffff !important;
    font-weight: 600;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

#vmp-root > div:first-child strong {
    color: #ffffff !important;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

/* Menu button - Dark theme */
#vmp-menu-btn {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-size: 24px;
    padding: 6px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 2;
}

#vmp-menu-btn:hover {
    background: rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* ---------------------------------
    MENU DROPDOWN - DARK THEME
    --------------------------------- */
#vmp-menu-dropdown {
    position: absolute;
    right: 20px;
    top: 90px;
    background: rgba(20, 20, 20, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(139, 92, 246, 0.3) !important;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    min-width: 95px;
    overflow: hidden;
}

#vmp-menu-dropdown.vmp-menu-hidden {
    display: none;
}

.vmp-menu-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 16px;
    border: none !important;
    background: transparent !important;
    color: #ffffff !important;
    text-align: center;
    cursor: pointer;
    font-size: 14px !important;
    font-family: system-ui, sans-serif;
    font-weight: 500 !important;
    transition: all 0.3s ease;
    text-decoration: none;
    min-height: 40px;
    white-space: nowrap;
    line-height: 1.2;
    margin: 0 !important;
    border-radius: 0 !important;
    outline: none !important;
}

.vmp-menu-item:hover {
    background: rgba(139, 92, 246, 0.2) !important;
    color: #a78bfa !important;
}

/* ---------------------------------
    CONTROLS TOP ROW - DARK BUTTONS
    --------------------------------- */
#vmp-controls-top {
    display: flex;
    gap: 12px;
    align-items: stretch;
    flex-wrap: wrap;
    margin-top: 8px !important;
}

.vmp-control-group {
    display: flex;
    gap: 12px;
    flex: 1;
    min-width: 200px;
}

/* Dark gradient buttons */
.vmp-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
    border: none;
    color: white;
    padding: 0;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 20px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    white-space: nowrap;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.vmp-btn svg {
    width: 22px;
    height: 22px;
    stroke: white;
    transition: all 0.3s;
}

.vmp-btn:hover {
    background: linear-gradient(135deg, #a78bfa 0%, #c4b5fd 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.vmp-btn:active {
    transform: translateY(0);
}

.vmp-btn.active {
    background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.6);
}

.vmp-btn.active svg {
    stroke: #fde047;
}

/* Search Input - Dark theme */
#vmp-search {
    flex: 1;
    max-width: 350px;
    padding: 14px 20px;
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s;
    outline: none;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    padding-left: 40px !important;
}

#vmp-search:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

#vmp-search::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* ---------------------------------
    PLAYLIST CONTAINER - DARK
    --------------------------------- */
#vmp-playlist-container {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    overflow: hidden;
    max-height: 600px;
    width: 100% !important;
    overflow-y: auto;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-top: 12px !important;
    margin-bottom: 0 !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.5) rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.1);
}

#vmp-playlist-container::-webkit-scrollbar {
    width: 8px;
}

#vmp-playlist-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

#vmp-playlist-container::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.5);
    border-radius: 4px;
}

#vmp-playlist-container::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.7);
}

#vmp-playlist {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

#vmp-playlist li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    width: 100%;
    box-sizing: border-box;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
    background: transparent;
}

#vmp-playlist li:nth-child(odd) {
    background: rgba(255, 255, 255, 0.02);
}

#vmp-playlist li:hover {
    background: rgba(139, 92, 246, 0.1);
    transform: translateX(4px);
}

#vmp-playlist li.vmp-current-track {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.2) 0%, rgba(167, 139, 250, 0.15) 100%);
    border-left: 3px solid #8b5cf6;
    font-weight: 600;
}

#vmp-playlist li.vmp-current-track .vmp-track-title {
    color: #a78bfa;
}

.vmp-empty-list {
    text-align: center !important;
    padding: 60px 20px !important;
    color: rgba(255, 255, 255, 0.4) !important;
    font-size: 16px;
    font-style: italic;
}

.vmp-uploading {
    color: #8b5cf6 !important;
    font-style: italic;
    background: rgba(139, 92, 246, 0.15) !important;
    border-left: 4px solid #8b5cf6 !important;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.vmp-track-title {
    flex: 1;
    font-size: 15px;
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 8px 10px;
    cursor: move;
    text-align: left;
}

.vmp-track-title:hover {
    color: #a78bfa;
}

.playlist-buttons {
    display: flex;
    gap: 8px;
    position: relative;
}

.vmp-play-track {
    display: none !important;
}

.vmp-delete-track {
    background: none !important;
    border: none !important;
    cursor: pointer;
    font-size: 16px;
    padding: 0 !important;
    color: rgba(255, 255, 255, 0.4) !important;
    flex-shrink: 0;
    transition: all 0.2s;
    line-height: 1;
    box-shadow: none !important;
}

.vmp-delete-track:hover {
    color: #ef4444 !important;
    background: none !important;
    transform: scale(1.2);
}

/* ---------------------------------
    MOVE MENU - DARK THEME
    --------------------------------- */
.vmp-move-menu {
    position: absolute;
    right: 0;
    top: 35px;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 100;
    min-width: 200px;
    max-width: 250px;
}

.vmp-move-title {
    padding: 12px 16px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.vmp-move-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: #ffffff;
    transition: all 0.2s;
}

.vmp-move-item:hover {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

.vmp-move-empty {
    padding: 12px 16px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    font-style: italic;
    text-align: center;
}

.vmp-move-divider {
    height: 1px;
    background: rgba(139, 92, 246, 0.2);
    margin: 8px 0;
}

.vmp-move-input {
    width: calc(100% - 24px);
    margin: 8px 12px 12px 12px;
    padding: 8px 12px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.vmp-move-input:focus {
    border-color: #8b5cf6;
}

.vmp-move-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    font-size: 20px;
    padding: 4px;
    width: 24px;
    height: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.vmp-move-close:hover {
    background: rgba(139, 92, 246, 0.2);
    color: #ffffff;
}

/* ---------------------------------
    MODAL - DARK THEME
    --------------------------------- */
.vmp-modal-hidden {
    display: none !important;
}

#vmp-modal,
#vmp-playlists-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
}

#vmp-modal.vmp-modal-hidden,
#vmp-playlists-modal.vmp-modal-hidden {
    display: none !important;
}

.vmp-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
}

.vmp-modal-content {
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 70vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 1;
    margin-top: 10px;
}

.vmp-modal-content.vmp-modal-large {
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    scrollbar-width: none;
}
.vmp-modal-content.vmp-modal-large::-webkit-scrollbar {
    display: none;
}

.vmp-modal-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 24px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    background: transparent;
}

.vmp-modal-header h2 {
    margin: 0 !important;
    font-size: 16px !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    display: block !important;
}

.vmp-modal-close,
.vmp-modal-close-playlists {
    background: none;
    border: none;
    font-size: 28px;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 32px;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.vmp-modal-close:hover,
.vmp-modal-close-playlists:hover {
    color: #ffffff;
}

.vmp-modal-body {
    padding: 24px;
    background: transparent;
}

@media (max-width: 768px) {
    .vmp-modal-body {
        display: flex;
        justify-content: center;
        padding: 10px;
    }
    
    .vmp-playlist-icon svg[fill="#a78bfa"] {
        width: 20px !important;
        height: 20px !important;
    }
    
    .vmp-playlist-icon svg[fill="none"] {
        width: 18px !important;
        height: 18px !important;
    }
}

.vmp-create-playlist {
    display: flex;
    gap: 14px;
}

.vmp-create-playlist input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

.vmp-create-playlist input:focus {
    border-color: #8b5cf6;
}

.vmp-btn-primary {
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
    border: none;
    color: white;
    padding: 14px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.vmp-btn-primary:hover {
    background: linear-gradient(135deg, #a78bfa 0%, #c4b5fd 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

/* ---------------------------------
    PLAYLISTS GRID - DARK CARDS
    --------------------------------- */
#vmp-playlists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
    justify-items: center;
}

.vmp-playlist-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    padding: 20px 12px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    min-height: 140px;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: auto;
    overflow: visible;
}

.vmp-playlist-card.vmp-create-new {
    background: rgba(139, 92, 246, 0.1);
    border: 2px dashed rgba(139, 92, 246, 0.4);
}

.vmp-playlist-card.vmp-create-new:hover {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.2);
}

.vmp-playlist-card:hover {
    border-color: #8b5cf6;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3);
    background: rgba(255, 255, 255, 0.08);
    z-index: 9999;
}

.vmp-playlist-icon {
    font-size: 24px;
    margin-bottom: 12px;
}

.vmp-playlist-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 6px;
    word-break: break-word;
}

.vmp-playlist-count {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0;
}

.vmp-playlist-card * {
    pointer-events: none;
}

.vmp-playlist-card .vmp-playlist-menu-btn,
.vmp-playlist-card .vmp-playlist-menu {
    pointer-events: auto !important;
}

.vmp-playlists-empty {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 16px;
    font-style: italic;
}

/* Playlist menu button */
.vmp-playlist-menu-btn {
    position: absolute;
    top: 2px;
    right: 8px;
    background: none !important;
    border: none !important;
    font-size: 20px;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    z-index: 10;
    pointer-events: auto !important;
    padding: 8px;
    outline: none !important;
    box-shadow: none !important;
    transition: color 0.3s ease;
}

.vmp-playlist-menu-btn:hover {
    color: #8b5cf6 !important;
}

/* Playlist menu dropdown */
.vmp-playlist-menu {
    position: absolute;
    top: 48px;
    right: 12px;
    background: rgba(20, 20, 20, 0.95) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.3) !important;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 99999 !important;
    min-width: 90px;
    overflow: hidden;
    pointer-events: auto !important;
    font-size: 13px;
}

.vmp-playlist-menu-hidden {
    display: none !important;
}

.vmp-playlist-menu-item {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none !important;
    background: transparent !important;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    color: #ffffff !important;
    pointer-events: auto !important;
    transition: all 0.3s ease;
    outline: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
}

.vmp-playlist-menu-item:hover {
    background: rgba(139, 92, 246, 0.2) !important;
    color: #a78bfa !important;
}

.vmp-playlist-delete:hover {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #ef4444 !important;
}

/* ---------------------------------
    AUDIO & VISUALIZER - DARK
    --------------------------------- */
#vmp-audio {
    width: 100%;
    outline: none;
    border-radius: 10px;
    margin-top: 0;
    margin-bottom: 0;
    background: rgba(139, 92, 246, 0.1) !important;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

#vmp-visualizer {
    display: none !important;
}

@media (max-width: 768px) {
    #vmp-visualizer {
        display: none;
    }
}

/* ---------------------------------
    YOUTUBE SEARCH MODAL - DARK
    --------------------------------- */
#vmp-youtube-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
}

#vmp-youtube-modal.vmp-modal-hidden {
    display: none !important;
}

.vmp-youtube-content {
    position: relative;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    background: rgba(15, 15, 15, 0.98) !important;
    backdrop-filter: blur(20px);
    border-radius: 16px !important;
    border: 1px solid rgba(139, 92, 246, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden !important;
    z-index: 1;
}

.vmp-youtube-header {
    padding: 8px 24px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent !important;
    border-radius: 0 !important;
    margin: -1px -1px 0 -1px;
    position: relative;
}

.vmp-youtube-header h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
}

.vmp-youtube-search input:focus {
    border-color: #8b5cf6 !important; /* Force la couleur mauve */
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2) !important;
    outline: none !important; /* Supprime le contour bleu du navigateur */
    -webkit-appearance: none; /* Pour certains navigateurs mobiles */
}

.vmp-youtube-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
    display: none;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 20px;
}

.vmp-youtube-search {
    padding: 20px 24px;
    background: rgba(139, 92, 246, 0.05);
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.vmp-youtube-search input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 10px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    outline: none;
    transition: all 0.3s;
}

.vmp-youtube-search input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.vmp-youtube-results {
    padding: 20px 24px;
    max-height: calc(90vh - 160px);
    overflow-y: auto;
}

.vmp-youtube-result {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin-bottom: 12px;
    transition: all 0.2s;
    border: 1px solid rgba(139, 92, 246, 0.1);
}

.vmp-youtube-result:hover {
    background: rgba(139, 92, 246, 0.15);
    transform: translateX(4px);
    border-color: rgba(139, 92, 246, 0.3);
}

.vmp-youtube-thumbnail {
    width: 120px;
    height: 90px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.vmp-youtube-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.vmp-youtube-title {
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
}

.vmp-youtube-channel {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

.vmp-youtube-add-btn {
    background: transparent !important;
    border: none !important;
    color: #a78bfa !important;
    padding: 0 !important;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.2s;
    flex-shrink: 0;
    align-self: center;
}

.vmp-youtube-add-btn:hover {
    color: #8b5cf6 !important;
    transform: scale(1.2);
}

.vmp-youtube-loading,
.vmp-youtube-empty {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
}

/* Force body to allow full width when player is open */
body:has(#vmp-yt-player-container[style*="display: flex"]),
body:has(#vmp-yt-player-container[style*="display: block"]) {
    overflow: hidden !important;
}

html, body {
    margin: 0 !important;
    padding: 0 !important;
}

/* YouTube Player - Recouvrement Total de l'Écran */
#vmp-yt-player-container {
    position: fixed !important;
    top: 0 !important;
    left: 50% !important;
    right: auto !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    transform: translateX(-50%) !important;
    background: rgba(0, 0, 0, 0.98) !important;
    backdrop-filter: blur(15px) !important;
    z-index: 2147483647 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: none; /* ← Caché par défaut */
}

#vmp-yt-player-container[style*="display: flex"],
#vmp-yt-player-container[style*="display: block"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: column !important; /* ← AJOUTÉ ICI */
}

#vmp-yt-player-container iframe {
    width: 95% !important;
    max-width: 1800px !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    border: none !important;
    box-shadow: 0 0 100px rgba(0,0,0,1) !important;
    position: relative !important;
    z-index: 1 !important;
}

.vmp-track-title {
    cursor: pointer !important;
}

.vmp-track-title:active {
    cursor: grabbing !important;
}

/* ---------------------------------
    MOBILE ADJUSTMENTS
    --------------------------------- */
@media (max-width: 768px) {
    #vmp-root {
        padding: 20px;
        margin: 10px auto !important;
    }
    
    .vmp-btn {
        font-size: 22px;
        padding: 12px 16px;
    }
    
    #vmp-controls-top {
        flex-direction: column;
    }
    
    .vmp-control-group {
        width: 100%;
        min-width: auto;
    }
    
    #vmp-search {
        max-width: none;
    }
    
    #vmp-playlist-container {
        max-height: 500px;
    }
    
    .vmp-modal-content {
        max-width: 90vw;
        max-height: 60vh;
    }
    
    .vmp-modal-content.vmp-modal-large {
        max-width: 95vw;
    }
    
    #vmp-playlists-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 12px;
    }
    
    .vmp-playlist-card {
    min-height: 95px;
    padding: 10px 6px;
}
    
    .vmp-playlist-icon {
        font-size: 24px;
    }
    
    .vmp-playlist-name {
        font-size: 12px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    #vmp-root {
        padding: 16px;
    }
    
    .vmp-btn {
        font-size: 20px;
        padding: 10px 14px;
    }
    
    @media (max-width: 768px) {
    #vmp-playlists-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        max-width: 450px;
        margin: 0 auto;
        justify-items: center;
    }
    
    .vmp-playlist-icon {
        font-size: 14px;
    }
}
    
    /* YouTube Modal - FULLSCREEN Mobile */
    .vmp-youtube-content {
        width: 100% !important;
        max-width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }
    
    .vmp-youtube-header {
    padding: 8px 12px !important;
    min-height: 40px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    position: relative !important;
}

    .vmp-youtube-header h3 {
    font-size: 12px !important;
    margin: 0 !important;
    font-weight: 600 !important;
    text-align: center !important;
}

.vmp-youtube-close {
        position: absolute !important;
        right: 10px !important;
        top: 10px !important;
        width: 28px !important;
        height: 28px !important;
        font-size: 16px !important;
        background: rgba(255, 255, 255, 0.2) !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 999 !important;
        color: #ffffff !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
}
    
    .vmp-youtube-close {
        width: 30px !important;
        height: 30px !important;
        font-size: 18px !important;
    }
    
    .vmp-youtube-search {
        padding: 8px 12px !important;
    }
    
    .vmp-youtube-search input {
        padding: 10px 14px !important;
        font-size: 14px !important;
    }
    
    .vmp-youtube-results {
        max-height: calc(100vh - 120px) !important;
        padding: 8px 12px !important;
        margin: 0 !important;
        overflow-y: auto !important;
    }
    
    .vmp-youtube-result {
        padding: 8px !important;
        margin-bottom: 8px !important;
        flex-direction: column !important;
    }
    
    .vmp-youtube-result:last-child {
        margin-bottom: 0 !important;
    }
    
    .vmp-youtube-thumbnail {
        width: 100% !important;
        height: auto !important;
        max-height: 200px !important;
        margin-bottom: 8px !important;
    }
    
    .vmp-youtube-info {
        width: 100% !important;
    }
    
    .vmp-youtube-title {
        font-size: 14px !important;
    }
    
    .vmp-youtube-channel {
        font-size: 12px !important;
    }
}

/* Fix visualizer paragraph spacing */
#vmp-root p {
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
    line-height: 0 !important;
}

/* Hide scrollbar but keep scrolling */
body {
    overflow: auto !important;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}
body::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}
html {
    overflow: auto !important;
}
#vmp-root {
    overflow: visible !important;
}

.vmp-youtube-header {
    padding: 20px 24px 20px 60px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent !important;
    border-radius: 0 !important;
    margin: -1px -1px 0 -1px;
}

.vmp-youtube-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
}

/* Hide BR in menu dropdown */
#vmp-menu-dropdown br {
    display: none !important;
} 

/* Fix YouTube Player Centering on Desktop */
#vmp-yt-player-container[style*="display: flex"],
#vmp-yt-player-container[style*="display: block"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#vmp-yt-player-container iframe {
    width: 95% !important;
    max-width: 1400px !important;
    height: 800px !important;
    aspect-ratio: 16 / 9 !important;
}

@media (max-width: 991px) {
    #vmp-yt-player-container iframe {
        width: 95% !important;
    }
}

/* Fix WordPress wpautop adding P tags in menu */
#vmp-menu-dropdown p {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
    height: 0 !important;
    display: contents !important;
}

#vmp-menu-dropdown p br {
    display: none !important;
}

/* ========================================
   BARRE DE CONTRÔLE YOUTUBE
   ======================================== */
.vmp-yt-controls-bar {
    position: relative !important; /* ← CHANGÉ de absolute à relative */
    bottom: auto !important; /* ← CHANGÉ */
    left: auto !important; /* ← CHANGÉ */
    right: auto !important; /* ← CHANGÉ */
    transform: none !important; /* ← CHANGÉ */
    width: 100% !important; /* ← CHANGÉ de 95% à 100% */
    max-width: none !important; /* ← CHANGÉ */
    margin-top: -100px !important; /* ← AJOUTÉ (pour remonter sur la vidéo) */
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 50%, transparent 100%);
    padding: 20px 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    opacity: 1 !important;
    transition: opacity 0.3s ease;
    z-index: 2147483649 !important;
}

/* Ajustement mobile pour la barre de contrôle */
@media (max-width: 768px) {
    .vmp-yt-controls-bar {
        bottom: 20px !important;
        padding: 15px 20px !important;
    }
}

#vmp-yt-player-container:hover .vmp-yt-controls-bar,
.vmp-yt-controls-bar.vmp-yt-show {
    opacity: 1;
}

.vmp-yt-control-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    transition: all 0.2s ease;
    border-radius: 50%;
}

.vmp-yt-progress-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
}

.vmp-yt-time {
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    min-width: 45px;
    text-align: center;
}

.vmp-yt-progress-bar {
    flex: 1;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    position: relative;
    cursor: pointer;
    transition: height 0.2s ease;
}

.vmp-yt-progress-bar:hover {
    height: 7px;
}

.vmp-yt-progress-filled {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #a78bfa, #c4b5fd);
    border-radius: 10px;
    width: 0%;
    transition: width 0.1s linear;
    pointer-events: none;
}

.vmp-yt-progress-handle {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: #fff;
    border: 2px solid #a78bfa;
    border-radius: 50%;
    left: 0%;
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 2px 8px rgba(167, 139, 250, 0.4);
    pointer-events: none;
}

.vmp-yt-progress-bar:hover .vmp-yt-progress-handle {
    opacity: 1;
}

/* Bouton fermer YouTube (mobile uniquement) */
.vmp-yt-close-mobile {
    display: none !important;
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    width: 50px;
    height: 50px;
    color: #fff !important;
    font-size: 40px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    z-index: 9999999999 !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent !important;
    pointer-events: auto !important;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.6) !important; /* ← AJOUTÉ */
}

/* Afficher le X seulement sur mobile quand YouTube est ouvert */
@media (max-width: 768px) {
    #vmp-yt-player-container[style*="display: block"] .vmp-yt-close-mobile,
    #vmp-yt-player-container[style*="display: flex"] .vmp-yt-close-mobile {
        display: block !important;
    }
}

.vmp-yt-close-mobile:hover,
.vmp-yt-close-mobile:focus,
.vmp-yt-close-mobile:active,
.vmp-yt-close-mobile:visited {
    background: transparent !important;
    color: #fff !important;
    outline: none !important;
    box-shadow: none !important;
    transform: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* Afficher seulement sur mobile */
@media (max-width: 768px) {
    .vmp-yt-close-mobile {
        display: block;
    }
}

.vmp-playlist-close-mobile {
    display: none !important;
}

@media (max-width: 768px) {
    .vmp-playlist-close-mobile {
        display: block !important;
        position: absolute;
        right: 10px;
        top: 10px;
        background: none;
        border: none;
        color: #ffffff;
        font-size: 24px;
        cursor: pointer;
        padding: 0;
        line-height: 1;
    }
    
    .vmp-modal-header {
        position: relative;
    }
}

.vmp-move-track {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    opacity: 1;
    color: #ffffff;
    transition: opacity 0.3s;
}
.vmp-move-track:hover {
    opacity: 1;
}
.vmp-move-track svg {
    width: 18px;
    height: 18px;
}

.vmp-share-track {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #fff;
    padding: 0;
    width: 20px;
    height: 20px;
}

.vmp-share-track {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #fff;
    padding: 0;
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-top: 3px;
}
.vmp-share-track svg {
    width: 20px;
    height: 20px;
}