/* ============================================= 
   VARIABLES Y ESTILOS GLOBALES
   ============================================= */
:root {
    --purple-main: #9333EA;
    --purple-dark: #7C3AED;
    --purple-light: #A855F7;
    --purple-lighter: #C084FC;
    --bg-dark: #0F0F23;
    --bg-darker: #0A0A15;
    --glass-bg: rgba(147, 51, 234, 0.1);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0F0F23 0%, #1a0033 50%, #2d1b69 100%);
    background-attachment: fixed;
    color: white;
    overflow-x: hidden;
}

/* ============================================= 
   EFECTOS GLASS
   ============================================= */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    box-shadow: 0 8px 32px 0 rgba(147, 51, 234, 0.2);
}

.glass-input {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--glass-border) !important;
    color: white !important;
    backdrop-filter: blur(5px);
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--purple-light) !important;
    box-shadow: 0 0 0 0.2rem rgba(147, 51, 234, 0.25) !important;
    color: white !important;
}

.glass-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* ============================================= 
   FIX SELECTS - DROPDOWN OSCURO
   ============================================= */
.glass-input option {
    background-color: #1a1a2e !important;
    color: white !important;
    padding: 10px;
}

.glass-input option:hover,
.glass-input option:focus,
.glass-input option:checked {
    background-color: #9333EA !important;
    color: white !important;
}

select.glass-input {
    background-color: rgba(26, 26, 46, 0.95) !important;
    color: white !important;
}

select.glass-input:focus {
    background-color: rgba(26, 26, 46, 0.98) !important;
}

/* Para navegadores webkit (Chrome, Safari, Edge) */
select.glass-input option {
    background: #1a1a2e;
    color: #ffffff;
}

/* Custom select para mejor compatibilidad */
.form-control.glass-input[multiple] option,
.form-control.glass-input option {
    background-color: #1a1a2e;
    color: #ffffff;
    padding: 8px 12px;
}

