/* 
 * WiseBot AI Chatbot Styles
 * Diseño moderno y distintivo
 */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700&family=DM+Sans:wght@400;500;700&display=swap');

:root {
    --wisebot-primary: #6366f1;
    --wisebot-primary-dark: #4f46e5;
    --wisebot-secondary: #8b5cf6;
    --wisebot-bg: #ffffff;
    --wisebot-surface: #f8fafc;
    --wisebot-text: #0f172a;
    --wisebot-text-light: #64748b;
    --wisebot-border: #e2e8f0;
    --wisebot-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --wisebot-radius: 20px;
}

/* Contenedor principal del chatbot */
#wisebot-ai-chatbot {
    position: fixed;
    z-index: 9999;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

#wisebot-ai-chatbot.bottom-right {
    bottom: 30px;
    right: 30px;
}

#wisebot-ai-chatbot.bottom-left {
    bottom: 30px;
    left: 30px;
}

#wisebot-ai-chatbot.top-right {
    top: 30px;
    right: 30px;
}

#wisebot-ai-chatbot.top-left {
    top: 30px;
    left: 30px;
}

/* Botón flotante */
.wisebot-chat-button {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--wisebot-primary) 0%, var(--wisebot-secondary) 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.wisebot-chat-button::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wisebot-chat-button:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 50px rgba(99, 102, 241, 0.4);
}

.wisebot-chat-button:hover::before {
    opacity: 1;
}

.wisebot-chat-button:active {
    transform: scale(0.95);
}

.wisebot-chat-button svg {
    width: 32px;
    height: 32px;
    fill: white;
    transition: transform 0.3s ease;
}

.wisebot-chat-button:hover svg {
    transform: scale(1.1);
}

/* Badge de notificación */
.wisebot-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    border: 3px solid white;
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Ventana del chatbot */
.wisebot-chat-window {
    position: absolute;
    bottom: 90px;
    right: 0;
    width: 420px;
    height: 600px;
    background: var(--wisebot-bg);
    border-radius: var(--wisebot-radius);
    box-shadow: var(--wisebot-shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    animation: slideInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--wisebot-border);
}

.wisebot-chat-window.open {
    display: flex;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header del chat */
.wisebot-chat-header {
    background: linear-gradient(135deg, var(--wisebot-primary) 0%, var(--wisebot-secondary) 100%);
    color: white;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.wisebot-chat-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
}

.wisebot-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1;
}

.wisebot-bot-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.wisebot-bot-details h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Syne', sans-serif;
    letter-spacing: -0.02em;
}

.wisebot-bot-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    opacity: 0.9;
    margin-top: 2px;
}

.wisebot-status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.wisebot-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1;
}

.wisebot-language-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.wisebot-lang-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    font-family: inherit;
}

.wisebot-lang-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.wisebot-lang-btn.active {
    color: white;
    background: rgba(255, 255, 255, 0.25);
}

.wisebot-lang-separator {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

.wisebot-new-chat-btn,
.wisebot-close-btn {
    background: transparent;
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1;
    font-size: 22px;
    font-weight: normal;
    padding: 0;
}

.wisebot-new-chat-btn:hover,
.wisebot-close-btn:hover {
    transform: scale(1.2);
    opacity: 0.8;
}

.wisebot-new-chat-btn:active,
.wisebot-close-btn:active {
    transform: scale(1);
    opacity: 1;
}

/* Área de mensajes */
.wisebot-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--wisebot-surface);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wisebot-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.wisebot-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.wisebot-chat-messages::-webkit-scrollbar-thumb {
    background: var(--wisebot-border);
    border-radius: 10px;
}

.wisebot-chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--wisebot-text-light);
}

/* Mensaje individual */
.wisebot-message {
    display: flex;
    gap: 12px;
    animation: fadeInMessage 0.4s ease;
    align-items: flex-start;
}

