/**
 * CSS do Chat de Suporte com IA - FynixGlobal
 */

/* ===== WIDGET CONTAINER ===== */
.support-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99998;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ===== BOTÃO FLUTUANTE ===== */
.support-fab {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    position: relative;
}

.support-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.6);
}

.support-fab.active {
    background: linear-gradient(135deg, #764ba2, #667eea);
}

.support-fab-icon {
    font-size: 28px;
}

.support-fab-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 22px;
    height: 22px;
    background: #ff4757;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badgePulse 1.5s infinite;
}

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

/* ===== MODAL DO CHAT ===== */
.support-modal {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 550px;
    background: #1a1a2e;
    border-radius: 20px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(102, 126, 234, 0.3);
    animation: chatSlideIn 0.3s ease;
}

@keyframes chatSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== HEADER ===== */
.support-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.support-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.support-header-text {
    color: #fff;
}

.support-name {
    font-weight: bold;
    font-size: 16px;
}

.support-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.support-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

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

/* ===== ÁREA DE MENSAGENS ===== */
.support-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #16213e;
}

.support-messages::-webkit-scrollbar {
    width: 5px;
}

.support-messages::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}

.support-messages::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 3px;
}

/* ===== MENSAGENS ===== */
.support-message {
    display: flex;
    max-width: 85%;
}

.support-message.user {
    align-self: flex-end;
}

.support-message.bot {
    align-self: flex-start;
}

.message-content {
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
}

.support-message.user .message-content {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border-bottom-right-radius: 5px;
}

.support-message.bot .message-content {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-bottom-left-radius: 5px;
}

.message-sender {
    font-size: 11px;
    opacity: 0.7;
    margin-bottom: 5px;
}

.message-text {
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-time {
    font-size: 10px;
    opacity: 0.5;
    margin-top: 5px;
    text-align: right;
}

/* ===== LOADING / TYPING ===== */
.support-loading {
    text-align: center;
    color: #888;
    padding: 40px;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    justify-content: center;
    align-items: center;
    padding: 5px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #667eea;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* ===== ÁREA DE INPUT ===== */
.support-input-area {
    padding: 15px;
    background: #1a1a2e;
    display: flex;
    gap: 10px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

#support-input {
    flex: 1;
    padding: 12px 18px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 25px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

#support-input:focus {
    border-color: #667eea;
    background: rgba(255,255,255,0.15);
}

#support-input::placeholder {
    color: rgba(255,255,255,0.4);
}

.support-send-btn {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.support-send-btn:hover {
    transform: scale(1.1);
}

/* ===== BROADCASTS ===== */
.support-broadcast {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 170, 0, 0.1));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.broadcast-icon {
    font-size: 24px;
}

.broadcast-content {
    flex: 1;
}

.broadcast-title {
    font-weight: bold;
    color: #ffd700;
    margin-bottom: 5px;
    font-size: 14px;
}

.broadcast-message {
    color: #ddd;
    font-size: 13px;
    line-height: 1.4;
}

.broadcast-close {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
}

.broadcast-close:hover {
    color: #fff;
}

/* ===== ERRO ===== */
.support-error {
    color: #ff4757;
    text-align: center;
    padding: 20px;
}

/* ===== BADGE NO MENU ===== */
.menu-badge.support-menu-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    background: #ff4757;
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badgePulse 1.5s infinite;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 480px) {
    .support-modal {
        width: calc(100% - 20px);
        height: calc(100% - 120px);
        bottom: 80px;
        right: 10px;
        left: 10px;
        border-radius: 15px;
    }
    
    .support-fab {
        width: 55px;
        height: 55px;
        bottom: 70px;
        right: 15px;
    }
}

/* ===== AJUSTE PARA NÃO SOBREPOR TORNEIO ===== */
@media (min-width: 769px) {
    .support-widget {
        right: 310px; /* Espaço para o painel do torneio */
    }
}
