* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #030303;
    color: #f1f1f1;
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 280px;
    min-width: 280px;
    background-color: #0f0f0f;
    border-right: 1px solid #212121;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h3 {
    font-size: 1.2rem;
    color: #fff;
}

.song-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
    padding: 0 10px;
}

.song-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 12px;
    margin-bottom: 4px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #aaa;
    transition: all 0.2s ease;
}

.item-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 8px;
}

.song-item:hover {
    background-color: #212121;
    color: #fff;
}

.song-item.active {
    background-color: #272727;
    color: #fff;
    font-weight: 500;
}

.song-item.no-audio-item {
    border-left: 2px dashed #333;
    color: #666;
}

/* Badges */
.badge {
    font-size: 0.65rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
}

.badge-pdf {
    background-color: #ff4e4e;
    color: white;
}

.badge-midi {
    background-color: #ff9900;
    color: black;
}

/* Zone principale */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #030303;
}

.viewer-container {
    flex: 1;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-text {
    color: #4a4a5a;
    font-size: 1.1rem;
    font-style: italic;
    text-align: center;
}

/* Barre de lecture façon YouTube Music en bas */
.player-bar {
    height: 85px;
    background-color: #0f0f0f;
    border-top: 1px solid #212121;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.player-info {
    display: flex;
    align-items: center;
    width: 30%;
    gap: 14px;
}

.player-cover {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    object-fit: cover;
    background-color: #212121;
}

.title-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.player-song-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.type-badge {
    font-size: 0.6rem;
    font-weight: bold;
    padding: 2px 4px;
    border-radius: 4px;
}

.player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 45%;
}

.control-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
    margin-bottom: 6px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.control-btn:disabled {
    color: #444;
}

.progress-container {
    display: flex;
    align-items: center;
    width: 100%;
}

.time-stamp {
    font-size: 0.75rem;
    color: #aaa;
    width: 35px;
}

#currentTime { text-align: right; margin-right: 8px; }
#durationTime { text-align: left; margin-left: 8px; }

.progress-bar {
    flex: 1;
    height: 4px;
    background: #212121;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff4e4e;
}

.player-right-spacer {
    width: 25%;
}

/* Elements Mobile / Tablette par défaut (masqués sur PC) */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    transition: opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

.close-sidebar-btn {
    display: none;
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.close-sidebar-btn:hover {
    color: #fff;
}

.mobile-header {
    display: none;
    height: 56px;
    background-color: #0f0f0f;
    border-bottom: 1px solid #212121;
    align-items: center;
    padding: 0 16px;
    gap: 16px;
}

.menu-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.menu-btn:hover {
    background-color: #212121;
}

.mobile-header-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

/* responsive tablettes et smartphones */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.5);
    }

    .sidebar.open {
        left: 0;
    }

    .close-sidebar-btn {
        display: block;
    }

    .mobile-header {
        display: flex;
    }
}

/* responsive smartphones */
@media (max-width: 768px) {
    .viewer-container {
        padding: 0;
    }

    .viewer-container iframe {
        border-radius: 0 !important;
    }

    /* Ajustements du Player Bar sur mobile */
    .player-bar {
        height: 80px;
        padding: 0 16px;
        position: relative;
        justify-content: space-between;
    }

    .player-info {
        width: 65%;
        gap: 10px;
    }

    .player-cover {
        width: 40px;
        height: 40px;
    }

    .player-song-title {
        font-size: 0.85rem;
        max-width: 160px;
    }

    .type-badge {
        font-size: 0.55rem;
    }

    .player-controls {
        width: auto;
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
    }

    .control-btn {
        margin-bottom: 0;
        font-size: 1.4rem;
        width: 36px;
        height: 36px;
    }

    /* Barre de progression style YouTube Music en haut du Player Bar */
    .progress-container {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
    }

    /* Masquer les timestamps pour épurer */
    .progress-container .time-stamp {
        display: none;
    }

    .progress-bar {
        width: 100%;
        height: 3px;
        border-radius: 0;
        margin: 0;
        padding: 0;
        background: #212121;
    }

    .progress-bar::-webkit-slider-thumb {
        width: 10px;
        height: 10px;
        background: #ff4e4e;
    }

    .player-right-spacer {
        display: none;
    }
}