/* === LAYOUT PRINCIPAL === */
.youtube-player-wrapper {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
}

.player-main {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    width: 100%;
    height: 100%;
}

.youtube-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* === ÉTATS DE CHARGEMENT / OVERLAYS === */
.completion-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: white;
    text-align: center;
    z-index: 10;
}

/* === OVERLAYS === */
.interaction-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.interaction-content {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.interaction-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.completion-content {
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.completion-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.completion-stats {
    background: rgba(255,255,255,0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    margin: 1rem 0;
    display: inline-block;
}

/* === PLAYER === */
.player-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.youtube-player {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

/* === INDICATEUR DE SÉQUENCE === */
.sequence-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sequence-info {
    flex: 1;
}

.sequence-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.sequence-progress {
    font-size: 0.9rem;
    opacity: 0.8;
}

.separator {
    margin: 0 0.25rem;
}

.phase-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px; /* pill */
    border: 1px solid transparent;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-top: 0.25rem;
}

.phase-pre { background: var(--info-color); border-color: var(--info-enhanced-color); color: #fff; }
.phase-video { background: var(--success-color); border-color: var(--success-enhanced-color); color: #fff; }
.phase-post { background: var(--warning-color); border-color: var(--warning-enhanced-color); color: #000; }
.phase-blocked { background: var(--danger-color); border-color: var(--danger-enhanced-color); color: #fff; }

.sequence-controls {
    margin-left: 1rem;
}

.audio-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.audio-btn:hover {
    background: rgba(255,255,255,0.3);
}

.audio-btn.playing {
    background: var(--warning-color);
    color: #000;
}

/* === CONTRÔLES === */
.player-controls {
    background: rgba(0,0,0,0.8);
    padding: 1rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.control-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: rgba(255,255,255,0.2);
}

.control-btn[disabled], .audio-btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.2);
}

.control-btn.primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.control-btn.primary:hover {
    background: var(--primary-enhanced-color);
}

/* Bouton brand remplaçant btn-primary */
.btn-brand {
    background: var(--primary-color);
    color: #fff;
    border: 1px solid var(--primary-color);
}
.btn-brand:hover {
    background: var(--primary-enhanced-color);
    border-color: var(--primary-enhanced-color);
    color: #fff;
}

/* === SIDEBAR SÉQUENCES === */
.sequences-sidebar {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    max-height: 600px;
    overflow-y: auto;
}

.sequences-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.sequences-header h4 {
    margin: 0;
    color: #495057;
    font-weight: 600;
}

.sequences-count {
    background: var(--primary-color);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
}

.sequences-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* === CARTES DE SÉQUENCES === */
.sequence-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sequence-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #28a745);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.sequence-card:hover {
    border-color: var(--primary-color);
    background: #f8f9ff;
    box-shadow: 0 4px 12px rgba(0,123,255,0.15);
}

.sequence-card:hover::before {
    transform: scaleX(1);
}

.sequence-card.active {
    border-color: var(--success-color);
    background: #d4edda;
    box-shadow: 0 4px 12px rgba(40,167,69,0.2);
}

.sequence-card.active::before {
    transform: scaleX(1);
    background: var(--success-color);
}

.sequence-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f8f9fa;
}

.sequence-card.has-audio {
    border-left: 4px solid var(--success-color);
}

.sequence-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.sequence-number {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-enhanced-color));
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    flex-shrink: 0;
}

.sequence-card.disabled .sequence-number {
    background: var(--secondary-color);
}

.sequence-card.active .sequence-number {
    background: linear-gradient(135deg, var(--success-color), var(--success-enhanced-color));
}

.sequence-title {
    flex: 1;
    font-weight: 600;
    color: var(--text-color, #ffffff);
    font-size: 0.95rem;
}

.sequence-status {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.status-badge {
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.disabled {
    background: var(--secondary-color);
    color: var(--on-secondary-color, #1d2025);
}

.status-badge.audio {
    background: var(--success-color);
    color: #fff;
}

.status-badge.timing {
    background: var(--info-color);
    color: #fff;
}

.sequence-card-body {
    margin-top: 0.5rem;
}

.sequence-timing {
    font-size: 0.875rem;
    color: var(--text-muted, #6c757d);
    margin-bottom: 0.75rem;
}

.duration {
    color: var(--text-muted-2, #adb5bd);
    font-style: italic;
}

.sequence-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.audio-control {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #495057;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.audio-control:hover {
    background: #e9ecef;
}

.audio-control.playing {
    background: var(--warning-color);
    color: #000;
    border-color: var(--warning-color);
}

.volume-indicator {
    font-size: 0.75rem;
    color: var(--text-muted, #6c757d);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* (audio-status supprimé car jugé non essentiel) */

/* === SPINNER === */
.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid #fff;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Réduction animations si l'utilisateur préfère moins de mouvement */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* === RESPONSIVE === */
@media (max-width: 1200px) {
}

@media (max-width: 768px) {
    .youtube-player-wrapper {
        width: 100%;
        height: 100%;
    }

    /* sidebar supprimé */

    .sequence-indicator {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .sequence-controls {
        margin-left: 0;
    }

    .player-controls {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .control-btn {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .sequences-header {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .sequence-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .sequence-status {
        width: 100%;
        justify-content: flex-start;
    }
}