/**
 * Styles pour le frontend du plugin Live Stream
 */

/* ====================
   CONTENEUR PRINCIPAL
   ==================== */

.wcls-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px;
}

.wcls-container.wcls-full-width {
    max-width: 100%;
}

/* ====================
   EN-TÊTE DU LIVE
   ==================== */

.wcls-live-header {
    margin-bottom: 24px;
}

.wcls-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.wcls-live-badge.wcls-archived {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
}

.wcls-live-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #fff;
    border-radius: 50%;
    animation: wcls-pulse-light 2s ease-in-out infinite;
}

@keyframes wcls-pulse-light {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

.wcls-live-title {
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 16px 0;
    line-height: 1.2;
}

.wcls-live-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.wcls-live-show {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

.wcls-live-duration {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f1f5f9;
    color: #667eea;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.wcls-live-duration svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.wcls-live-participants {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

.wcls-live-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

.wcls-icon {
    display: inline-block;
    vertical-align: middle;
}

.wcls-live-description {
    font-size: 16px;
    color: #64748b;
    line-height: 1.6;
}

/* ====================
   CONTENU DU LIVE
   ==================== */

.wcls-live-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
    margin-bottom: 40px;
}

@media (max-width: 1024px) {
    .wcls-live-content {
        grid-template-columns: 1fr;
    }
}

/* Contenu vidéo pour les lives archivés (sans chat) */
.wcls-archive-video {
    margin-bottom: 40px;
}

/* ====================
   LECTEUR VIDÉO
   ==================== */

.wcls-video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    background: #000;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.wcls-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

.wcls-video-container.wcls-video-full {
    max-width: 1200px;
    margin: 0 auto;
}

.wcls-video-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    padding: 60px 40px;
    text-align: center;
    color: #64748b;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #cbd5e1;
}

.wcls-video-error svg {
    color: #94a3b8;
    margin-bottom: 20px;
}

.wcls-video-error p {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #475569;
}

/* ====================
   TCHAT
   ==================== */

.wcls-chat-container {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    height: fit-content;
    max-height: 700px;
}

.wcls-chat-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.wcls-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.wcls-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8fafc;
    min-height: 400px;
    max-height: 500px;
}

.wcls-chat-message {
    margin-bottom: 16px;
    animation: wcls-slide-in 0.3s ease-out;
}

@keyframes wcls-slide-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wcls-chat-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.wcls-chat-user {
    color: #667eea;
    font-size: 14px;
    font-weight: 600;
}

.wcls-chat-message-own .wcls-chat-user {
    color: #10b981;
}

.wcls-chat-time {
    color: #94a3b8;
    font-size: 12px;
}

.wcls-chat-message-content {
    color: #1e293b;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    background: #fff;
    padding: 10px 12px;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.wcls-chat-message-own .wcls-chat-message-content {
    border-left-color: #10b981;
    background: #f0fdf4;
}

.wcls-no-messages {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
    font-size: 14px;
}

.wcls-chat-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 20px;
    color: #64748b;
    font-size: 14px;
}

.wcls-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-radius: 50%;
    border-top-color: #667eea;
    animation: wcls-spin 0.8s linear infinite;
}

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

/* ====================
   FORMULAIRE DE TCHAT
   ==================== */

.wcls-chat-form {
    padding: 16px 20px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
}

#wcls-chat-form {
    display: flex;
    gap: 12px;
}

#wcls-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#wcls-chat-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.wcls-chat-send {
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wcls-chat-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.wcls-chat-send:active {
    transform: translateY(0);
}

.wcls-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.wcls-chat-login-required {
    text-align: center;
    padding: 20px;
}

.wcls-chat-login-required p {
    margin-bottom: 16px;
    color: #64748b;
    font-size: 14px;
}

.wcls-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.wcls-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.wcls-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    color: #fff;
}

/* ====================
   AUCUN LIVE EN COURS
   ==================== */

.wcls-no-live {
    text-align: center;
    padding: 80px 40px;
    margin-bottom: 60px;
}

.wcls-no-live-icon {
    margin-bottom: 24px;
    color: #cbd5e1;
}

.wcls-no-live h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 12px 0;
}

.wcls-no-live p {
    font-size: 16px;
    color: #64748b;
    margin: 0;
    max-width: 600px;
    margin: 0 auto;
}

/* ====================
   LIVES PROGRAMMÉS
   ==================== */

.wcls-scheduled {
    margin-top: 48px;
    margin-bottom: 48px;
}

.wcls-scheduled-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.wcls-scheduled-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.wcls-scheduled-title svg {
    color: #667eea;
}

.wcls-carousel-nav {
    display: none;
    gap: 8px;
}

.wcls-carousel-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.wcls-carousel-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}

.wcls-carousel-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.wcls-carousel-container {
    position: relative;
    overflow: hidden;
}

.wcls-carousel-wrapper {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 10px;
}

.wcls-carousel-wrapper::-webkit-scrollbar {
    display: none;
}

