/**
 * ═══════════════════════════════════════════════════════════════════════════
 * CHATBOT WIDGET - STYLES
 * ═══════════════════════════════════════════════════════════════════════════
 *
 * Styles pour le widget de chatbot flottant CosmoBot.
 *
 * SECTIONS :
 * 1. Widget & toggle button
 * 2. Container & header
 * 3. Messages (texte)
 * 4. Typing indicator
 * 5. Quick replies
 * 6. Input area
 * 7. Rich content — base
 * 8. Rich content — donation progress
 * 9. Rich content — stats dashboard
 * 10. Rich content — streamer cards
 * 11. Rich content — countdown
 * 12. Rich content — event live
 * 13. Rich content — action buttons
 * 14. Responsive mobile
 *
 * @package    L'Envol des Gamers
 * @subpackage Assets/CSS
 * @version    2.0.0
 */

/* ═══════════════════════════════════════════════════════════════════════════
   1. WIDGET & TOGGLE BUTTON
   ═══════════════════════════════════════════════════════════════════════════ */

.chatbot-widget {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 9999999 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6FB1 0%, #A56BFF 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(255, 111, 177, 0.4);
    transition: all 0.3s ease;
    position: relative;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(255, 111, 177, 0.5);
}

.chatbot-toggle .chatbot-icon {
    font-size: 28px;
    transition: transform 0.3s ease;
}

.chatbot-toggle.active .chatbot-icon {
    transform: rotate(180deg);
}

