/* ==========================================
   CHATBOT VIRTUAL ASISTENTE - ICEID
   Diseño profesional, elegante y conversacional
   ========================================== */

/* Botón Flotante del Chat */
.chat-widget-button {
    position: fixed !important;
    bottom: 2rem !important;
    right: 2rem !important;
    width: 65px !important;
    height: 65px !important;
    background: linear-gradient(135deg, #0a2463, #00d9ff) !important;
    border-radius: 50% !important;
    border: none !important;
    cursor: pointer !important;
    box-shadow: 0 8px 32px rgba(0, 217, 255, 0.4) !important;
    z-index: 9999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    animation: pulse-chat 2s ease-in-out infinite !important;
}

.chat-widget-button:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 12px 48px rgba(0, 217, 255, 0.6) !important;
}

.chat-widget-button i {
    font-size: 1.8rem !important;
    color: white !important;
    transition: all 0.3s ease !important;
}

.chat-widget-button.active i.fa-comments {
    display: none !important;
}

.chat-widget-button i.fa-times {
    display: none !important;
}

.chat-widget-button.active i.fa-times {
    display: block !important;
}

/* Badge de Notificación */
.chat-notification-badge {
    position: absolute !important;
    top: -5px !important;
    right: -5px !important;
    width: 24px !important;
    height: 24px !important;
    background: #ef4444 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    color: white !important;
    border: 3px solid white !important;
    animation: bounce-badge 1s ease-in-out infinite !important;
}

@keyframes pulse-chat {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(0, 217, 255, 0.4);
    }
    50% {
        box-shadow: 0 8px 32px rgba(0, 217, 255, 0.7), 0 0 0 12px rgba(0, 217, 255, 0.1);
    }
}

@keyframes bounce-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Ventana del Chat */
.chat-widget-window {
    position: fixed !important;
    bottom: 110px !important;
    right: 2rem !important;
    width: 420px !important;
    max-width: calc(100vw - 4rem) !important;
    height: 600px !important;
    max-height: calc(100vh - 150px) !important;
    background: white !important;
    border-radius: 20px !important;
    box-shadow: 0 20px 80px rgba(10, 36, 99, 0.2) !important;
    z-index: 9998 !important;
    display: none !important;
    flex-direction: column !important;
    overflow: hidden !important;
    animation: slideInUp 0.4s ease-out !important;
}

