/**
 * ═══════════════════════════════════════════════════════════════════════════
 * INDEX - PLAYER NOTIFICATIONS
 * ═══════════════════════════════════════════════════════════════════════════
 * 
 * OBJECTIF:
 * Afficher des notifications dans le player pour informer l'utilisateur:
 * - Reprise d'un clip à un timestamp spécifique
 * - Prochain clip qui arrive (countdown)
 * - Stream offline (message d'erreur)
 * - Blocage Twitch (cookies tiers désactivés)
 * 
 * TYPES DE NOTIFICATIONS:
 * 1. Clip Resume: "Reprendre à X:XX ?" avec boutons Reprendre/Recommencer
 * 2. Next Clip: Countdown avant le prochain clip avec titre et streamer
 * 3. Offline: Message quand le stream est hors ligne
 * 4. Twitch Blocked: Instructions pour activer les cookies tiers
 * 
 * CHARGEMENT: Avec cache busting
 * TAILLE: 9.1 KB
 * 
 * DÉPENDANCES:
 * - JavaScript: index-offline-handler.js (gère les clips et offline)
 * - LocalStorage: Sauvegarde des timestamps de reprise
 * ═══════════════════════════════════════════════════════════════════════════
 */

/* ===== NOTIFICATION 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);
}

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

@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);
    }
}

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

/* ===== OVERLAY ET CONFIRMATION DE REPRISE ===== */
.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);
}

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

.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;
    }
}

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

/* ===== NOTIFICATION DU PROCHAIN CLIP ===== */
.next-clip-notification {
    position: absolute;
    top: 20px;
    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);
    scroll-margin: 0;
    scroll-behavior: auto;
}

@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;
    font-weight: 800;
}

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

.next-clip-streamer {
    font-size: 0.85rem;
    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);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .blocked-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-enable-cookies, .btn-reload {
        width: 200px;
    }
    
    .next-clip-notification {
        top: 10px;
        right: 10px;
        max-width: calc(100vw - 20px);
        padding: 0.75rem 1rem;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   FIN DU FICHIER
   ═══════════════════════════════════════════════════════════════════════════
   
   RÉSUMÉ:
   Ce fichier gère toutes les notifications affichées dans le player
   pour améliorer l'expérience utilisateur lors de la lecture de clips.
   
   NOTIFICATIONS:
   1. Clip Resume (centre): Demande si l'utilisateur veut reprendre où il s'était arrêté
   2. Next Clip (haut droite): Countdown avant le prochain clip avec preview
   3. Offline (centre): Message quand le stream est hors ligne
   4. Twitch Blocked (centre): Instructions pour activer les cookies tiers
   
   ANIMATIONS:
   - clipResumeSlideIn: Apparition du centre avec scale
   - clipResumeIconBounce: Icône qui rebondit
   - slideInFromRight: Notification qui arrive de la droite
   - clipConfirmIconPulse: Icône qui pulse
   
   COULEURS:
   - Violet/Indigo: Notifications de reprise (#9333ea, #4f46e5)
   - Vert: Bouton "Reprendre" (#10b981)
   - Gris: Bouton "Recommencer" (#6b7280)
   - Jaune: Temps de reprise (#fbbf24)
   
   TECHNIQUE:
   - Overlay avec backdrop-filter blur pour le fond
   - Gradient backgrounds pour les notifications
   - Boutons avec effet de brillance au hover (::before)
   - Animations CSS pour les transitions smooth
   
   MAINTENANCE:
   Pour changer les durées d'animation, modifier les valeurs dans @keyframes
   Pour changer les couleurs, modifier les gradients linear-gradient()
   
   DERNIÈRE MISE À JOUR: 6 mai 2026
   ═══════════════════════════════════════════════════════════════════════════
*/
