/* SecoBot Chat - Tailwind UI Components Style */

/* FORZAR estilos del plugin sobre cualquier tema de WordPress */
.secobot-fullpage-chat, .secobot-fullpage-chat * {
    box-sizing: border-box !important;
}

.secobot-fullpage-chat {
    all: initial !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

.secobot-fullpage-chat {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 140px);
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    position: relative;
}

.secobot-chat-messages {
    flex: 1;
    overflow-y: auto !important;
    overflow-x: hidden;
    padding: 8rem 1.5rem;
    background: transparent;
    /* Scroll suave */
    scroll-behavior: smooth;
    min-height: 0; /* Permite que flex funcione correctamente */
    max-height: 100%;
    /* Asegurar que el scroll siempre esté visible */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

/* Estilos para scrollbar en Webkit (Chrome, Safari, Edge) */
.secobot-chat-messages::-webkit-scrollbar {
    width: 8px;
}

.secobot-chat-messages::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.secobot-chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.secobot-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.secobot-welcome-message {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #6b7280;
}

.secobot-welcome-title {
    font-size: 1.875rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.5rem;
}

.secobot-welcome-subtitle {
    font-size: 1rem;
    color: #6b7280;
}

.secobot-message,
.secobot-user-message,
.secobot-bot-message {
    display: flex;
    margin-bottom: 1rem;
}

.secobot-message.user,
.secobot-user-message {
    justify-content: flex-end;
}

.secobot-message.bot,
.secobot-bot-message {
    justify-content: flex-start;
}

.secobot-message-content {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

/* Mensajes de usuario - Estilo moderno */
.secobot-message.user .secobot-message-content,
.secobot-user-message .secobot-message-content {
    background: linear-gradient(135deg, #667eea 0%, #15015c 100%);
    color: #ffffff;
    border-radius: 18px;
    border-bottom-right-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    max-width: 80%;
}

/* Mensajes de bot - Estilo moderno tipo ChatGPT */
.secobot-message.bot .secobot-message-content,
.secobot-bot-message .secobot-message-content {
    background: #ffffff !important;
    color: #374151 !important;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    max-width: 85%;
}

/* FORZAR color de texto en todo el contenido del mensaje bot */
.secobot-fullpage-chat .secobot-message.bot .secobot-message-text,
.secobot-fullpage-chat .secobot-bot-message .secobot-message-text,
.secobot-fullpage-chat .secobot-ai-message .secobot-message-text {
    color: #374151 !important;
}

.secobot-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.secobot-message.user .secobot-avatar,
.secobot-user-message .secobot-user-avatar {
    background: linear-gradient(135deg, #667eea 0%, #15015c 100%);
    color: #ffffff;
    margin-left: 0.75rem;
    order: 2;
    font-weight: 700;
}

/* Avatar IA con imagen personalizada */
.secobot-message.bot .secobot-avatar,
.secobot-bot-message .secobot-bot-avatar,
.secobot-ai-avatar {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #ffffff;
    margin-right: 0.75rem;
    background-image: url('../images/chat-ia.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid #ffffff;
}

.secobot-message-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.secobot-message.user .secobot-message-wrapper {
    align-items: flex-end;
}

.secobot-message.bot .secobot-message-wrapper {
    align-items: flex-start;
}

.secobot-timestamp {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

.secobot-typing {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding: 0 1rem;
    animation: fadeIn 0.3s ease-in;
}

.secobot-typing .secobot-avatar {
    background: #233A79;
    color: #ffffff;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.secobot-typing-indicator {
    background: #f3f4f6;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    border-bottom-left-radius: 0.25rem;
    display: inline-flex;
    align-items: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.secobot-typing-dots {
    display: flex;
    gap: 0.25rem;
}

.secobot-typing-dot {
    width: 0.5rem;
    height: 0.5rem;
    background: #9ca3af;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.secobot-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.secobot-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.4;
        transform: scale(1);
    }
    30% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Indicador moderno de IA procesando */
.secobot-ai-processing {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 8px 16px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-radius: 20px !important;
    color: white !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    animation: pulse-glow 2s ease-in-out infinite;
}

.secobot-ai-processing-icon {
    font-size: 18px;
    animation: bounce-icon 1.5s ease-in-out infinite;
}

.secobot-ai-processing-text {
    font-weight: 600;
    letter-spacing: 0.3px;
}

.secobot-ai-processing-dots {
    display: inline-flex;
    gap: 2px;
}

.secobot-ai-processing-dots .dot {
    animation: dot-blink 1.4s infinite;
    opacity: 0;
}

.secobot-ai-processing-dots .dot:nth-child(1) {
    animation-delay: 0s;
}

.secobot-ai-processing-dots .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.secobot-ai-processing-dots .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
        transform: translateY(0);
    }
    50% {
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
        transform: translateY(-2px);
    }
}

@keyframes bounce-icon {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-4px) rotate(-5deg);
    }
    75% {
        transform: translateY(-2px) rotate(5deg);
    }
}

@keyframes dot-blink {
    0%, 20%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
}

/* Dark mode para el indicador de IA */
body[data-theme="dark"] .secobot-ai-processing {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

body[data-theme="dark"] .secobot-ai-processing {
    animation: pulse-glow-dark 2s ease-in-out infinite;
}

@keyframes pulse-glow-dark {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
        transform: translateY(0);
    }
    50% {
        box-shadow: 0 6px 20px rgba(124, 58, 237, 0.6);
        transform: translateY(-2px);
    }
}

.secobot-chat-input-area {
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
}

.secobot-input-wrapper {
    position: relative;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 1.5rem;
    padding: 0.75rem 3rem 0.75rem 1rem;
    transition: all 0.2s;
}

.secobot-input-wrapper:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.secobot-chat-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    font-size: 0.875rem;
    line-height: 1.5rem;
    min-height: 1.25rem;
    max-height: 6rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 400;
    color: #374151;
    letter-spacing: 0.025em;
}

.secobot-chat-send {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    background: #233A79;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.secobot-chat-send:hover:not(:disabled) {
    background: #FEC704;
}

.secobot-chat-send:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

.secobot-choice-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
    max-width: 70%;
}

.secobot-choice-button {
    background: #ffffff;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.secobot-choice-button:hover {
    background: #f9fafb;
    border-color: #3b82f6;
    color: #3b82f6;
}

.secobot-choice-button:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

/* Message time styling */
.secobot-message-time {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.25rem;
}

.secobot-bot-message .secobot-message-time,
.secobot-message.bot .secobot-message-time {
    color: #9ca3af;
}

.secobot-message-text {
    margin-bottom: 0.25rem;
}

.secobot-message-text a{
    color: #233A79;
}

/* Dark Theme */
body[data-theme="dark"] .secobot-fullpage-chat {
    background: #0f172a;
}

body[data-theme="dark"] .secobot-chat-messages {
    background: #0f172a;
}

body[data-theme="dark"] .secobot-welcome-title {
    color: #f1f5f9;
}

body[data-theme="dark"] .secobot-welcome-subtitle {
    color: #94a3b8;
}

body[data-theme="dark"] .secobot-message.bot .secobot-message-content,
body[data-theme="dark"] .secobot-bot-message .secobot-message-content {
    background: #1e293b !important;
    color: #f1f5f9 !important;
    border-color: #374151 !important;
}

/* FORZAR color de texto en todo el contenido del mensaje bot - TEMA OSCURO */
body[data-theme="dark"] .secobot-fullpage-chat .secobot-message.bot .secobot-message-text,
body[data-theme="dark"] .secobot-fullpage-chat .secobot-bot-message .secobot-message-text,
body[data-theme="dark"] .secobot-fullpage-chat .secobot-ai-message .secobot-message-text {
    color: #f1f5f9 !important;
}

body[data-theme="dark"] .secobot-chat-input-area {
    background: #0f172a;
    border-color: #334155;
}

body[data-theme="dark"] .secobot-input-wrapper {
    background: #1e293b;
    border-color: #475569;
}

body[data-theme="dark"] .secobot-input-wrapper:focus-within {
    border-color: #3b82f6;
}

body[data-theme="dark"] .secobot-chat-input {
    color: #f1f5f9;
}

body[data-theme="dark"] .secobot-chat-input::placeholder {
    color: #94a3b8;
}

body[data-theme="light"] .secobot-chat-input::placeholder {
    color: #9ca3af;
}

body[data-theme="dark"] .secobot-typing-indicator {
    background: #1e293b;
}

body[data-theme="dark"] .secobot-choice-button {
    background: #1e293b;
    border-color: #475569;
    color: #f1f5f9;
}

body[data-theme="dark"] .secobot-message-text a{
    color: #FEC704;
}

body[data-theme="dark"] .secobot-choice-button:hover {
    background: #334155;
    border-color: #3b82f6;
    color: #60a5fa;
}

/* Menu options styling */
.secobot-menu-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0 16px 0;
    padding: 0;
    max-width: 400px; /* Limitar ancho en pantallas grandes */
}

