/**
 * TikTok Live Chat - Estilos ATUALIZADOS
 * Visual limpo com mensagens flutuantes
 */

/* Container principal do chat */
.tlc-chat-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 380px;
    height: 600px;
    display: flex;
    flex-direction: column;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.tlc-chat-container.position-left {
    left: 20px;
    right: auto;
}

.tlc-chat-container.position-center {
    left: 50%;
    transform: translateX(-50%);
    right: auto;
}

/* ===== CABEÇALHO SIMPLIFICADO (SEM FUNDO VERMELHO) ===== */
.tlc-chat-header {
    background: transparent !important;
    padding: 10px 15px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: none !important;
    border-bottom: none !important;
}

.tlc-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.tlc-online-count {
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    text-shadow: none;
    backdrop-filter: blur(10px);
}

.tlc-online-indicator {
    width: 8px;
    height: 8px;
    background: #00ff88;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
    margin-right: 5px;
}

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

/* ===== ÁREA DE MENSAGENS (SEM FUNDO) ===== */
.tlc-chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 15px;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.tlc-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.tlc-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.tlc-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

.tlc-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* ===== MENSAGEM INDIVIDUAL (SEM CAIXA) ===== */
.tlc-message {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    animation: slideInMessage 0.4s ease-out;
}

@keyframes slideInMessage {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== AVATAR REDONDO ===== */
.tlc-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50% !important; /* 100% redondo */
    margin-right: 10px;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.8);
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.tlc-message-content {
    flex: 1;
    min-width: 0;
}

.tlc-message-header {
    display: flex;
    align-items: center;
    margin-bottom: 2px;
    gap: 6px;
}

/* ===== NOME DO USUÁRIO (DESTAQUE) ===== */
.tlc-message-username {
    font-weight: 700;
    font-size: 14px;
    color: #00f5ff;
    text-shadow: 
        0 0 10px rgba(0, 245, 255, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.8);
}

.tlc-message-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* ===== TEXTO DA MENSAGEM (SEM CAIXA, FLUTUANTE) ===== */
.tlc-message-text {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    color: white;
    font-size: 15px;
    line-height: 1.4;
    word-wrap: break-word;
    font-weight: 500;
    text-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.9),
        0 0 20px rgba(0, 0, 0, 0.6);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Destaque para mensagem do usuário atual */
.tlc-message.tlc-message-own .tlc-message-username {
    color: #ffea00;
    text-shadow: 
        0 0 10px rgba(255, 234, 0, 0.8),
        0 2px 4px rgba(0, 0, 0, 0.8);
}

/* ===== ÁREA DE INPUT (ARREDONDADA) ===== */
.tlc-chat-input-container {
    padding: 15px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px 20px 0 0;
}

.tlc-chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ===== INPUT DE MENSAGEM (CANTOS ARREDONDADOS) ===== */
.tlc-chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px !important; /* Mais arredondado */
    padding: 12px 20px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.tlc-chat-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.tlc-chat-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #00f5ff;
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.3);
}

/* ===== BOTÃO ENVIAR ===== */
.tlc-btn-send {
    background: linear-gradient(135deg, #fe2c55 0%, #ff0050 100%);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.tlc-btn-send:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(254, 44, 85, 0.5);
}

.tlc-btn-send:active {
    transform: scale(0.95);
}

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

.tlc-btn-send svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Botões de emoji e gif */
.tlc-emoji-btn,
.tlc-gif-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 18px;
}

.tlc-emoji-btn:hover,
.tlc-gif-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* ===== AVISO DE LOGIN ===== */
.tlc-login-required {
    text-align: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 15px;
    margin: 10px;
    backdrop-filter: blur(10px);
}

.tlc-login-required p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
    font-size: 14px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.tlc-btn-login {
    background: linear-gradient(135deg, #fe2c55 0%, #ff0050 100%);
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.tlc-btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(254, 44, 85, 0.4);
    color: white;
}

/* ===== MENSAGEM VAZIA ===== */
.tlc-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.8);
}

.tlc-empty-state-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.6;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

.tlc-empty-state p {
    margin: 0;
    font-size: 14px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* ===== LOADING ===== */
.tlc-loading {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.8);
}

.tlc-loading-spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #00f5ff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

/* ===== NOTIFICAÇÃO ===== */
.tlc-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #fe2c55 0%, #ff0050 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    animation: slideInNotification 0.3s ease-out;
    cursor: pointer;
}

@keyframes slideInNotification {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.tlc-notification:hover {
    transform: scale(1.05);
}

/* ===== RESPONSIVO ===== */
@media (max-width: 768px) {
    .tlc-chat-container {
        width: calc(100% - 20px);
        right: 10px;
        left: 10px;
        bottom: 10px;
        height: calc(100vh - 100px);
    }
    
    .tlc-chat-container.position-left,
    .tlc-chat-container.position-center {
        left: 10px;
        right: 10px;
        transform: none;
    }
}

/* ===== MODO MINIFICADO ===== */
.tlc-chat-container.minimized {
    height: 60px;
    width: 200px;
    cursor: pointer;
}

.tlc-chat-container.minimized .tlc-chat-messages,
.tlc-chat-container.minimized .tlc-chat-input-container {
    display: none;
}

.tlc-minimize-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.tlc-minimize-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

/* ===== TYPING INDICATOR ===== */
.tlc-typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-style: italic;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.tlc-typing-dots {
    display: flex;
    gap: 4px;
}

.tlc-typing-dots span {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

.tlc-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.tlc-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

/* ===== MELHORIAS VISUAIS EXTRAS ===== */

/* Efeito glow nas mensagens quando aparecem */
.tlc-message.new-message .tlc-message-text {
    animation: glowText 1s ease-out;
}

@keyframes glowText {
    0% {
        text-shadow: 
            0 0 30px rgba(0, 245, 255, 0.8),
            0 2px 4px rgba(0, 0, 0, 0.9);
    }
    100% {
        text-shadow: 
            0 2px 4px rgba(0, 0, 0, 0.9),
            0 0 20px rgba(0, 0, 0, 0.6);
    }
}

/* Melhor contraste para leitura */
.tlc-message-text {
    letter-spacing: 0.3px;
}

/* Avatar com efeito hover */
.tlc-message-avatar:hover {
    transform: scale(1.1);
    border-color: #00f5ff;
    box-shadow: 0 0 15px rgba(0, 245, 255, 0.6);
    transition: all 0.3s ease;
}