.form-control.glass-input[multiple] option:checked,
.form-control.glass-input option:checked {
    background: linear-gradient(0deg, #9333EA 0%, #9333EA 100%);
    color: white;
}

/* Fix para el custom-file en masivos */
.custom-file-input:lang(es) ~ .custom-file-label::after {
    content: "Buscar";
}

/* ============================================= 
   PÁGINA DE LOGIN
   ============================================= */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.login-box {
    padding: 40px;
    animation: fadeInUp 0.5s ease;
}

.brand-logo {
    font-size: 2.5rem;
    color: var(--purple-light);
    font-weight: bold;
}

.btn-purple {
    background: linear-gradient(135deg, var(--purple-main), var(--purple-dark));
    border: none;
    color: white;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.btn-purple:hover {
    background: linear-gradient(135deg, var(--purple-dark), var(--purple-main));
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(147, 51, 234, 0.4);
    color: white;
}

/* ============================================= 
   DASHBOARD
   ============================================= */
.dashboard-page {
    padding-top: 70px;
}

.navbar {
    z-index: 1000;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--purple-light) !important;
}

.dashboard-container {
    height: calc(100vh - 70px);
    padding: 0;
}

/* ============================================= 
   SIDEBAR
   ============================================= */
.sidebar {
    height: 100%;
    overflow-y: auto;
    padding: 20px 0;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
}

.menu-item {
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.menu-item i {
    margin-right: 10px;
    font-size: 1.2rem;
    width: 25px;
}

.menu-item:hover {
    background: rgba(147, 51, 234, 0.2);
    border-left-color: var(--purple-light);
    color: white;
    text-decoration: none;
}

.menu-item.active {
    background: rgba(147, 51, 234, 0.3);
    border-left-color: var(--purple-light);
    color: var(--purple-lighter);
}

/* ============================================= 
   CONTENIDO PRINCIPAL
   ============================================= */
.main-content {
    height: 100%;
    overflow-y: auto;
    padding: 20px;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ============================================= 
   LISTA DE CHATS
   ============================================= */
.chat-list-container {
    height: calc(100vh - 110px);
    display: flex;
    flex-direction: column;
}

.chat-list-header {
    border-bottom: 1px solid var(--glass-border);
}

.chat-list {
    flex: 1;
    overflow-y: auto;
}

.chat-item {
    padding: 15px;
    border-bottom: 1px solid var(--glass-border);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    overflow: hidden;
    max-width: 100%;
}

.chat-item:hover {
    background: rgba(147, 51, 234, 0.15);
}

.chat-item.active {
    background: rgba(147, 51, 234, 0.25);
    border-left: 3px solid var(--purple-light);
}

.chat-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--purple-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.5rem;
}

.chat-info {
    flex: 1;
    min-width: 0; /* Importante para que text-overflow funcione en flexbox */
    overflow: hidden;
}

.chat-name {
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-last-message {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.chat-meta {
    text-align: right;
}

.chat-time {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 5px;
}

.chat-badge {
    background: var(--purple-main);
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: bold;
}

/* ============================================= 
   ÁREA DE CONVERSACIÓN
   ============================================= */
.conversation-container {
    height: calc(100vh - 110px);
    display: flex;
    flex-direction: column;
}

.no-chat-selected {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#chatContainer {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chat-header {
    border-bottom: 1px solid var(--glass-border);
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.message {
    margin-bottom: 15px;
    display: flex;
    animation: fadeInMessage 0.3s ease;
}

.message.entrante {
    justify-content: flex-start;
}

.message.saliente {
    justify-content: flex-end;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 15px;
    word-wrap: break-word;
}

.message.entrante .message-bubble {
    background: rgba(255, 255, 255, 0.1);
    border-bottom-left-radius: 5px;
}

.message.saliente .message-bubble {
    background: linear-gradient(135deg, var(--purple-main), var(--purple-dark));
    border-bottom-right-radius: 5px;
}

.message-time {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 5px;
}

.message-input-container {
    border-top: 1px solid var(--glass-border);
}

/* ============================================= 
   MODALES
   ============================================= */
.modal-content.glass {
    background: var(--bg-darker);
}

.modal-header {
    border-bottom-color: var(--glass-border);
}

.modal-footer {
    border-top-color: var(--glass-border);
}

/* ============================================= 
   TABLAS
   ============================================= */
.table-glass {
    background: rgba(255, 255, 255, 0.02);
    color: white;
}

.table-glass th {
    border-color: var(--glass-border);
    color: var(--purple-lighter);
    font-weight: 600;
}

.table-glass td {
    border-color: var(--glass-border);
}

.table-glass tbody tr:hover {
    background: rgba(147, 51, 234, 0.1);
}

/* ============================================= 
   TARJETAS
   ============================================= */
.card-glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.card-glass:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(147, 51, 234, 0.3);
}

/* ============================================= 
   BADGES Y ETIQUETAS
   ============================================= */
.badge-purple {
    background: var(--purple-main);
    color: white;
}

.badge-success {
    background: #10B981;
}

.badge-danger {
    background: #EF4444;
}

.badge-warning {
    background: #F59E0B;
}

/* ============================================= 
   ANIMACIONES
   ============================================= */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInMessage {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================= 
   SCROLLBARS PERSONALIZADOS
   ============================================= */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: var(--purple-main);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--purple-dark);
}

/* ============================================= 
   RESPONSIVE
   ============================================= */
@media (max-width: 991px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }
    
    .message-bubble {
        max-width: 85%;
    }
    
    /* Menú móvil en navbar */
    .mobile-menu {
        width: 100%;
        padding: 10px 0;
        border-bottom: 1px solid var(--glass-border);
        margin-bottom: 10px;
    }
    
    .mobile-menu-item {
        padding: 12px 15px !important;
        border-radius: 8px;
        margin: 2px 0;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-item:hover {
        background: rgba(147, 51, 234, 0.2);
    }
    
    .mobile-menu-item.active {
        background: rgba(147, 51, 234, 0.3);
        color: var(--purple-lighter) !important;
    }
    
    .mobile-menu-item i {
        width: 25px;
        margin-right: 10px;
    }
    
    .mobile-divider {
        border-top: 1px solid var(--glass-border);
        margin: 10px 0;
    }
    
    /* Navbar collapse background */
    #navbarNav {
        background: rgba(15, 15, 35, 0.95);
        backdrop-filter: blur(10px);
        border-radius: 0 0 15px 15px;
        padding: 15px;
        margin-top: 10px;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    /* Dashboard container ajuste */
    .dashboard-container {
        height: auto;
        min-height: calc(100vh - 70px);
    }
}

@media (max-width: 768px) {
    /* ========================================
       SISTEMA DE PESTAÑAS MÓVIL PARA CHATS
       ======================================== */
    
    /* Mostrar las pestañas en móvil */
    .mobile-chat-tabs {
        display: flex !important;
        background: rgba(15, 15, 35, 0.98);
        border-bottom: 2px solid var(--purple-main);
        position: sticky;
        top: 0;
        z-index: 100;
    }
    
    .mobile-tab {
        flex: 1;
        padding: 12px 15px;
        background: transparent;
        border: none;
        color: rgba(255, 255, 255, 0.6);
        font-size: 0.9rem;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        cursor: pointer;
        transition: all 0.3s ease;
        position: relative;
    }
    
    .mobile-tab i {
        font-size: 1.1rem;
    }
    
    .mobile-tab:hover {
        color: rgba(255, 255, 255, 0.8);
        background: rgba(147, 51, 234, 0.1);
    }
    
    .mobile-tab.active {
        color: white;
        background: rgba(147, 51, 234, 0.2);
    }
    
    .mobile-tab.active::after {
        content: '';
        position: absolute;
        bottom: -2px;
        left: 0;
        right: 0;
        height: 3px;
        background: linear-gradient(90deg, var(--purple-main), var(--purple-light));
        border-radius: 3px 3px 0 0;
    }
    
    /* Badge de notificación en pestaña */
    .tab-badge {
        background: #ef4444;
        color: white;
        font-size: 0.7rem;
        padding: 2px 6px;
        border-radius: 10px;
        min-width: 18px;
        text-align: center;
    }
    
    /* Indicador de chat activo en pestaña conversación */
    .mobile-tab.has-chat::after {
        content: '';
        position: absolute;
        top: 8px;
        right: 15%;
        width: 8px;
        height: 8px;
        background: #10b981;
        border-radius: 50%;
        animation: pulse-dot 2s infinite;
    }
    
    @keyframes pulse-dot {
        0%, 100% { opacity: 1; transform: scale(1); }
        50% { opacity: 0.7; transform: scale(1.2); }
    }
    
    /* Sección Chats responsive - altura completa */
    #chatsSection {
        height: calc(100vh - 70px);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    #chatsSection .row {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        min-height: 0;
    }
    
    #chatsSection .row.h-100 {
        height: 100% !important;
    }
    
    /* PANEL DE LISTA DE CHATS */
    #chatsSection .chat-list-container {
        display: none;
        flex-direction: column;
        flex: 1;
        max-width: 100%;
        height: 100%;
        overflow: hidden;
    }
    
    #chatsSection .chat-list-container.mobile-active {
        display: flex !important;
    }
    
    #chatsSection .chat-list-container .chat-list {
        flex: 1;
        overflow-y: auto;
    }
    
    /* PANEL DE CONVERSACIÓN */
    #chatsSection .conversation-container {
        display: none !important;
        flex-direction: column;
        flex: 1;
        max-width: 100%;
        height: 100%;
        overflow: hidden;
    }
    
    #chatsSection .conversation-container.mobile-active {
        display: flex !important;
    }
    
    /* #chatContainer altura completa */
    #chatContainer {
        height: 100%;
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }
    
    /* Header del chat - no se encoge */
    .conversation-container .chat-header {
        flex-shrink: 0;
        padding: 10px 15px !important;
    }
    
    /* Botón de volver en header del chat móvil */
    .mobile-back-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: rgba(147, 51, 234, 0.3);
        border: none;
        border-radius: 50%;
        color: white;
        margin-right: 10px;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .mobile-back-btn:hover {
        background: var(--purple-main);
    }
    
    /* Contenedor de mensajes con scroll */
    .conversation-container .messages-container {
        flex: 1;
        overflow-y: auto;
        min-height: 0;
        padding: 15px;
    }
    
    /* Indicador de presencia del operador */
    .conversation-container #operadorPresenciaContainer {
        flex-shrink: 0;
    }
    
    /* Aviso de modo bot */
    .conversation-container .mode-bot-aviso {
        flex-shrink: 0;
    }
    
    /* ========================================
       INPUT SIEMPRE VISIBLE EN MÓVIL
       ======================================== */
    .conversation-container .message-input-container {
        flex-shrink: 0 !important;
        background: rgba(10, 10, 21, 0.98);
        z-index: 100;
        padding: 10px !important;
        border-top: 1px solid var(--glass-border);
    }
    
    .conversation-container .message-input-container .input-group {
        display: flex !important;
        flex-wrap: nowrap;
    }
    
    .conversation-container .message-input-container #messageInput {
        flex: 1;
        min-width: 0;
        height: 44px;
        font-size: 16px; /* Previene zoom en iOS */
    }
    
    .conversation-container .message-input-container .btn {
        flex-shrink: 0;
        height: 44px;
        min-width: 44px;
    }
    
    /* Selector de plantillas compacto */
    .conversation-container .plantilla-selector-container {
        padding: 5px 0;
        flex-shrink: 0;
    }
    
    .conversation-container .plantilla-selector-container select {
        font-size: 0.85rem;
        max-width: 150px;
    }
    
    /* Form de mensaje */
    .conversation-container .message-input-container form {
        width: 100%;
    }
    
    /* Contenedor de archivos clip */
    .conversation-container .clip-files-container {
        flex-shrink: 0;
        max-height: 150px;
        overflow-y: auto;
    }
    
    /* Grabador de audio */
    .conversation-container .audio-recorder-container {
        flex-shrink: 0;
    }
    
    /* No chat selected en móvil */
    #noChatSelected {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
}

/* ============================================= 
   UTILIDADES
   ============================================= */
.text-purple {
    color: var(--purple-light) !important;
}

.bg-purple {
    background: var(--purple-main) !important;
}

.border-purple {
    border-color: var(--purple-light) !important;
}

hr {
    border-top-color: var(--glass-border);
}

/* ============================================= 
   CUSTOM SWITCHES
   ============================================= */
.custom-switch .custom-control-label::before {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: var(--glass-border);
}

.custom-switch .custom-control-input:checked~.custom-control-label::before {
    background-color: var(--purple-main);
    border-color: var(--purple-main);
}

/* ============================================= 
   PANEL DE CONTROLES DEL BOT
   ============================================= */
.bot-controls-panel {
    background: rgba(147, 51, 234, 0.15);
    border-top: 1px solid var(--glass-border);
    animation: fadeIn 0.3s ease;
}

.bot-controls-panel .form-control-sm {
    font-size: 0.85rem;
    padding: 0.375rem 0.75rem;
}

.chat-mode-indicator .badge {
    padding: 8px 12px;
    font-size: 0.85rem;
}

/* Icono de modo en la lista de chats */
.chat-name i {
    margin-left: 5px;
    font-size: 0.85rem;
}

/* Mensaje de error de audio */
.message .text-warning {
    color: #F59E0B !important;
    font-style: italic;
}

/* Badge de audio en prompts */
.badge-info {
    background: #06B6D4;
    color: white;
}

/* Modal Nueva Sesión - Configuración del Bot */
#sessionBotSelectionContainer {
    animation: fadeIn 0.2s ease;
}

