/**
 * Geektaku Stream Widget - Styles pour Elementor
 * Design correspondant à l'image de référence
 */

/* Reset et styles de base */
.geektaku-stream-wrapper * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Variables CSS pour les couleurs personnalisables */
.geektaku-stream-widget {
    --bg-start: #0e5577;
    --bg-middle: #0c4a6e;
    --bg-end: #0a3d5c;
}

/* Widget en mode Fixe à droite */
.geektaku-stream-wrapper.stream-widget-fixed-right .geektaku-stream-widget {
    position: fixed;
    right: 0;
    top: 0;
    width: 320px;
    height: 100vh;
    background: linear-gradient(180deg, var(--bg-start) 0%, var(--bg-middle) 50%, var(--bg-end) 100%);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1;
    border-radius: 0;
}

/* Widget en mode Fixe à gauche */
.geektaku-stream-wrapper.stream-widget-fixed-left .geektaku-stream-widget {
    position: fixed;
    left: 0;
    top: 0;
    width: 320px;
    height: 100vh;
    background: linear-gradient(180deg, var(--bg-start) 0%, var(--bg-middle) 50%, var(--bg-end) 100%);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1;
    border-radius: 0;
}

/* Widget en mode Inline (intégré dans la sidebar/contenu) */
.geektaku-stream-wrapper.stream-widget-inline .geektaku-stream-widget {
    position: relative;
    width: 100%;
    background: linear-gradient(180deg, var(--bg-start) 0%, var(--bg-middle) 50%, var(--bg-end) 100%);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

/* En-tête du widget - Design exact de l'image */
.geektaku-stream-widget .stream-widget-header {
    background: rgba(0, 0, 0, 0.3);
    padding: 18px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1;
    backdrop-filter: blur(10px);
}

.geektaku-stream-widget .stream-widget-header h2 {
    color: white;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.geektaku-stream-widget .stream-close-btn {
    background: rgba(255, 82, 82, 0.2);
    border: 1px solid rgba(255, 82, 82, 0.4);
    color: #ff5252;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
    font-weight: 300;
    line-height: 1;
}

.geektaku-stream-widget .stream-close-btn:hover {
    background: rgba(255, 82, 82, 0.4);
    border-color: #ff5252;
    transform: rotate(90deg);
}

/* Liste des partenaires */
.geektaku-stream-widget .stream-partners-list {
    padding: 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Supprimer la scrollbar de la liste */
.geektaku-stream-widget .stream-partners-list::-webkit-scrollbar {
    display: none;
}

.geektaku-stream-widget .stream-partners-list {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Carte de partenaire - Design exact de l'image */
.geektaku-stream-widget .stream-partner-card {
    padding: 0;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
}

.geektaku-stream-widget .stream-partner-card:hover {
    background: rgba(255, 255, 255, 0.05);
}

.geektaku-stream-widget .stream-partner-card.live {
    background: rgba(239, 68, 68, 0.05);
}

/* En-tête de la carte */
.geektaku-stream-widget .stream-partner-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
}

/* Avatar du partenaire */
.geektaku-stream-widget .stream-partner-avatar {
    position: relative;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
}

.geektaku-stream-widget .stream-partner-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    object-fit: cover;
    background: #0a3d5c;
}

.geektaku-stream-widget .stream-partner-avatar.live img {
    border-color: #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
    animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% {
        box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
    }
    50% {
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.8);
    }
}

/* Indicateur de statut */
.geektaku-stream-widget .stream-status-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #0c4a6e;
    background-color: #6b7280;
}

.geektaku-stream-widget .stream-status-indicator.online {
    background-color: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.7);
    animation: statusPulse 2s ease-in-out infinite;
}

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

