/* =================================== */
/* --- ESTILOS GLOBALES Y DE DISEÑO BASE --- */
/* =================================== */
body { 
  font-family: 'Inter', sans-serif;
  background-color: #0A192F; 
}
.hidden { display: none; }
.page-content { display: none; animation: fadeIn 0.5s; }
.page-content.active { display: block; }

/* =================================== */
/* --- ANIMACIONES GLOBALES (KEYFRAMES) --- */
/* =================================== */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sparkle-animation { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes flame-flicker {
    0%, 100% { transform: scaleY(1) skewX(0); opacity: 0.9; }
    50% { transform: scaleY(1.05) skewX(2deg); opacity: 1; }
}
@keyframes white-glow {
    0% { box-shadow: 0 0 4px 0px rgba(255, 255, 255, 0.2); }
    50% { box-shadow: 0 0 16px 4px rgba(255, 255, 255, 0.4); }
    100% { box-shadow: 0 0 4px 0px rgba(255, 255, 255, 0.2); }
}


/* ================================================= */
/* --- ESTILOS PARA LA PANTALLA DE LOGIN --- */
/* ================================================= */

.login-background {
  background-color: #0A192F;
  background-size: cover;
  background-position: center;
}

.login-background > div {
    animation: fadeInLogin 0.8s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes fadeInLogin {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =================================== */
/* --- ESTILOS DE COMPONENTES GENERALES --- */
/* =================================== */
.auth-card { animation: fadeIn 0.5s ease-out; }
.sidebar { transition: transform 0.3s ease-in-out; }
.sidebar-closed { transform: translateX(-100%); }
.main-content { transition: margin-left 0.3s ease-in-out; }
.gemini-sparkle { background: linear-gradient(90deg, #4285F4, #9b72cb, #d96570, #f2a600); -webkit-background-clip: text; -webkit-text-fill-color: transparent; animation: sparkle-animation 5s infinite linear; background-size: 200% 100%; }
.integration-pulse { animation: pulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1); }

/* Scrollbar Personalizada y Elegante */
.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #4b5563; /* Color gris oscuro para el scroll */
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: content-box;
}
.custom-scrollbar:hover::-webkit-scrollbar-thumb {
  background: #6b7280; 
}

/* ================================================= */
/* --- ESTILOS DEFINITIVOS PARA EL LAYOUT DEL CRM --- */
/* ================================================= */
#app-header {
    background-color: #0f172a; /* Azul oscuro más profundo */
    color: white;
    height: 64px;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-shrink: 0;
    border-bottom: 1px solid #1e293b; /* Borde sutil */
}

.header-icon-btn {
    color: #94a3b8; /* Color de icono más suave */
    padding: 0.5rem;
    border-radius: 9999px;
    transition: background-color 0.2s, color 0.2s;
}
.header-icon-btn:hover {
    background-color: #1e293b;
    color: white;
}
.nav-link-header.active {
    color: white;
    background-color: #334155;
}

.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1900;
    transition: opacity 0.3s;
}

.app-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 288px;
    background-color: #0f172a; /* Fondo oscuro para el sidebar */
    color: #e2e8f0; /* Texto claro */
    z-index: 2000;
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
    border-right: 1px solid #1e293b;
}

.app-sidebar .nav-link {
    color: #cbd5e1;
}
.app-sidebar .nav-link:hover {
    background-color: #1e293b;
    color: white;
}
.app-sidebar .font-bold {
    color: white;
}
.app-sidebar .border-b, .app-sidebar .border-t {
    border-color: #1e293b;
}


.app-sidebar.is-hidden {
    transform: translateX(-100%);
}

#app-footer {
    background-color: #0f172a;
    color: #94a3b8;
    height: 48px; /* Un poco más de altura para que no se vea apretado */
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between; /* Clave para separar las 3 secciones */
    flex-shrink: 0;
    border-top: 1px solid #1e293b;
    font-size: 0.8rem;
}

.footer-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* NUEVO: Estilo para el lema con fuente elegante */
.footer-tagline {
    font-family: 'Playfair Display', serif; /* Usa una de las fuentes que ya importaste */
    font-style: italic;
    color: #94a3b8;
    font-size: 0.9rem;
}

.footer-logo {
    height: 20px;
    margin-left: 0.5rem;
    opacity: 0.7; /* Un poco de opacidad para integrarlo mejor */
    filter: brightness(0) invert(1); 
}
.footer-icon {
    color: #94a3b8;
    transition: color 0.2s;
}
.footer-icon:hover {
    color: white; /* El color cambia a blanco al pasar el mouse */
}


/* =================================== */
/* --- ESTILOS PARA TARJETAS DE CONTENIDO (Configuración, etc.) --- */
/* =================================== */
#settings-content .bg-white {
    background-color: #0f172a;
    border: 1px solid #1e293b;
}

