/**
 * Business Chat Widget Styles
 * Modern floating chat button with animations and multiple platform support
 */

.business-chat-widget {
    position: fixed;
    z-index: 9999;
    font-family: inherit;
}

/* Chat Button */
.chat-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.chat-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.chat-button:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.chat-button:active {
    transform: translateY(0);
}

/* Chat Icon */
.chat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #ffffff;
    transition: all 0.3s ease;
}

.chat-icon img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.chat-icon i {
    font-size: 30px;
}

/* Hover Animations */
.chat-button.hover-pulse:hover {
    animation: pulse 1s infinite;
}

.chat-button.hover-bounce:hover {
    animation: bounce 0.6s ease;
}

.chat-button.hover-shake:hover {
    animation: shake 0.6s ease;
}

.chat-button.hover-scale:hover {
    transform: scale(1.1) translateY(-2px);
}

/* Offline State */
.chat-button.offline {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    opacity: 0.7;
}

.chat-button.offline:hover {
    background: linear-gradient(135deg, #5a6268 0%, #3d4142 100%);
}

/* Chat Menu */
.chat-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    padding: 8px;
    min-width: 200px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.business-chat-widget.position-top-left .chat-menu,
.business-chat-widget.position-top-right .chat-menu {
    bottom: auto;
    top: 70px;
}

.business-chat-widget.position-bottom-left .chat-menu,
.business-chat-widget.position-top-left .chat-menu {
    right: auto;
    left: 0;
}

.chat-menu[style*="block"] {
    opacity: 1;
    transform: translateY(0);
}

/* Chat Menu Items */
.chat-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    opacity: 0;
    transform: translateX(-10px);
    margin-bottom: 4px;
}

.chat-menu-item:last-child {
    margin-bottom: 0;
}

.chat-menu-item.show {
    opacity: 1;
    transform: translateX(0);
}

.chat-menu-item:hover {
    background: #f8f9fa;
    transform: translateX(4px);
}

.chat-menu-item .chat-icon {
    font-size: 20px;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.chat-menu-item .chat-label {
    font-size: 14px;
    font-weight: 500;
    color: #333333;
}

/* Platform-specific colors */
.chat-menu-item[data-platform="whatsapp"] .chat-icon {
    color: #25D366;
}

.chat-menu-item[data-platform="messenger"] .chat-icon {
    color: #0084FF;
}

.chat-menu-item[data-platform="telegram"] .chat-icon {
    color: #0088CC;
}

.chat-menu-item[data-platform="custom"] .chat-icon {
    color: #6c757d;
}

/* Tooltip */
.chat-tooltip {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: #333333;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 10000;
    max-width: 200px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.chat-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 20px;
    border: 5px solid transparent;
    border-top-color: #333333;
}

.business-chat-widget.position-top-left .chat-tooltip,
.business-chat-widget.position-top-right .chat-tooltip {
    bottom: auto;
    top: 70px;
    transform: translateY(-10px);
}

.business-chat-widget.position-top-left .chat-tooltip::after,
.business-chat-widget.position-top-right .chat-tooltip::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #333333;
}

.business-chat-widget.position-bottom-left .chat-tooltip,
.business-chat-widget.position-top-left .chat-tooltip {
    right: auto;
    left: 0;
}

.business-chat-widget.position-bottom-left .chat-tooltip::after,
.business-chat-widget.position-top-left .chat-tooltip::after {
    right: auto;
    left: 20px;
}

.chat-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.chat-tooltip.offline-tooltip {
    background: #dc3545;
}

.chat-tooltip.offline-tooltip::after {
    border-top-color: #dc3545;
}

.business-chat-widget.position-top-left .chat-tooltip.offline-tooltip::after,
.business-chat-widget.position-top-right .chat-tooltip.offline-tooltip::after {
    border-bottom-color: #dc3545;
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1) translateY(-2px); }
    50% { transform: scale(1.05) translateY(-2px); }
    100% { transform: scale(1) translateY(-2px); }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% { transform: translateY(-2px); }
    40%, 43% { transform: translateY(-8px); }
    70% { transform: translateY(-4px); }
    90% { transform: translateY(-2px); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0) translateY(-2px); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px) translateY(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px) translateY(-2px); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ripple Effect */
.chat-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.chat-button:active::before {
    width: 100%;
    height: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chat-button {
        width: 50px;
        height: 50px;
    }
    
    .chat-icon {
        font-size: 24px;
    }
    
    .chat-icon img {
        width: 24px;
        height: 24px;
    }
    
    .chat-menu {
        min-width: 180px;
        bottom: 60px;
    }
    
    .business-chat-widget.position-top-left .chat-menu,
    .business-chat-widget.position-top-right .chat-menu {
        top: 60px;
    }
    
    .chat-tooltip {
        bottom: 60px;
        font-size: 11px;
        padding: 6px 10px;
        max-width: 150px;
    }
    
    .business-chat-widget.position-top-left .chat-tooltip,
    .business-chat-widget.position-top-right .chat-tooltip {
        top: 60px;
    }
}

@media (max-width: 480px) {
    .chat-button {
        width: 45px;
        height: 45px;
    }
    
    .chat-icon {
        font-size: 20px;
    }
    
    .chat-icon img {
        width: 20px;
        height: 20px;
    }
    
    .chat-menu {
        min-width: 160px;
        bottom: 55px;
    }
    
    .business-chat-widget.position-top-left .chat-menu,
    .business-chat-widget.position-top-right .chat-menu {
        top: 55px;
    }
    
    .chat-menu-item {
        padding: 10px 12px;
        gap: 10px;
    }
    
    .chat-menu-item .chat-icon {
        font-size: 18px;
        width: 20px;
        height: 20px;
    }
    
    .chat-menu-item .chat-label {
        font-size: 13px;
    }
    
    .chat-tooltip {
        bottom: 55px;
        font-size: 10px;
        padding: 5px 8px;
        max-width: 120px;
    }
    
    .business-chat-widget.position-top-left .chat-tooltip,
    .business-chat-widget.position-top-right .chat-tooltip {
        top: 55px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .chat-menu {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .chat-menu-item:hover {
        background: #4a5568;
    }
    
    .chat-menu-item .chat-label {
        color: #e2e8f0;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .chat-button {
        border: 2px solid #000000;
    }
    
    .chat-menu {
        border: 2px solid #000000;
    }
    
    .chat-tooltip {
        border: 1px solid #000000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .chat-button,
    .chat-menu,
    .chat-menu-item,
    .chat-tooltip {
        transition: none;
    }
    
    .chat-button:hover {
        transform: none;
    }
    
    .chat-button.hover-pulse:hover,
    .chat-button.hover-bounce:hover,
    .chat-button.hover-shake:hover {
        animation: none;
    }
    
    .chat-button.hover-scale:hover {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .business-chat-widget {
        display: none !important;
    }
}

/* Focus Visible Support */
.chat-button:focus-visible {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.chat-menu-item:focus-visible {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Loading State */
.chat-button.loading {
    pointer-events: none;
    opacity: 0.7;
}

.chat-button.loading .chat-icon {
    animation: spin 1s linear infinite;
}

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

/* Success State */
.chat-button.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.chat-button.success .chat-icon {
    animation: pulse 0.6s ease;
}
