/* Floating Widget Styles */
.fw-widget {
    position: fixed;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Desktop Alignment */
.fw-right {
    right: 20px;
    bottom: 20px;
}

.fw-left {
    left: 20px;
    bottom: 20px;
}

.fw-top {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.fw-bottom {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

/* Widget Icon */
.fw-icon {
    width: 60px;
    height: 60px;
    background: #007cba;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    border: 3px solid white;
    overflow: hidden;
}

.fw-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.fw-icon img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    display: block;
}

/* Make sure white icons are visible on blue background */
.fw-icon img[src*=".svg"] {
    filter: brightness(0) invert(1);
}

/* Widget Content */
.fw-content {
    position: absolute;
    width: 300px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

/* Content positioning */
.fw-right .fw-content {
    bottom: 70px;
    right: 0;
}

.fw-left .fw-content {
    bottom: 70px;
    left: 0;
}

.fw-top .fw-content {
    top: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
}

.fw-bottom .fw-content {
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
}

.fw-widget.active .fw-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fw-top.active .fw-content,
.fw-bottom.active .fw-content {
    transform: translateX(-50%) translateY(0);
}

/* Header */
.fw-header {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.fw-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

.fw-close {
    cursor: pointer;
    font-size: 20px;
    color: #999;
    line-height: 1;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.fw-close:hover {
    color: #333;
    background: #f0f0f0;
}

/* Body */
.fw-body {
    padding: 20px;
}

.fw-section {
    margin-bottom: 20px;
}

.fw-section:last-child {
    margin-bottom: 0;
}

.fw-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Subscription Form */
#fw-subscription-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#fw-subscription-form input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

#fw-subscription-form input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

#fw-subscription-form button {
    padding: 12px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-weight: 500;
}

#fw-subscription-form button:hover {
    background: #005a87;
}

#fw-subscription-form button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Call Button */
.fw-call-button {
    display: block;
    padding: 12px;
    background: #28a745;
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.fw-call-button:hover {
    background: #218838;
    color: white;
    text-decoration: none;
}

/* Messages */
.fw-message {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    display: none;
}

.fw-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.fw-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .fw-widget {
        left: 50% !important;
        right: auto !important;
        bottom: 20px !important;
        top: auto !important;
        transform: translateX(-50%) !important;
    }
    
    .fw-content {
        width: 90vw;
        max-width: 300px;
        bottom: 70px !important;
        left: 50% !important;
        transform: translateX(-50%) translateY(10px) !important;
    }
    
    .fw-widget.active .fw-content {
        transform: translateX(-50%) translateY(0) !important;
    }
}

/* Animation */
@keyframes fw-bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        transform: translate3d(0,-8px,0);
    }
    70% {
        transform: translate3d(0,-4px,0);
    }
    90% {
        transform: translate3d(0,-2px,0);
    }
}

.fw-icon.pulse {
    animation: fw-bounce 1s ease infinite;
}