/* ==========================================================================
   🤖 TEKKA AI ULTRA FUTURISTIC V4.0 - O CSS MAIS FODA DO UNIVERSO
   ========================================================================== */

/* ============================================================
   VARIÁVEIS FUTURÍSTICAS
   ============================================================ */
:root {
    --tekka-primary: #0066FF;
    --tekka-secondary: #00D4FF;
    --tekka-accent: #7C3AED;
    --tekka-glow: rgba(0, 212, 255, 0.6);
    --tekka-dark: #0A0E27;
    --tekka-glass: rgba(255, 255, 255, 0.08);
}

/* ============================================================
   BOTÃO FLUTUANTE FUTURÍSTICO
   ============================================================ */
#tekka-chat-btn {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 65px; /* Reduzido de 75px */
    height: 65px; /* Reduzido de 75px */
    border-radius: 50%;
    background: linear-gradient(135deg, var(--tekka-primary) 0%, var(--tekka-secondary) 50%, var(--tekka-accent) 100%);
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 0 30px var(--tekka-glow),
        0 0 60px rgba(124, 58, 237, 0.4),
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 2px 10px rgba(255, 255, 255, 0.2);
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px; /* Ajustado proporcionalmente */
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: tekka-quantum-pulse 3s ease-in-out infinite, tekka-float 4s ease-in-out infinite;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
}

/* Partículas Orbitais */
#tekka-chat-btn::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        var(--tekka-secondary) 90deg,
        transparent 180deg,
        var(--tekka-accent) 270deg,
        transparent 360deg
    );
    animation: tekka-orbit 4s linear infinite;
    opacity: 0.6;
    z-index: -1;
}

/* Círculo Interno Brilhante */
#tekka-chat-btn::after {
    content: '';
    position: absolute;
    width: 60%;
    height: 60%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0%, transparent 70%);
    animation: tekka-inner-pulse 2s ease-in-out infinite;
}

#tekka-chat-btn:hover {
    transform: scale(1.15) rotate(10deg);
    box-shadow:
        0 0 50px var(--tekka-glow),
        0 0 80px rgba(124, 58, 237, 0.6),
        0 12px 48px rgba(0, 0, 0, 0.4) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
}

#tekka-chat-btn:active {
    transform: scale(1.05);
}

#tekka-chat-btn img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    z-index: 2;
    object-fit: cover;
    /* Removido filtros que causavam a cor falhada */
}

/* ============================================================
   ESTADO DE SCROLL (EFEITO FANTASMA)
   ============================================================ */
#tekka-chat-btn.tekka-scrolling {
    opacity: 0 !important; /* Totalmente invisível - FORÇADO */
    filter: grayscale(1);
    transform: scale(0); /* Desaparece diminuindo */
    pointer-events: none; /* Evita cliques acidentais enquanto rola */
}

/* ============================================================
   ANIMAÇÕES FUTURÍSTICAS
   ============================================================ */
@keyframes tekka-quantum-pulse {
    0%, 100% {
        box-shadow:
            0 0 30px var(--tekka-glow),
            0 0 60px rgba(124, 58, 237, 0.4),
            0 8px 32px rgba(0, 0, 0, 0.3),
            inset 0 2px 10px rgba(255, 255, 255, 0.2);
    }
    50% {
        box-shadow:
            0 0 50px var(--tekka-glow),
            0 0 100px rgba(124, 58, 237, 0.7),
            0 12px 48px rgba(0, 0, 0, 0.4),
            inset 0 2px 10px rgba(255, 255, 255, 0.2);
    }
}

@keyframes tekka-float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

@keyframes tekka-orbit {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes tekka-inner-pulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.2); }
}

@keyframes tekka-img-glow {
    0%, 100% { filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3)); }
    50% { filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.8)); }
}
/* ============================================================
   MODAL FUTURÍSTICO (GLASSMORPHISM + NEON)
   ============================================================ */