@keyframes fadeInMessage {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wisebot-message.user {
    flex-direction: row-reverse;
}

.wisebot-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

.wisebot-message.bot .wisebot-message-avatar {
    background: linear-gradient(135deg, var(--wisebot-primary) 0%, var(--wisebot-secondary) 100%);
    color: white;
}

.wisebot-message.user .wisebot-message-avatar {
    background: var(--wisebot-text);
    color: white;
}

.wisebot-message-content {
    max-width: 75%;
    padding: 14px 18px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.6;
}

.wisebot-message.bot .wisebot-message-content {
    background: white;
    color: var(--wisebot-text);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.wisebot-message.user .wisebot-message-content {
    background: linear-gradient(135deg, var(--wisebot-primary) 0%, var(--wisebot-secondary) 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Indicador de escritura */
.wisebot-typing-indicator {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 0 12px;
}

.wisebot-typing-indicator .wisebot-message-avatar {
    background: linear-gradient(135deg, var(--wisebot-primary) 0%, var(--wisebot-secondary) 100%);
}

.wisebot-typing-dots {
    display: flex;
    gap: 6px;
    padding: 14px 18px;
    background: white;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
}

.wisebot-typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--wisebot-text-light);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.wisebot-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.wisebot-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Preguntas sugeridas */
.wisebot-suggested-questions {
    padding: 16px 24px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border-top: 1px solid var(--wisebot-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wisebot-suggested-btn {
    background: white;
    border: 2px solid var(--wisebot-border);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--wisebot-text);
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.wisebot-suggested-btn:hover {
    background: var(--wisebot-primary);
    color: white;
    border-color: var(--wisebot-primary);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.wisebot-suggested-btn:active {
    transform: translateX(2px);
}

.wisebot-suggested-questions.hidden {
    display: none;
}

/* Input del chat */
.wisebot-chat-input-wrapper {
    padding: 20px 24px;
    background: white;
    border-top: 1px solid var(--wisebot-border);
}

.wisebot-chat-input-container {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.wisebot-chat-input {
    flex: 1;
    border: 2px solid var(--wisebot-border);
    border-radius: 14px;
    padding: 14px 18px;
    font-size: 15px;
    font-family: 'DM Sans', sans-serif;
    resize: none;
    max-height: 120px;
    transition: all 0.3s ease;
    background: var(--wisebot-surface);
}

.wisebot-chat-input:focus {
    outline: none;
    border-color: var(--wisebot-primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.wisebot-send-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--wisebot-primary) 0%, var(--wisebot-secondary) 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    font-size: 20px;
    padding-left: 3px;
    font-weight: normal;
}

.wisebot-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

.wisebot-send-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.wisebot-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Mensaje de bienvenida */
.wisebot-welcome-message {
    text-align: center;
    padding: 32px 24px;
}

.wisebot-welcome-message .wisebot-bot-avatar {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    font-size: 32px;
    background: linear-gradient(135deg, var(--wisebot-primary) 0%, var(--wisebot-secondary) 100%);
}

.wisebot-welcome-message h4 {
    margin: 0 0 8px;
    font-size: 20px;
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    color: var(--wisebot-text);
}

.wisebot-welcome-message p {
    margin: 0;
    color: var(--wisebot-text-light);
    font-size: 15px;
    line-height: 1.6;
}

/* Sugerencias rápidas */
.wisebot-quick-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
}

.wisebot-suggestion-btn {
    background: white;
    border: 2px solid var(--wisebot-border);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--wisebot-text);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-family: 'DM Sans', sans-serif;
}

.wisebot-suggestion-btn:hover {
    border-color: var(--wisebot-primary);
    background: var(--wisebot-surface);
    transform: translateX(4px);
}

/* Responsive */
@media (max-width: 480px) {
    .wisebot-chat-window {
        width: 100vw;
        height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    #wisebot-ai-chatbot.bottom-right,
    #wisebot-ai-chatbot.bottom-left,
    #wisebot-ai-chatbot.top-right,
    #wisebot-ai-chatbot.top-left {
        bottom: 20px;
        right: 20px;
    }
}

/* Efectos de brillo */
@keyframes shine {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

.wisebot-shine {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    background-size: 200% 100%;
    animation: shine 3s infinite;
}
