/**
 * WhatsApp Floating Button PRO - Frontend Styles
 * Stili per il pulsante flottante e menu numeri multipli
 */

/* Overlay Menu */
.wfb-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wfb-menu-overlay.wfb-show {
    opacity: 1;
}

/* Menu Numeri Multipli */
.wfb-numbers-menu {
    position: fixed;
    z-index: 99999;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: calc(100% - 40px);
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wfb-numbers-menu.wfb-show {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Posizionamento del menu */
.wfb-menu-bottom-right {
    bottom: 100px;
    right: 20px;
}

.wfb-menu-bottom-left {
    bottom: 100px;
    left: 20px;
}

.wfb-menu-top-right {
    top: 100px;
    right: 20px;
}

.wfb-menu-top-left {
    top: 100px;
    left: 20px;
}

/* Header Menu */
.wfb-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e5e5;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: white;
}

.wfb-menu-title {
    font-size: 16px;
    font-weight: 600;
}

.wfb-menu-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.wfb-menu-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Body Menu */
.wfb-menu-body {
    overflow-y: auto;
    padding: 8px 0;
}

.wfb-menu-body::-webkit-scrollbar {
    width: 6px;
}

.wfb-menu-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.wfb-menu-body::-webkit-scrollbar-thumb {
    background: #25D366;
    border-radius: 3px;
}

.wfb-menu-body::-webkit-scrollbar-thumb:hover {
    background: #128C7E;
}

/* Item Numero */
.wfb-number-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    text-decoration: none;
    color: #333;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.wfb-number-item:hover {
    background: #f5f5f5;
    border-left-color: #25D366;
}

.wfb-number-item:active {
    background: #e8f5e9;
}

/* Icona Numero */
.wfb-number-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    transition: transform 0.2s ease;
}

.wfb-number-item:hover .wfb-number-icon {
    transform: scale(1.1);
}

.wfb-number-icon svg {
    width: 100%;
    height: 100%;
    color: white;
}

/* Info Numero */
.wfb-number-info {
    flex: 1;
    min-width: 0;
}

.wfb-number-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wfb-number-department {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Freccia */
.wfb-number-arrow {
    flex-shrink: 0;
    color: #25D366;
    font-size: 20px;
    font-weight: bold;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.2s ease;
}

.wfb-number-item:hover .wfb-number-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Responsive Mobile */
@media (max-width: 768px) {
    .wfb-numbers-menu {
        max-width: none;
        width: calc(100% - 20px);
        left: 10px !important;
        right: 10px !important;
        bottom: 10px !important;
        top: auto !important;
    }
    
    .wfb-menu-header {
        padding: 14px 16px;
    }
    
    .wfb-menu-title {
        font-size: 15px;
    }
    
    .wfb-number-item {
        padding: 10px 16px;
    }
    
    .wfb-number-icon {
        width: 40px;
        height: 40px;
        padding: 9px;
    }
    
    .wfb-number-name {
        font-size: 14px;
    }
    
    .wfb-number-department {
        font-size: 12px;
    }
}

/* Animazione entrata pulsante principale */
.wfb-floating-button {
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.wfb-floating-button.wfb-show {
    opacity: 1;
    transform: scale(1);
}

/* Badge per numero attivo */
.wfb-numbers-menu::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    top: 24px;
    right: 60px;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

/* Stato vuoto */
.wfb-menu-empty {
    padding: 40px 20px;
    text-align: center;
    color: #999;
}

.wfb-menu-empty svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* Accessibility */
.wfb-number-item:focus {
    outline: 2px solid #25D366;
    outline-offset: -2px;
}

.wfb-menu-close:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .wfb-numbers-menu {
        background: #1e1e1e;
        color: #fff;
    }
    
    .wfb-menu-header {
        border-bottom-color: #333;
    }
    
    .wfb-number-item {
        color: #fff;
    }
    
    .wfb-number-item:hover {
        background: #2a2a2a;
    }
    
    .wfb-number-item:active {
        background: #1a3a1a;
    }
    
    .wfb-number-name {
        color: #fff;
    }
    
    .wfb-number-department {
        color: #aaa;
    }
}

/* Shortcode Button Styles */
.wfb-shortcode-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: #25D366;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.wfb-shortcode-button:hover {
    background: #128C7E;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    color: white;
}

.wfb-shortcode-button .wfb-icon {
    width: 24px;
    height: 24px;
}

.wfb-btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.wfb-btn-small .wfb-icon {
    width: 18px;
    height: 18px;
}

.wfb-btn-large {
    padding: 16px 32px;
    font-size: 18px;
}

.wfb-btn-large .wfb-icon {
    width: 28px;
    height: 28px;
}

/* Floating Button Styles */
.wfb-floating-button {
    position: fixed;
    z-index: 9999;
    transition: all 0.3s ease;
}

.wfb-floating-button a {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #25D366;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    text-decoration: none;
}

.wfb-floating-button:hover a {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.wfb-floating-button svg {
    width: 100%;
    height: 100%;
    color: white;
}

/* Posizioni */
.wfb-position-bottom-right {
    bottom: 20px;
    right: 20px;
}

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

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

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

/* Temi */
.wfb-theme-minimal a {
    background: white;
    border: 2px solid #25D366;
}

.wfb-theme-minimal svg {
    color: #25D366;
}

.wfb-theme-gradient a {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
}

.wfb-theme-pulse a {
    animation: wfb-pulse 2s infinite;
}

@keyframes wfb-pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0,0,0,0.15), 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    50% {
        box-shadow: 0 4px 12px rgba(0,0,0,0.15), 0 0 0 10px rgba(37, 211, 102, 0);
    }
}

.wfb-theme-dark a {
    background: #128C7E;
}

/* Tooltip */
.wfb-tooltip {
    position: absolute;
    right: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.wfb-position-bottom-left .wfb-tooltip,
.wfb-position-top-left .wfb-tooltip {
    right: auto;
    left: calc(100% + 10px);
}

.wfb-floating-button:hover .wfb-tooltip {
    opacity: 1;
}

.wfb-tooltip:after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 5px solid #333;
}

.wfb-position-bottom-left .wfb-tooltip:after,
.wfb-position-top-left .wfb-tooltip:after {
    right: auto;
    left: -5px;
    border-left: none;
    border-right: 5px solid #333;
}