#tekka-modal {
    position: fixed;
    bottom: 190px;
    right: 30px;
    width: 440px;
    max-width: calc(100vw - 60px);
    height: 600px;
    max-height: calc(100vh - 220px);
    background: linear-gradient(
        135deg,
        rgba(10, 14, 39, 0.98) 0%,
        rgba(20, 24, 60, 0.98) 100%
    );
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 32px;
    border: 2px solid rgba(0, 212, 255, 0.3);
    box-shadow:
        0 0 60px rgba(0, 212, 255, 0.4),
        0 25px 80px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: none;
    flex-direction: column;
    z-index: 99999; /* 🔥 CORREÇÃO: Acima de TUDO, incluindo header do site */
    overflow: hidden;
    animation: tekka-modal-materialize 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Efeito de Borda Neon Animada */
#tekka-modal::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 32px;
    background: linear-gradient(
        45deg,
        var(--tekka-primary),
        var(--tekka-secondary),
        var(--tekka-accent),
        var(--tekka-primary)
    );
    background-size: 300% 300%;
    opacity: 0.5;
    z-index: -1;
    animation: tekka-border-flow 4s ease infinite;
    filter: blur(8px);
}

/* Grid Holográfico de Fundo */
#tekka-modal::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            rgba(0, 212, 255, 0.03) 1px,
            transparent 2px,
            transparent 40px
        ),
        repeating-linear-gradient(
            90deg,
            transparent 0px,
            rgba(124, 58, 237, 0.03) 1px,
            transparent 2px,
            transparent 40px
        );
    border-radius: 32px;
    pointer-events: none;
    z-index: 0;
}

@keyframes tekka-modal-materialize {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.85) rotateX(20deg);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotateX(0deg);
        filter: blur(0);
    }
}

@keyframes tekka-border-flow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ============================================================
   HEADER FUTURÍSTICO
   ============================================================ */
.tekka-header {
    background: linear-gradient(135deg, rgba(0, 102, 255, 0.95) 0%, rgba(124, 58, 237, 0.95) 100%) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    color: white !important;
    padding: 1.25rem 1rem !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center !important;
    gap: 1rem !important;
    border-radius: 32px 32px 0 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative !important;
    z-index: 10 !important;
    flex-shrink: 0 !important; /* 🔥 CRÍTICO: Impede que o header encolha */
    min-height: 70px !important;
}

/* Efeito de Ondas no Header */
.tekka-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 200%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    animation: tekka-wave 3s ease-in-out infinite;
}

@keyframes tekka-wave {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.tekka-avatar-lg {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: white;
    padding: 4px;
    box-shadow:
        0 0 20px rgba(0, 212, 255, 0.6),
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(0, 212, 255, 0.5);
    object-fit: cover;
    /* Removido filtros que causavam a cor falhada */
    position: relative;
    z-index: 2;
}

@keyframes tekka-avatar-pulse {
    0%, 100% {
        box-shadow:
            0 0 20px rgba(0, 212, 255, 0.6),
            0 4px 15px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow:
            0 0 40px rgba(0, 212, 255, 1),
            0 4px 20px rgba(0, 0, 0, 0.4);
    }
}

.tekka-info {
    flex: 1;
    z-index: 2;
}

.tekka-info h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 900;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #ffffff 0%, #e0f2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tekka-info p {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.95;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
    border-radius: 50%;
    box-shadow:
        0 0 10px rgba(34, 197, 94, 0.8),
        0 0 20px rgba(34, 197, 94, 0.4);
    animation: tekka-status-blink 2s ease-in-out infinite;
}

@keyframes tekka-status-blink {
    0%, 100% {
        opacity: 1;
        box-shadow:
            0 0 10px rgba(34, 197, 94, 0.8),
            0 0 20px rgba(34, 197, 94, 0.4);
    }
    50% {
        opacity: 0.4;
        box-shadow:
            0 0 5px rgba(34, 197, 94, 0.4),
            0 0 10px rgba(34, 197, 94, 0.2);
    }
}

.tekka-close {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
    color: #0066FF !important;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 100;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
}

.tekka-close:hover {
    background: #ffffff !important;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.6);
}

.tekka-close {
    font-size: 1.4rem;
    font-weight: bold;
    line-height: 1;
}

