/**
 * CLIPS UPCOMING - Section événement à venir
 * 
 * Composant pour afficher la page clips en mode "upcoming"
 * Utilisé quand l'événement n'a pas encore commencé
 * 
 * CHARGEMENT: Conditionnel si $currentEvent['status'] === 'upcoming'
 * DÉPENDANCES: animations.css (pour les animations globales)
 * 
 * SECTIONS:
 * - Header avec countdown
 * - Section streamers en live
 * - Contenu en 2 colonnes (streamers + liens rapides)
 * - Clips des éditions précédentes
 * - Responsive mobile
 */

/* ===== SECTION UPCOMING - DESIGN MODERNE ===== */
.upcoming-clips-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Espacement entre les sections */
.upcoming-clips-page > * + * {
    margin-top: 3rem;
}

/* Header avec countdown - VERSION DISCRÈTE */
.upcoming-header {
    text-align: center;
    padding: 1.5rem 1.5rem;
    background: linear-gradient(135deg, rgba(165, 107, 255, 0.06), rgba(255, 111, 177, 0.06));
    border-radius: 16px;
    margin-bottom: 2rem;
    border: 1px solid rgba(165, 107, 255, 0.15);
}

.upcoming-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(165, 107, 255, 0.08), transparent 70%);
    pointer-events: none;
}

.upcoming-header-content { 
    max-width: 900px; 
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.upcoming-title {
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, #A56BFF, #FF6FB1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 0.35rem;
    letter-spacing: -0.01em;
}

.upcoming-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0 0 1.25rem;
    font-weight: 400;
}

/* Countdown COMPACT ET DISCRET */
.countdown {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(165, 107, 255, 0.2);
}

.countdown-item { 
    text-align: center; 
    min-width: 55px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.countdown-value {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #A56BFF, #FF6FB1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    line-height: 1;
}

.countdown-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.countdown-sep {
    font-size: 1.5rem;
    color: rgba(165, 107, 255, 0.3);
    font-weight: 300;
    margin: 0 0.25rem;
    align-self: center;
}

/* Section Live */
.live-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 0, 0, 0.04);
    border-radius: 16px;
    border: 1px solid rgba(255, 0, 0, 0.12);
}

/* ===== SECTION RÉSEAUX SOCIAUX - WIDGETS EMBARQUÉS ===== */
.social-section {
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(165, 107, 255, 0.08), rgba(255, 111, 177, 0.08));
    border-radius: 20px;
    border: 2px solid rgba(165, 107, 255, 0.15);
}

.social-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 2rem;
    text-align: center;
    background: linear-gradient(135deg, #A56BFF, #FF6FB1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.social-widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.social-widget {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.social-widget:hover {
    transform: translateY(-4px);
    border-color: var(--widget-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.widget-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--widget-color-1), var(--widget-color-2));
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.widget-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.widget-title h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
}

.widget-title p {
    margin: 0.25rem 0 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    font-family: monospace;
}