#sessionBotInfo {
    display: block;
    margin-top: 5px;
}

/* ============================================= 
   SECCIÓN MASIVOS
   ============================================= */

/* Botón outline purple */
.btn-outline-purple {
    color: var(--purple-light);
    border-color: var(--purple-light);
    background: transparent;
}

.btn-outline-purple:hover,
.btn-outline-purple.active {
    background: var(--purple-main);
    border-color: var(--purple-main);
    color: white;
}

/* Botón neon play */
.btn-neon-play {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    border: none;
    color: white;
    position: relative;
    overflow: hidden;
    animation: neon-glow 2s infinite;
}

.btn-neon-play:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
}

.btn-neon-play:disabled {
    background: #6c757d;
    animation: none;
}

@keyframes neon-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(16, 185, 129, 0.4),
                    0 0 10px rgba(16, 185, 129, 0.3),
                    0 0 15px rgba(16, 185, 129, 0.2);
    }
    50% {
        box-shadow: 0 0 10px rgba(16, 185, 129, 0.6),
                    0 0 20px rgba(16, 185, 129, 0.4),
                    0 0 30px rgba(16, 185, 129, 0.3);
    }
}

/* Botón stop */
.btn-stop {
    animation: pulse-danger 1s infinite;
}

@keyframes pulse-danger {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
}

/* Archivo item */
.archivo-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.archivo-item:hover {
    background: rgba(147, 51, 234, 0.1);
}

/* Campaña item */
.campania-item {
    transition: all 0.3s ease;
}

.campania-item:hover {
    transform: translateX(5px);
}

/* Custom file input */
.custom-file-label.glass-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: rgba(255, 255, 255, 0.7);
}

.custom-file-label.glass-input::after {
    background: var(--purple-main);
    color: white;
    border: none;
}

/* Progress bar personalizado */
.progress {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.progress-bar {
    border-radius: 10px;
    transition: width 0.3s ease;
}

/* SweetAlert2 personalizado */
.swal2-popup {
    background: var(--bg-darker) !important;
    border: 1px solid var(--glass-border);
}

.swal2-title {
    color: white !important;
}

.swal2-html-container {
    color: rgba(255, 255, 255, 0.8) !important;
}

.swal2-confirm {
    background: linear-gradient(135deg, var(--purple-main), var(--purple-dark)) !important;
}

/* Text purple */
.text-purple {
    color: var(--purple-light) !important;
}

/* Badge en contador */
#contadorCaracteres {
    font-size: 0.75rem;
    padding: 3px 8px;
}

/* Responsive masivos */
@media (max-width: 992px) {
    #masivosSection .col-md-6 {
        margin-bottom: 20px;
    }
}

/* ============================================= 
   SECCIÓN DASHBOARD - PÁGINA DE INICIO
   ============================================= */

.dashboard-welcome-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Título neón animado */
.neon-title-container {
    text-align: center;
    margin-bottom: 50px;
    padding: 30px;
}

.neon-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.neon-text {
    font-size: 3.5rem;
    font-weight: 900;
    background: linear-gradient(90deg, #a855f7, #d946ef, #c084fc, #a855f7);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: neon-flow 3s ease-in-out infinite, neon-pulse 2s ease-in-out infinite;
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
    filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.8)) 
            drop-shadow(0 0 40px rgba(192, 132, 252, 0.6))
            drop-shadow(0 0 60px rgba(217, 70, 239, 0.4));
    letter-spacing: 2px;
}

.neon-subtitle {
    font-size: 2rem;
    font-weight: 600;
    color: #e879f9;
    text-shadow: 0 0 10px rgba(232, 121, 249, 0.8),
                 0 0 20px rgba(232, 121, 249, 0.6),
                 0 0 30px rgba(232, 121, 249, 0.4),
                 0 0 40px rgba(168, 85, 247, 0.3);
    animation: subtitle-glow 2s ease-in-out infinite alternate;
}

@keyframes neon-flow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes neon-pulse {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.8)) 
                drop-shadow(0 0 40px rgba(192, 132, 252, 0.6))
                drop-shadow(0 0 60px rgba(217, 70, 239, 0.4));
    }
    50% {
        filter: drop-shadow(0 0 30px rgba(168, 85, 247, 1)) 
                drop-shadow(0 0 60px rgba(192, 132, 252, 0.8))
                drop-shadow(0 0 90px rgba(217, 70, 239, 0.6));
    }
}

@keyframes subtitle-glow {
    0% {
        text-shadow: 0 0 10px rgba(232, 121, 249, 0.8),
                     0 0 20px rgba(232, 121, 249, 0.6),
                     0 0 30px rgba(232, 121, 249, 0.4);
    }
    100% {
        text-shadow: 0 0 15px rgba(232, 121, 249, 1),
                     0 0 30px rgba(232, 121, 249, 0.8),
                     0 0 45px rgba(232, 121, 249, 0.6),
                     0 0 60px rgba(168, 85, 247, 0.4);
    }
}

/* Tarjetas de pasos */
.steps-container {
    margin-bottom: 40px;
}

.step-card {
    padding: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.step-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(147, 51, 234, 0.4);
}

.step-emoji {
    font-size: 4rem;
    margin-bottom: 15px;
    animation: bounce-emoji 2s ease-in-out infinite;
}

.step-card:nth-child(1) .step-emoji { animation-delay: 0s; }
.step-card:nth-child(2) .step-emoji { animation-delay: 0.3s; }
.step-card:nth-child(3) .step-emoji { animation-delay: 0.6s; }

@keyframes bounce-emoji {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.step-number {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, var(--purple-main), var(--purple-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.5);
}

.step-title {
    color: var(--purple-lighter);
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.step-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Mensaje de bienvenida */
.welcome-message {
    text-align: center;
    padding: 40px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.welcome-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--purple-light), transparent);
}

.welcome-icon {
    font-size: 3rem;
    color: var(--purple-light);
    margin-bottom: 20px;
    animation: rocket-float 3s ease-in-out infinite;
}

@keyframes rocket-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-5px) rotate(5deg); }
    75% { transform: translateY(-5px) rotate(-5deg); }
}

.welcome-message h3 {
    color: white;
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.welcome-text {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.1rem;
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto 25px;
}

.welcome-text .highlight {
    color: var(--purple-lighter);
    font-weight: 600;
    position: relative;
}

.welcome-text .highlight::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--purple-light);
    animation: underline-pulse 2s ease-in-out infinite;
}

@keyframes underline-pulse {
    0%, 100% { opacity: 0.5; transform: scaleX(0.8); }
    50% { opacity: 1; transform: scaleX(1); }
}

.welcome-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.feature-badge {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.3), rgba(192, 132, 252, 0.2));
    border: 1px solid rgba(192, 132, 252, 0.4);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.feature-badge:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.5), rgba(192, 132, 252, 0.4));
    box-shadow: 0 5px 20px rgba(147, 51, 234, 0.3);
}

.feature-badge i {
    color: var(--purple-lighter);
}

/* ============================================= 
   EFECTOS DE LUZ NEÓN EN MOVIMIENTO
   ============================================= */

/* Contenedor de efectos neón */
.neon-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* Contenedor de líneas neón */
.neon-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Líneas de neón animadas */
.neon-line {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent, 
        #a855f7, 
        #d946ef, 
        #a855f7, 
        transparent
    );
    box-shadow: 
        0 0 10px #a855f7,
        0 0 20px #a855f7,
        0 0 40px #d946ef,
        0 0 80px #d946ef;
    animation: neon-line-move linear infinite;
    opacity: 0.6;
}

.neon-line-1 {
    top: 15%;
    width: 200px;
    animation-duration: 8s;
    animation-delay: 0s;
}