/* ============================================================
   CORPO DO CHAT (HOLOGRÁFICO)
   ============================================================ */
.tekka-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.75rem 1.5rem;
    background: linear-gradient(
        180deg,
        rgba(10, 14, 39, 0.4) 0%,
        rgba(20, 24, 60, 0.6) 100%
    );
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: relative;
    z-index: 1;
    -webkit-overflow-scrolling: touch; /* Scroll suave e nativo no iOS */
}

/* Scrollbar Futurística */
.tekka-body::-webkit-scrollbar {
    width: 8px;
}

.tekka-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.tekka-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--tekka-secondary) 0%, var(--tekka-accent) 100%);
    border-radius: 10px;
    box-shadow: 0 0 10px var(--tekka-glow);
}

.tekka-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--tekka-accent) 0%, var(--tekka-primary) 100%);
}

/* ============================================================
   MENSAGENS FUTURÍSTICAS PREMIUM
   ============================================================ */
.tekka-msg {
    padding: 1.25rem 1.5rem;
    border-radius: 20px;
    max-width: 88%;
    word-wrap: break-word;
    line-height: 1.6;
    font-size: 0.95rem;
    position: relative;
    animation: tekka-message-materialize 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

@keyframes tekka-message-materialize {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
        filter: blur(5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* Mensagem da IA (Tekka) */
.tekka-msg.ai {
    background: linear-gradient(
        135deg,
        rgba(0, 102, 255, 0.15) 0%,
        rgba(124, 58, 237, 0.15) 100%
    );
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #e0f2fe;
    align-self: flex-start;
    border: 1px solid rgba(0, 212, 255, 0.3);
    box-shadow:
        0 0 20px rgba(0, 212, 255, 0.2),
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* 🔥 REMOVIDO: Avatar/emoji duplicado nas mensagens da AI
.tekka-msg.ai::before {
    content: '👩‍🚀';
    position: absolute;
    top: -12px;
    left: 12px;
    font-size: 1.5rem;
    filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.8));
}
*/

/* Mensagem do Usuário */
.tekka-msg.user {
    background: linear-gradient(
        135deg,
        rgba(0, 212, 255, 0.9) 0%,
        rgba(124, 58, 237, 0.9) 100%
    );
    backdrop-filter: blur(10px);
    color: white;
    align-self: flex-end;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow:
        0 0 20px rgba(124, 58, 237, 0.4),
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    font-weight: 500;
}

.tekka-msg strong {
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.tekka-msg a {
    color: var(--tekka-secondary);
    text-decoration: none;
    font-weight: 700;
    border-bottom: 1px solid var(--tekka-secondary);
    transition: all 0.3s ease;
}

.tekka-msg a:hover {
    color: white;
    border-bottom-color: white;
    text-shadow: 0 0 10px var(--tekka-glow);
}

/* Imagem de Produto na Mensagem */
.tekka-msg .product-thumb {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    object-fit: cover;
    margin: 0.75rem 0;
    border: 2px solid rgba(0, 212, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.tekka-msg .product-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px var(--tekka-glow);
}

/* ============================================================
   INDICADOR DE DIGITAÇÃO ULTRA FUTURÍSTICO
   ============================================================ */
.typing-indicator {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(
        135deg,
        rgba(0, 102, 255, 0.1) 0%,
        rgba(124, 58, 237, 0.1) 100%
    );
    backdrop-filter: blur(10px);
    border-radius: 20px;
    width: fit-content;
    border: 1px solid rgba(0, 212, 255, 0.3);
    box-shadow:
        0 0 20px rgba(0, 212, 255, 0.2),
        0 4px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}

.typing-indicator::before {
    content: '⚡';
    position: absolute;
    top: -10px;
    left: 10px;
    font-size: 1.3rem;
    animation: tekka-lightning 1s ease-in-out infinite;
}

@keyframes tekka-lightning {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.8));
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
        filter: drop-shadow(0 0 15px rgba(0, 212, 255, 1));
    }
}

.typing-dot {
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, var(--tekka-secondary) 0%, var(--tekka-accent) 100%);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--tekka-glow);
    animation: tekka-typing-quantum 1.6s ease-in-out infinite;
}

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

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