/* --- NUEVO: ESTILOS DE TEXTO ESPECÍFICOS --- */
.settings-main-title {
    color: #000000; /* Título principal en blanco */
}
.settings-subtitle {
    color: #94a3b8; /* Subtítulo en gris claro */
}
.settings-card-title {
    color: #00d1ff; /* Títulos de las tarjetas en azul cian */
}
.settings-card-text {
    color: #cbd5e1; /* Texto normal dentro de las tarjetas */
}
/* --- FIN DE ESTILOS DE TEXTO ESPECÍFICOS --- */

#settings-content .border-b {
    border-color: #1e293b;
}

/* Se aplica el efecto de resplandor a los botones de acción */
#settings-content .bg-gray-800, 
#settings-content .bg-blue-600, 
#settings-content .bg-green-600 {
    animation: white-glow 3s infinite ease-in-out;
}


/* =================================== */
/* --- BANDEJA UNIFICADA (Ejemplo de cómo se adaptaría) --- */
/* =================================== */
#unified-inbox-content .conversation-list-item.active { background-color: #1e293b; }
#unified-inbox-content .conversation-list-item:hover { background-color: #1a2436; }
#unified-inbox-content .message-bubble-received { background-color: #1e293b; border: 1px solid #334155; color: #e2e8f0; }
#unified-inbox-content .message-bubble-sent { background-color: #1d4ed8; color: white; }


/* =================================== */
/* --- ADMIN BLOG (Ejemplo de cómo se adaptaría) --- */
/* =================================== */
#admin-blog-content .ql-editor { min-height: 150px; font-size: 1rem; background-color: #1e293b; color: #e2e8f0; border-radius: 5px; }
#admin-blog-content .ql-toolbar { border-top-left-radius: 5px; border-top-right-radius: 5px; background-color: #334155; border-color: #4b5563 !important; }
#admin-blog-content .ql-toolbar .ql-stroke { stroke: #e2e8f0; }
#admin-blog-content .ql-toolbar .ql-fill { fill: #e2e8f0; }
#admin-blog-content .ql-container { border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; border-color: #4b5563 !important; }


/* =================================== */
/* --- MODALES --- */
/* =================================== */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(10, 25, 47, 0.8); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 2000; opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s; }
.modal-overlay.visible { opacity: 1; visibility: visible; }
.modal-content-sm, .modal-content-lg, .modal-content-xl {
  background: #ffffff;
  color: #0f3464;
  border: 1px solid #1e293b;
  padding: 2rem; 
  border-radius: 8px; 
  box-shadow: 0 10px 30px rgba(0,0,0,0.4); 
}
.modal-content-sm { max-width: 450px; width: 90%; text-align: center; }
.modal-content-lg { position: relative; max-width: 800px; width: 90%; }
.modal-content-xl { position: relative; max-width: 1100px; width: 90%; max-height: 90vh; display: flex; flex-direction: column;}
.modal-body { overflow-y: auto; }
.modal-buttons { margin-top: 1.5rem; display: flex; justify-content: flex-end; gap: 1rem; }


/* NUEVO: Estilos para el modal de integración -settings */
.platform-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    background-color: #1e293b;
    border-radius: 8px;
    border: 1px solid #334155;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}
.platform-card:hover {
    background-color: #334155;
    color: white;
    transform: translateY(-4px);
    border-color: #00d1ff;
}

.modal-input {
    background-color: #ffffff;
    color: #000000;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    width: 100%;
    transition: border-color 0.2s;
}
.modal-input:focus {
    outline: none;
    border-color: #00d1ff;
    box-shadow: 0 0 0 2px rgba(0, 209, 255, 0.3);
}

/* =================================== */
/* --- ESTILOS PARA CONSOLA DE SOPORTE --- */
/* =================================== */

/* Contenedor principal de la consola de soporte */
.support-console {
  display: flex;
  height: 100vh; /* Ocupa toda la altura de la ventana */
  background-color: #0A192F; /* Fondo principal de la consola */
}

/* Barra lateral izquierda con la lista de usuarios */
.support-sidebar {
  width: 350px;
  flex-shrink: 0;
  background-color: #0f172a; /* Fondo de la barra lateral */
  border-right: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
}

/* Título "Consola de Soporte" */
.support-sidebar h2 {
  color: #ffffff; /* Color del título */
}

/* Tarjeta de cada usuario en la lista */
.support-user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #1e293b;
  transition: background-color 0.2s;
}

.support-user-item:hover {
  background-color: #1e293b; /* Color al pasar el mouse */
}

/* Panel principal derecho donde se ven los detalles */
.support-main-content {
  flex-grow: 1;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Estilos para el modal de solicitud de código */
#request-access-modal .modal-content-lg {
    background-color: #1e293b; /* Fondo del modal */
    border-color: #334155;
}

#request-access-modal h3 {
    color: #ffffff; /* Color del título del modal */
}

#request-access-modal p {
    color: #cbd5e1; /* Color del texto del modal */
}

#access-code-display {
    background-color: #0f172a; /* Fondo de la caja del código */
    border-color: #334155;
    color: #00d1ff; /* Color del código */
}


/* =================================== */
/* --- ESTILOS PARA LA PÁGINA DE AYUDA --- */
/* =================================== */