/* Info du partenaire */
.geektaku-stream-widget .stream-partner-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.geektaku-stream-widget .stream-partner-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.geektaku-stream-widget .stream-partner-name {
    color: white;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.geektaku-stream-widget .stream-partner-game {
    color: rgba(255, 255, 255, 0.65);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Indicateur EN DIRECT (à côté du pseudo) */
.geektaku-stream-widget .stream-live-indicator {
    color: #ef4444;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: liveIndicatorPulse 2s ease-in-out infinite;
    white-space: nowrap;
    flex-shrink: 0;
}

@keyframes liveIndicatorPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Actions du partenaire (spectateurs + badges) */
.geektaku-stream-widget .stream-partner-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.geektaku-stream-widget .stream-viewers-badge {
    display: flex;
    align-items: center;
    gap: 3px;
    background: rgba(0, 0, 0, 0.3);
    padding: 3px 7px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.geektaku-stream-widget .stream-viewers-badge i {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

/* Conteneur des badges de plateformes */
.geektaku-stream-widget .stream-partner-platforms {
    display: flex;
    gap: 4px;
    align-self: flex-start;
}

/* Badge plateforme */
.geektaku-stream-widget .stream-partner-platform {
    font-size: 16px;
    padding: 6px 8px;
    border-radius: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.geektaku-stream-widget .stream-partner-platform:hover {
    opacity: 1;
    transform: scale(1.1);
}

.geektaku-stream-widget .stream-partner-platform.live {
    opacity: 1;
    animation: platformPulse 2s ease-in-out infinite;
}

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

.geektaku-stream-widget .stream-partner-platform.twitch {
    background: #9146ff;
    color: white;
}

.geektaku-stream-widget .stream-partner-platform.tiktok {
    background: linear-gradient(45deg, #ff0050, #00f2ea);
    color: white;
}

.geektaku-stream-widget .stream-partner-platform i {
    font-size: 16px;
}

/* Preview du stream - EXACTEMENT comme dans l'image */
.geektaku-stream-widget .stream-preview-container {
    width: 100%;
    height: 180px;
    position: relative;
    background: #000;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.geektaku-stream-widget .stream-preview-container:hover {
    transform: scale(1.02);
}

/* Supprimer la scrollbar */
.geektaku-stream-widget .stream-preview-container::-webkit-scrollbar {
    display: none;
}

.geektaku-stream-widget .stream-preview-container {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.geektaku-stream-widget .stream-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Lecteur vidéo intégré dans la carte */
.geektaku-stream-widget .stream-preview-container .stream-player-embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 5;
    display: none;
}

.geektaku-stream-widget .stream-preview-container .stream-player-embed.active {
    display: block;
}

.geektaku-stream-widget .stream-preview-container .stream-player-embed iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Masquer la thumbnail et les overlays quand le lecteur est actif */
.geektaku-stream-widget .stream-preview-container.playing img,
.geektaku-stream-widget .stream-preview-container.playing .stream-preview-overlay,
.geektaku-stream-widget .stream-preview-container.playing .stream-live-badge,
.geektaku-stream-widget .stream-preview-container.playing .stream-viewer-count,
.geektaku-stream-widget .stream-preview-container.playing .stream-play-overlay {
    display: none;
}

/* Overlay avec bouton Play */
.geektaku-stream-widget .stream-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    pointer-events: none;
}

.geektaku-stream-widget .stream-preview-container:hover .stream-play-overlay {
    background: rgba(0, 0, 0, 0.5);
}

.geektaku-stream-widget .stream-play-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.geektaku-stream-widget .stream-preview-container:hover .stream-play-button {
    transform: scale(1.1);
    background: white;
}

.geektaku-stream-widget .stream-play-button i {
    font-size: 24px;
    color: #ef4444;
    margin-left: 4px;
}

/* Bouton pour réduire le lecteur - SUPPRIMÉ (non utilisé) */

/* État réduit */
.geektaku-stream-widget .stream-preview-container.minimized {
    height: 0;
    min-height: 0;
    cursor: pointer;
    overflow: hidden;
}

.geektaku-stream-widget .stream-preview-container.minimized .stream-player-embed {
    display: none !important;
}

.geektaku-stream-widget .stream-preview-container.minimized img {
    display: none;
}

.geektaku-stream-widget .stream-preview-container.minimized .stream-live-badge,
.geektaku-stream-widget .stream-preview-container.minimized .stream-viewer-count,
.geektaku-stream-widget .stream-preview-container.minimized .stream-preview-overlay {
    display: none;
}

/* Overlay pour le preview */
.geektaku-stream-widget .stream-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 50%, rgba(0,0,0,0.4) 100%);
    pointer-events: none;
}

/* Nombre de spectateurs */
.geektaku-stream-widget .stream-viewer-count {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
    backdrop-filter: blur(5px);
}

.geektaku-stream-widget .stream-viewer-count::before {
    content: "👁️";
    font-size: 13px;
}

/* Badge LIVE */
.geektaku-stream-widget .stream-live-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #ef4444;
    color: white;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: liveBadgePulse 2s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

@keyframes liveBadgePulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.85;
    }
}

/* Placeholder pour preview (éditeur Elementor) */
.geektaku-stream-widget .stream-preview-placeholder {
    width: 100%;
    height: 140px;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.geektaku-stream-widget .stream-preview-text {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    font-weight: 600;
}

.geektaku-stream-widget .stream-preview-note {
    color: rgba(255, 255, 255, 0.3);
    font-size: 11px;
}

/* État vide */
.geektaku-stream-widget .stream-empty-state {
    padding: 40px 20px;
    text-align: center;
}

.geektaku-stream-widget .stream-empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.geektaku-stream-widget .stream-empty-title {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.geektaku-stream-widget .stream-empty-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    line-height: 1.6;
}

/* Message de chargement */
.geektaku-stream-widget .stream-loading-message {
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    padding: 30px 20px;
    font-size: 14px;
}

/* Modal pour le stream */
.geektaku-stream-wrapper .geektaku-stream-modal {
    display: none;
}

/* Lecteur vidéo intégré dans le widget - Supprimé (non utilisé) */

/* Scrollbar personnalisée */
.geektaku-stream-widget::-webkit-scrollbar {
    width: 6px;
}

.geektaku-stream-widget::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.geektaku-stream-widget::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.geektaku-stream-widget::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .geektaku-stream-wrapper.stream-widget-fixed-right .geektaku-stream-widget,
    .geektaku-stream-wrapper.stream-widget-fixed-left .geektaku-stream-widget {
        width: 100%;
        left: 0;
        right: 0;
    }
    
    .geektaku-stream-wrapper .stream-modal-content {
        width: 95%;
        height: 75%;
    }
}

/* Ajustements pour Elementor Editor */
.elementor-editor-active .stream-widget-fixed-right .geektaku-stream-widget,
.elementor-editor-active .stream-widget-fixed-left .geektaku-stream-widget {
    position: relative;
    height: auto;
    max-height: 600px;
}

.elementor-editor-active .geektaku-stream-widget .stream-widget-header {
    position: relative;
}

/* Mode inline dans l'éditeur Elementor */
.elementor-editor-active .stream-widget-inline .geektaku-stream-widget {
    max-height: 600px;
}
