/* =============================== */
/* 🎯 VARIÁVEIS CSS */
/* =============================== */
:root {
    --roxo: #8a2be2;
    --roxo-claro: #9d4edd;
    --roxo-escuro: #7b1fa2;
    --texto: #ffffff;
    --fundo: #0f0f0f;
    --fundo-card: #1a1a1a;
    --fundo-input: #2d2d2d;
    --borda: rgba(138, 43, 226, 0.3);
    --sucesso: #10b981;
    --erro: #ef4444;
    --aviso: #f59e0b;
    --gradiente-roxo: linear-gradient(135deg, var(--roxo), var(--roxo-claro));
    --gradiente-roxo-hover: linear-gradient(135deg, var(--roxo-claro), var(--roxo-escuro));
}

/* =============================== */
/* 🎯 RESET E BASE */
/* =============================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--fundo);
    color: var(--texto);
    height: 100vh;
    overflow: hidden;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(138, 43, 226, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(157, 78, 221, 0.05) 0%, transparent 50%);
}

/* =============================== */
/* 🎯 CONTAINER PRINCIPAL */
/* =============================== */
.ia-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    background: var(--fundo);
    position: relative;
}

.ia-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 15% 50%, rgba(138, 43, 226, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 85% 80%, rgba(157, 78, 221, 0.08) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* =============================== */
/* 🎯 HEADER MELHORADO */
/* =============================== */
.ia-header {
    background: rgba(23, 23, 23, 0.95);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border-bottom: 1px solid var(--borda);
    padding: 1rem 1.5rem;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.ia-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradiente-roxo);
    opacity: 0.3;
}

.ia-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
}

.back-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--texto);
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    background: rgba(138, 43, 226, 0.08);
    border: 1px solid var(--borda);
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.back-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradiente-roxo);
    transition: left 0.3s ease;
    z-index: -1;
}

.back-button:hover {
    color: white;
    border-color: var(--roxo);
    transform: translateX(-3px);
}

.back-button:hover::before {
    left: 0;
}