/* Los estilos de las tarjetas y textos se heredan de las clases 
   .settings-main-title, .settings-card-title, etc., que ya
   están definidas en styles.css.

   Aquí podemos añadir estilos específicos si los necesitamos en el futuro.
*/

#access-code-input {
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 0.2em;
}

.notification-dropdown-container {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    width: 320px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    border: 1px solid #e5e7eb;
    z-index: 50;
    max-height: 400px;
    overflow-y: auto;
}

/*==========================================================================
   ESTILOS EXCLUSIVOS PARA EL CENTRO DE CREACIÓN DE CHATBOTS
==========================================================================*/

/* --- Botón Principal "Crear Nuevo Chatbot" --- */
#create-chatbot-btn {
    background: linear-gradient(45deg, #10b981, #34d399);
    color: white;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5); /* Resplandor */
    transition: all 0.3s ease;
    animation: pulse-green 2s infinite;
}

#create-chatbot-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.8);
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.5); }
    50% { box-shadow: 0 0 30px rgba(16, 185, 129, 0.8); }
    100% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.5); }
}


/* --- Modal de Creación de Chatbot --- */
#create-chatbot-modal .modal-content-lg {
    background: #111827; /* Fondo oscuro */
    color: #e5e7eb;
    border: 1px solid #374151;
    border-radius: 12px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
}

#create-chatbot-modal h3 {
    color: white;
    font-weight: bold;
}

#create-chatbot-modal label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #9ca3af;
    margin-bottom: 4px;
    display: block;
}

/* Estilos para los campos del formulario */
#create-chatbot-modal .modal-input, 
#create-chatbot-modal select, 
#create-chatbot-modal textarea {
    background-color: #1f2937;
    border: 1px solid #4b5563;
    color: white;
    border-radius: 8px;
    padding: 12px;
}

/* --- Nueva Sección para Cargar Archivos --- */
.file-upload-area {
    background-color: #1f2937;
    border: 2px dashed #4b5563;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.file-upload-area:hover {
    border-color: #10b981;
    background-color: #374151;
}
.file-upload-area i {
    color: #10b981;
    margin-bottom: 12px;
}
.file-upload-area p {
    color: #9ca3af;
    font-size: 0.875rem;
}
.file-upload-area #file-info {
    font-weight: 600;
    color: white;
    margin-top: 8px;
}


/* --- Modal de Prueba del Chatbot --- */
#test-chatbot-modal .modal-content-lg {
    background-color: #f9fafb; /* Fondo claro para el modal */
}

.phone-mockup-new {
    width: 100%;
    max-width: 350px;
    height: 95%;
    margin: auto;
    background: #111827; /* Teléfono negro */
    border-radius: 40px;
    padding: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    display: flex;
}

.phone-screen {
    background-color: #e5e7eb; /* Fondo de pantalla del chat */
    width: 100%;
    border-radius: 30px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-body-new {
    padding: 16px;
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Burbujas de chat */
.chat-bubble-user {
    background: #3b82f6;
    color: white;
    align-self: flex-end;
    border-radius: 20px 20px 4px 20px;
}

.chat-bubble-agent {
    background: #ffffff;
    color: #1f2937;
    align-self: flex-start;
    border-radius: 20px 20px 20px 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Botón del micrófono */
#mic-button {
    transition: all 0.3s ease;
}
#mic-button.voice-active {
    background-color: #ef4444; /* Rojo cuando está escuchando */
    color: white;
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/*==================================================
   ESTILOS PARA EL ASISTENTE FLOTANTE GEMINI
====================================================*/

/* --- Contenedor del Botón Flotante (FAB) --- */
#gemini-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, #3b82f6, #60a5fa);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(96, 165, 250, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transform: scale(1);
    transition: transform 0.2s ease-out;
}

#gemini-fab:hover {
    transform: scale(1.1);
}

.flame {
    width: 25px;
    height: 25px;
    background-color: white;
    border-radius: 50% 0% 50% 50%;
    transform: rotate(-45deg);
    animation: flicker 1.5s ease-in-out infinite;
}

@keyframes flicker {
    0%, 100% { transform: rotate(-45deg) scaleY(1); opacity: 1; }
    50% { transform: rotate(-45deg) scaleY(1.1); opacity: 0.9; }
}

#gemini-fab-label {
    position: absolute;
    right: 75px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #1f2937;
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#gemini-fab:hover #gemini-fab-label {
    opacity: 1;
    visibility: visible;
}

/* --- Modal del Chat de Gemini --- */
#gemini-chat-modal {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 500px;
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    z-index: 999;
    /* Inicia oculto */
    opacity: 0;
    transform: translateY(20px);
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

#gemini-chat-modal.visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

#gemini-chat-modal header {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#gemini-chat-modal h3 {
    font-weight: 600;
    color: #111827;
}

#gemini-chat-modal #gemini-chat-body {
    flex-grow: 1;
    padding: 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#gemini-chat-modal #gemini-chat-form {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
}

#gemini-chat-modal #gemini-chat-input {
    flex-grow: 1;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 12px;
}