* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: #f7f9fa;
    color: #1c1d1f;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.formation-container {
    display: flex;
    /*height: calc(100vh - 68px);*/
    margin-top: 0;
    flex: 1;
}

.sidebar {
    width: 360px;
    background: #fff;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #d1d7dc;
}

.sidebar-header {
    padding: 24px;
    background: #fff;
    border-bottom: 1px solid #d1d7dc;
}

.sidebar-header h2 {
    font-size: 19px;
    font-weight: 700;
    color: #1c1d1f;
    margin-bottom: 8px;
}

.user-info {
    padding: 12px;
    background: #f7f9fa;
    border-radius: 4px;
    font-size: 14px;
    color: #6a6f73;
    margin-bottom: 12px;
}

.user-info a {
    color: #5624d0;
    text-decoration: none;
    font-weight: 600;
}

.user-info a:hover {
    color: #401b9c;
}

.access-status {
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.access-status.granted {
    background: #ecf4e7;
    color: #3d7b2d;
}

.access-status.denied {
    background: #fcebe8;
    color: #b32d0f;
}

.buy-section {
    padding: 16px 24px;
    background: #fff;
    border-bottom: 1px solid #d1d7dc;
}

.buy-btn {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: #34b5ef;
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 700;
    font-size: 16px;
    transition: background 0.2s ease;
    border: none;
    cursor: pointer;
    margin-bottom: 12px;
}

.buy-btn:last-child {
    margin-bottom: 0;
}

.buy-btn:hover {
    background: #8710d8;
}

.buy-btn.in-cart {
    background: #a435f0;
}

.buy-btn.in-cart:hover {
    background: #8BC34A;
}

.buy-btn.download {
    background: #34b5ef;
}

.buy-btn.download:hover {
    background: #a435f0;
}

.buy-btn.disabled {
    background: #d1d7dc;
    color: #6a6f73;
    cursor: not-allowed;
}

.buy-btn.disabled:hover {
    background: #d1d7dc;
}

.btn-subtitle {
    font-size: 12px;
    margin-top: 4px;
    font-weight: 400;
    opacity: 0.9;
}

.playlist {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    background: #fff;
}

.playlist-title {
    padding: 20px 24px 12px;
    font-size: 17px;
    font-weight: 700;
    color: #1c1d1f;
}

.video-item {
    border-bottom: 1px solid #d1d7dc;
    transition: all 0.2s ease;
}

.video-item a,
.video-item .disabled {
    display: flex;
    align-items: flex-start;
    padding: 16px 24px;
    text-decoration: none;
    color: #1c1d1f;
    background: #fff;
    transition: all 0.2s ease;
}

.video-item a:hover {
    background: #f7f9fa;
}

.video-item.active a {
    background: #f7f9fa;
    border-left: 4px solid #a435f0;
    padding-left: 20px;
}

.video-item.disabled .disabled {
    background: #fff;
    color: #6a6f73;
    cursor: not-allowed;
}

.video-item.disabled .disabled:hover {
    background: #fff;
}

.video-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d7dc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 12px;
}

.video-item.active .video-checkbox {
    background: #a435f0;
    border-color: #a435f0;
    color: white;
}

.video-item.disabled .video-checkbox {
    border-color: #d1d7dc;
    color: #d1d7dc;
}

.video-info {
    flex: 1;
}

.video-name {
    font-size: 14px;
    font-weight: 400;
    margin-bottom: 4px;
    line-height: 1.4;
}

.video-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #6a6f73;
}

.video-item.active .video-name {
    font-weight: 600;
}

.video-item.disabled .video-name {
    color: #6a6f73;
}

.lock-icon {
    font-size: 16px;
    margin-left: 8px;
    color: #6a6f73;
}

.free-badge {
    background: #ecf4e7;
    color: #3d7b2d;
    padding: 4px 8px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 700;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.content-header {
    padding: 16px 24px;
    background: #fff;
    color: #1c1d1f;
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid #d1d7dc;
}

.back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #f7f9fa;
    border-radius: 4px;
    color: #1c1d1f;
    text-decoration: none;
    font-size: 20px;
    transition: background 0.2s ease;
    flex-shrink: 0;
    border: 1px solid #d1d7dc;
}

.back-btn:hover {
    background: #e8ebed;
}

.header-text {
    flex: 1;
}

.content-header h2 {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #1c1d1f;
    text-transform: capitalize;
}

.breadcrumb {
    color: #6a6f73;
    font-size: 14px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.subtitle-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f7f9fa;
    border-radius: 4px;
    border: 1px solid #d1d7dc;
}

.subtitle-selector-wrapper label {
    font-size: 13px;
    font-weight: 600;
    color: #1c1d1f;
    margin: 0;
}

#subtitleSelector {
    padding: 6px 10px;
    border: 1px solid #d1d7dc;
    border-radius: 4px;
    font-size: 13px;
    background: #fff;
    color: #1c1d1f;
    cursor: pointer;
    transition: all 0.2s ease;
}

#subtitleSelector:hover {
    border-color: #a435f0;
}

#subtitleSelector:focus {
    outline: none;
    border-color: #a435f0;
    box-shadow: 0 0 0 2px rgba(164, 53, 240, 0.1);
}

.video-player-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0;
    background: #fff;
    overflow-y: auto;
}

