/* Floating Contact Widget - Frontend Styles */

/* Widget Container */
.fcw-widget-container {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Animations */
.fcw-animation-fade {
    animation: fcwFadeIn 0.5s ease-out;
}

.fcw-animation-slide {
    animation: fcwSlideIn 0.5s ease-out;
}

.fcw-animation-bounce {
    animation: fcwBounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.fcw-animation-scale {
    animation: fcwScaleIn 0.4s ease-out;
}

@keyframes fcwFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fcwSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fcwBounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes fcwScaleIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Floating Button */
.fcw-widget-button {
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #fff;
    position: relative;
    overflow: visible;
}

.fcw-widget-button::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    background: inherit;
    opacity: 0.3;
    animation: fcwPulse 2.5s ease-out infinite;
}

.fcw-widget-button:hover {
    transform: scale(1.1);
    filter: brightness(1.1);
}

.fcw-widget-button:active {
    transform: scale(0.95);
}

.fcw-widget-button.active {
    transform: rotate(90deg);
}

.fcw-widget-button svg {
    fill: currentColor;
    transition: all 0.3s ease;
}

.fcw-button-icon,
.fcw-button-close {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.fcw-widget-button.active .fcw-button-icon {
    transform: rotate(90deg);
    opacity: 0;
}

.fcw-widget-button.active .fcw-button-close {
    transform: rotate(0deg);
    opacity: 1;
}

.fcw-button-close {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-90deg);
    opacity: 0;
}

/* Pulse Animation */
@keyframes fcwPulse {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }

    50% {
        transform: scale(1.15);
        opacity: 0;
    }

    100% {
        transform: scale(1.15);
        opacity: 0;
    }
}

/* Contact Panel */
.fcw-contact-panel {
    position: absolute;
    width: auto;
    min-width: 80px;
    max-width: 280px;
    max-height: 400px;
    border-radius: 12px;
    overflow: visible;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 999998;
}

/* Panel positioning based on widget position */
/* Bottom positions - panel appears ABOVE button (pop up) */
.fcw-widget-container.fcw-position-bottom-right .fcw-contact-panel {
    bottom: 100% !important;
    top: auto !important;
    right: 0;
    margin-bottom: 10px;
    transform-origin: bottom right;
    transform: translateY(10px) scale(0.95);
}

.fcw-widget-container.fcw-position-bottom-left .fcw-contact-panel {
    bottom: 100% !important;
    top: auto !important;
    left: 0;
    margin-bottom: 10px;
    transform-origin: bottom left;
    transform: translateY(10px) scale(0.95);
}

/* Top positions - panel appears BELOW button (drop down) */
.fcw-widget-container.fcw-position-top-right .fcw-contact-panel {
    top: 100% !important;
    bottom: auto !important;
    right: 0;
    margin-top: 10px;
    transform-origin: top right;
    transform: translateY(-10px) scale(0.95);
}

.fcw-widget-container.fcw-position-top-left .fcw-contact-panel {
    top: 100% !important;
    bottom: auto !important;
    left: 0;
    margin-top: 10px;
    transform-origin: top left;
    transform: translateY(-10px) scale(0.95);
}

.fcw-contact-panel.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

/* Panel Animations */
.fcw-panel-animation-fade.open {
    animation: fcwPanelFadeIn 0.3s ease-out forwards;
}

