/**
 * Estilos CSS para el Chatbot Widget
 * Compatible con cualquier sitio web
 */

/* Reset específico para el widget para evitar conflictos */
#chatbot-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Estilos responsivos para el widget */
@media (max-width: 768px) {
    #chatbot-window {
        width: calc(100vw - 40px) !important;
        height: calc(100vh - 100px) !important;
        right: 20px !important;
        left: 20px !important;
        bottom: 80px !important;
    }
}

@media (max-width: 480px) {
    #chatbot-window {
        width: calc(100vw - 20px) !important;
        height: calc(100vh - 80px) !important;
        right: 10px !important;
        left: 10px !important;
        bottom: 70px !important;
    }

    #chatbot-button {
        width: 50px !important;
        height: 50px !important;
        bottom: 15px !important;
        right: 15px !important;
    }
}

/* Animaciones del widget */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 20%, 60%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    80% {
        transform: translateY(-5px);
    }
}

#chatbot-window {
    animation: slideInUp 0.3s ease-out;
}

#chatbot-button {
    animation: fadeIn 0.5s ease-out;
}

/* Hover effects */
.message button:hover {
    background-color: var(--primary-color, #007bff) !important;
    color: white !important;
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

#chatbot-send:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

#chatbot-close:hover {
    background-color: rgba(255, 255, 255, 0.2) !important;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #e9ecef;
    border-radius: 18px;
    margin-bottom: 15px;
    max-width: 80%;
}

.typing-indicator span {
    height: 6px;
    width: 6px;
    background: #999;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Estados del widget */
.widget-hidden {
    display: none !important;
}

.widget-minimized #chatbot-window {
    height: 60px !important;
    overflow: hidden;
}

.widget-minimized #chatbot-messages,
.widget-minimized #chatbot-input-area {
    display: none !important;
}

/* Accesibilidad */
#chatbot-button:focus,
#chatbot-send:focus,
#chatbot-close:focus,
#chatbot-input:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Tema oscuro (opcional) */
@media (prefers-color-scheme: dark) {
    .dark-theme #chatbot-window {
        background: #2d3748 !important;
        color: white;
    }

    .dark-theme #chatbot-messages {
        background: #1a202c !important;
    }

    .dark-theme .bot-message .message-content {
        background: #4a5568 !important;
        color: white;
    }

    .dark-theme #chatbot-input {
        background: #2d3748 !important;
        border-color: #4a5568 !important;
        color: white;
    }
}

/* Estilos para notificaciones */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    animation: bounce 2s infinite;
}