/* Responsive: full width en móviles */
@media (max-width: 768px) {
    .secobot-menu-container {
        max-width: none;
    }
}

.secobot-menu-option {
    background: #233A79;
    border: 1px solid #233A79;
    border-radius: 8px;
    padding: 12px 16px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #ffffff;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.secobot-menu-option:hover {
    background: #FEC704;
    border-color: #FEC704;
    color: #1f2937;
}

.secobot-menu-option:active {
    background: #e6b304;
    border-color: #e6b304;
    color: #1f2937;
    transform: scale(0.98);
}

/* Dark mode menu options - using corporate colors */
body[data-theme="dark"] .secobot-menu-option {
    background: #233A79;
    border-color: #1e3366;
    color: #ffffff;
}

body[data-theme="dark"] .secobot-menu-option:hover {
    background: #FEC704;
    border-color: #f0b800;
    color: #1f2937;
}

body[data-theme="dark"] .secobot-menu-option:active {
    background: #f0b800;
    color: #1f2937;
}

/* Form styling */
.secobot-form-container {
    margin: 12px 0 16px 0;
    max-width: 500px; /* Limitar ancho en pantallas grandes */
}

/* Responsive: full width en móviles */
@media (max-width: 768px) {
    .secobot-form-container {
        max-width: none;
    }
}

