/* Botón flotante */
#chatbot-button {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: white;
    border: 2px solid #f4d165;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
    z-index: 10001;
    overflow: hidden;
}

#chatbot-button:hover {
    transform: scale(1.05);
}

#chatbot-button.open {
    width: 50px;
    height: 50px;
    box-shadow: 0 6px 12px rgba(244, 209, 101, 0.35);
}

#chatbot-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#chatbot-button .notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

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

/* Ventana del chat */
#chatbot-window {
    position: fixed;
    bottom: 104px;
    right: 40px;
    width: 384px;
    height: 600px;
    max-width: calc(100vw - 48px);
    max-height: calc(100vh - 140px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 10000;
}

#chatbot-window.show {
    display: flex;
}

/* Header */
.chat-header {
    background: linear-gradient(135deg, #f4d165 0%, #e5c24f 100%);
    padding: 16px 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: white;
    border: 1px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.chat-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-header-title {
    font-weight: 600;
    font-size: 16px;
}

/* Mensajes */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    background: #f9fafb;
}

.message {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.message.user {
    justify-content: flex-end;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    border: 2px solid #f4d165;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 75%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
}

.message.user .message-content {
    background: linear-gradient(135deg, #f4d165 0%, #e5c24f 100%);
    
    color: white;
}

.typing-indicator {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
}

/* Botones de opciones */
.chat-buttons {
    padding: 0 20px 16px;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.button-group.horizontal {
    flex-direction: row;
}

.option-button {
    background: white;
    border: 1px solid #e5e7eb;
    color: #374151;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.button-group.horizontal .option-button {
    flex: 1;
    justify-content: center;
}

.option-button:hover {
    border-color: #f4d165;
}

.option-button.border-green {
    border-color: #10b981;
}

.option-button.border-green:hover {
    border-color: #059669;
}

.option-button.border-red {
    border-color: #ef4444;
}

.option-button.border-red:hover {
    border-color: #dc2626;
}

.option-button svg {
    flex-shrink: 0;
}

/* Formulario */
.chat-form {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: none;
}

.chat-form.show {
    display: block;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 4px;
}

.form-label .required {
    color: #ef4444;
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #f4d165;
}

.form-input.error {
    border-color: #ef4444;
}

.form-error {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
}

.form-note {
    font-size: 12px;
    color: #6b7280;
    margin-top: 8px;
}

.form-buttons {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.form-button {
    flex: 1;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.form-button.secondary {
    background: white;
    border: 2px solid #e5e7eb;
    color: #374151;
}

.form-button.secondary:hover {
    background: #f9fafb;
}

.form-button.primary {
    background: linear-gradient(135deg, #f4d165 0%, #e5c24f 100%);
    color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-button.primary:hover {
    opacity: 0.9;
}

.hidden {
    display: none;
}