.ia-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* =============================== */
/* 🎯 LOGO COM BORDA ROXA - FUNDO TRANSPARENTE */
/* =============================== */
.ia-logo {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--roxo);
    box-shadow: 
        0 0 0 1px rgba(138, 43, 226, 0.3),
        0 4px 15px rgba(138, 43, 226, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ia-logo::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradiente-roxo);
    border-radius: 14px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ia-logo::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 10px;
    background: rgba(138, 43, 226, 0.05);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ia-logo:hover {
    transform: scale(1.05);
    border-color: var(--roxo-claro);
    box-shadow: 
        0 0 0 2px rgba(138, 43, 226, 0.4),
        0 6px 25px rgba(138, 43, 226, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.ia-logo:hover::after {
    opacity: 1;
}

.ia-logo:hover::before {
    opacity: 0.1;
}

.ia-logo img {
    width: 70%;
    height: 70%;
    object-fit: contain;
    filter: brightness(0) invert(1);
    transition: transform 0.3s ease;
}

.ia-logo:hover img {
    transform: scale(1.1);
}

.ia-title {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.ia-title-main {
    font-size: 1.4rem;
    font-weight: 700;
    background: var(--gradiente-roxo);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.ia-title-sub {
    font-size: 0.75rem;
    opacity: 0.7;
    font-weight: 400;
    letter-spacing: 0.5px;
}

.ia-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--sucesso);
    background: rgba(16, 185, 129, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--sucesso);
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 10px var(--sucesso);
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1;
        transform: scale(1);
    }
    50% { 
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* =============================== */
/* 🎯 CONTAINER DO CHAT MELHORADO */
/* =============================== */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: 
        radial-gradient(circle at 0% 0%, rgba(138, 43, 226, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(157, 78, 221, 0.02) 0%, transparent 50%);
}

/* =============================== */
/* 🎯 MENSAGENS MELHORADAS */
/* =============================== */
.message {
    display: flex;
    gap: 1rem;
    max-width: 85%;
    animation: messageSlide 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.ai-message {
    align-self: flex-start;
}

.message-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.user-message .message-avatar {
    background: var(--gradiente-roxo);
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3);
}

.ai-message .message-avatar {
    background: linear-gradient(135deg, #555, #777);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.message-avatar i {
    font-size: 1.1rem;
    color: white;
}

.message-content {
    background: var(--fundo-card);
    padding: 1.2rem 1.5rem;
    border-radius: 20px;
    border: 1px solid var(--borda);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 100%;
    position: relative;
    transition: all 0.3s ease;
}

.message-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradiente-roxo);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.message-content:hover::before {
    opacity: 0.3;
}

.user-message .message-content {
    background: var(--gradiente-roxo);
    border: none;
    box-shadow: 0 4px 25px rgba(138, 43, 226, 0.25);
}

.user-message .message-content:hover {
    box-shadow: 0 6px 30px rgba(138, 43, 226, 0.35);
    transform: translateY(-2px);
}

.ai-message .message-content:hover {
    border-color: rgba(138, 43, 226, 0.5);
    transform: translateY(-1px);
}

.message-text {
    line-height: 1.6;
    margin-bottom: 0.75rem;
    word-wrap: break-word;
    font-size: 0.95rem;
}

.message-text strong {
    color: var(--roxo-claro);
    font-weight: 600;
}

.message-text em {
    font-style: italic;
    opacity: 0.9;
    color: #e0e0e0;
}

.message-text code {
    background: rgba(138, 43, 226, 0.15);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.85em;
    border: 1px solid var(--borda);
    color: var(--roxo-claro);
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.6;
    text-align: right;
    font-weight: 500;
}

/* =============================== */
/* 🎯 ÁREA DE INPUT MELHORADA */
/* =============================== */
.input-container {
    padding: 1.5rem;
    background: rgba(23, 23, 23, 0.9);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid var(--borda);
    flex-shrink: 0;
    position: relative;
}

.input-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradiente-roxo);
    opacity: 0.2;
}

.input-wrapper {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    margin-bottom: 0.75rem;
}

#user-input {
    flex: 1;
    background: var(--fundo-input);
    border: 1.5px solid var(--borda);
    border-radius: 16px;
    padding: 1.2rem 1.5rem;
    color: var(--texto);
    font-size: 1rem;
    resize: none;
    min-height: 55px;
    max-height: 150px;
    transition: all 0.3s ease;
    font-family: inherit;
    line-height: 1.5;
}

#user-input:focus {
    outline: none;
    border-color: var(--roxo);
    box-shadow: 0 0 0 3px rgba(138, 43, 226, 0.15);
    background: rgba(45, 45, 45, 0.8);
}

#user-input::placeholder {
    color: #888;
    font-weight: 400;
}

.send-button {
    background: var(--gradiente-roxo);
    border: none;
    border-radius: 14px;
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3);
    position: relative;
    overflow: hidden;
}

.send-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.send-button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(138, 43, 226, 0.4);
    background: var(--gradiente-roxo-hover);
}

.send-button:hover:not(:disabled)::before {
    left: 100%;
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 8px rgba(138, 43, 226, 0.2);
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #888;
}

