/* Chat Widget Styles - Similar to modern chat widgets */
#chat-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#chat-widget-popup {
    display: none;
    position: absolute;
    bottom: 5px;
    right: 0;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.05);
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

#chat-widget-popup.show {
    display: block;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chat-widget-header {
    background: linear-gradient(135deg, #007AFF 0%, #0051D5 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.chat-widget-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-widget-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.chat-widget-close:hover {
    background: rgba(255,255,255,0.1);
}

.chat-widget-body {
    height: calc(100% - 68px);
    position: relative;
}

.chat-widget-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #f8f9fa;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    #chat-widget-popup {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        animation: slideUpMobile 0.3s ease-out;
        z-index: 9999; /* Higher than overlay */
        pointer-events: auto; /* Ensure popup can receive clicks */
    }
    
    @keyframes slideUpMobile {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    #chat-widget-container {
        bottom: 20px;
        right: 20px;
    }
}

/* Overlay for mobile */
/* Overlay for mobile */
#chat-widget-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 9998;
}

#chat-widget-overlay.show {
    display: block;
    pointer-events: none; /* This allows clicks to pass through to the popup */
}

/* Notification badge */
.chat-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #FF3B30;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}


/* Floating Chat Button */
#chat-widget-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #007AFF 0%, #0051D5 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 122, 255, 0.3);
    z-index: 9999;
    transition: all 0.3s ease;
}

#chat-widget-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 122, 255, 0.4);
}

#chat-widget-button i {
    color: white;
    font-size: 24px;
}

/* Hide floating button when chat is open */
#chat-widget-container.chat-open #chat-widget-button {
    display: none;
}

/* Mobile adjustments */
@media (max-width: 480px) {
    #chat-widget-button {
        width: 56px;
        height: 56px;
        bottom: 16px;
        right: 16px;
    }
    
    #chat-widget-button i {
        font-size: 22px;
    }
}