@keyframes tekka-typing-quantum {
    0%, 60%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.7;
        box-shadow: 0 0 10px var(--tekka-glow);
    }
    30% {
        transform: translateY(-15px) scale(1.3);
        opacity: 1;
        box-shadow: 0 0 20px var(--tekka-glow);
    }
}

/* ============================================================
   FOOTER (INPUT) FUTURÍSTICO
   ============================================================ */
.tekka-footer {
    display: flex;
    gap: 0.875rem;
    padding: 1.5rem;
    background: linear-gradient(
        135deg,
        rgba(10, 14, 39, 0.95) 0%,
        rgba(20, 24, 60, 0.95) 100%
    );
    backdrop-filter: blur(15px);
    border-top: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 0 0 32px 32px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 -4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.tekka-input {
    flex: 1;
    border: 2px solid rgba(0, 212, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
    font-family: 'Outfit', sans-serif;
    color: white;
    outline: none;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tekka-input::placeholder {
    color: rgba(224, 242, 254, 0.5);
}

.tekka-input:focus {
    border-color: var(--tekka-secondary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow:
        0 0 20px var(--tekka-glow),
        inset 0 2px 8px rgba(0, 0, 0, 0.3);
    transform: scale(1.02);
}

.tekka-send {
    background: linear-gradient(135deg, var(--tekka-primary) 0%, var(--tekka-secondary) 50%, var(--tekka-accent) 100%);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    touch-action: manipulation; /* Remove delay de toque em navegadores mobile */
    box-shadow:
        0 0 20px rgba(0, 212, 255, 0.4),
        0 4px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.tekka-send::before {
    content: '';
    position: absolute;
    inset: -50%;
    background: conic-gradient(
        from 0deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: tekka-send-spin 2s linear infinite;
}

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

.tekka-send:hover {
    transform: scale(1.15) rotate(15deg);
    box-shadow:
        0 0 40px var(--tekka-glow),
        0 6px 25px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.6);
}

.tekka-send:active {
    transform: scale(1.05) rotate(0deg);
}

.tekka-send i {
    font-size: 1.2rem;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* ============================================================
   MOBILE RESPONSIVO FUTURÍSTICO
   ============================================================ */
@media (max-width: 768px) {
    #tekka-chat-btn {
        width: 55px; /* Menor no mobile */
        height: 55px;
        bottom: 20px;
        right: 20px;
    }

    #tekka-chat-btn img {
        width: 100%;
        height: 100%;
    }

    /* 🔥 MODAL EM TELA CHEIA (Experiência de App Nativo) */
    #tekka-modal {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        border: none !important;
        margin: 0 !important;
        z-index: 99999 !important; /* 🔥 Acima de TUDO */
        flex-direction: column !important; /* 🔥 Garante layout vertical */
        overflow: hidden !important;
        animation: tekka-slide-up-mobile 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    }

    /* 🔥 Quando o modal está visível (display: flex via JS) */
    #tekka-modal[style*="display: flex"],
    #tekka-modal[style*="display:flex"] {
        display: flex !important;
    }

    @keyframes tekka-slide-up-mobile {
        from { transform: translateY(100%); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }

    .tekka-header {
        padding: 1rem 1rem !important;
        padding-top: max(1.5rem, env(safe-area-inset-top)) !important;
        border-radius: 0 !important;
        gap: 0.75rem !important;
        display: flex !important;
        align-items: center !important;
        min-height: 70px !important;
        position: relative !important;
        z-index: 10 !important;
        flex-shrink: 0 !important; /* 🔥 Impede que o header encolha */
        background: linear-gradient(135deg, rgba(0, 102, 255, 0.95) 0%, rgba(124, 58, 237, 0.95) 100%) !important;
    }

    .tekka-avatar-lg {
        width: 45px;
        height: 45px;
        min-width: 45px;
        min-height: 45px;
        flex-shrink: 0;
    }

    .tekka-info {
        flex: 1;
        min-width: 0; /* Permite que o texto quebre se necessário */
    }

    .tekka-info h3 {
        font-size: 1.1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .tekka-info p {
        font-size: 0.75rem;
    }

    .tekka-body {
        padding: 1rem !important;
        gap: 1rem !important;
        flex: 1 !important; /* 🔥 Ocupa o espaço restante entre header e footer */
        min-height: 0 !important; /* 🔥 Permite que o flex shrink funcione */
        overflow-y: auto !important;
    }

    .tekka-msg {
        padding: 0.875rem 1rem;
        max-width: 85%;
        font-size: 0.95rem;
    }

    .tekka-footer {
        padding: 1rem;
        padding-bottom: max(1rem, env(safe-area-inset-bottom)); /* Respeita a barra de navegação */
        gap: 0.75rem;
        border-radius: 0;
    }

    /* 🔥 Botão de fechar SEMPRE VISÍVEL no mobile */
    .tekka-close {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        background: rgba(255, 255, 255, 0.95) !important;
        border: 2px solid #ffffff !important;
        margin-left: auto;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        position: relative !important;
        z-index: 100 !important;
    }

    .tekka-close {
        font-size: 1.6rem !important;
        font-weight: bold !important;
        line-height: 1 !important;
    }

    .tekka-close:hover {
        background: #ffffff !important;
        transform: scale(1.1) !important;
    }

    .tekka-input {
        font-size: 16px; /* 🔥 CRUCIAL: Evita que o iPhone dê zoom ao clicar no input */
        padding: 0.875rem 1.25rem;
    }

    .tekka-send {
        width: 48px;
        height: 48px;
    }

    /* Ajuste do Popup de Boas-vindas para mobile */
    .tekka-welcome-popup {
        bottom: 85px; /* 🔥 CORREÇÃO: 20px (btn) + 55px (height) + 10px (gap) */
        right: 20px; /* 🔥 CORREÇÃO: Alinhado com o botão Mobile */
        left: auto;
        max-width: 170px; /* Menor no mobile */
        padding: 0.7rem;
        transform: translateX(0); /* Remove qualquer transformação indesejada */
    }

    .tekka-welcome-arrow {
        right: 20px; /* 🔥 CORREÇÃO: Alinhado com o centro do botão Mobile */
        transform: rotate(45deg);
    }

    .tekka-welcome-content p {
        font-size: 0.75rem; /* Texto menor */
        line-height: 1.3;
    }

    .tekka-welcome-emoji {
        font-size: 1.5rem; /* Emoji menor */
    }
}

/* ============================================================
   EFEITOS EXTRAS FUTURÍSTICOS
   ============================================================ */

/* Brilho de Entrada */
@keyframes tekka-shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* Partículas Flutuantes (Opcional) */
.tekka-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--tekka-secondary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--tekka-glow);
    animation: tekka-particle-float 5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes tekka-particle-float {
    0%, 100% { transform: translateY(0) translateX(0); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateY(-100px) translateX(50px); opacity: 0; }
}

/* ============================================================
   EXPERIÊNCIA DE BOAS-VINDAS (POP-UP & LOCK)
   ============================================================ */
.tekka-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 39, 0.6); /* Fundo escuro semi-transparente */
    backdrop-filter: blur(3px);
    z-index: 995; /* Acima de tudo, abaixo do botão destacado */
    opacity: 0;
    animation: tekka-fade-in 0.5s forwards;
}

#tekka-chat-btn.tekka-highlight {
    z-index: 1000; /* Traz o botão para frente do overlay */
    animation: tekka-pulse-highlight 2s infinite;
    box-shadow: 0 0 50px var(--tekka-secondary);
}

