/**
 * BuenChat - Estilos Modo WhatsApp
 * 
 * Estilos específicos para el widget cuando está en modo de contacto WhatsApp
 * Este archivo complementa chat-widget.css
 *
 * @package BuenChat
 * @since 1.5.0
 */

/* ============================================================================
   MODO WHATSAPP - CONTENEDOR PRINCIPAL
   ============================================================================ */

#buenchat-container.mode-whatsapp {
    --whatsapp-green: #25D366;
    --whatsapp-dark-green: #128C7E;
    --whatsapp-light-green: #DCF8C6;
    --whatsapp-bg: #E5DDD5;
    --whatsapp-header: #075E54;
}

/* ============================================================================
   LAUNCHER (BOTÓN FLOTANTE) - MODO WHATSAPP
   ============================================================================ */

#buenchat-container.mode-whatsapp #buenchat-launcher {
    background: var(--whatsapp-green);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

#buenchat-container.mode-whatsapp #buenchat-launcher:hover {
    background: var(--whatsapp-dark-green);
    transform: scale(1.1);
}

#buenchat-container.mode-whatsapp #buenchat-launcher svg {
    fill: white;
}

/* ============================================================================
   VENTANA DEL CHAT - MODO WHATSAPP
   ============================================================================ */

#buenchat-container.mode-whatsapp #buenchat-window {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* Header estilo WhatsApp */
#buenchat-container.mode-whatsapp .bc-header {
    background: var(--whatsapp-header);
    padding: 12px 16px;
}

#buenchat-container.mode-whatsapp .bc-header .bc-info h3 {
    color: white;
    font-size: 16px;
    margin: 0;
}

#buenchat-container.mode-whatsapp .bc-header .bc-status {
    display: none;
    /* Ocultar status en modo WhatsApp */
}

/* Badge WHATSAPP */
.whatsapp-badge {
    display: inline-block;
    background: var(--whatsapp-green);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================================================
   CUERPO DEL WIDGET WHATSAPP
   ============================================================================ */

#buenchat-container.mode-whatsapp .bc-body {
    background: var(--whatsapp-bg);
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwgAADsIBFShKgAAAABl0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC4xMkMEa+wAAABLSURBVGhD7c8BDQAwDMCw8e/p3CRBMFt1o6Z7d9dzx/P6+EcMskAWyAJZIAtkgSyQBbJAFsgCWSALZIEskAWyQBbIAlkgC2SBLNgBLm4B/X9dYP0AAAAASUVORK5CYII=');
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* ============================================================================
   BURBUJA DE MENSAJE WHATSAPP
   ============================================================================ */

.whatsapp-message-bubble {
    background: white;
    border-radius: 8px;
    padding: 12px 14px;
    max-width: 95%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
    margin-bottom: 12px;
}

.whatsapp-message-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    width: 0;
    height: 0;
    border-top: 8px solid white;
    border-left: 8px solid transparent;
}

.whatsapp-message-bubble p {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    color: #303030;
}

.whatsapp-message-bubble p strong {
    color: #128C7E;
    font-weight: 600;
}

/* Timestamp */
.whatsapp-timestamp {
    display: block;
    text-align: right;
    font-size: 11px;
    color: #999;
    margin-top: 6px;
}

/* ============================================================================
   BOTÓN CTA WHATSAPP
   ============================================================================ */

.whatsapp-cta-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: var(--whatsapp-green);
    color: white !important;
    text-decoration: none !important;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
    margin-top: 4px;
    border: none;
    cursor: pointer;
}

.whatsapp-cta-button:hover {
    background: var(--whatsapp-dark-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.whatsapp-cta-button svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* ============================================================================
   NOTIFICACIONES - MODO WHATSAPP
   ============================================================================ */

#buenchat-container.mode-whatsapp .bc-notification {
    border-left: 4px solid var(--whatsapp-green);
}

#buenchat-container.mode-whatsapp .bc-notification .bc-notification-tag {
    background: var(--whatsapp-light-green);
    color: var(--whatsapp-dark-green);
}

/* Botones de notificación en modo WhatsApp */
#buenchat-container.mode-whatsapp .bc-notification-actions .bc-notif-btn.primary {
    background: var(--whatsapp-green);
    color: white;
}

#buenchat-container.mode-whatsapp .bc-notification-actions .bc-notif-btn.primary:hover {
    background: var(--whatsapp-dark-green);
}

/* ============================================================================
   FOOTER - OCULTO EN MODO WHATSAPP
   ============================================================================ */

#buenchat-container.mode-whatsapp .bc-footer {
    display: none;
    /* No hay input en modo WhatsApp */
}

/* ============================================================================
   ACCIONES DEL HEADER - MODO WHATSAPP
   ============================================================================ */

#buenchat-container.mode-whatsapp .bc-actions svg {
    fill: white;
    opacity: 0.8;
}

#buenchat-container.mode-whatsapp .bc-actions svg:hover {
    opacity: 1;
}

/* Ocultar botón de limpiar en modo WhatsApp */
#buenchat-container.mode-whatsapp #bc-clear {
    display: none;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 480px) {
    #buenchat-container.mode-whatsapp #buenchat-window {
        width: 100%;
        height: auto;
        max-height: 100%;
        border-radius: 0;
        right: 0;
        bottom: 0;
    }

    #buenchat-container.mode-whatsapp .bc-body {
        padding: 12px;
    }
}

/* ============================================================================
   ANIMACIONES
   ============================================================================ */

@keyframes whatsapp-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

#buenchat-container.mode-whatsapp #buenchat-launcher.pulse {
    animation: whatsapp-pulse 2s infinite;
}

/* ============================================================================
   ICONO WHATSAPP SVG
   ============================================================================ */

.whatsapp-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
}

.whatsapp-icon svg {
    fill: currentColor;
}

/* ============================================================================
   DIRECTORIO DE CONTACTOS
   ============================================================================ */
.bc-directory-list {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.bc-directory-title {
    font-size: 13px;
    color: #555;
    margin: 0 0 10px 0;
    font-weight: 600;
}

.bc-directory-item {
    display: flex;
    align-items: center;
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    text-decoration: none !important;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.bc-directory-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.bc-dir-icon {
    width: 24px;
    height: 24px;
    color: var(--whatsapp-green);
    margin-right: 12px;
    flex-shrink: 0;
}

.bc-dir-icon svg {
    fill: currentColor;
}

.bc-dir-name {
    flex-grow: 1;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.bc-dir-arrow {
    width: 16px;
    height: 16px;
    fill: #ccc;
    transition: transform 0.2s;
}

.bc-directory-item:hover .bc-dir-arrow {
    fill: var(--whatsapp-green);
    transform: translateX(4px);
}