.widget-content {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.widget-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.widget-placeholder,
.instagram-embed-placeholder,
.tiktok-embed-placeholder {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.widget-placeholder p,
.instagram-embed-placeholder p,
.tiktok-embed-placeholder p {
    margin: 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.widget-placeholder small,
.instagram-embed-placeholder small,
.tiktok-embed-placeholder small {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Loading spinner */
.social-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    gap: 1rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(165, 107, 255, 0.2);
    border-top-color: #A56BFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.social-loading p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Message de configuration */
.social-config-needed {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.config-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}

.social-config-needed h4 {
    margin: 0 0 0.75rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.social-config-needed p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.social-config-needed ul {
    list-style: none;
    padding: 0;
    font-size: 0.85rem;
    line-height: 1.8;
}

.social-config-needed ul li:before {
    content: "→ ";
    color: #A56BFF;
    font-weight: bold;
}

.config-link {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #A56BFF, #FF6FB1);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.2s;
}

.config-link:hover {
    transform: translateY(-2px);
}

.widget-link {
    display: block;
    padding: 1rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.widget-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--widget-color);
}

/* Couleurs spécifiques par widget */
.twitch-widget {
    --widget-color: #9146FF;
    --widget-color-1: #9146FF;
    --widget-color-2: #772CE8;
}

.discord-widget {
    --widget-color: #5865F2;
    --widget-color-1: #5865F2;
    --widget-color-2: #4752C4;
}

.instagram-widget {
    --widget-color: #E4405F;
    --widget-color-1: #E4405F;
    --widget-color-2: #C13584;
}

.tiktok-widget {
    --widget-color: #000000;
    --widget-color-1: #000000;
    --widget-color-2: #EE1D52;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #ff0000;
    border-radius: 50%;
    animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.count-badge {
    background: linear-gradient(135deg, #FF6FB1, #A56BFF);
    color: white;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
}

.live-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.live-card {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s, box-shadow 0.2s;
}

.live-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(255, 0, 0, 0.15);
}

.live-thumb {
    position: relative;
    height: 110px;
    background-size: cover;
    background-position: center;
    background-color: #1a1a2e;
}

.live-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #ff0000;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.live-viewers {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
}

.live-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem;
}

.live-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #ff0000;
    object-fit: cover;
}

.live-name {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-game {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Contenu en 2 colonnes - PLUS AÉRÉ */
.content-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.content-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s;
}

.content-box:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(165, 107, 255, 0.2);
    transform: translateY(-2px);
}

.box-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

/* Grille d'avatars - PLUS GRANDE */
.avatars-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
}

.avatars-grid::-webkit-scrollbar { 
    width: 6px; 
}

.avatars-grid::-webkit-scrollbar-thumb { 
    background: linear-gradient(180deg, #A56BFF, #FF6FB1); 
    border-radius: 3px; 
}

.avatar-link {
    display: block;
    transition: transform 0.2s;
}

.avatar-link:hover { 
    transform: scale(1.15); 
}

.avatar-link img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid rgba(165, 107, 255, 0.3);
    object-fit: cover;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.avatar-link:hover img {
    border-color: #A56BFF;
    box-shadow: 0 6px 20px rgba(165, 107, 255, 0.4);
}

/* Liens rapides - PLUS VISIBLES */
.quick-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(165, 107, 255, 0.1);
    border: 2px solid rgba(165, 107, 255, 0.2);
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.quick-link:hover {
    background: rgba(165, 107, 255, 0.2);
    border-color: rgba(165, 107, 255, 0.4);
    transform: translateX(8px);
    box-shadow: 0 4px 16px rgba(165, 107, 255, 0.2);
}

.social-icon-svg {
    filter: brightness(0) invert(1);
    flex-shrink: 0;
}

.quick-link.discord { 
    border-color: rgba(88, 101, 242, 0.3); 
    background: rgba(88, 101, 242, 0.1);
}

.quick-link.discord:hover { 
    background: rgba(88, 101, 242, 0.2); 
    border-color: rgba(88, 101, 242, 0.5);
}

.quick-link.twitter { 
    border-color: rgba(29, 161, 242, 0.3);
    background: rgba(29, 161, 242, 0.1);
}

.quick-link.twitter:hover {
    background: rgba(29, 161, 242, 0.2);
    border-color: rgba(29, 161, 242, 0.5);
}

.quick-link.twitch {
    border-color: rgba(145, 70, 255, 0.3);
    background: rgba(145, 70, 255, 0.1);
}

.quick-link.twitch:hover {
    background: rgba(145, 70, 255, 0.2);
    border-color: rgba(145, 70, 255, 0.5);
}

.quick-link.instagram {
    border-color: rgba(228, 64, 95, 0.3);
    background: rgba(228, 64, 95, 0.1);
}

.quick-link.instagram:hover {
    background: rgba(228, 64, 95, 0.2);
    border-color: rgba(228, 64, 95, 0.5);
}

.quick-link.tiktok {
    border-color: rgba(238, 29, 82, 0.3);
    background: rgba(238, 29, 82, 0.1);
}

.quick-link.tiktok:hover {
    background: rgba(238, 29, 82, 0.2);
    border-color: rgba(238, 29, 82, 0.5);
}

.quick-link.youtube {
    border-color: rgba(255, 0, 0, 0.3);
    background: rgba(255, 0, 0, 0.1);
}

.quick-link.youtube:hover {
    background: rgba(255, 0, 0, 0.2);
    border-color: rgba(255, 0, 0, 0.5);
}

.quick-link.youtube {
    border-color: rgba(255, 0, 0, 0.3);
    background: rgba(255, 0, 0, 0.1);
}

.quick-link.youtube:hover {
    background: rgba(255, 0, 0, 0.2);
    border-color: rgba(255, 0, 0, 0.5);
}

/* Section clips */
.clips-section {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.clips-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.event-select {
    background: rgba(165, 107, 255, 0.1);
    border: 1px solid rgba(165, 107, 255, 0.2);
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    color: var(--text);
    font-size: 0.75rem;
    cursor: pointer;
    outline: none;
}

.event-select:focus { 
    border-color: #A56BFF; 
}

.clips-scroll {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scroll-behavior: smooth;
}

.clips-scroll::-webkit-scrollbar { 
    height: 5px; 
}

.clips-scroll::-webkit-scrollbar-thumb { 
    background: linear-gradient(90deg, #A56BFF, #FF6FB1); 
    border-radius: 3px; 
}

.clip-item {
    flex: 0 0 180px;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s;
}

.clip-item:hover { 
    transform: translateY(-3px); 
}

.clip-thumb {
    position: relative;
    height: 100px;
    background-size: cover;
    background-position: center;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
}

.clip-duration {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.85);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
}

.clip-item .clip-title {
    font-size: 0.75rem;
    font-weight: 500;
    margin: 0.4rem 0 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clip-author {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .upcoming-clips-page { 
        padding: 1rem; 
    }
    
    .upcoming-header { 
        padding: 1.25rem 1rem; 
    }
    
    .upcoming-title { 
        font-size: 1.25rem; 
    }
    
    .upcoming-subtitle {
        font-size: 0.85rem;
    }
    
    /* Countdown responsive */
    .countdown {
        gap: 0.5rem;
        padding: 0.65rem 1.25rem;
    }
    
    .countdown-item {
        min-width: 45px;
    }
    
    .countdown-value {
        font-size: 1.5rem;
    }
    
    .countdown-label {
        font-size: 0.65rem;
    }
    
    .countdown-sep {
        font-size: 1.25rem;
    }
    
    /* Social widgets responsive */
    .social-widgets-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .widget-content {
        min-height: 250px;
    }
    
    .content-row { 
        grid-template-columns: 1fr; 
        gap: 1.5rem;
    }
    
    .content-box {
        padding: 1.5rem;
    }
    
    .live-grid { 
        grid-template-columns: repeat(2, 1fr); 
    }
    
    .live-thumb { 
        height: 90px; 
    }
    
    .clip-item { 
        flex: 0 0 160px; 
    }
}

@media (max-width: 480px) {
    .upcoming-title {
        font-size: 1.1rem;
    }
    
    .upcoming-subtitle {
        font-size: 0.8rem;
    }
    
    .countdown {
        gap: 0.4rem;
        padding: 0.6rem 1rem;
    }
    
    .countdown-item {
        min-width: 40px;
    }
    
    .countdown-value {
        font-size: 1.35rem;
    }
    
    .countdown-label {
        font-size: 0.6rem;
    }
    
    .countdown-sep {
        font-size: 1.1rem;
    }
    
    .social-widgets-grid {
        grid-template-columns: 1fr;
    }
    
    .widget-header {
        padding: 1rem;
    }
    
    .widget-icon {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .live-grid {
        grid-template-columns: 1fr;
    }
}