.secobot-form {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
}

.secobot-form-field {
    margin-bottom: 16px;
}

.secobot-form-field:last-of-type {
    margin-bottom: 0;
}

.secobot-form label {
    display: block;
    font-weight: 500;
    font-size: 14px;
    color: #374151;
    margin-bottom: 6px;
}

.secobot-form input,
.secobot-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
    background: #ffffff;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.secobot-form input:focus,
.secobot-form textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px #3b82f6;
}

.secobot-form textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.secobot-form-submit {
    background: #233A79;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: 12px;
    min-height: 44px;
}

.secobot-form-submit:hover {
    background: #FEC704;
    color: #1f2937;
}

.secobot-form-submit:active {
    background: #f0b800;
    color: #1f2937;
    transform: scale(0.98);
}

/* Dark mode form styling */
body[data-theme="dark"] .secobot-form {
    background: #374151;
    border-color: #4b5563;
}

body[data-theme="dark"] .secobot-form label {
    color: #f9fafb;
}

body[data-theme="dark"] .secobot-form input,
body[data-theme="dark"] .secobot-form textarea {
    background: #4b5563;
    border-color: #6b7280;
    color: #f9fafb;
}

body[data-theme="dark"] .secobot-form input:focus,
body[data-theme="dark"] .secobot-form textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px #3b82f6;
}

body[data-theme="dark"] .secobot-form input::placeholder,
body[data-theme="dark"] .secobot-form textarea::placeholder {
    color: #9ca3af;
}

/* Restart button styling */
.secobot-restart-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.secobot-restart-button {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.secobot-restart-button:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
}