.tekka-welcome-popup {
    position: fixed;
    bottom: 175px; /* Logo acima do botão (botão está em 100px + 65px altura = 165px, +10px espaço) */
    right: 30px; /* Alinhado com o botão (botão está em right: 30px) */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 0.85rem; /* Menor padding */
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    z-index: 10000; /* Acima do botão */
    max-width: 190px; /* Caixa menor */
    border: 2px solid var(--tekka-primary);
    animation: tekka-slide-in-smooth 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; /* Animação suave */
    transition: all 0.3s ease;
    transform-origin: bottom center; /* Origem da transformação */
}

.tekka-welcome-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
}

/* Estado de Scroll para o Popup (Desaparece igual o botão) */
.tekka-welcome-popup.tekka-scrolling {
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    pointer-events: none;
}

.tekka-welcome-emoji {
    font-size: 2rem; /* Emoji um pouco menor */
    animation: tekka-bounce 1s infinite;
}

.tekka-welcome-content p {
    margin: 0;
    font-size: 0.85rem; /* Fonte menor */
    color: var(--tekka-dark);
    line-height: 1.4;
    font-family: 'Outfit', sans-serif;
}

.tekka-welcome-close {
    background: linear-gradient(135deg, var(--tekka-primary), var(--tekka-accent));
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    font-size: 0.85rem;
    cursor: pointer;
    margin-top: 0.5rem;
    font-weight: 700;
    transition: transform 0.2s;
    box-shadow: 0 4px 10px rgba(0, 102, 255, 0.3);
    position: relative;
    z-index: 10; /* Garante que o botão fique acima de tudo dentro do popup */
    cursor: pointer;
}