.char-count {
    font-size: 0.75rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.clear-button {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--erro);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.clear-button:hover {
    background: var(--erro);
    border-color: var(--erro);
    color: white;
    transform: translateY(-1px);
}

/* =============================== */
/* 🎯 LOADING E MODAIS MELHORADOS */
/* =============================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.loading-spinner {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    background: var(--fundo-card);
    padding: 2.5rem 2rem;
    border-radius: 16px;
    border: 1px solid var(--borda);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.loading-spinner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradiente-roxo);
}

.loading-spinner i {
    font-size: 1.8rem;
    background: var(--gradiente-roxo);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: spin 1.8s linear infinite;
}

.loading-spinner span {
    font-weight: 600;
    color: var(--texto);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(15px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.error-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--fundo-card);
    border: 1px solid var(--borda);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradiente-roxo);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--erro);
}

.modal-header i {
    font-size: 2rem;
}

.modal-header h3 {
    font-size: 1.4rem;
    font-weight: 700;
}

.modal-body {
    margin-bottom: 2rem;
    line-height: 1.6;
    color: #e0e0e0;
    font-size: 1rem;
}

.modal-close {
    background: var(--gradiente-roxo);
    border: none;
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3);
}

.modal-close:hover {
    background: var(--gradiente-roxo-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(138, 43, 226, 0.4);
}

/* =============================== */
/* 🎯 RESPONSIVIDADE MELHORADA */
/* =============================== */
@media (max-width: 768px) {
    .ia-header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .ia-brand {
        order: -1;
    }

    .message {
        max-width: 92%;
    }

    .input-wrapper {
        gap: 0.75rem;
    }

    .send-button {
        width: 50px;
        height: 50px;
    }

    .messages-container {
        padding: 1.5rem 1rem;
    }

    .input-container {
        padding: 1.25rem;
    }

    .ia-logo {
        width: 40px;
        height: 40px;
    }

    .ia-title-main {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .ia-header {
        padding: 0.875rem 1rem;
    }

    .message-content {
        padding: 1rem 1.25rem;
    }

    .input-footer {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .back-button {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .modal-content {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }

    #user-input {
        padding: 1rem 1.25rem;
        font-size: 0.95rem;
    }
}

/* =============================== */
/* 🎯 SCROLLBAR PERSONALIZADA */
/* =============================== */
.messages-container::-webkit-scrollbar {
    width: 8px;
}

.messages-container::-webkit-scrollbar-track {
    background: rgba(138, 43, 226, 0.05);
    border-radius: 4px;
}

.messages-container::-webkit-scrollbar-thumb {
    background: var(--gradiente-roxo);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: var(--gradiente-roxo-hover);
    background-clip: content-box;
}

/* =============================== */
/* 🎯 ANIMAÇÕES ESPECIAIS */
/* =============================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ia-container {
    animation: fadeIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* =============================== */
/* 🎯 EFEITOS DE FOCO E ACESSIBILIDADE */
/* =============================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast support */
@media (prefers-contrast: high) {
    :root {
        --borda: rgba(138, 43, 226, 0.6);
    }
    
    .message-content {
        border-width: 2px;
    }
}

/* =============================== */
/* 🎯 MODAL DE LIMPAR CONVERSA */
/* =============================== */
.clear-confirm-modal .modal-content {
    background: var(--fundo-card);
    border: 1px solid var(--borda);
    border-radius: 16px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.clear-confirm-modal .modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradiente-roxo);
}

.clear-confirm-modal .modal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--erro);
}

.clear-confirm-modal .modal-header i {
    font-size: 2rem;
}

.clear-confirm-modal .modal-header h3 {
    font-size: 1.4rem;
    font-weight: 700;
}

.clear-confirm-modal .modal-body {
    margin-bottom: 2rem;
    line-height: 1.6;
}

.clear-confirm-modal .modal-body p {
    color: #e0e0e0;
    margin-bottom: 0.5rem;
}

.clear-confirm-modal .modal-warning {
    color: var(--aviso) !important;
    font-size: 0.9rem;
    font-weight: 500;
}

.clear-confirm-modal .modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.clear-confirm-modal .modal-cancel {
    background: transparent;
    border: 1px solid var(--borda);
    color: var(--texto);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.clear-confirm-modal .modal-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #666;
}

.clear-confirm-modal .modal-confirm {
    background: var(--erro);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.clear-confirm-modal .modal-confirm:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

/* =============================== */
/* 🎯 MENSAGENS TEMPORÁRIAS */
/* =============================== */
.temp-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--sucesso);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 1002;
    opacity: 0;
    transition: all 0.3s ease;
    font-weight: 500;
}

.temp-success {
    background: var(--sucesso);
}

.temp-info {
    background: var(--fundo-card);
    border: 1px solid var(--borda);
}

/* =============================== */
/* 🎯 DESTAQUE DE PALAVRAS-CHAVE EM ROXO */
/* =============================== */

