/* WhatsApp Float Button */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    right: 40px;
    background: var(--gold-gradient);
    color: #1a1a1a !important;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: none;
    outline: none;
}

.whatsapp-float:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.6);
}

.whatsapp-float i {
    margin-top: 2px;
}

/* Chatbot Button */
.chatbot-button {
    position: fixed;
    width: 70px;
    height: 70px;
    bottom: 120px;
    right: 30px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 32px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    outline: none;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s forwards 1s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
    }
}

.chatbot-button i {
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.chatbot-button:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg, #0056b3, #003d82);
    animation: pulse 2s infinite;
}

/* Chatbot Container */
.chatbot-container {
    position: fixed;
    bottom: 200px;
    right: 30px;
    width: 350px;
    max-width: 90%;
    background: #1a1a1a;
    border-radius: 15px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.chatbot-container.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.chatbot-header {
    background: #0a0a0a;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chatbot-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.chatbot-close {
    background: none;
    border: none;
    color: #999;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 0;
    line-height: 1;
}

.chatbot-close:hover {
    color: #fff;
}

.chatbot-messages {
    padding: 20px;
    height: 300px;
    overflow-y: auto;
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    margin-bottom: 15px;
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    line-height: 1.4;
    position: relative;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.bot-message {
    background: #2d2d2d;
    color: #fff;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

.user-message {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.chatbot-input {
    display: flex;
    padding: 15px;
    background: #0a0a0a;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chatbot-input input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    background: #2d2d2d;
    color: white;
    outline: none;
    transition: all 0.3s ease;
}

.chatbot-input input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.chatbot-input button {
    margin-left: 10px;
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chatbot-input button:hover {
    background: linear-gradient(135deg, #0056b3, #003d82);
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
    .chatbot-button {
        width: 60px;
        height: 60px;
        font-size: 28px;
        bottom: 100px;
        right: 20px;
    }
    
    .chatbot-container {
        width: 90%;
        right: 5%;
        bottom: 170px;
    }
}

.chatbot-container.active {
    display: flex;
}

.chatbot-header {
    background: var(--darker-bg);
    color: var(--white);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chatbot-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.close-chatbot {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-chatbot:hover {
    color: var(--primary-color);
}

.chatbot-messages {
    padding: 20px;
    height: 300px;
    overflow-y: auto;
    background: #1a1a1a;
}

.chatbot-message {
    margin-bottom: 15px;
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    line-height: 1.4;
    position: relative;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chatbot-message.bot {
    background: #2a2a2a;
    color: var(--white);
    border-bottom-left-radius: 5px;
    align-self: flex-start;
}

.chatbot-message.user {
    background: var(--gold-gradient);
    color: #1a1a1a;
    border-bottom-right-radius: 5px;
    margin-left: auto;
}

.chatbot-input {
    display: flex;
    padding: 15px;
    background: #1a1a1a;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chatbot-input input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    background: #2a2a2a;
    color: var(--white);
    outline: none;
    transition: all 0.3s ease;
}

.chatbot-input input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

.chatbot-input button {
    background: var(--gold-gradient);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-left: 10px;
    color: #1a1a1a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chatbot-input button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.3);
}

.chatbot-trigger {
    position: fixed;
    bottom: 40px;
    right: 120px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--gold-gradient);
    color: #1a1a1a;
    border: none;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1100; /* por encima de whatsapp (100) y contenedor (1000) */
    pointer-events: auto; /* asegurar que el botón reciba clics */
    transition: all 0.3s ease;
}

.chatbot-trigger:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.4);
}

/* Asegurar que los clics sobre el ícono se apliquen al botón */
.chatbot-trigger i {
    pointer-events: none;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 24px;
    }
    
    .chatbot-container {
        width: 90%;
        right: 5%;
        bottom: 100px;
    }
    
    .chatbot-trigger {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 90px;
        font-size: 20px;
    }
}
