/**
 * WhatsApp Chat Flutuante - Widget CSS
 * Estilo do botão flutuante e card de departamentos
 */

/* ===================================
   BOTÃO FLUTUANTE
=================================== */
.wcf-widget {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Posicionamentos */
.wcf-position-bottom-right {
    bottom: 20px;
    right: 20px;
}

.wcf-position-bottom-left {
    bottom: 20px;
    left: 20px;
}

.wcf-position-top-right {
    top: 20px;
    right: 20px;
}

.wcf-position-top-left {
    top: 20px;
    left: 20px;
}

/* Botão Principal */
.wcf-button {
    position: relative;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: white;
    font-size: 28px;
    outline: none;
}

.wcf-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.wcf-button:active {
    transform: scale(0.95);
}

/* Ícones do Botão */
.wcf-icon-open,
.wcf-icon-close {
    position: absolute;
    transition: all 0.3s ease;
}

.wcf-icon-open {
    opacity: 1;
    transform: rotate(0deg);
}

.wcf-icon-close {
    opacity: 0;
    transform: rotate(90deg);
}

.wcf-button.active .wcf-icon-open {
    opacity: 0;
    transform: rotate(-90deg);
}

.wcf-button.active .wcf-icon-close {
    opacity: 1;
    transform: rotate(0deg);
}

/* ===================================
   ANIMAÇÕES DO BOTÃO
=================================== */
@keyframes wcfBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes wcfPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes wcfFadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.wcf-widget[data-animation="bounce"] .wcf-button {
    animation: wcfBounce 2s infinite;
}

.wcf-widget[data-animation="pulse"] .wcf-button {
    animation: wcfPulse 2s infinite;
}

.wcf-widget[data-animation="fade"] .wcf-button {
    animation: wcfFadeIn 0.5s ease-out;
}

/* ===================================
   CARD DE ATENDIMENTO
=================================== */
.wcf-card-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 360px;
    max-width: calc(100vw - 40px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
}

.wcf-position-bottom-left .wcf-card-container {
    right: auto;
    left: 0;
}

.wcf-position-top-right .wcf-card-container {
    bottom: auto;
    top: 80px;
}

.wcf-position-top-left .wcf-card-container {
    bottom: auto;
    top: 80px;
    right: auto;
    left: 0;
}

.wcf-card-container.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Cabeçalho do Card */
.wcf-card-header {
    padding: 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
}

.wcf-header-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.wcf-header-text h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
}

.wcf-header-text p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

/* Tempo de Resposta */
.wcf-response-time {
    padding: 12px 20px;
    background: #f8f9fa;
    text-align: center;
    font-size: 13px;
    color: #666;
    border-bottom: 1px solid #e9ecef;
}

/* Lista de Departamentos */
.wcf-departments {
    padding: 8px 0;
}

.wcf-department-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 16px 20px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

.wcf-department-item:last-child {
    border-bottom: none;
}

.wcf-department-item:hover {
    background: #f8f9fa;
    padding-left: 25px;
}

.wcf-dept-icon {
    width: 45px;
    height: 45px;
    background: #e8f5e9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #128C7E;
    flex-shrink: 0;
}

.wcf-dept-info {
    flex: 1;
}

.wcf-dept-info h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.wcf-dept-info p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.wcf-dept-arrow {
    color: #25D366;
    font-size: 22px;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.wcf-department-item:hover .wcf-dept-arrow {
    opacity: 1;
    transform: translateX(5px);
}

/* ===================================
   RESPONSIVO
=================================== */
@media (max-width: 480px) {
    .wcf-widget {
        bottom: 15px !important;
        right: 15px !important;
    }
    
    .wcf-position-bottom-left {
        left: 15px !important;
    }
    
    .wcf-card-container {
        width: calc(100vw - 30px);
        bottom: 75px;
    }
    
    .wcf-button {
        width: 55px !important;
        height: 55px !important;
        font-size: 24px;
    }
    
    .wcf-card-header {
        padding: 15px;
    }
    
    .wcf-header-icon {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .wcf-header-text h3 {
        font-size: 16px;
    }
    
    .wcf-header-text p {
        font-size: 13px;
    }
    
    .wcf-department-item {
        padding: 14px 15px;
    }
    
    .wcf-dept-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .wcf-card-container {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* ===================================
   ACESSIBILIDADE
=================================== */
.wcf-button:focus {
    outline: 2px solid rgba(0, 0, 0, 0.2);
    outline-offset: 3px;
}

.wcf-department-item:focus {
    outline: 2px solid rgba(0, 0, 0, 0.1);
    outline-offset: -2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .wcf-button {
        border: 2px solid white;
    }
    
    .wcf-card-container {
        border: 2px solid #333;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .wcf-button,
    .wcf-card-container,
    .wcf-department-item,
    .wcf-dept-arrow {
        animation: none !important;
        transition: none !important;
    }
}