.secobot-restart-button:active {
    background: #1d4ed8;
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* Dark mode restart button - using corporate colors */
body[data-theme="dark"] .secobot-restart-button {
    background: #233A79;
}

body[data-theme="dark"] .secobot-restart-button:hover {
    background: #FEC704;
    color: #1f2937;
}

body[data-theme="dark"] .secobot-restart-button:active {
    background: #f0b800;
    color: #1f2937;
}

/* Dark mode avatares corporativos */
body[data-theme="dark"] .secobot-message.user .secobot-avatar,
body[data-theme="dark"] .secobot-user-message .secobot-user-avatar {
    background: #FEC704;
    color: #1f2937;
    /* El amarillo se mantiene igual en dark mode para buena visibilidad */
}

body[data-theme="dark"] .secobot-message.bot .secobot-avatar,
body[data-theme="dark"] .secobot-bot-message .secobot-bot-avatar,
body[data-theme="dark"] .secobot-typing .secobot-avatar {
    background: #233A79;
    color: #ffffff;
    /* El azul corporativo se mantiene igual en ambos modos */
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .secobot-chat-messages {
        padding: 1rem;
    }
    
    .secobot-chat-input-area {
        padding: 0.75rem 1rem 1rem;
    }
    
    .secobot-message-content {
        max-width: 85%;
    }
    
    .secobot-welcome-message {
        padding: 2rem 1rem;
    }
    
    .secobot-menu-option {
        min-height: 48px;
        font-size: 16px;
    }
    
    .secobot-form input,
    .secobot-form textarea {
        font-size: 16px;
    }
    
    .secobot-form-submit {
        min-height: 48px;
        font-size: 16px;
    }

    /* Dark mode mobile form submit button */
    body[data-theme="dark"] .secobot-form-submit {
        background: #233A79;
    }

    body[data-theme="dark"] .secobot-form-submit:hover {
        background: #FEC704;
        color: #1f2937;
    }

    body[data-theme="dark"] .secobot-form-submit:active {
        background: #f0b800;
        color: #1f2937;
    }
}

/* === Chat IA Mode Styles === */

/* Mensajes de IA con estilo especial */
.secobot-ai-message {
    background: linear-gradient(135deg, #e3f2fd, #ffffee);
    border: 1px solid #adaeaf;
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
    position: relative;
}

.secobot-ai-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #2196f3, #03a9f4, #00bcd4);
    border-radius: 12px 12px 0 0;
}

/* Avatar específico para IA */
.secobot-ai-avatar {
    background: linear-gradient(135deg, #2196f3, #03a9f4);
    color: white;
    border: 2px solid #1976d2;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Animación suave para el indicador de modo IA */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Input area en modo IA con estilo diferente */
.secobot-chat-input-area.ai-mode {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 2px solid #2196f3;
    border-radius: 12px;
    margin: 16px;
    padding: 8px;
}

.secobot-chat-input-area.ai-mode .secobot-chat-input {
    background: rgba(255, 255, 255, 0.9);
    
    color: #0d47a1;
}

.secobot-chat-input-area.ai-mode .secobot-chat-input:focus {
    
    box-shadow: 0 0 8px rgba(33, 150, 243, 0.3);
}

.secobot-chat-input-area.ai-mode .secobot-chat-send {
    background: linear-gradient(135deg, #2196f3, #233A79);
    border: none;
    color: white;
}

.secobot-chat-input-area.ai-mode .secobot-chat-send:hover {
    background: linear-gradient(135deg, #d3a606, #FEC704);
    
}

/* Dark mode para mensajes IA */
body[data-theme="dark"] .secobot-ai-message {
    background: linear-gradient(135deg, #0d47a1, #1565c0);
    border-color: #2196f3;
    color: #ffffff;
}

body[data-theme="dark"] .secobot-ai-avatar {
    background: linear-gradient(135deg, #1976d2, #2196f3);
    border-color: #03a9f4;
}

body[data-theme="dark"] .secobot-chat-input-area.ai-mode {
    background: linear-gradient(135deg, #0d47a1, #1565c0);
    border-color: #2196f3;
}

body[data-theme="dark"] .secobot-chat-input-area.ai-mode .secobot-chat-input {
    background: rgba(255, 255, 255, 0.1);
    
    color: #ffffff;
}

body[data-theme="dark"] .secobot-chat-input-area.ai-mode .secobot-chat-input::placeholder {
    color: #bbdefb;
}

/* ========================= */
/* ESTILOS PARA MARKDOWN EN RESPUESTAS AI */
/* ========================= */

/* Headers en mensajes bot - TEMA CLARO */
.secobot-fullpage-chat .secobot-message-text h2,
.secobot-chat-messages .secobot-message-text h2 {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: #111827 !important;
    margin: 1rem 0 0.75rem 0 !important;
    padding-bottom: 0.5rem !important;
    border-bottom: 2px solid #d1d5db !important;
}

.secobot-fullpage-chat .secobot-message-text h3,
.secobot-chat-messages .secobot-message-text h3 {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: #1f2937 !important;
    margin: 0.75rem 0 0.5rem 0 !important;
}

/* Headers en mensajes bot - TEMA OSCURO (override) */
body[data-theme="dark"] .secobot-fullpage-chat .secobot-message-text h2,
body[data-theme="dark"] .secobot-chat-messages .secobot-message-text h2 {
    color: #f9fafb !important;
    border-bottom-color: #374151 !important;
}

body[data-theme="dark"] .secobot-fullpage-chat .secobot-message-text h3,
body[data-theme="dark"] .secobot-chat-messages .secobot-message-text h3 {
    color: #e5e7eb !important;
}

/* Listas en mensajes bot */
.secobot-message-text ul {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.secobot-message-text li {
    margin: 0.25rem 0;
    line-height: 1.5;
}

/* Enlaces en mensajes bot - TEMA CLARO */
.secobot-fullpage-chat .secobot-message-text a,
.secobot-chat-messages .secobot-message-text a {
    color: #2563eb !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    border-bottom: 1px solid transparent !important;
    transition: all 0.2s ease !important;
}

.secobot-fullpage-chat .secobot-message-text a:hover,
.secobot-chat-messages .secobot-message-text a:hover {
    color: #1d4ed8 !important;
    border-bottom-color: #2563eb !important;
}

/* Enlaces en mensajes bot - TEMA OSCURO */
body[data-theme="dark"] .secobot-fullpage-chat .secobot-message-text a,
body[data-theme="dark"] .secobot-chat-messages .secobot-message-text a {
    color: #60a5fa !important;
}

body[data-theme="dark"] .secobot-fullpage-chat .secobot-message-text a:hover,
body[data-theme="dark"] .secobot-chat-messages .secobot-message-text a:hover {
    color: #93c5fd !important;
    border-bottom-color: #60a5fa !important;
}

/* Texto en negritas - TEMA CLARO */
.secobot-fullpage-chat .secobot-message-text strong,
.secobot-chat-messages .secobot-message-text strong {
    font-weight: 700 !important;
    color: #111827 !important;
}

/* Texto en cursiva - TEMA CLARO */
.secobot-fullpage-chat .secobot-message-text em,
.secobot-chat-messages .secobot-message-text em {
    font-style: italic !important;
    color: #4b5563 !important;
}

/* Texto en negritas - TEMA OSCURO */
body[data-theme="dark"] .secobot-fullpage-chat .secobot-message-text strong,
body[data-theme="dark"] .secobot-chat-messages .secobot-message-text strong {
    color: #f9fafb !important;
}

/* Texto en cursiva - TEMA OSCURO */
body[data-theme="dark"] .secobot-fullpage-chat .secobot-message-text em,
body[data-theme="dark"] .secobot-chat-messages .secobot-message-text em {
    color: #d1d5db !important;
}

/* Espaciado mejorado para párrafos con BR */
.secobot-message-text br + br {
    content: "";
    display: block;
    margin: 0.5rem 0;
}

/* Estilos específicos para mensajes AI */
.secobot-ai-message .secobot-message-text h2 {
    color: #ffffff;
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.secobot-ai-message .secobot-message-text h3 {
    color: #e3f2fd;
}

.secobot-ai-message .secobot-message-text strong {
    color: #ffffff;
}

.secobot-ai-message .secobot-message-text a {
    color: #bbdefb;
    border-bottom-color: transparent;
}

.secobot-ai-message .secobot-message-text a:hover {
    color: #ffffff;
    border-bottom-color: #bbdefb;
}

/* Esta sección se movió arriba con selectores más específicos */

/* ========================= */
/* MEJORAS MODERNAS ESTILO CHATGPT/CLAUDE */
/* ========================= */

/* Mejoras en los mensajes - Efecto moderno tipo Claude */
.secobot-message {
    margin-bottom: 1.5rem;
    animation: messageSlideIn 0.4s ease-out;
}

/* Mensajes de IA con efecto shimmer elegante */
.secobot-ai-message {
    animation: aiMessageAppear 0.6s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes aiMessageAppear {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    50% {
        opacity: 0.8;
        transform: translateY(5px) scale(0.99);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mensajes de IA con estilo especial */
.secobot-ai-message .secobot-message-content {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
}

/* Mejora en el padding de contenido */
.secobot-message-content {
    padding: 1rem 1.25rem;
    position: relative;
}

/* Typing cursor para efecto de escritura */
.typing-cursor {
    display: inline-block;
    background: #374151;
    width: 2px;
    height: 1.2em;
    animation: blink 1s infinite;
}

/* Mejoras en scrollbar */
.secobot-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.secobot-chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.secobot-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.secobot-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Mejoras en input area */
.secobot-chat-input-area {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1rem 1.5rem;
}

.secobot-input-wrapper {
    max-width: 768px;
    margin: 0 auto;
    display: flex;
    align-items: end;
    gap: 0.75rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    padding: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.secobot-chat-input {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.95rem;
    line-height: 1.4;
    resize: none;
    outline: none;
}

.secobot-chat-send {
    width: 36px;
    height: 36px;
    border-radius: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.secobot-chat-send:hover:not(:disabled) {
    
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.secobot-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Animación de hover en avatares */
.secobot-avatar {
    transition: transform 0.2s ease;
}

.secobot-avatar:hover {
    transform: scale(1.05);
}

/* ========================= */
/* PANTALLA DE BIENVENIDA ESTILO CLAUDE/CHATGPT */
/* ========================= */

/* Pantalla de bienvenida principal */
.secobot-welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: calc(100vh - 250px);
    padding: 3rem 2rem 2rem;
    text-align: center;
    animation: welcomeScreenFadeIn 0.6s ease-out;
}

.secobot-welcome-content {
    max-width: 800px;
    width: 100%;
    margin-bottom: 3rem;
}

/* Título principal */
.secobot-welcome-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 1rem 0;
    line-height: 1.2;
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Subtítulo */
.secobot-welcome-subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    color: #6b7280;
    margin: 0 0 1.5rem 0;
    line-height: 1.4;
}

/* Texto introductorio para agentes */
.secobot-agents-intro {
    font-size: 1rem;
    color: #9ca3af;
    margin: 0;
    font-weight: 400;
    line-height: 1.5;
}

/* Dark mode para pantalla de bienvenida */
body[data-theme="dark"] .secobot-welcome-title {
    background: linear-gradient(135deg, #f9fafb 0%, #e5e7eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body[data-theme="dark"] .secobot-welcome-subtitle {
    color: #9ca3af;
}

body[data-theme="dark"] .secobot-agents-intro {
    color: #6b7280;
}

/* Responsive para pantalla de bienvenida */
@media (max-width: 768px) {
    .secobot-welcome-screen {
        padding: 2rem 1rem 1rem;
        min-height: calc(100vh - 200px);
    }

    .secobot-welcome-title {
        font-size: 2rem;
    }

    .secobot-welcome-subtitle {
        font-size: 1.25rem;
    }

    .secobot-agents-intro {
        font-size: 0.9rem;
    }

    .secobot-welcome-content {
        margin-bottom: 2rem;
    }
}

/* Animación de aparición */
@keyframes welcomeScreenFadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================= */
/* ESTILOS PARA TARJETAS DE AGENTES */
/* ========================= */

/* Contenedor principal de agentes */
.secobot-agents-container {
    margin: 1rem 0;
    animation: slideDown 0.5s ease-out;
    width: 100%;
    max-width: 900px;
}

/* Grid de tarjetas de agentes */
.secobot-agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 1rem 0;
    justify-items: center;
}

/* Tarjeta individual de agente */
.secobot-agent-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 320px;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.secobot-agent-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #06b6d4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.secobot-agent-card:hover::before {
    opacity: 1;
}

.secobot-agent-card:hover {
    transform: translateY(-4px);
    border-color: #3b82f6;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.secobot-agent-card:active {
    transform: translateY(-2px);
}

/* Icono del agente */
.secobot-agent-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    transition: transform 0.3s ease;
}

.secobot-agent-card:hover .secobot-agent-icon {
    transform: scale(1.1);
}

/* Nombre del agente */
.secobot-agent-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

/* Descripción del agente */
.secobot-agent-description {
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.4;
    margin: 0;
}

/* Opción de chat general */
.secobot-general-option {
    margin-top: 1.5rem;
    text-align: center;
}

.secobot-general-chat-btn {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(107, 114, 128, 0.2);
}

.secobot-general-chat-btn:hover {
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

.secobot-general-chat-btn:active {
    transform: translateY(0);
}

/* Responsive para tarjetas de agentes */
@media (max-width: 768px) {
    .secobot-agents-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .secobot-agent-card {
        padding: 1.25rem;
    }

    .secobot-agent-icon {
        font-size: 2.5rem;
        margin-bottom: 0.75rem;
    }

    .secobot-agent-name {
        font-size: 1rem;
    }

    .secobot-agent-description {
        font-size: 0.85rem;
    }

    .secobot-general-chat-btn {
        width: 100%;
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }
}

/* Dark mode para tarjetas de agentes */
body[data-theme="dark"] .secobot-agent-card {
    background: linear-gradient(135deg, #374151 0%, #4b5563 100%);
    border-color: #4b5563;
    color: #f9fafb;
}

body[data-theme="dark"] .secobot-agent-card:hover {
    border-color: #60a5fa;
    box-shadow: 0 8px 25px rgba(96, 165, 250, 0.2);
}

body[data-theme="dark"] .secobot-agent-name {
    color: #f9fafb;
}

body[data-theme="dark"] .secobot-agent-description {
    color: #d1d5db;
}

body[data-theme="dark"] .secobot-general-chat-btn {
    background: linear-gradient(135deg, #233A79 0%, #1e3366 100%);
}

body[data-theme="dark"] .secobot-general-chat-btn:hover {
    background: linear-gradient(135deg, #FEC704 0%, #d3a606 100%);
    color: #1f2937;
}

/* Estilo para mensaje de subtítulo */
.secobot-message.secobot-subtitle .secobot-message-content {
    background: transparent;
    border: none;
    box-shadow: none;
    text-align: center;
    font-weight: 500;
    color: #6b7280;
    font-size: 0.95rem;
    padding: 0.5rem 0;
}

body[data-theme="dark"] .secobot-message.secobot-subtitle .secobot-message-content {
    color: #9ca3af;
}

/* Animación para la aparición de tarjetas */
.secobot-agent-card {
    animation: cardSlideIn 0.5s ease-out forwards;
}

.secobot-agent-card:nth-child(1) { animation-delay: 0.1s; }
.secobot-agent-card:nth-child(2) { animation-delay: 0.2s; }
.secobot-agent-card:nth-child(3) { animation-delay: 0.3s; }
.secobot-agent-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Footer institucional fijo */
.secobot-footer {
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    padding: 0.75rem 1rem;
    text-align: center;
    z-index: 100;
    font-size: 0.75rem;
    color: #6b7280;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
}

.secobot-footer p {
    margin: 0;
    font-weight: 500;
    line-height: 1.2;
}

/* Área de input de bienvenida inline (dentro del contenido de bienvenida) */
.secobot-welcome-input-inline {
    margin-top: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    transition: all 0.3s ease;
}

/* Ajustar altura del chat para acomodar footer */
.secobot-fullpage-chat {
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Input fijo que aparece justo encima del footer */
.secobot-chat-input-area {
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    position: fixed;
    bottom: 2.5rem; /* Altura del footer: 0.75rem padding top + 0.75rem padding bottom + altura del texto ≈ 2.5rem */
    left: 0;
    right: 0;
    width: 100%;
    z-index: 99; /* Menor que el footer pero encima del contenido */
}

/* Estilos para modo oscuro del footer */
body[data-theme="dark"] .secobot-footer {
    background: #1e293b;
    border-color: #334155;
    color: #94a3b8;
}

/* Estilos para modo oscuro del input fijo */
body[data-theme="dark"] .secobot-chat-input-area {
    background: #0f172a;
    border-color: #334155;
}


/* Responsive para el footer */
@media (max-width: 768px) {
    .secobot-footer {
        font-size: 0.6875rem;
        padding: 0.5rem 0.75rem;
    }

    .secobot-welcome-input-inline {
        margin: 1.5rem 1rem 0.75rem 1rem;
    }
}