.chatbot-toggle .chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: white;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.chatbot-toggle .chatbot-badge.visible {
    opacity: 1;
    transform: scale(1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   2. CONTAINER & HEADER
   ═══════════════════════════════════════════════════════════════════════════ */

.chatbot-container {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 540px;
    max-height: calc(100vh - 150px);
    background: var(--bg-secondary, #1a1a2e);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 111, 177, 0.2);
    z-index: 9999999 !important;
}

.chatbot-container.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.chatbot-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #FF6FB1 0%, #A56BFF 100%);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.chatbot-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.chatbot-header-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.chatbot-header-info p {
    margin: 2px 0 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

.chatbot-header-close {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    transition: background 0.2s;
}

.chatbot-header-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ═══════════════════════════════════════════════════════════════════════════
   3. MESSAGES (TEXTE)
   ═══════════════════════════════════════════════════════════════════════════ */

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.chatbot-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    animation: messageSlide 0.3s ease;
    word-break: break-word;
}

@keyframes messageSlide {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.chatbot-message.bot {
    background: rgba(255, 111, 177, 0.12);
    color: var(--text, #f0f0f0);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

.chatbot-message.user {
    background: linear-gradient(135deg, #FF6FB1 0%, #A56BFF 100%);
    color: white;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

.chatbot-link {
    color: #FF6FB1;
    text-decoration: underline;
    word-break: break-all;
}

/* ═══════════════════════════════════════════════════════════════════════════
   4. TYPING INDICATOR
   ═══════════════════════════════════════════════════════════════════════════ */

.chatbot-message.typing {
    display: flex;
    gap: 4px;
    padding: 16px;
    background: rgba(255, 111, 177, 0.12);
    align-self: flex-start;
}

.chatbot-message.typing span {
    width: 8px;
    height: 8px;
    background: #FF6FB1;
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

.chatbot-message.typing span:nth-child(2) { animation-delay: 0.2s; }
.chatbot-message.typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 60%, 100% { transform: translateY(0);   opacity: 0.4; }
    30%            { transform: translateY(-8px); opacity: 1;   }
}

/* ═══════════════════════════════════════════════════════════════════════════
   5. QUICK REPLIES
   ═══════════════════════════════════════════════════════════════════════════ */

.chatbot-suggestions {
    padding: 8px 16px 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
}

.chatbot-suggestion {
    padding: 7px 13px;
    background: rgba(255, 111, 177, 0.1);
    border: 1px solid rgba(255, 111, 177, 0.3);
    border-radius: 20px;
    color: var(--text, #f0f0f0);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.chatbot-suggestion:hover {
    background: rgba(255, 111, 177, 0.22);
    border-color: #FF6FB1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   6. INPUT AREA
   ═══════════════════════════════════════════════════════════════════════════ */

.chatbot-input-area {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.chatbot-input {
    flex: 1;
    padding: 11px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    color: var(--text, #f0f0f0);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input:focus {
    border-color: #FF6FB1;
}

.chatbot-input::placeholder {
    color: var(--text-muted, #888);
}

.chatbot-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6FB1 0%, #A56BFF 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.chatbot-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 111, 177, 0.4);
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   7. RICH CONTENT — BASE
   ═══════════════════════════════════════════════════════════════════════════ */

.chatbot-rich {
    align-self: flex-start;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: messageSlide 0.3s ease;
}

/* Point rouge "live" reutilisable */
.chatbot-live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: livePulse 1.5s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes livePulse {
    0%, 100% { opacity: 1;   transform: scale(1);    }
    50%       { opacity: 0.5; transform: scale(1.3);  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   8. RICH CONTENT — DONATION PROGRESS
   ═══════════════════════════════════════════════════════════════════════════ */

.chatbot-rich-donation {
    background: rgba(255, 111, 177, 0.08);
    border: 1px solid rgba(255, 111, 177, 0.2);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chatbot-rich-donation-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chatbot-rich-donation-icon {
    font-size: 18px;
}

.chatbot-rich-donation-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text, #f0f0f0);
    flex: 1;
}

.chatbot-rich-donation-percent {
    font-size: 14px;
    font-weight: 700;
    color: #FF6FB1;
}

/* Barre de progression partagee */
.chatbot-rich-progress-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.chatbot-rich-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF6FB1 0%, #A56BFF 100%);
    border-radius: 4px;
    transition: width 0.8s ease;
    min-width: 2px;
}

.chatbot-rich-donation-amounts {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.chatbot-rich-donation-current {
    font-size: 18px;
    font-weight: 700;
    color: #FF6FB1;
}

.chatbot-rich-donation-goal {
    font-size: 13px;
    color: var(--text-muted, #888);
}

.chatbot-rich-donation-meta {
    font-size: 12px;
    color: var(--text-muted, #888);
}

/* ═══════════════════════════════════════════════════════════════════════════
   9. RICH CONTENT — STATS DASHBOARD
   ═══════════════════════════════════════════════════════════════════════════ */

.chatbot-rich-dashboard {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 111, 177, 0.2);
    border-radius: 12px;
    overflow: hidden;
}

.chatbot-rich-dashboard-header {
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.chatbot-rich-dashboard-header.live {
    background: rgba(239, 68, 68, 0.15);
    border-bottom: 1px solid rgba(239, 68, 68, 0.2);
}

.chatbot-rich-dashboard-header.upcoming {
    background: rgba(255, 111, 177, 0.1);
    border-bottom: 1px solid rgba(255, 111, 177, 0.15);
}

.chatbot-rich-dashboard-header.ended {
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chatbot-rich-dashboard-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text, #f0f0f0);
}

.chatbot-rich-dashboard-status {
    font-size: 12px;
    font-weight: 600;
    color: #FF6FB1;
    white-space: nowrap;
}

.chatbot-rich-dashboard-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chatbot-rich-dashboard-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chatbot-rich-dashboard-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted, #888);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chatbot-rich-dashboard-streamer-stats {
    font-size: 13px;
    color: var(--text, #f0f0f0);
}

.chatbot-rich-stat-live {
    color: #ef4444;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════
   10. RICH CONTENT — STREAMER CARDS
   ═══════════════════════════════════════════════════════════════════════════ */

.chatbot-rich-streamers {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chatbot-rich-streamers-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text, #f0f0f0);
    padding: 0 2px;
}

.chatbot-rich-streamers-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chatbot-rich-streamer-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.chatbot-rich-streamer-card:hover {
    background: rgba(255, 111, 177, 0.1);
    border-color: rgba(255, 111, 177, 0.3);
}

.chatbot-rich-streamer-card.is-live {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.06);
}

.chatbot-rich-streamer-card.is-live:hover {
    background: rgba(239, 68, 68, 0.12);
}

.chatbot-rich-streamer-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.chatbot-rich-streamer-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.chatbot-rich-streamer-live-badge {
    position: absolute;
    bottom: -3px;
    right: -3px;
    background: #ef4444;
    color: white;
    font-size: 8px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    letter-spacing: 0.05em;
}

.chatbot-rich-streamer-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chatbot-rich-streamer-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text, #f0f0f0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chatbot-rich-streamer-game {
    font-size: 11px;
    color: var(--text-muted, #888);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chatbot-rich-streamer-viewers {
    font-size: 11px;
    color: #ef4444;
    font-weight: 600;
}

.chatbot-rich-streamer-watch {
    font-size: 12px;
    color: var(--text-muted, #888);
    flex-shrink: 0;
    transition: color 0.2s;
}

.chatbot-rich-streamer-card:hover .chatbot-rich-streamer-watch {
    color: #FF6FB1;
}

.chatbot-rich-streamers-more {
    font-size: 12px;
    color: var(--text-muted, #888);
    text-align: center;
    padding: 4px 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   11. RICH CONTENT — COUNTDOWN
   ═══════════════════════════════════════════════════════════════════════════ */

.chatbot-rich-countdown {
    background: linear-gradient(135deg, rgba(255, 111, 177, 0.1) 0%, rgba(165, 107, 255, 0.1) 100%);
    border: 1px solid rgba(255, 111, 177, 0.25);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chatbot-rich-countdown-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted, #888);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.chatbot-rich-countdown-event {
    font-size: 14px;
    font-weight: 700;
    color: var(--text, #f0f0f0);
}

.chatbot-rich-countdown-timer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 4px;
}

.chatbot-rich-countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 44px;
}

.chatbot-rich-countdown-val {
    font-size: 24px;
    font-weight: 800;
    color: #FF6FB1;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.chatbot-rich-countdown-lbl {
    font-size: 10px;
    color: var(--text-muted, #888);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.chatbot-rich-countdown-sep {
    font-size: 20px;
    font-weight: 700;
    color: rgba(255, 111, 177, 0.5);
    margin-bottom: 12px;
}

.chatbot-rich-countdown-started {
    font-size: 16px;
    font-weight: 700;
    color: #FF6FB1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   12. RICH CONTENT — EVENT LIVE
   ═══════════════════════════════════════════════════════════════════════════ */

.chatbot-rich-event-live {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chatbot-rich-event-live-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chatbot-rich-event-live-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text, #f0f0f0);
}

.chatbot-rich-event-live-label {
    font-size: 12px;
    font-weight: 700;
    color: #ef4444;
    letter-spacing: 0.08em;
}

/* ═══════════════════════════════════════════════════════════════════════════
   13. RICH CONTENT — ACTION BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */

.chatbot-rich-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chatbot-rich-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.chatbot-rich-action-btn.primary {
    background: linear-gradient(135deg, #FF6FB1 0%, #A56BFF 100%);
    color: white;
    border: none;
}

.chatbot-rich-action-btn.primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 111, 177, 0.35);
}

.chatbot-rich-action-btn.secondary {
    background: transparent;
    color: var(--text, #f0f0f0);
    border: 1px solid rgba(255, 111, 177, 0.4);
}

.chatbot-rich-action-btn.secondary:hover {
    background: rgba(255, 111, 177, 0.1);
    border-color: #FF6FB1;
}

/* ═══════════════════════════════════════════════════════════════════════════
   14. RESPONSIVE MOBILE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    .chatbot-widget {
        bottom: 70px;
        right: 10px;
    }

    .chatbot-container {
        width: calc(100vw - 20px);
        height: calc(100vh - 140px);
        right: -5px;
    }

    .chatbot-toggle {
        width: 50px;
        height: 50px;
    }

    .chatbot-toggle .chatbot-icon {
        font-size: 24px;
    }

    .chatbot-rich-countdown-val {
        font-size: 20px;
    }

    .chatbot-rich-countdown-unit {
        min-width: 36px;
    }
}