.wcls-scheduled-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    flex: 0 0 280px;
    width: 280px;
}

.wcls-scheduled-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.wcls-scheduled-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    background: #e2e8f0;
    overflow: hidden;
}

.wcls-scheduled-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wcls-scheduled-thumbnail-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.wcls-scheduled-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(102, 126, 234, 0.95);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    backdrop-filter: blur(8px);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wcls-scheduled-badge svg {
    width: 12px;
    height: 12px;
}

.wcls-scheduled-content {
    padding: 14px;
}

.wcls-scheduled-item-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 10px 0;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.wcls-scheduled-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 10px;
}

.wcls-scheduled-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wcls-scheduled-meta svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.wcls-scheduled-show {
    color: #667eea;
    font-weight: 600;
}

.wcls-scheduled-date {
    color: #64748b;
    font-weight: 500;
}

.wcls-scheduled-description {
    display: none;
}

.wcls-scheduled-duration {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 4px 10px;
    background: #fef3c7;
    color: #f59e0b;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    width: fit-content;
}

.wcls-scheduled-duration svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

/* ====================
   HISTORIQUE DES LIVES
   ==================== */

.wcls-history {
    margin-top: 60px;
}

.wcls-history-title {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 24px;
}

.wcls-history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.wcls-history-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    display: block;
}

.wcls-history-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.wcls-history-thumbnail {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    background: #f1f5f9;
    overflow: hidden;
}

.wcls-history-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wcls-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.wcls-history-item:hover .wcls-play-overlay {
    opacity: 1;
}

.wcls-play-overlay svg {
    color: #fff;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.wcls-history-content {
    padding: 20px;
}

.wcls-history-item-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.wcls-history-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #64748b;
}

.wcls-history-show {
    font-weight: 600;
}

.wcls-history-date {
    font-weight: 400;
}

/* ====================
   NAVIGATION
   ==================== */

.wcls-back-link {
    margin-bottom: 24px;
}

.wcls-back-link a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f1f5f9;
    color: #475569;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.wcls-back-link a:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* ====================
   PAGE CONNEXION REQUISE
   ==================== */

.wcls-login-required {
    text-align: center;
    padding: 100px 40px;
    max-width: 600px;
    margin: 0 auto;
}

.wcls-login-required-icon {
    margin-bottom: 32px;
    color: #667eea;
}

.wcls-login-required h2 {
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 16px 0;
}

.wcls-login-required p {
    font-size: 16px;
    color: #64748b;
    margin: 0 0 32px 0;
    line-height: 1.6;
}

.wcls-login-required-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.wcls-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.wcls-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.wcls-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    color: #fff;
}

.wcls-btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.wcls-btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
    transform: translateY(-2px);
}

/* ====================
   RESPONSIVE
   ==================== */

@media (max-width: 768px) {
    .wcls-container {
        padding: 12px;
    }
    
    .wcls-live-title {
        font-size: 24px;
    }
    
    .wcls-live-meta {
        gap: 8px;
    }
    
    .wcls-chat-container {
        max-height: 500px;
    }
    
    .wcls-chat-messages {
        min-height: 300px;
        max-height: 350px;
    }
    
    .wcls-history-grid {
        grid-template-columns: 1fr;
    }
    
    .wcls-scheduled-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .wcls-scheduled-title {
        font-size: 20px;
    }
    
    .wcls-scheduled-item {
        flex: 0 0 240px;
        width: 240px;
    }
}

/* ====================
   SCROLLBAR PERSONNALISÉE
   ==================== */

.wcls-chat-messages::-webkit-scrollbar,
.wcls-admin-chat-messages::-webkit-scrollbar {
    width: 8px;
}

.wcls-chat-messages::-webkit-scrollbar-track,
.wcls-admin-chat-messages::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.wcls-chat-messages::-webkit-scrollbar-thumb,
.wcls-admin-chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.wcls-chat-messages::-webkit-scrollbar-thumb:hover,
.wcls-admin-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ====================
   ANIMATIONS
   ==================== */

@keyframes wcls-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.wcls-live-wrapper {
    animation: wcls-fade-in 0.5s ease-out;
}

/* ====================
   ACCESSIBILITÉ
   ==================== */

.wcls-chat-send:focus,
#wcls-chat-input:focus,
.wcls-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Mode sombre (optionnel, si le thème le supporte) */
@media (prefers-color-scheme: dark) {
    .wcls-container {
        color: #f1f5f9;
    }
    
    .wcls-live-title {
        color: #f1f5f9;
    }
    
    .wcls-live-description {
        color: #cbd5e1;
    }
}

/* ====================
   LOADER DYNAMIQUE
   ==================== */

.wcls-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.97);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    animation: fadeIn 0.3s ease-in-out;
}

.wcls-loader {
    text-align: center;
    padding: 40px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.wcls-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f1f5f9;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

.wcls-loader p {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #475569;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