.neon-line-2 {
    top: 35%;
    width: 150px;
    animation-duration: 12s;
    animation-delay: -2s;
    background: linear-gradient(90deg, 
        transparent, 
        #06b6d4, 
        #22d3ee, 
        #06b6d4, 
        transparent
    );
    box-shadow: 
        0 0 10px #06b6d4,
        0 0 20px #06b6d4,
        0 0 40px #22d3ee,
        0 0 80px #22d3ee;
}

.neon-line-3 {
    top: 55%;
    width: 180px;
    animation-duration: 10s;
    animation-delay: -4s;
}

.neon-line-4 {
    top: 75%;
    width: 120px;
    animation-duration: 15s;
    animation-delay: -6s;
    background: linear-gradient(90deg, 
        transparent, 
        #10b981, 
        #34d399, 
        #10b981, 
        transparent
    );
    box-shadow: 
        0 0 10px #10b981,
        0 0 20px #10b981,
        0 0 40px #34d399,
        0 0 80px #34d399;
}

.neon-line-5 {
    top: 90%;
    width: 160px;
    animation-duration: 9s;
    animation-delay: -1s;
}

@keyframes neon-line-move {
    0% {
        left: -250px;
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

/* Orbes de luz flotantes */
.neon-orbs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.neon-orb {
    position: absolute;
    border-radius: 50%;
    animation: neon-orb-float ease-in-out infinite;
    filter: blur(1px);
}

.neon-orb-1 {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 10%;
    background: radial-gradient(circle, 
        rgba(168, 85, 247, 0.4) 0%, 
        rgba(168, 85, 247, 0.1) 50%, 
        transparent 70%
    );
    box-shadow: 
        0 0 30px rgba(168, 85, 247, 0.5),
        0 0 60px rgba(168, 85, 247, 0.3),
        0 0 100px rgba(168, 85, 247, 0.2);
    animation-duration: 6s;
}

.neon-orb-2 {
    width: 60px;
    height: 60px;
    top: 60%;
    left: 80%;
    background: radial-gradient(circle, 
        rgba(6, 182, 212, 0.4) 0%, 
        rgba(6, 182, 212, 0.1) 50%, 
        transparent 70%
    );
    box-shadow: 
        0 0 30px rgba(6, 182, 212, 0.5),
        0 0 60px rgba(6, 182, 212, 0.3),
        0 0 100px rgba(6, 182, 212, 0.2);
    animation-duration: 8s;
    animation-delay: -2s;
}

.neon-orb-3 {
    width: 100px;
    height: 100px;
    top: 40%;
    left: 50%;
    background: radial-gradient(circle, 
        rgba(217, 70, 239, 0.3) 0%, 
        rgba(217, 70, 239, 0.1) 50%, 
        transparent 70%
    );
    box-shadow: 
        0 0 40px rgba(217, 70, 239, 0.4),
        0 0 80px rgba(217, 70, 239, 0.2),
        0 0 120px rgba(217, 70, 239, 0.1);
    animation-duration: 10s;
    animation-delay: -4s;
}

.neon-orb-4 {
    width: 50px;
    height: 50px;
    top: 80%;
    left: 25%;
    background: radial-gradient(circle, 
        rgba(16, 185, 129, 0.4) 0%, 
        rgba(16, 185, 129, 0.1) 50%, 
        transparent 70%
    );
    box-shadow: 
        0 0 25px rgba(16, 185, 129, 0.5),
        0 0 50px rgba(16, 185, 129, 0.3),
        0 0 80px rgba(16, 185, 129, 0.2);
    animation-duration: 7s;
    animation-delay: -1s;
}

.neon-orb-5 {
    width: 70px;
    height: 70px;
    top: 10%;
    left: 70%;
    background: radial-gradient(circle, 
        rgba(236, 72, 153, 0.4) 0%, 
        rgba(236, 72, 153, 0.1) 50%, 
        transparent 70%
    );
    box-shadow: 
        0 0 30px rgba(236, 72, 153, 0.5),
        0 0 60px rgba(236, 72, 153, 0.3),
        0 0 100px rgba(236, 72, 153, 0.2);
    animation-duration: 9s;
    animation-delay: -3s;
}

.neon-orb-6 {
    width: 40px;
    height: 40px;
    top: 50%;
    left: 5%;
    background: radial-gradient(circle, 
        rgba(251, 191, 36, 0.4) 0%, 
        rgba(251, 191, 36, 0.1) 50%, 
        transparent 70%
    );
    box-shadow: 
        0 0 20px rgba(251, 191, 36, 0.5),
        0 0 40px rgba(251, 191, 36, 0.3),
        0 0 70px rgba(251, 191, 36, 0.2);
    animation-duration: 11s;
    animation-delay: -5s;
}

@keyframes neon-orb-float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.5;
    }
    25% {
        transform: translate(30px, -20px) scale(1.1);
        opacity: 0.7;
    }
    50% {
        transform: translate(10px, 20px) scale(0.9);
        opacity: 0.4;
    }
    75% {
        transform: translate(-20px, 10px) scale(1.05);
        opacity: 0.6;
    }
}

/* Efecto de pulso neón en el fondo */
@keyframes neon-bg-pulse {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* ========== FIN EFECTOS NEÓN ========== */

/* Responsive para dashboard */
@media (max-width: 768px) {
    .neon-text {
        font-size: 2rem;
    }
    
    .neon-subtitle {
        font-size: 1.3rem;
    }
    
    .step-card {
        min-height: auto;
        padding: 20px;
    }
    
    .step-emoji {
        font-size: 3rem;
    }
    
    /* Responsive efectos neón */
    .neon-line {
        height: 1px;
    }
    
    .neon-orb {
        transform: scale(0.6);
    }
}

/* ============================================= 
   CLIP DE ARCHIVOS - BARRA DE CARGA
   ============================================= */

.clip-files-container {
    background: rgba(147, 51, 234, 0.15);
    border: 1px solid rgba(147, 51, 234, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-top: 10px;
    animation: fadeIn 0.3s ease;
}

.clip-files-header {
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.clip-files-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 10px 0;
}

/* Item de archivo individual */
.clip-file-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.clip-file-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.clip-file-item.uploading {
    border-color: rgba(147, 51, 234, 0.5);
}

.clip-file-item.success {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.1);
}

.clip-file-item.error {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.1);
}

/* Icono del archivo */
.clip-file-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(147, 51, 234, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    margin-right: 12px;
    flex-shrink: 0;
}

.clip-file-icon.image { background: rgba(59, 130, 246, 0.3); }
.clip-file-icon.video { background: rgba(239, 68, 68, 0.3); }
.clip-file-icon.audio { background: rgba(16, 185, 129, 0.3); }
.clip-file-icon.document { background: rgba(245, 158, 11, 0.3); }

/* Info del archivo */
.clip-file-info {
    flex: 1;
    min-width: 0;
}

.clip-file-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.clip-file-size {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Barra de progreso */
.clip-file-progress {
    margin-top: 6px;
}

.clip-progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.clip-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #9333EA, #A855F7);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
}

.clip-file-item.success .clip-progress-fill {
    background: linear-gradient(90deg, #10B981, #059669);
    width: 100%;
}

.clip-file-item.error .clip-progress-fill {
    background: linear-gradient(90deg, #EF4444, #DC2626);
}

/* Estado del archivo */
.clip-file-status {
    margin-left: 10px;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.clip-file-status .fa-spinner {
    color: #A855F7;
}

.clip-file-status .fa-check-circle {
    color: #10B981;
}

.clip-file-status .fa-times-circle {
    color: #EF4444;
}

/* Botón eliminar archivo */
.clip-file-remove {
    margin-left: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.2);
    border: none;
    color: #EF4444;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.clip-file-remove:hover {
    background: #EF4444;
    color: white;
}

/* Footer del contenedor */
.clip-files-footer {
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#clipFilesInfo {
    color: rgba(255, 255, 255, 0.7);
}

#btnEnviarClipFiles {
    transition: all 0.3s ease;
}

#btnEnviarClipFiles:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#btnEnviarClipFiles:not(:disabled) {
    animation: btn-pulse-green 2s infinite;
}

