/* ========================================
   COMPOSANT : PLAYER ADVANCED
   ======================================== 
   
   Extrait de : public/pages/index.php (styles inline)
   Date d'extraction : 2026-04-15
   Utilisé par : index.php (player Twitch avancé)
   Impact : MOYEN (toujours chargé)
   
   REFACTORING CSS - Phase 1
   
   Contient :
   - Timer de rotation
   - Notifications de clips
   - Messages de blocage Twitch
   - Boutons de raid
   - Vue multistream
   ======================================== */

/* Timer de rotation */
.timer-play-pause-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    margin-left: 0.75rem;
    transition: all 0.3s ease;
}

.timer-play-pause-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.timer-play-pause-btn:active {
    transform: scale(0.95);
}

.rotation-timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    scroll-margin: 0;
    scroll-behavior: auto;
}

/* Désactiver les animations quand le timer est en pause */
.rotation-timer.paused {
    animation: none !important;
    opacity: 0.8;
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.2) !important;
}

.rotation-timer.paused .timer-icon {
    animation: none !important;
    opacity: 0.6;
}

.rotation-timer.paused .timer-countdown {
    opacity: 0.7;
}

.timer-countdown {
    scroll-margin: 0;
    outline: none;
}

/* Message de reprise de clip */
.clip-resume-notification {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.95), rgba(79, 70, 229, 0.95));
    color: white;
    padding: 20px 30px;
    border-radius: 15px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    z-index: 1000;
    animation: clipResumeSlideIn 0.5s ease-out;
    max-width: 350px;
    line-height: 1.4;
}

.clip-resume-notification .resume-icon {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
    animation: clipResumeIconBounce 1s ease-in-out infinite;
}

.clip-resume-notification .resume-time {
    color: #fbbf24;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

@keyframes clipResumeSlideIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -60%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes clipResumeIconBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.clip-resume-notification.fade-out {
    animation: clipResumeFadeOut 0.5s ease-in forwards;
}

@keyframes clipResumeFadeOut {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

/* Overlay noir transparent pour la confirmation */
.clip-resume-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    animation: clipOverlayFadeIn 0.3s ease-out;
    backdrop-filter: blur(2px);
}

/* Boîte de confirmation de reprise */
.clip-resume-confirmation {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.98), rgba(50, 50, 50, 0.98));
    color: white;
    padding: 25px 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    z-index: 1001;
    animation: clipConfirmSlideIn 0.4s ease-out;
    max-width: 400px;
    min-width: 320px;
}

.clip-resume-confirmation .confirm-icon {
    font-size: 32px;
    margin-bottom: 15px;
    display: block;
    animation: clipConfirmIconPulse 2s ease-in-out infinite;
}

.clip-resume-confirmation .confirm-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #fbbf24;
}

.clip-resume-confirmation .confirm-message {
    font-size: 14px;
    margin-bottom: 20px;
    opacity: 0.9;
    line-height: 1.4;
}

.clip-resume-confirmation .confirm-time {
    color: #10b981;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.clip-resume-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
}

.clip-resume-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    position: relative;
    overflow: hidden;
}

.clip-resume-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.clip-resume-btn:hover:before {
    left: 100%;
}

.clip-resume-btn.resume {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.clip-resume-btn.resume:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.clip-resume-btn.restart {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
    box-shadow: 0 4px 15px rgba(107, 114, 128, 0.3);
}

.clip-resume-btn.restart:hover {
    background: linear-gradient(135deg, #4b5563, #374151);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 114, 128, 0.4);
}

@keyframes clipConfirmSlideIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -60%) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes clipConfirmIconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes clipOverlayFadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.clip-resume-overlay.fade-out {
    animation: clipOverlayFadeOut 0.3s ease-in forwards;
}

@keyframes clipOverlayFadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Notification du prochain clip */
.next-clip-notification {
    position: absolute;
    top: 20px;
    scroll-margin: 0;
    scroll-behavior: auto;
    right: 20px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.85));
    border: 2px solid rgba(165, 107, 255, 0.8);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    max-width: 350px;
    z-index: 1000;
    backdrop-filter: blur(10px);
    animation: slideInFromRight 0.5s ease-out;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

@keyframes slideInFromRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.next-clip-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.next-clip-header {
    font-size: 0.9rem;
    color: #A56BFF;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#next-clip-countdown {
    color: #FF6FB1;
    font-size: 1.1rem;
}

.next-clip-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    line-height: 1.3;
}

