/**
 * Fibik Floating WhatsApp Button Styles
 * Estilos para el botón flotante de WhatsApp
 */

/* Contenedor principal */
#fibik-floating-whatsapp {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Botón flotante */
.fibik-whatsapp-button {
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    color: white;
}

.fibik-whatsapp-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.6);
}

.fibik-whatsapp-button svg {
    width: 28px;
    height: 28px;
}

/* Widget de chat */
.fibik-whatsapp-widget {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.fibik-whatsapp-widget.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Header del widget */
.fibik-whatsapp-header {
    background: #25D366;
    padding: 16px;
    display: flex;
    align-items: center;
    color: white;
    position: relative;
}

.fibik-whatsapp-profile {
    margin-right: 12px;
    background: white;
    padding: 5px;
    border-radius: 50%;
}

.fibik-whatsapp-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.fibik-whatsapp-avatar-default {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.fibik-whatsapp-info {
    flex: 1;
}

.fibik-whatsapp-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 2px;
}

.fibik-whatsapp-status {
    font-size: 12px;
    opacity: 0.9;
}

.fibik-whatsapp-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.fibik-whatsapp-close:hover {
    opacity: 1;
}

.fibik-whatsapp-close svg {
    width: 16px;
    height: 16px;
}

/* Cuerpo del widget */
.fibik-whatsapp-body {
    padding: 16px;
}

.fibik-whatsapp-message {
    background: #f0f0f0;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
}

/* Contenedor de entrada */
.fibik-whatsapp-input-container {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 8px;
    border: 1px solid #e9ecef;
}

.fibik-whatsapp-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
    color: #333;
}

.fibik-whatsapp-input::placeholder {
    color: #6c757d;
}

.fibik-whatsapp-send-btn {
    width: 36px;
    height: 36px;
    background: #25D366;
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: background-color 0.2s ease;
    margin-left: 8px;
}

.fibik-whatsapp-send-btn:hover {
    background: #1ea952;
}

.fibik-whatsapp-send-btn svg {
    width: 16px;
    height: 16px;
}

/* Animación de pulso para el botón */
@keyframes fibik-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

.fibik-whatsapp-button.pulse {
    animation: fibik-pulse 2s infinite;
}

/* Responsive */
@media (max-width: 480px) {
    #fibik-floating-whatsapp {
        bottom: 15px;
        right: 15px;
    }
    
    .fibik-whatsapp-widget {
        width: 280px;
        bottom: 75px;
    }
    
    .fibik-whatsapp-button {
        width: 55px;
        height: 55px;
    }
    
    .fibik-whatsapp-button svg {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 360px) {
    .fibik-whatsapp-widget {
        width: 260px;
        right: -10px;
    }
}

/* Estados de carga */
.fibik-whatsapp-send-btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

.fibik-whatsapp-send-btn.loading svg {
    animation: fibik-spin 1s linear infinite;
}

@keyframes fibik-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Mejoras de accesibilidad */
.fibik-whatsapp-button:focus,
.fibik-whatsapp-send-btn:focus,
.fibik-whatsapp-input:focus {
    outline: 2px solid #25D366;
    outline-offset: 2px;
}

/* Modo oscuro (opcional) */
@media (prefers-color-scheme: dark) {
    .fibik-whatsapp-widget {
        background: #1a1a1a;
        color: #ffffff;
    }
    
    .fibik-whatsapp-message {
        background: #2d2d2d;
        color: #ffffff;
    }
    
    .fibik-whatsapp-input-container {
        background: #2d2d2d;
        border-color: #404040;
    }
    
    .fibik-whatsapp-input {
        color: #ffffff;
    }
    
    .fibik-whatsapp-input::placeholder {
        color: #a0a0a0;
    }
}