.video-wrapper {
    width: 100%;
    max-width: 100%;
    background: #000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

video {
    width: 100%;
    display: block;
    max-height: calc(100vh - 136px);
}

.video-description {
    padding: 24px;
    background: #fff;
    width: 100%;
}

.video-description h3 {
    font-size: 19px;
    font-weight: 700;
    color: #1c1d1f;
    margin-bottom: 12px;
}

.video-description-content {
    font-size: 14px;
    line-height: 1.6;
    color: #1c1d1f;
}

.video-description-content p {
    margin-bottom: 12px;
}

.video-description-content p:last-child {
    margin-bottom: 0;
}

.access-denied {
    text-align: center;
    max-width: 600px;
    padding: 48px;
    background: #f7f9fa;
    border-radius: 8px;
    color: #1c1d1f;
    margin: 40px;
    border: 1px solid #d1d7dc;
}

.access-denied h2 {
    color: #1c1d1f;
    margin-bottom: 16px;
    font-size: 24px;
    font-weight: 700;
}

.access-denied p {
    color: #6a6f73;
    line-height: 1.6;
    margin-bottom: 32px;
    font-size: 16px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.2s ease;
    margin: 4px;
}

.btn-primary {
    background: #a435f0;
    color: white;
}

.btn-primary:hover {
    background: #8710d8;
}

.btn-secondary {
    background: #fff;
    color: #1c1d1f;
    border: 1px solid #1c1d1f;
}

.btn-secondary:hover {
    background: #f7f9fa;
}

.playlist::-webkit-scrollbar {
    width: 8px;
}

.playlist::-webkit-scrollbar-track {
    background: #f7f9fa;
}

.playlist::-webkit-scrollbar-thumb {
    background: #d1d7dc;
    border-radius: 4px;
}

.playlist::-webkit-scrollbar-thumb:hover {
    background: #b4bcc4;
}

.success-message {
    padding: 12px 16px;
    margin-bottom: 16px;
    background: #ecf4e7;
    color: #3d7b2d;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    border-left: 4px solid #3d7b2d;
}

/* DESKTOP LAYOUT - Description à droite du player */
@media (min-width: 1025px) {
    .video-player-container {
        flex-direction: row;
        gap: 24px;
        padding: 24px;
        align-items: flex-start;
    }
    
    .video-wrapper {
        flex: 0 0 65%;
        max-width: 65%;
        background: #000;
    }
    
    .video-wrapper video {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
        max-height: none;
    }
    
    .video-description {
        flex: 1;
        padding: 20px;
        margin: 0;
        background: #f7f9fa;
        border-radius: 8px;
        border: 1px solid #d1d7dc;
        position: sticky;
        top: 24px;
        max-height: calc(100vh - 180px);
        overflow-y: auto;
    }
    
    .video-description h3 {
        margin-top: 0;
        font-size: 17px;
    }
    
    .video-description-content {
        font-size: 14px;
        line-height: 1.6;
        color: #1c1d1f;
    }
    
    /* Scrollbar personnalisée pour la description */
    .video-description::-webkit-scrollbar {
        width: 6px;
    }
    
    .video-description::-webkit-scrollbar-track {
        background: transparent;
        border-radius: 3px;
    }
    
    .video-description::-webkit-scrollbar-thumb {
        background: #d1d7dc;
        border-radius: 3px;
    }
    
    .video-description::-webkit-scrollbar-thumb:hover {
        background: #b4bcc4;
    }
}

/* Media Queries */
@media (max-width: 1024px) {
    .sidebar {
        width: 300px;
    }
    
    /* Layout vertical pour tablette */
    .video-player-container {
        flex-direction: column;
    }
    
    .video-wrapper video {
        max-height: 60vh;
    }
}

@media (max-width: 768px) {
    .formation-container {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 68px);
    }
    
    .sidebar {
        width: 100%;
        max-height: 40vh;
        border-right: none;
        border-bottom: 1px solid #d1d7dc;
    }
    
    .sidebar-header {
        padding: 16px;
    }
    
    .buy-section {
        padding: 12px 16px;
    }
    
    .playlist {
        max-height: calc(40vh - 200px);
    }
    
    .main-content {
        flex: 1;
        min-height: 60vh;
    }
    
    .content-header {
        padding: 12px 16px;
    }
    
    .content-header h2 {
        font-size: 16px;
    }
    
    .breadcrumb {
        font-size: 12px;
    }
    
    .back-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    video {
        max-height: none;
    }
    
    .video-description {
        padding: 16px;
    }
    
    .video-description h3 {
        font-size: 17px;
    }
    
    .video-description-content {
        font-size: 14px;
    }
    
    .access-denied {
        margin: 20px;
        padding: 32px 24px;
    }
    
    .access-denied h2 {
        font-size: 20px;
    }
    
    .access-denied p {
        font-size: 14px;
    }
    
    .btn {
        display: block;
        width: 100%;
        margin: 8px 0;
    }
}

@media (max-width: 480px) {
    .sidebar {
        max-height: 50vh;
    }
    
    .sidebar-header {
        padding: 12px;
    }
    
    .sidebar-header h2 {
        font-size: 16px;
    }
    
    .access-status,
    .user-info {
        font-size: 12px;
        padding: 10px;
    }
    
    .buy-btn {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .video-item a,
    .video-item .disabled {
        padding: 12px 16px;
    }
    
    .video-name {
        font-size: 13px;
    }
    
    .video-meta {
        font-size: 11px;
    }
    
    .content-header h2 {
        font-size: 14px;
    }
    
    .video-description {
        padding: 12px;
    }
    
    .video-description h3 {
        font-size: 16px;
    }
    
    .access-denied {
        padding: 24px 16px;
    }
}