.next-clip-streamer {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Message de blocage Twitch */
.twitch-blocked-message {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 480px;
    border: 2px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
}

.blocked-content {
    text-align: center;
    padding: 2rem;
    max-width: 500px;
}

.blocked-content h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.blocked-content p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.blocked-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-enable-cookies, .btn-reload {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-enable-cookies {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
}

.btn-enable-cookies:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(139, 92, 246, 0.4);
}

.btn-reload {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-reload:hover {
    background: var(--bg-card);
    transform: translateY(-2px);
}

/* Styles pour les boutons de raid */
.card-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
}

.raid-btn {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.raid-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.5);
    background: linear-gradient(135deg, #f7931e, #ff6b35);
}

.raid-btn:active {
    transform: translateY(0);
}

/* S'assurer que les cartes de streamers ont une position relative */
.streamer-mini-card {
    position: relative;
}

/* Modal de raid temporaire */
.raid-auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.raid-auth-content {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.raid-auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text);
}

.raid-auth-description {
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.raid-auth-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.raid-auth-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.raid-auth-btn.primary {
    background: linear-gradient(135deg, #9146ff, #772ce8);
    color: white;
    box-shadow: 0 4px 12px rgba(145, 70, 255, 0.3);
}

.raid-auth-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(145, 70, 255, 0.4);
}

.raid-auth-btn.secondary {
    background: var(--bg-secondary);
    color: var(--text);
    border: 2px solid var(--border);
}

.raid-auth-btn.secondary:hover {
    background: var(--bg-card);
    transform: translateY(-2px);
}

.raid-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
}

.raid-status.success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.raid-status.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.raid-status.loading {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* ===== VUE MULTISTREAM ===== */
.multistream-container {
    display: none !important;
    visibility: hidden;
    width: 100%;
    height: 480px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.multistream-container.active {
    display: block !important;
    visibility: visible;
}

/* S'assurer que le lecteur principal et multistream ne sont jamais visibles ensemble */
.player-container:has(.multistream-container.active) #twitch-embed {
    display: none !important;
    visibility: hidden;
}

.multistream-container:not(.active) {
    display: none !important;
    visibility: hidden;
}

.multistream-grid {
    display: grid;
    width: 100%;
    height: 100%;
    gap: 2px;
    background: #1a1a1a;
}

.multistream-grid.grid-1 {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

.multistream-grid.grid-2 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
}

.multistream-grid.grid-3 {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.multistream-grid.grid-3 .multistream-player:first-child {
    grid-row: 1 / 3;
}

.multistream-grid.grid-4 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.multistream-grid.grid-5,
.multistream-grid.grid-6 {
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
}

.multistream-grid.grid-5 .multistream-player:first-child,
.multistream-grid.grid-6 .multistream-player:first-child {
    grid-row: 1 / 3;
}

.multistream-player {
    position: relative;
    background: #000;
    overflow: hidden;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.multistream-player:hover {
    transform: scale(1.02);
    z-index: 10;
    box-shadow: 0 4px 12px rgba(165, 107, 255, 0.4);
}

.multistream-player.main-player {
    border: 3px solid #A56BFF;
    box-shadow: 0 0 15px rgba(165, 107, 255, 0.6);
}

.multistream-player.main-player:hover {
    box-shadow: 0 4px 20px rgba(165, 107, 255, 0.8);
}

.multistream-player iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.multistream-player-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.multistream-player:hover .multistream-player-info {
    opacity: 1;
}

.multistream-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 100;
}

.multistream-btn {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.multistream-btn:hover {
    background: rgba(165, 107, 255, 0.8);
    border-color: rgba(165, 107, 255, 1);
}

.multistream-layout-selector {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: flex;
    gap: 0.25rem;
    z-index: 100;
}

.layout-btn {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.layout-btn.active {
    background: rgba(165, 107, 255, 0.8);
    border-color: rgba(165, 107, 255, 1);
}

.layout-btn:hover {
    background: rgba(165, 107, 255, 0.6);
}

/* Responsive */
@media (max-width: 768px) {
    .blocked-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-enable-cookies, .btn-reload {
        width: 200px;
    }
    
    .multistream-container {
        height: 300px;
    }
    
    .multistream-grid.grid-3,
    .multistream-grid.grid-4,
    .multistream-grid.grid-5,
    .multistream-grid.grid-6 {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr;
    }
    
    .multistream-grid.grid-3 .multistream-player:first-child,
    .multistream-grid.grid-5 .multistream-player:first-child,
    .multistream-grid.grid-6 .multistream-player:first-child {
        grid-row: auto;
    }
}