.fcw-panel-animation-slide.open {
    animation: fcwPanelSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.fcw-panel-animation-scale.open {
    animation: fcwPanelScaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.fcw-panel-animation-bounce.open {
    animation: fcwPanelBounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes fcwPanelFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fcwPanelSlideIn {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fcwPanelScaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fcwPanelBounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

    50% {
        opacity: 1;
        transform: scale(1.05);
    }

    70% {
        transform: scale(0.95);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Panel Header Removed */

/* Contact Icons */
.fcw-contact-icons {
    padding: 15px 10px 10px 10px;
    max-height: 350px;
    overflow-y: auto;
    overflow-x: hidden;
}

.fcw-contact-icon {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 12px;
    text-decoration: none;
    color: inherit;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 6px;
    position: relative;
    overflow: visible;
    width: 100%;
}

.fcw-contact-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
    border-radius: 10px;
}

.fcw-contact-icon:last-child {
    margin-bottom: 0;
}

.fcw-contact-icon:hover {
    background: rgba(0, 0, 0, 0.04);
    padding-right: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.fcw-contact-icon:hover::before {
    opacity: 1;
}

.fcw-contact-icon:active {
    transform: scale(0.98);
}

.fcw-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 2;
}

.fcw-icon-wrapper::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.fcw-contact-icon:hover .fcw-icon-wrapper {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.fcw-contact-icon:hover .fcw-icon-wrapper::after {
    opacity: 1;
}

.fcw-icon-wrapper svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    position: relative;
    z-index: 1;
}

.fcw-icon-label {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 0;
    color: #333;
}

.fcw-contact-icon:hover .fcw-icon-label {
    opacity: 1;
    max-width: 200px;
    margin-left: 12px;
    color: #000;
}

/* Scrollbar Styling */
.fcw-contact-icons::-webkit-scrollbar {
    width: 6px;
}

.fcw-contact-icons::-webkit-scrollbar-track {
    background: transparent;
}

.fcw-contact-icons::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.fcw-contact-icons::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* RTL Support */
[dir="rtl"] .fcw-widget-container.fcw-position-bottom-right .fcw-contact-panel {
    right: auto;
    left: 0;
    transform-origin: bottom left;
}

[dir="rtl"] .fcw-widget-container.fcw-position-bottom-left .fcw-contact-panel {
    left: auto;
    right: 0;
    transform-origin: bottom right;
}

[dir="rtl"] .fcw-widget-container.fcw-position-top-right .fcw-contact-panel {
    right: auto;
    left: 0;
    transform-origin: top left;
}

[dir="rtl"] .fcw-widget-container.fcw-position-top-left .fcw-contact-panel {
    left: auto;
    right: 0;
    transform-origin: top right;
}

[dir="rtl"] .fcw-contact-icon:hover {
    padding-left: 15px;
    padding-right: 12px;
}

[dir="rtl"] .fcw-icon-label {
    margin-left: 0;
    margin-right: 0;
}

[dir="rtl"] .fcw-contact-icon:hover .fcw-icon-label {
    margin-left: 0;
    margin-right: 12px;
}

/* Mobile Responsive & Global Style Override */
.fcw-contact-panel {
    width: auto !important;
    background: transparent !important;
    box-shadow: none !important;
}

.fcw-contact-icons {
    padding: 0 !important;
    overflow: visible !important;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
}

/* Remove hover bg */
.fcw-contact-icon,
.fcw-contact-icon:hover {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    width: auto !important;
}

.fcw-contact-icon::before {
    display: none !important;
}

/* Hide labels */
.fcw-icon-label {
    display: none !important;
}

.fcw-icon-wrapper {
    margin: 0 !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2) !important;
}

/* Move widget up */
.fcw-widget-container.fcw-position-bottom-right,
.fcw-widget-container.fcw-position-bottom-left {
    bottom: 90px !important;
}

/* Ensure panel stays close to icons */
.fcw-widget-container.fcw-position-bottom-right .fcw-contact-panel,
.fcw-widget-container.fcw-position-bottom-left .fcw-contact-panel {
    margin-bottom: 20px !important;
}

/* Align icons based on position */
.fcw-widget-container.fcw-position-bottom-left .fcw-contact-icons {
    align-items: flex-start;
}

.fcw-widget-container.fcw-position-top-left .fcw-contact-icons {
    align-items: flex-start;
}

/* Adjust button size if needed */
.fcw-widget-button {
    width: 56px;
    height: 56px;
}

/* Accessibility */
.fcw-widget-button:focus,
.fcw-contact-icon:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {

    .fcw-widget-container,
    .fcw-widget-button,
    .fcw-contact-panel,
    .fcw-contact-icon,
    .fcw-icon-wrapper {
        animation: none !important;
        transition: none !important;
    }
}

/* Print Styles */
@media print {
    .fcw-widget-container {
        display: none !important;
    }
}