/* ========================================
   AI Command Input (/kai) Styling
   ======================================== */

/* Glow effect when /kai command is active */
#message-input.kai-active {
    background-color: rgba(74, 144, 226, 0.3);
    box-shadow: 0 0 10px rgba(173, 216, 230, 0.6),
                0 0 20px rgba(173, 216, 230, 0.3),
                inset 0 0 8px rgba(173, 216, 230, 0.2);
    border-color: #4a90e2;
    transition: box-shadow 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

/* Add inactive class for smooth transition */
#message-input.kai-inactive {
    background-color: transparent;
    box-shadow: none;
    border: 1px solid #ccc;
    border-radius: 20px;
    transition: box-shadow 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

/* Robot icon inside the input box */
#kai-robot-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    opacity: 0.8;
    pointer-events: none;
    animation: robotPulse 2s ease-in-out infinite;
    z-index: 15;
}

/* AI Robot Profile Icon - Perfeitamente centralizado no círculo azul */
.chat-msg-robot-icon {
    width: 32px;
    height: 32px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #92bfdf;
    color: #1a69c4;
    font-size: 21px;
    line-height: 1;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Pequeno ajuste no container da profile do AI para ficar mais limpo */
.chat-msg.ai-sender .chat-msg-profile {
    gap: 6px;
}

#kai-robot-profile {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}

@keyframes robotPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Overlay for formatting /kai text in input */
#kai-input-overlay {
    pointer-events: none;
    position: absolute;
    color: #222;
    background: transparent;
    z-index: 10;
    white-space: pre-wrap;
    overflow: hidden;
}

#kai-input-overlay b {
    color: #4a90e2;
    font-weight: 600;
}

/* ========================================
   AI Response Message Styling
   ======================================== */

/* AI message balloon wrapper */
.chat-msg.ai-sender {
    /* Special styling for AI messages */
}

.chat-msg.ai-sender .chat-msg-content {
    align-items: flex-start;
}

/* AI response text styling */
.chat-msg-text.ai-response {
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f2fd 100%);
    border-left: 4px solid #4a90e2;
    color: #1a3a52;
    border-radius: 8px;
    font-weight: 500;
    padding: 12px 15px;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.15);
    position: relative;
}

.chat-msg-text.ai-response::before {
    content: '🤖 ';
    margin-right: 6px;
    font-size: 16px;
}

/* AI message label styling */
.chat-msg.ai-sender .chat-msg-label {
    color: #4a90e2;
    font-weight: normal;
    font-size: 13px;
}

/* AI profile icon styling */
.chat-msg.ai-sender .chat-msg-img {
    filter: hue-rotate(200deg) saturate(1.2);
    border: 2px solid #4a90e2;
}

/* ========================================
   Dark Mode AI Styling
   ======================================== */

body.dark-mode #message-input.kai-active {
    background-color: rgba(100, 180, 255, 0.3);
    box-shadow: 0 0 10px rgba(173, 216, 230, 0.5),
                0 0 20px rgba(173, 216, 230, 0.2),
                inset 0 0 8px rgba(173, 216, 230, 0.15);
    border-color: #64b4ff;
}

body.dark-mode .chat-msg-text.ai-response {
    background: linear-gradient(135deg, #1a2a3a 0%, #233042 100%);
    border-left-color: #64b4ff;
    color: #b0d4ff;
    box-shadow: 0 2px 8px rgba(100, 180, 255, 0.2);
}

body.dark-mode .chat-msg.ai-sender .chat-msg-label {
    color: #64b4ff;
}

body.dark-mode .chat-msg.ai-sender .chat-msg-img {
    filter: hue-rotate(200deg) saturate(1.5);
    border-color: #64b4ff;
}



/* Pergunta original dentro do balão do Kai */
.ai-question {
    font-size: 12.5px;
    color: #555;
    background: rgba(0, 123, 255, 0.08);
    padding: 6px 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    margin-top: 18px;
    border-left: 3px solid #007bff;
    font-style: italic;
    word-wrap: break-word;
}

body.dark-mode .ai-question {
    background: rgba(100, 180, 255, 0.12);
    color: #b0d4ff;
    border-left-color: #64b4ff;
}