/**
 * WhatsApp Integration Styles
 * Arquivo: public/css/whatsapp-integration.css
 */

/* === ESTILOS PRINCIPAIS === */
.whatsapp-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: #25D366;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.whatsapp-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 211, 102, 0.3), transparent);
    transition: left 0.5s;
}

.whatsapp-link:hover::before {
    left: 100%;
}

.whatsapp-link:hover {
    color: #128C7E;
    background-color: rgba(37, 211, 102, 0.1);
    text-decoration: none;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
}

.whatsapp-icon {
    margin-right: 6px;
    font-size: 16px;
    animation: pulse 2s infinite;
    position: relative;
    z-index: 1;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.whatsapp-link:hover .whatsapp-icon {
    animation: bounce 0.6s ease-in-out;
    transform: scale(1.2);
}

@keyframes bounce {
    0%, 20%, 60%, 100% { transform: translateY(0) scale(1.2); }
    40% { transform: translateY(-3px) scale(1.3); }
    80% { transform: translateY(-1px) scale(1.25); }
}

/* === CONTAINER DO TELEFONE === */
.phone-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.phone-number {
    color: #6c757d;
    font-size: 0.875rem;
    position: relative;
    z-index: 1;
}

/* === BOTÃO DE COPIAR === */
.copy-phone-btn {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 12px;
    position: relative;
    z-index: 1;
}

.copy-phone-btn:hover {
    color: #495057;
    background-color: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.copy-phone-btn:active {
    transform: scale(0.95);
}

/* === ESTADOS ESPECIAIS === */
.whatsapp-link.loading {
    pointer-events: none;
    opacity: 0.7;
}

.whatsapp-link.loading .whatsapp-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* === BADGE DE STATUS ONLINE === */
.whatsapp-status {
    position: relative;
}

.whatsapp-status::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background-color: #25D366;
    border: 2px solid white;
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

/* === VARIAÇÕES DE TAMANHO === */
.whatsapp-link.sm {
    padding: 2px 4px;
    font-size: 0.75rem;
}

.whatsapp-link.sm .whatsapp-icon {
    font-size: 12px;
    margin-right: 4px;
}

.whatsapp-link.lg {
    padding: 8px 12px;
    font-size: 1.1rem;
}

.whatsapp-link.lg .whatsapp-icon {
    font-size: 20px;
    margin-right: 8px;
}

/* === BOTÃO FLUTUANTE WHATSAPP === */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
    text-decoration: none;
    color: white;
    font-size: 24px;
}

.whatsapp-float:hover {
    background-color: #128C7E;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
    color: white;
    text-decoration: none;
}

.whatsapp-float .fa-whatsapp {
    animation: pulse 2s infinite;
}

/* === TOOLTIP PERSONALIZADO === */
.whatsapp-tooltip {
    position: relative;
}

.whatsapp-tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1001;
}

.whatsapp-tooltip::after {
    content: '';
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #333;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.whatsapp-tooltip:hover::before,
.whatsapp-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* === TOAST CUSTOMIZADO === */
.whatsapp-toast {
    background-color: #25D366;
    color: white;
    border: none;
}

.whatsapp-toast .toast-header {
    background-color: #128C7E;
    color: white;
    border-bottom: none;
}

.whatsapp-toast .btn-close {
    filter: invert(1);
}

/* === RESPONSIVIDADE === */
@media (max-width: 768px) {
    .phone-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .whatsapp-link {
        font-size: 0.8rem;
        padding: 3px 6px;
    }
    
    .whatsapp-icon {
        font-size: 14px;
        margin-right: 4px;
    }
    
    .copy-phone-btn {
        font-size: 10px;
        padding: 2px;
    }
    
    .whatsapp-float {
        width: 50px;
        height: 50px;
        font-size: 20px;
        bottom: 15px;
        right: 15px;
    }
}

@media (max-width: 576px) {
    .whatsapp-link {
        width: 100%;
        justify-content: flex-start;
        margin-bottom: 2px;
    }
    
    .phone-container {
        width: 100%;
    }
}

/* === TEMA ESCURO === */
@media (prefers-color-scheme: dark) {
    .whatsapp-link {
        color: #4FD673;
    }
    
    .whatsapp-link:hover {
        color: #25D366;
        background-color: rgba(79, 214, 115, 0.2);
    }
    
    .copy-phone-btn {
        color: #adb5bd;
    }
    
    .copy-phone-btn:hover {
        color: #dee2e6;
        background-color: rgba(255, 255, 255, 0.1);
    }
    
    .phone-number {
        color: #adb5bd;
    }
}

/* === ANIMAÇÕES DE ENTRADA === */
.whatsapp-animate-in {
    animation: slideInFromRight 0.5s ease-out;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* === INDICADOR DE CARREGAMENTO === */
.whatsapp-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #25D366;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* === EFEITOS VISUAIS AVANÇADOS === */
.whatsapp-link.premium {
    background: linear-gradient(45deg, #25D366, #128C7E);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.whatsapp-link.premium:hover {
    background: linear-gradient(45deg, #128C7E, #0a5d54);
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
}

.whatsapp-link.premium .whatsapp-icon {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* === CONTADOR DE MENSAGENS === */
.whatsapp-counter {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    animation: pulse 1s infinite;
}

/* === INTEGRAÇÃO COM TABELAS === */
.table .whatsapp-link {
    white-space: nowrap;
}

.table-sm .whatsapp-link {
    padding: 2px 4px;
    font-size: 0.75rem;
}

.table-sm .whatsapp-icon {
    font-size: 12px;
    margin-right: 3px;
}

/* === ESTADOS DE FOCO === */
.whatsapp-link:focus {
    outline: 2px solid rgba(37, 211, 102, 0.5);
    outline-offset: 2px;
}

.copy-phone-btn:focus {
    outline: 1px solid rgba(108, 117, 125, 0.5);
    outline-offset: 1px;
}