/**
 * Floating Button Widget Styles
 * @package FloatingButtonWidget
 */

/* ==========================================================================
   Floating Button Styles
   ========================================================================== */

.floating-button-widget {
    position: fixed;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    bottom: 30px;
    background-color: #007cba;
}

.floating-button-widget.floating-btn-left {
    left: 30px;
}

.floating-button-widget.floating-btn-right {
    right: 30px;
}

.floating-button-widget:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.floating-button-widget .button-icon {
    width: 30px;
    height: 30px;
    max-width: 30px;
    max-height: 30px;
    object-fit: contain;
}

.floating-button-widget .default-icon {
    color: white;
    font-size: 24px;
}

/* Button state when chat is open */
.floating-button-widget.chat-open {
    background-color: #dc3545;
    transform: rotate(45deg);
}

.floating-button-widget.chat-open .default-icon {
    transform: rotate(-45deg);
}

.floating-button-widget.chat-open .button-icon {
    transform: rotate(-45deg);
}

/* ==========================================================================
   Chat Widget Styles
   ========================================================================== */

.chat-widget-widget {
    position: fixed;
    bottom: 100px;
    width: 400px;
    max-width: 90vw;
    height: 600px;
    max-height: 80vh;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    z-index: 10000;
    display: none;
    border: 1px solid rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.chat-widget-widget.open {
    display: block;
    animation: slideUpIn 0.3s ease-out;
}

.chat-widget-container-widget {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.chat-header-widget {
    background: #007cba;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-radius: 12px 12px 0 0;
}

.chat-title-widget {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.chat-close-widget {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 20px;
    font-weight: bold;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.chat-close-widget:hover {
    background: rgba(255,255,255,0.2);
}

.chat-iframe-widget {
    width: 100%;
    height: 100%;
    border: none;
    flex: 1;
}

/* ==========================================================================
   Notification Popup Styles
   ========================================================================== */

.notification-popup-widget {
    position: fixed;
    bottom: 100px;
    background: white;
    color: #333;
    padding: 16px 20px 16px 60px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    z-index: 9998;
    display: none;
    max-width: 320px;
    min-width: 280px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    animation: slideInBounce 0.4s ease-out;
    border: 1px solid rgba(0,0,0,0.1);
}

.notification-popup-widget.show {
    display: block;
}

/* Speech bubble tail */
.notification-popup-widget:after {
    content: '';
    position: absolute;
    bottom: -8px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

.notification-message-widget {
    margin: 0;
    line-height: 1.4;
    transition: opacity 0.2s ease;
    color: #333;
    cursor: pointer;
    font-weight: 500;
}

.notification-message-widget:hover {
    opacity: 0.8;
}

.notification-profile-widget {
    position: absolute;
    left: 16px;
    top: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #666;
    overflow: hidden;
}

.notification-profile-widget img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.notification-profile-widget:after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
    border: 2px solid white;
}

.notification-close-widget {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #f0f0f0;
    color: #666;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.notification-close-widget:hover {
    background: #e0e0e0;
    transform: scale(1.1);
}

/* ==========================================================================
   Animations
   ========================================================================== */

@keyframes slideUpIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideInBounce {
    0% {
        transform: translateY(20px) scale(0.9);
        opacity: 0;
    }
    60% {
        transform: translateY(-3px) scale(1.02);
        opacity: 1;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media screen and (max-width: 768px) {
    .chat-widget-widget {
        width: calc(100vw - 20px);
        height: 70vh;
        bottom: 80px;
        left: 10px !important;
        right: 10px !important;
    }
    
    .floating-button-widget {
        width: 50px;
        height: 50px;
        bottom: 20px;
    }
    
    .floating-button-widget.floating-btn-left {
        left: 20px;
    }
    
    .floating-button-widget.floating-btn-right {
        right: 20px;
    }
    
    .floating-button-widget .button-icon {
        width: 25px;
        height: 25px;
    }
    
    .floating-button-widget .default-icon {
        font-size: 20px;
    }
    
    .chat-header-widget {
        padding: 12px 15px;
    }
    
    .chat-title-widget {
        font-size: 14px;
    }

    /* Notification responsive styles */
    .notification-popup-widget {
        left: 20px !important;
        right: 20px !important;
        bottom: 80px;
        max-width: calc(100vw - 40px);
        min-width: auto;
        padding: 14px 16px 14px 54px;
        font-size: 12px;
    }
    
    .notification-profile-widget {
        width: 28px;
        height: 28px;
        left: 12px;
        top: 14px;
    }
    
    .notification-close-widget {
        width: 18px;
        height: 18px;
        font-size: 16px;
        top: 3px;
        right: 3px;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .floating-button-widget,
    .chat-widget-widget,
    .notification-popup-widget {
        transition: none !important;
        animation: none !important;
    }
}

.floating-button-widget:focus,
.chat-close-widget:focus,
.notification-close-widget:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .floating-button-widget,
    .chat-widget-widget,
    .notification-popup-widget {
        border: 2px solid currentColor;
    }
}