/* Preview de imagen */
.clip-file-preview {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 12px;
    flex-shrink: 0;
}

/* Mensaje de error */
.clip-file-error-msg {
    font-size: 0.75rem;
    color: #EF4444;
    margin-top: 4px;
}

/* ============================================= 
   INDICADORES DE PRESENCIA (ESCRIBIENDO/GRABANDO)
   ============================================= */

/* Indicador de presencia del cliente en el header del chat */
.presencia-indicator {
    margin-top: 4px;
    font-size: 0.75rem;
}

/* Indicador de escritura */
.typing-indicator {
    color: #4ade80;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    animation: fadeIn 0.3s ease;
}

.typing-indicator i {
    animation: typing-bounce 0.5s ease-in-out infinite;
}

.typing-dots {
    display: inline-flex;
    gap: 2px;
}

.typing-dots span {
    animation: typing-dot 1.4s ease-in-out infinite;
    opacity: 0;
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-dot {
    0%, 60%, 100% { opacity: 0; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

@keyframes typing-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

/* Indicador de grabación */
.recording-indicator {
    color: #f87171;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    animation: fadeIn 0.3s ease;
}

.recording-indicator i {
    animation: recording-pulse-icon 1s ease-in-out infinite;
}

.recording-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f87171;
    animation: recording-pulse-dot 1s ease-in-out infinite;
}

@keyframes recording-pulse-icon {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
}

@keyframes recording-pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
}

/* Indicador en la lista de chats */
.chat-item .chat-presencia {
    font-size: 0.7rem;
    margin-top: 2px;
}

.chat-item .chat-presencia-typing {
    color: #4ade80;
}

.chat-item .chat-presencia-recording {
    color: #f87171;
}

.chat-item .chat-presencia i {
    margin-right: 3px;
}

/* Estado del operador (referencia visual) */
.operador-presencia-container {
    padding: 5px 15px;
    background: rgba(147, 51, 234, 0.1);
    border-top: 1px solid var(--glass-border);
    font-size: 0.75rem;
}

.operador-typing-status,
.operador-recording-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* ============================================= 
   GRABADOR DE AUDIO
   ============================================= */

.btn-record {
    position: relative;
    transition: all 0.3s ease;
}

.btn-record.recording {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    animation: recording-btn-pulse 1s ease-in-out infinite;
}

@keyframes recording-btn-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
}

.audio-recorder-container {
    padding: 10px 15px;
    background: rgba(239, 68, 68, 0.15);
    border-radius: 10px;
    margin-top: 10px;
    animation: fadeIn 0.3s ease;
}

.recording-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #f87171;
    font-weight: 600;
}

.recording-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ef4444;
    animation: recording-dot-blink 1s ease-in-out infinite;
}

@keyframes recording-dot-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.recording-controls {
    display: flex;
    gap: 10px;
}

.recording-controls .btn {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* Indicador de presencia en item de chat de la lista */
.chat-item-presencia {
    font-size: 0.7rem;
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-item-presencia.typing {
    color: #4ade80;
}

.chat-item-presencia.recording {
    color: #f87171;
}

.chat-item-presencia .dots {
    display: inline-flex;
    gap: 1px;
}

.chat-item-presencia .dots span {
    animation: typing-dot 1.4s ease-in-out infinite;
    opacity: 0;
}

.chat-item-presencia .dots span:nth-child(1) { animation-delay: 0s; }
.chat-item-presencia .dots span:nth-child(2) { animation-delay: 0.2s; }
.chat-item-presencia .dots span:nth-child(3) { animation-delay: 0.4s; }

/* ============================================= 
   INPUT DE MENSAJE - AJUSTE DE ALTURA
   ============================================= */

/* Contenedor del input de mensaje */
.message-input-container .input-group {
    align-items: stretch;
}

/* Input de mensaje con altura igual a los botones */
.message-input-container #messageInput {
    height: 44px;
    padding: 10px 15px;
    font-size: 0.95rem;
    border-radius: 0;
}

/* Botones del input-group con altura fija */
.message-input-container .input-group .btn {
    height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
}

/* Botón de clip (prepend) */
.message-input-container .input-group-prepend .btn {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Botones de grabar y enviar (append) */
.message-input-container .input-group-append .btn:first-child {
    border-radius: 0;
}

.message-input-container .input-group-append .btn:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* ============================================= 
   SECCIÓN RECORDATORIOS
   ============================================= */

/* Bloque de recordatorio */
.bloque-recordatorio {
    border-left: 3px solid var(--purple-main);
    transition: all 0.3s ease;
}

.bloque-recordatorio:hover {
    border-left-color: var(--purple-light);
    box-shadow: 0 5px 20px rgba(147, 51, 234, 0.2);
}

/* Lista de archivos del bloque */
.lista-archivos-bloque {
    max-height: 200px;
    overflow-y: auto;
    padding: 5px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.lista-archivos-bloque .archivo-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 5px;
}

/* Badge de estado activo con animación */
.recordatorio-activo {
    animation: pulse-success 2s infinite;
}

@keyframes pulse-success {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
}

/* Botón play con efecto neón mejorado para recordatorios */
.btn-neon-play {
    position: relative;
    overflow: hidden;
}

.btn-neon-play::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transform: rotate(45deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

/* Contenedor de bloques scrolleable */
#bloquesRecordatorioContainer {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

/* Fix para el modal XL de recordatorios */
.modal-xl {
    max-width: 1140px;
}

@media (max-width: 1200px) {
    .modal-xl {
        max-width: 90%;
    }
}

/* Indicador de bloque activo */
.bloque-activo {
    border-left-color: #10B981 !important;
    background: rgba(16, 185, 129, 0.1) !important;
}

/* Archivo nombre input más compacto */
.archivo-nombre-personalizado {
    font-size: 0.85rem !important;
    padding: 0.25rem 0.5rem !important;
}

/* ============================================= 
   SWITCH BOT/HUMANO
   ============================================= */

.chat-mode-switch-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ============================================= 
   SWITCH DEL HEADER - ICONOS AFUERA
   ============================================= */

.header-switch-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

/* Texto dinámico arriba del switch del header */
.header-mode-text {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.header-mode-text.bot {
    color: #10b981;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

.header-mode-text.humano {
    color: #8b5cf6;
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.6);
}

/* Contenedor del switch con iconos - header */
.header-switch-icons {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Iconos del header */
.header-icon-left,
.header-icon-right {
    font-size: 1rem;
    transition: all 0.3s ease;
    opacity: 0.4;
}

.header-icon-left.active {
    color: #8b5cf6;
    opacity: 1;
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.8);
    transform: scale(1.1);
}

.header-icon-right.active {
    color: #10b981;
    opacity: 1;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
    transform: scale(1.1);
}

/* Switch del header - solo slider */
.header-mode-switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 28px;
    cursor: pointer;
    margin: 0;
}

.header-mode-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* Slider del header limpio */
.header-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.4);
}

.header-slider::before {
    content: '';
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Header switch - Modo BOT (checked) */
.header-mode-switch input:checked + .header-slider {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.4);
}

.header-mode-switch input:checked + .header-slider::before {
    transform: translateX(28px);
}

/* Hover en header switch */
.header-mode-switch:hover .header-slider {
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.5);
}

.header-mode-switch input:checked:hover + .header-slider {
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.5);
}

/* Aviso de modo Bot */
.mode-bot-aviso {
    border-top: 1px solid var(--glass-border);
    background: rgba(16, 185, 129, 0.1);
}

.mode-bot-aviso .alert {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #fff;
}

.mode-bot-aviso .alert i {
    color: #10b981;
}