.tekka-welcome-close:hover {
    transform: scale(1.05);
}

.tekka-welcome-arrow {
    position: absolute;
    bottom: -10px;
    right: 25px; /* 🔥 CORREÇÃO: Alinhado com o centro do botão Desktop */
    transform: rotate(45deg);
    width: 16px;
    height: 16px;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 2px solid var(--tekka-primary);
    border-right: 2px solid var(--tekka-primary);
}

/* Ajustes para o Mini Popup (Outras páginas) */
.tekka-mini-popup {
    z-index: 990; /* Menor que o overlay */
    animation: tekka-slide-in 0.5s ease-out forwards;
    /* Não tem overlay, então o fundo do site continua normal */
}

@keyframes tekka-fade-in {
    to { opacity: 1; }
}

@keyframes tekka-slide-in {
    from { opacity: 0; transform: translateY(20px) scale(0.8); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes tekka-slide-in-smooth {
    0% {
        opacity: 0;
        transform: translateY(15px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes tekka-pulse-highlight {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes tekka-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.fade-out {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
    transition: opacity 0.6s ease, transform 0.6s ease; /* Transição suave */
    pointer-events: none;
}

/* ============================================================
   CONTROLE DE SCROLL DO BODY QUANDO MODAL ABERTO
   ============================================================ */
.tekka-modal-open {
    overflow: hidden !important;
}

/* 🔥 CORREÇÃO: Esconde o botão flutuante quando o chat está aberto */
.tekka-modal-open #tekka-chat-btn {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Efeito de "falha" no fundo quando a Tekka está aberta */
/* REMOVIDO: O efeito de blur e escurecimento agora é aplicado pelo .tekka-overlay */
/* html.tekka-modal-open main,
html.tekka-modal-open #global-header,
html.tekka-modal-open footer { } */

/* Garante que os elementos da Tekka não sejam afetados pelo filtro */
#tekka-chat-btn,
#tekka-modal,
.tekka-overlay,
.tekka-welcome-popup {
    filter: none; /* Remove qualquer filtro herdado */
    pointer-events: auto; /* Reativa a interação */
}

/* 🔥 FORÇA A TEKKA A SUMIR QUANDO O MENU ESTIVER ABERTO */
body.sidebar-open #tekka-chat-btn,
body.sidebar-open .tekka-welcome-popup,
body.sidebar-open #tekka-modal {
    display: none !important; /* Garante que o elemento não seja renderizado */
    visibility: hidden !important; /* Garante que o elemento seja invisível */
    pointer-events: none !important; /* Garante que o elemento não seja clicável */
}

/* ============================================================
   FIM DO CSS MAIS FUTURÍSTICO DO UNIVERSO 🚀
   ========================================================================== */