/* Palavras importantes destacadas em roxo */
.message-text .keyword {
    color: var(--roxo-claro);
    font-weight: 600;
    background: rgba(138, 43, 226, 0.1);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    border: 1px solid rgba(138, 43, 226, 0.2);
}

/* Números e valores importantes */
.message-text .number {
    color: var(--roxo-claro);
    font-weight: 600;
    font-family: 'Fira Code', 'Courier New', monospace;
}

/* Termos técnicos e conceitos */
.message-text .concept {
    color: var(--roxo-claro);
    font-weight: 500;
    font-style: italic;
}

/* Ações e verbos importantes */
.message-text .action {
    color: var(--roxo-claro);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--roxo-claro);
    text-underline-offset: 2px;
}

/* Destaque para passos e etapas */
.message-text .step {
    color: var(--roxo-claro);
    font-weight: 600;
    position: relative;
    padding-left: 0.5rem;
}

.message-text .step::before {
    content: "•";
    color: var(--roxo-claro);
    font-weight: bold;
    margin-right: 0.3rem;
}

/* Destaque para prazos e datas */
.message-text .deadline {
    color: var(--roxo-claro);
    font-weight: 600;
    background: rgba(138, 43, 226, 0.08);
    padding: 0.1rem 0.4rem;
    border-radius: 6px;
    border: 1px dashed rgba(138, 43, 226, 0.3);
}

/* =============================== */
/* 🎯 MELHORIAS NO TEXTO DAS MENSAGENS */
/* =============================== */

.message-text {
    line-height: 1.6;
    margin-bottom: 0.75rem;
    word-wrap: break-word;
    font-size: 0.95rem;
}

/* Melhor contraste para o texto */
.message-text strong {
    color: var(--roxo-claro);
    font-weight: 700;
    background: linear-gradient(135deg, var(--roxo-claro), var(--roxo));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.message-text em {
    font-style: italic;
    opacity: 0.9;
    color: #e0e0e0;
}

.message-text code {
    background: rgba(138, 43, 226, 0.15);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.85em;
    border: 1px solid var(--borda);
    color: var(--roxo-claro);
    font-weight: 500;
}

/* Listas numeradas com destaque */
.message-text ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.message-text li {
    margin-bottom: 0.3rem;
    position: relative;
}

.message-text li::marker {
    color: var(--roxo-claro);
    font-weight: 600;
}

/* Destaque para citações e referências */
.message-text blockquote {
    border-left: 3px solid var(--roxo-claro);
    padding-left: 1rem;
    margin: 0.5rem 0;
    color: #e0e0e0;
    font-style: italic;
    background: rgba(138, 43, 226, 0.05);
    padding: 0.8rem 1rem;
    border-radius: 0 8px 8px 0;
}

/* =============================== */
/* 🎯 ANIMAÇÕES PARA DESTAQUES */
/* =============================== */

@keyframes highlightPulse {
    0% {
        background: rgba(138, 43, 226, 0.1);
        transform: scale(1);
    }
    50% {
        background: rgba(138, 43, 226, 0.2);
        transform: scale(1.02);
    }
    100% {
        background: rgba(138, 43, 226, 0.1);
        transform: scale(1);
    }
}

.message-text .keyword.highlight {
    animation: highlightPulse 2s ease-in-out;
}

/* =============================== */
/* 🎯 RESPONSIVIDADE PARA TEXTOS */
/* =============================== */

@media (max-width: 768px) {
    .message-text {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .message-text .keyword,
    .message-text .number,
    .message-text .concept {
        font-size: 0.85rem;
    }
}

/* =============================== */
/* 🎯 MELHORIAS DE ACESSIBILIDADE */
/* =============================== */

@media (prefers-reduced-motion: reduce) {
    .message-text .keyword.highlight {
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .message-text .keyword {
        background: rgba(138, 43, 226, 0.3);
        border: 2px solid var(--roxo);
    }
    
    .message-text strong {
        -webkit-text-fill-color: var(--roxo);
        background: none;
    }
}

* {
  -webkit-tap-highlight-color: transparent;
}

