.floating-buttons {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.whatsapp-float,
.social-float {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.7rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s;
}

.whatsapp-float {
    background-color: #25d366;
}
.whatsapp-float:hover {
    background-color: #128C7E;
}

.facebook-float {
    background-color: #1877f3;
}
.facebook-float:hover {
    background-color: #145db2;
}

.instagram-float {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
}
.instagram-float:hover {
    filter: brightness(0.9);
}

.tiktok-float {
    background-color: #000;
}
.tiktok-float:hover {
    background-color: #222;
}

.whatsapp-text {
    display: none;
}

.chatbot-button {
    background: var(--primary-color);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.chatbot-button:hover {
    transform: scale(1.1);
}

.chatbot-button i {
    font-size: 1.5rem;
}

.chatbot-widget {
    position: fixed;
    right: 20px;
    bottom: 100px;
    width: 350px;
    height: 450px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    display: none;
    overflow: hidden;
    z-index: 1001; /* Asegurar que esté por encima de otros elementos */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.chatbot-widget.active {
    display: flex;
    flex-direction: column;
    opacity: 1;
    transform: translateY(0);
}

.chatbot-header {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
}

.chatbot-messages {
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
}

.chatbot-input {
    padding: 1rem;
    border-top: 1px solid #eee;
    display: flex;
    gap: 0.5rem;
}

.chatbot-input input {
    flex-grow: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
}

.chatbot-input button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Estilos responsivos */
@media (max-width: 768px) {
    .whatsapp-text {
        display: none;
    }

    .whatsapp-float {
        width: 50px;
        height: 50px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
        bottom: 20px;
        right: 20px;
    }

    .floating-buttons {
        bottom: 20px;
        right: 20px;
    }

    .chatbot-widget {
        width: calc(100% - 40px);
        height: 400px;
        bottom: 90px;
    }
}

/* Ajustes para modo oscuro */
[data-theme="dark"] .whatsapp-float {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* New styles for modern chat */
.modern-chat {
    position: fixed;
    bottom: 100px; /* Aumentado para estar más arriba que WhatsApp */
    right: 30px;
    z-index: 999; /* Asegurar que esté debajo de WhatsApp */
}

.chat-trigger {
    background: linear-gradient(135deg, #0066cc, #0052a3);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.2);
    transition: all 0.3s ease;
}

.chat-trigger:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 102, 204, 0.3);
}

.chat-button-text {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Ajustar visibilidad del chat */
.chat-popup {
    position: fixed;
    bottom: 120px;
    right: 30px;
    width: 320px;
    height: 400px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.1);
    display: none;
    flex-direction: column;
    z-index: 1002;
    transition: all 0.3s ease;
}

.chat-popup.active {
    display: flex;
    animation: slideIn 0.3s ease forwards;
}

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

/* Mejorar visibilidad de los mensajes */
.chat-messages {
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
}

.chat-message {
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

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

.chat-header {
    background: linear-gradient(135deg, #0066cc, #0052a3);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-logo {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.chat-logo-text {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    color: white;
}

.chat-info h4 {
    font-size: 1rem;
    margin: 0;
}

.status {
    font-size: 0.8rem;
    opacity: 0.8;
}

.chat-close {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.chat-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
}

.chat-message {
    margin-bottom: 10px;
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 80%;
    word-wrap: break-word;
}

.user-message {
    background: #0066cc;
    color: white;
    margin-left: auto;
}

.bot-message {
    background: #f0f0f0;
    color: #333;
    margin-right: auto;
}

.chat-input-wrapper {
    padding: 15px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #e1e1e1;
    border-radius: 20px;
    outline: none;
    font-size: 0.9rem;
}

.chat-send {
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-send:hover {
    background: #0052a3;
    transform: scale(1.1);
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.assistant-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.chat-avatar:hover .assistant-img {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .chat-button-text {
        display: none;
    }

    .chat-trigger {
        width: 50px;
        height: 50px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }

    .chat-popup {
        width: 300px;
        height: 400px;
        bottom: 60px;
    }

    .modern-chat {
        bottom: 90px; /* Ajustado para móviles */
        right: 20px;
    }
}

/* Ajustes específicos para el modo oscuro */
[data-theme="dark"] .chat-popup {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .chat-input {
    background-color: var(--input-bg);
    color: var(--text-color);
    border-color: var(--border-color);
}

[data-theme="dark"] .chat-messages {
    background-color: var(--card-bg);
}

[data-theme="dark"] .bot-message {
    background-color: #333;
    color: var(--text-color);
}

[data-theme="dark"] .user-message {
    background-color: var(--primary-color);
    color: #ffffff;
}

/* New styles for floating buttons in the middle */
.floating-buttons-middle {
    position: fixed;
    top: 60%;
    right: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transform: translateY(-50%);
}

@media (max-width: 768px) {
    .floating-buttons-middle {
        top: 45%;
        right: 10px;
        gap: 10px;
    }
}