/* Switch en lista de chats */
.chat-item-mode-switch {
    margin-top: 5px;
}

.chat-item-mode-switch .mode-switch {
    width: 90px;
    height: 26px;
}

.chat-item-mode-switch .mode-slider::before {
    height: 20px;
    width: 42px;
    left: 3px;
    bottom: 3px;
}

.chat-item-mode-switch .mode-switch input:checked + .mode-slider::before {
    transform: translateX(42px);
}

.chat-item-mode-switch .mode-label {
    font-size: 0.6rem;
}

.chat-item-mode-switch .mode-label.mode-bot {
    right: 8px;
}

.chat-item-mode-switch .mode-label.mode-humano {
    left: 6px;
}

.chat-item-mode-switch .mode-label i {
    font-size: 0.55rem;
}

/* Badge de modo en lista de chats */
.chat-mode-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}

.chat-mode-badge.bot {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.chat-mode-badge.humano {
    background: rgba(99, 102, 241, 0.2);
    color: #8b5cf6;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Animación para el cambio de modo */
@keyframes modeChange {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.mode-switch.changing .mode-slider {
    animation: modeChange 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .mode-switch {
        width: 110px;
        height: 32px;
    }
    
    .mode-slider::before {
        height: 24px;
        width: 52px;
    }
    
    .mode-switch input:checked + .mode-slider::before {
        transform: translateX(52px);
    }
    
    .mode-label {
        font-size: 0.65rem;
    }
}

/* ============================================= 
   MINI SWITCH PARA LISTA DE CHATS
   ============================================= */

.chat-item-switch {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

/* Texto dinámico arriba del switch */
.switch-mode-text {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    margin-right: 2px;
}

.switch-mode-text.bot {
    color: #10b981;
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.switch-mode-text.humano {
    color: #8b5cf6;
    text-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}

/* Contenedor del switch con iconos */
.switch-with-icons {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Iconos a los lados */
.switch-icon-left,
.switch-icon-right {
    font-size: 0.75rem;
    transition: all 0.3s ease;
    opacity: 0.4;
}

.switch-icon-left.active {
    color: #8b5cf6;
    opacity: 1;
    text-shadow: 0 0 8px rgba(139, 92, 246, 0.6);
}

.switch-icon-right.active {
    color: #10b981;
    opacity: 1;
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

/* Mini switch - solo slider */
.mini-mode-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
    cursor: pointer;
    margin: 0;
}

.mini-mode-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* Mini slider limpio */
.mini-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.mini-slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Mini switch - Modo BOT (checked) */
.mini-mode-switch input:checked + .mini-slider {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.mini-mode-switch input:checked + .mini-slider::before {
    transform: translateX(22px);
}

/* Hover en mini switch */
.mini-mode-switch:hover .mini-slider {
    box-shadow: 0 3px 12px rgba(99, 102, 241, 0.5);
}

.mini-mode-switch input:checked:hover + .mini-slider {
    box-shadow: 0 3px 12px rgba(16, 185, 129, 0.5);
}

/* ============================================= 
   ORGANIZADOR DE CHATS
   ============================================= */

/* Pestañas del organizador */
.nav-tabs-organizador {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-tabs-organizador .nav-link {
    color: rgba(255, 255, 255, 0.7);
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    padding: 10px 20px;
    transition: all 0.3s ease;
}

.nav-tabs-organizador .nav-link:hover {
    color: white;
    border-color: rgba(147, 51, 234, 0.5);
}

.nav-tabs-organizador .nav-link.active {
    color: white;
    background: transparent;
    border-color: var(--purple-main);
}

/* Tablero del organizador (estilo Kanban) */
.organizador-tablero {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 15px;
    min-height: 400px;
}

/* Columnas de etiquetas */
.etiqueta-columna {
    flex: 0 0 280px;
    min-width: 280px;
    max-width: 280px;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 350px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}

/* Efecto de brillo en las columnas */
.etiqueta-columna::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transition: left 0.5s ease;
    pointer-events: none;
}

.etiqueta-columna:hover::before {
    left: 100%;
}

/* Header de columna */
.etiqueta-columna-header {
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.etiqueta-columna-header .etiqueta-count {
    background: rgba(0, 0, 0, 0.3);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
}

/* Contenedor de chats en columna */
.etiqueta-columna-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    min-height: 100px;
}

/* Cards de chat dentro de las columnas */
.chat-card-org {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: grab;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-card-org:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.chat-card-org:active {
    cursor: grabbing;
}

.chat-card-org.sortable-ghost {
    opacity: 0.5;
    background: rgba(147, 51, 234, 0.3);
}

.chat-card-org.sortable-drag {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

/* Info del chat en card */
.chat-card-org .chat-telefono {
    font-weight: 600;
    font-size: 0.95rem;
    color: white;
    margin-bottom: 4px;
}

.chat-card-org .chat-ticket {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
}

.chat-card-org .chat-preview {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 10px;
    line-height: 1.4;
    max-height: 40px;
    overflow: hidden;
}

/* Botón Ir a Chat */
.btn-ir-chat {
    width: 100%;
    padding: 6px 12px;
    font-size: 0.8rem;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    color: white;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.btn-ir-chat:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    color: white;
}

/* Botón eliminar en card (tache) */
.chat-card-org .btn-remove-chat {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 22px;
    height: 22px;
    padding: 0;
    font-size: 0.7rem;
    background: rgba(239, 68, 68, 0.8);
    border: none;
    color: white;
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-card-org:hover .btn-remove-chat {
    opacity: 1;
}

.chat-card-org .btn-remove-chat:hover {
    background: #ef4444;
    transform: scale(1.1);
}

.chat-card-org .btn-classify-chat {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 22px;
    height: 22px;
    padding: 0;
    font-size: 0.7rem;
    background: rgba(147, 51, 234, 0.8);
    border: none;
    color: white;
    border-radius: 50%;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.chat-card-org:hover .btn-classify-chat {
    opacity: 1;
}

.chat-card-org .btn-classify-chat:hover {
    background: #9333EA;
    transform: scale(1.1);
}

.chat-card-org .chat-nombre {
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-card-org .chat-card-actions {
    margin-top: 8px;
}

.chat-card-org .btn-ir-chat {
    width: 100%;
    font-size: 0.75rem;
    padding: 6px 10px;
    background: rgba(147, 51, 234, 0.6);
    border: none;
    color: white;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.chat-card-org .btn-ir-chat:hover {
    background: #9333EA;
    transform: translateY(-1px);
}

/* Columna Sin Clasificar */
.etiqueta-columna[data-etiqueta-id="sin-clasificar"] {
    border: 2px dashed rgba(255, 255, 255, 0.2);
}

.etiqueta-columna[data-etiqueta-id="sin-clasificar"] .etiqueta-columna-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 5px;
}

.etiqueta-columna[data-etiqueta-id="sin-clasificar"] .btn-outline-light {
    font-size: 0.7rem;
    padding: 2px 8px;
}

.chat-card-org {
    position: relative;
}

/* Lista de etiquetas (pestaña Gestionar) */
.etiqueta-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    margin-bottom: 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-left: 4px solid;
    transition: all 0.3s ease;
}

.etiqueta-list-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.etiqueta-list-item .etiqueta-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.etiqueta-list-item .color-badge {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.etiqueta-list-item .etiqueta-nombre {
    font-weight: 600;
    font-size: 1rem;
}

.etiqueta-list-item .etiqueta-desc {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Colores preestablecidos en modal */
.colores-predef {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.color-preset {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.color-preset:hover {
    transform: scale(1.15);
    border-color: white;
}

.color-preset.active {
    border-color: white;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Vista previa de etiqueta */
.etiqueta-preview-container {
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.etiqueta-card-preview {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.etiqueta-card-preview .etiqueta-card-header {
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--purple-main);
}

.etiqueta-card-preview .etiqueta-nombre {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.etiqueta-card-preview .etiqueta-count {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
}

/* Responsive organizador */
@media (max-width: 768px) {
    .organizador-tablero {
        flex-direction: column;
    }
    
    .etiqueta-columna {
        flex: 0 0 auto;
        min-width: 100%;
        max-width: 100%;
        max-height: none;
        margin-bottom: 15px;
    }
    
    .etiqueta-columna-body {
        max-height: 300px;
    }
}

/* Animación de entrada para cards */
@keyframes slideInCard {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-card-org {
    animation: slideInCard 0.3s ease;
}

/* Placeholder cuando no hay chats */
.etiqueta-empty {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
}

.etiqueta-empty i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

/* ============================================= 
   VISTA PREVIA DE PROMPT EN MODAL
   ============================================= */

/* Contenedor de vista previa del prompt con scroll */
#promptPreview .card-glass {
    max-height: 300px;
    overflow-y: auto;
}

#promptPreview #promptPreviewText {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ============================================= 
   BOTÓN CREAR ASISTENTE CON DESTELLOS
   ============================================= */

.crear-asistente-container {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.btn-crear-asistente {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 18px 40px;
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #10B981 0%, #059669 50%, #047857 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 15px rgba(16, 185, 129, 0.4),
        0 0 30px rgba(16, 185, 129, 0.2);
    animation: btn-pulse-green 2s infinite;
}

.btn-crear-asistente:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 8px 25px rgba(16, 185, 129, 0.5),
        0 0 50px rgba(16, 185, 129, 0.3);
    color: white;
    text-decoration: none;
}

.btn-crear-asistente:active {
    transform: translateY(-1px);
}

@keyframes btn-pulse-green {
    0%, 100% {
        box-shadow: 
            0 4px 15px rgba(16, 185, 129, 0.4),
            0 0 30px rgba(16, 185, 129, 0.2);
    }
    50% {
        box-shadow: 
            0 6px 20px rgba(16, 185, 129, 0.6),
            0 0 60px rgba(16, 185, 129, 0.4),
            0 0 100px rgba(16, 185, 129, 0.2);
    }
}

/* Destellos (Sparkles) */
.btn-sparkle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    animation: sparkle 2s infinite;
    pointer-events: none;
}

.btn-sparkle:nth-child(1) {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.btn-sparkle:nth-child(2) {
    top: 60%;
    left: 25%;
    animation-delay: 0.3s;
}

.btn-sparkle:nth-child(3) {
    top: 30%;
    right: 15%;
    animation-delay: 0.6s;
}

.btn-sparkle:nth-child(4) {
    bottom: 20%;
    right: 25%;
    animation-delay: 0.9s;
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1) rotate(180deg);
        box-shadow: 
            0 0 10px white,
            0 0 20px rgba(255, 255, 255, 0.8),
            0 0 30px rgba(16, 185, 129, 0.6);
    }
}

/* Brillo que recorre el botón */
.btn-crear-asistente::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        transparent 40%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 60%,
        transparent
    );
    animation: shine-sweep 3s infinite;
}

@keyframes shine-sweep {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

/* ============================================= 
   WIZARD ONBOARDING - CREAR MI PRIMER BOT
   ============================================= */

.onboarding-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header del Wizard */
.wizard-header {
    position: relative;
    overflow: hidden;
}

.wizard-title {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
}

.wizard-subtitle {
    font-size: 1.1rem;
}

/* Progress Steps */
.wizard-progress {
    position: relative;
    padding: 0 20px;
}

.progress-track {
    position: absolute;
    top: 50%;
    left: 80px;
    right: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    transform: translateY(-20px);
    z-index: 1;
}

.progress-bar-wizard {
    height: 100%;
    background: linear-gradient(90deg, #10B981, #059669);
    border-radius: 2px;
    width: 0%;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

.steps-indicators {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.step-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
}

.step-indicator.active .step-circle {
    background: linear-gradient(135deg, #10B981, #059669);
    border-color: #10B981;
    color: white;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
    transform: scale(1.1);
}

.step-indicator.completed .step-circle {
    background: #10B981;
    border-color: #10B981;
    color: white;
}

/* Ocultar el ícono original y mostrar palomita cuando está completado */
.step-indicator.completed .step-circle i {
    display: none;
}

.step-indicator.completed .step-circle::after {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 1.5rem;
}

.step-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
}

.step-indicator.active .step-label {
    color: #10B981;
}

.step-indicator.completed .step-label {
    color: white;
}

/* Contenido del Wizard */
.wizard-content {
    margin-top: 20px;
}

.wizard-step {
    display: none;
    animation: fadeInStep 0.5s ease;
}

.wizard-step.active {
    display: block;
}

@keyframes fadeInStep {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Step Header Card */
.step-header-card {
    margin-bottom: 20px;
}

.step-badge {
    display: inline-block;
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Mensaje Motivacional */
.motivational-message {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.1));
    border-left: 4px solid #10B981;
    padding: 15px;
    border-radius: 0 10px 10px 0;
    color: white;
}

/* Tutorial Section */
.tutorial-section h5 {
    font-size: 1rem;
}

.tutorial-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tutorial-list li {
    padding: 10px 0;
    color: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tutorial-list li:last-child {
    border-bottom: none;
}

.tutorial-list li strong {
    color: white;
}

/* Demo Form */
.demo-form-container {
    margin-top: 20px;
}

.demo-form {
    background: rgba(255, 255, 255, 0.05);
}

.demo-input {
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 15px;
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Status Card */
.status-card {
    padding: 30px;
}

.status-icon i {
    transition: all 0.3s ease;
}

/* Action Buttons */
.action-buttons .btn-action {
    transition: all 0.3s ease;
}

.action-buttons .btn-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(16, 185, 129, 0.4);
}

/* Navigation Buttons */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-next:disabled, .btn-prev:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-next:not(:disabled) {
    animation: pulse-next 2s infinite;
}

@keyframes pulse-next {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(147, 51, 234, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(147, 51, 234, 0);
    }
}

/* Option Cards */
.option-cards {
    margin-top: 15px;
}

.option-card {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.option-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.option-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.option-info h6 {
    margin: 0;
}

/* Success Animation */
.success-animation {
    animation: success-pop 0.5s ease;
}

@keyframes success-pop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Detected Containers */
.proxy-detected-container,
.prompt-detected-container,
.session-detected-container {
    padding: 30px;
}

/* ============================================= 
   CELEBRATION STEP (PASO 4)
   ============================================= */

.celebration-container {
    position: relative;
    overflow: hidden;
    min-height: 500px;
}

.celebration-content {
    position: relative;
    z-index: 10;
}

.celebration-icon {
    animation: celebration-float 2s ease-in-out infinite;
}

@keyframes celebration-float {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

.celebration-bounce {
    animation: celebration-bounce 1s ease-in-out infinite;
}

@keyframes celebration-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.celebration-title {
    font-size: 3rem;
    font-weight: 800;
    text-shadow: 
        0 0 20px rgba(16, 185, 129, 0.5),
        0 0 40px rgba(16, 185, 129, 0.3);
    animation: title-glow 2s ease-in-out infinite alternate;
}

@keyframes title-glow {
    0% {
        text-shadow: 
            0 0 20px rgba(16, 185, 129, 0.5),
            0 0 40px rgba(16, 185, 129, 0.3);
    }
    100% {
        text-shadow: 
            0 0 30px rgba(16, 185, 129, 0.8),
            0 0 60px rgba(16, 185, 129, 0.5),
            0 0 90px rgba(16, 185, 129, 0.3);
    }
}

.celebration-text {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

.celebration-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    color: white;
}

.stat-item i {
    font-size: 2rem;
}

.celebration-actions {
    margin-top: 30px;
}

/* Fireworks */
.fireworks-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.firework {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: firework-explode 1s ease-out forwards;
}

@keyframes firework-explode {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: scale(20);
        opacity: 0;
    }
}

/* Confetti */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(500px) rotate(720deg);
        opacity: 0;
    }
}

/* Tooltip demo */
.tooltip-demo {
    cursor: help;
}

/* Responsive Wizard */
@media (max-width: 991px) {
    .wizard-title {
        font-size: 1.5rem;
    }
    
    .progress-track {
        left: 40px;
        right: 40px;
    }
    
    .step-circle {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .step-label {
        font-size: 0.75rem;
    }
    
    .celebration-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .btn-crear-asistente {
        padding: 15px 30px;
        font-size: 1rem;
    }
    
    .steps-indicators {
        gap: 5px;
    }
    
    .step-circle {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .step-label {
        font-size: 0.7rem;
        display: none;
    }
    
    .navigation-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .navigation-buttons .btn {
        width: 100%;
    }
    
    .celebration-stats {
        gap: 15px;
    }
    
    .stat-item {
        padding: 15px 20px;
    }
}

/* ============================================= 
   CONFIGURACIÓN - PESTAÑAS Y UNIFICAR CHATS
   ============================================= */

/* Pestañas de configuración */
.nav-tabs-configuracion {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-tabs-configuracion .nav-link {
    color: rgba(255, 255, 255, 0.7);
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    padding: 10px 20px;
    transition: all 0.3s ease;
}

.nav-tabs-configuracion .nav-link:hover {
    color: white;
    border-color: rgba(147, 51, 234, 0.5);
}

.nav-tabs-configuracion .nav-link.active {
    color: white;
    background: transparent;
    border-color: var(--purple-main);
}

.nav-tabs-configuracion .nav-link i {
    margin-right: 8px;
}

/* Contenedor de chats para unificar */
.unificar-chats-container {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
}

/* Item de chat para unificar */
.unificar-chat-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.unificar-chat-item:hover {
    background: rgba(147, 51, 234, 0.2);
    border-color: rgba(147, 51, 234, 0.5);
}

.unificar-chat-item.selected {
    background: rgba(147, 51, 234, 0.3);
    border-color: var(--purple-main);
}

.unificar-chat-item .chat-checkbox {
    margin-right: 15px;
}

.unificar-chat-item .chat-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--purple-main);
}

.unificar-chat-item .chat-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple-main), var(--purple-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
}

.unificar-chat-item .chat-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.unificar-chat-item .chat-info {
    flex: 1;
    min-width: 0;
}

.unificar-chat-item .chat-name {
    font-weight: 600;
    color: white;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unificar-chat-item .chat-phone {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 3px;
}

.unificar-chat-item .chat-session {
    font-size: 0.75rem;
    color: rgba(147, 51, 234, 0.8);
}

.unificar-chat-item .chat-last-message {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 5px;
}

.unificar-chat-item .chat-date {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    text-align: right;
    min-width: 80px;
}

/* Botones de acción */
.unificar-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.unificar-actions .btn {
    padding: 10px 20px;
}

/* Detalles de chats en modal */
.chats-unificar-detalles {
    max-height: 300px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 15px;
}

.chat-detalle-item {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid var(--purple-main);
}

.chat-detalle-item:last-child {
    margin-bottom: 0;
}

.chat-detalle-item.chat-principal {
    border-left-color: #10B981;
    background: rgba(16, 185, 129, 0.1);
}

.chat-detalle-item .detalle-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple-main), var(--purple-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 1rem;
    color: white;
    flex-shrink: 0;
}

.chat-detalle-item .detalle-info {
    flex: 1;
}

.chat-detalle-item .detalle-nombre {
    font-weight: 600;
    color: white;
    font-size: 0.95rem;
}

.chat-detalle-item .detalle-telefono {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.chat-detalle-item .detalle-ultimo-mensaje {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 5px;
    font-style: italic;
}

.chat-detalle-item .detalle-badge {
    background: #10B981;
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 10px;
}

/* Contador de selección */
.seleccion-contador {
    background: rgba(147, 51, 234, 0.2);
    border: 1px solid var(--purple-main);
    border-radius: 10px;
    padding: 10px 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.seleccion-contador .contador-texto {
    color: white;
    font-weight: 500;
}

.seleccion-contador .contador-numero {
    background: var(--purple-main);
    color: white;
    padding: 2px 10px;
    border-radius: 15px;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .unificar-actions {
        flex-direction: column;
    }
    
    .unificar-actions .btn {
        width: 100%;
    }
    
    .unificar-chat-item {
        flex-wrap: wrap;
    }
    
    .unificar-chat-item .chat-date {
        width: 100%;
        text-align: left;
        margin-top: 10px;
    }
}

/* ============================================= 
   ESTILOS ADICIONALES PARA PESTAÑAS MÓVILES
   ============================================= */

@media (max-width: 992px) {
    /* Asegurar que el main-content no corte el contenido */
    .main-content {
        overflow-y: auto;
        overflow-x: hidden;
    }
}

/* Ocultar botón de volver en escritorio */
.mobile-back-btn {
    display: none;
}

/* Ocultar pestañas en escritorio */
.mobile-chat-tabs {
    display: none;
}

/* Ocultar hint móvil en escritorio */
.mobile-hint {
    display: none !important;
}

@media (max-width: 768px) {
    /* Mostrar hint móvil */
    .mobile-hint {
        display: block !important;
        margin-top: 20px;
        animation: pulse-hint 2s infinite;
    }
    
    @keyframes pulse-hint {
        0%, 100% { opacity: 0.6; }
        50% { opacity: 1; }
    }
}

/* Para pantallas muy pequeñas (celulares compactos) */
@media (max-width: 480px) {
    /* Pestañas más compactas */
    .mobile-tab {
        padding: 10px 8px;
        font-size: 0.85rem;
    }
    
    .mobile-tab i {
        font-size: 1rem;
    }
    
    .mobile-tab span:not(.tab-badge) {
        display: none; /* Ocultar texto, solo mostrar icono */
    }
    
    .mobile-tab i {
        font-size: 1.3rem;
    }
    
    /* Header del chat más compacto */
    .conversation-container .chat-header {
        padding: 8px 10px !important;
    }
    
    .conversation-container .chat-header .chat-avatar {
        width: 35px !important;
        height: 35px !important;
        font-size: 0.9rem !important;
        margin-right: 8px !important;
    }
    
    .conversation-container .chat-header h6 {
        font-size: 0.85rem !important;
    }
    
    .mobile-back-btn {
        width: 32px !important;
        height: 32px !important;
        margin-right: 8px !important;
    }
    
    /* Switch más pequeño */
    .header-mode-switch {
        width: 42px !important;
        height: 22px !important;
    }
    
    .header-slider::before {
        height: 16px !important;
        width: 16px !important;
    }
    
    .header-mode-switch input:checked + .header-slider::before {
        transform: translateX(20px) !important;
    }
    
    .header-mode-text {
        font-size: 0.65rem !important;
    }
    
    /* Input más compacto */
    .conversation-container .message-input-container {
        padding: 8px !important;
    }
    
    .conversation-container .message-input-container #messageInput {
        height: 40px !important;
    }
    
    .conversation-container .message-input-container .btn {
        min-width: 38px !important;
        height: 40px !important;
    }
    
    /* Selector de plantillas compacto en pantallas pequeñas */
    .conversation-container .plantilla-selector-container {
        display: flex !important;
        padding: 3px 0 !important;
    }
    
    .conversation-container .plantilla-selector-container select {
        max-width: 120px !important;
        font-size: 0.75rem !important;
        height: 30px !important;
        padding: 2px 5px !important;
    }
    
    /* Mensajes */
    .message-bubble {
        max-width: 90% !important;
        padding: 8px 12px !important;
        font-size: 0.9rem !important;
    }
}