.chat-widget-window.active {
    display: flex !important;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header del Chat */
.chat-header {
    background: linear-gradient(135deg, #0a2463, #3e92cc) !important;
    padding: 1.5rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
    position: relative !important;
    overflow: hidden !important;
}

.chat-header::before {
    content: '' !important;
    position: absolute !important;
    top: -50% !important;
    right: -20% !important;
    width: 300px !important;
    height: 300px !important;
    background: radial-gradient(circle, rgba(0, 217, 255, 0.2) 0%, transparent 70%) !important;
    animation: pulse 3s ease-in-out infinite !important;
}

.chat-avatar-large {
    width: 55px !important;
    height: 55px !important;
    background: white !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    z-index: 1 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
}

.chat-avatar-large i {
    font-size: 1.6rem !important;
    background: linear-gradient(135deg, #0a2463, #00d9ff) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

.chat-header-info {
    flex: 1 !important;
    position: relative !important;
    z-index: 1 !important;
}

.chat-header-info h3 {
    font-size: 1.2rem !important;
    font-weight: 700 !important;
    color: white !important;
    margin: 0 0 0.25rem 0 !important;
    font-family: 'Orbitron', sans-serif !important;
}

.chat-status {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    font-size: 0.85rem !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.status-dot {
    width: 8px !important;
    height: 8px !important;
    background: #10b981 !important;
    border-radius: 50% !important;
    animation: pulse-dot 2s ease-in-out infinite !important;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Cuerpo del Chat - Mensajes */
.chat-body {
    flex: 1 !important;
    padding: 1.5rem !important;
    overflow-y: auto !important;
    background: #f8fafc !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
}

.chat-body::-webkit-scrollbar {
    width: 6px !important;
}

.chat-body::-webkit-scrollbar-thumb {
    background: #cbd5e1 !important;
    border-radius: 3px !important;
}

.chat-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8 !important;
}

/* Mensaje del Bot */
.chat-message {
    display: flex !important;
    gap: 0.75rem !important;
    animation: fadeInMessage 0.4s ease-out !important;
}

@keyframes fadeInMessage {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.user {
    flex-direction: row-reverse !important;
}

.message-avatar {
    width: 36px !important;
    height: 36px !important;
    background: linear-gradient(135deg, #0a2463, #00d9ff) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

.chat-message.user .message-avatar {
    background: linear-gradient(135deg, #64748b, #94a3b8) !important;
}

.message-avatar i {
    font-size: 1rem !important;
    color: white !important;
}

.message-content {
    max-width: 75% !important;
}

.message-bubble {
    background: white !important;
    padding: 1rem 1.25rem !important;
    border-radius: 16px 16px 16px 4px !important;
    box-shadow: 0 2px 8px rgba(10, 36, 99, 0.08) !important;
}

.chat-message.user .message-bubble {
    background: linear-gradient(135deg, #0a2463, #3e92cc) !important;
    border-radius: 16px 16px 4px 16px !important;
    color: white !important;
}

.message-bubble p {
    margin: 0 !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    color: #475569 !important;
}

.chat-message.user .message-bubble p {
    color: white !important;
}

.message-time {
    font-size: 0.75rem !important;
    color: #94a3b8 !important;
    margin-top: 0.5rem !important;
    display: block !important;
}

/* Opciones de Respuesta Rápida */
.quick-options {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    margin-top: 0.75rem !important;
}

.quick-option-btn {
    background: white !important;
    border: 2px solid #e8eef5 !important;
    border-radius: 12px !important;
    padding: 0.875rem 1.25rem !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    color: #0a2463 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    text-align: left !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
}

.quick-option-btn:hover {
    background: linear-gradient(135deg, #0a2463, #3e92cc) !important;
    color: white !important;
    border-color: transparent !important;
    transform: translateX(5px) !important;
    box-shadow: 0 4px 16px rgba(0, 217, 255, 0.3) !important;
}

.quick-option-btn i {
    font-size: 1.1rem !important;
    color: #00d9ff !important;
    transition: all 0.3s ease !important;
}

.quick-option-btn:hover i {
    color: white !important;
}

/* Formulario de Entrada */
.chat-input-container {
    padding: 1.25rem !important;
    background: white !important;
    border-top: 1px solid #e8eef5 !important;
}

.chat-input-form {
    display: flex !important;
    gap: 0.75rem !important;
    align-items: flex-end !important;
}

.chat-input-wrapper {
    flex: 1 !important;
    position: relative !important;
}

.chat-input {
    width: 100% !important;
    padding: 0.875rem 3rem 0.875rem 1rem !important;
    background: #f8fafc !important;
    border: 2px solid transparent !important;
    border-radius: 12px !important;
    font-size: 0.95rem !important;
    color: #0a2463 !important;
    font-family: 'Rajdhani', sans-serif !important;
    resize: none !important;
    max-height: 120px !important;
    transition: all 0.3s ease !important;
}

.chat-input:focus {
    outline: none !important;
    background: white !important;
    border-color: #00d9ff !important;
    box-shadow: 0 0 0 4px rgba(0, 217, 255, 0.1) !important;
}

.chat-emoji-btn {
    position: absolute !important;
    right: 0.75rem !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 1.2rem !important;
    color: #94a3b8 !important;
    transition: all 0.3s ease !important;
}

.chat-emoji-btn:hover {
    color: #00d9ff !important;
    transform: translateY(-50%) scale(1.2) !important;
}

.chat-send-btn {
    width: 45px !important;
    height: 45px !important;
    background: linear-gradient(135deg, #0a2463, #3e92cc) !important;
    border: none !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
    flex-shrink: 0 !important;
}

.chat-send-btn:hover {
    background: linear-gradient(135deg, #00d9ff, #0a2463) !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 16px rgba(0, 217, 255, 0.4) !important;
}

.chat-send-btn i {
    font-size: 1.1rem !important;
    color: white !important;
}

.chat-send-btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Indicador de Escritura */
.typing-indicator {
    display: none !important;
    padding: 0.75rem 1rem !important;
    background: white !important;
    border-radius: 16px !important;
    width: fit-content !important;
    box-shadow: 0 2px 8px rgba(10, 36, 99, 0.08) !important;
}

.typing-indicator.active {
    display: flex !important;
    gap: 0.4rem !important;
    align-items: center !important;
}

.typing-dot {
    width: 8px !important;
    height: 8px !important;
    background: #cbd5e1 !important;
    border-radius: 50% !important;
    animation: typing 1.4s ease-in-out infinite !important;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s !important;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s !important;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        background: #cbd5e1;
    }
    30% {
        transform: translateY(-10px);
        background: #00d9ff;
    }
}

/* Footer del Chat */
.chat-footer {
    padding: 0.875rem 1.25rem !important;
    background: #f8fafc !important;
    border-top: 1px solid #e8eef5 !important;
    text-align: center !important;
    font-size: 0.75rem !important;
    color: #94a3b8 !important;
}

.chat-footer a {
    color: #0a2463 !important;
    text-decoration: none !important;
    font-weight: 600 !important;
}

.chat-footer a:hover {
    color: #00d9ff !important;
}

/* Formulario de Datos */
.chat-form-container {
    display: none !important;
    flex-direction: column !important;
    gap: 1rem !important;
    padding: 1rem 0 !important;
}

.chat-form-container.active {
    display: flex !important;
}

.chat-form-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
}

.chat-form-label {
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    color: #64748b !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.chat-form-input,
.chat-form-select {
    padding: 0.75rem !important;
    background: white !important;
    border: 2px solid #e8eef5 !important;
    border-radius: 10px !important;
    font-size: 0.9rem !important;
    color: #0a2463 !important;
    font-family: 'Rajdhani', sans-serif !important;
    transition: all 0.3s ease !important;
}

.chat-form-input:focus,
.chat-form-select:focus {
    outline: none !important;
    border-color: #00d9ff !important;
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.1) !important;
}

.chat-form-submit {
    padding: 0.875rem !important;
    background: linear-gradient(135deg, #0a2463, #3e92cc) !important;
    border: none !important;
    border-radius: 10px !important;
    color: white !important;
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    margin-top: 0.5rem !important;
}

.chat-form-submit:hover {
    background: linear-gradient(135deg, #00d9ff, #0a2463) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(0, 217, 255, 0.4) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .chat-widget-button {
        bottom: 1.5rem !important;
        right: 1.5rem !important;
        width: 60px !important;
        height: 60px !important;
    }

    .chat-widget-window {
        bottom: 90px !important;
        right: 1rem !important;
        left: 1rem !important;
        width: auto !important;
        max-width: none !important;
    }

    .message-content {
        max-width: 80% !important;
    }
}

@media (max-width: 480px) {
    .chat-widget-window {
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        max-height: none !important;
        border-radius: 0 !important;
    }

    .chat-widget-button {
        bottom: 1rem !important;
        right: 1rem !important;
    }
}
