/* Tooltip Bubble */
.widget-tooltip {
    position: absolute;
    bottom: 80px;
    /* Above the button */
    right: 0;
    background-color: #fff;
    color: #0B0D12;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    line-height: 1.4;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    pointer-events: none;
    z-index: 10000;
    max-width: 240px;
}

.widget-tooltip.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Tooltip Arrow */
.tooltip-arrow {
    position: absolute;
    bottom: -6px;
    right: 22px;
    width: 12px;
    height: 12px;
    background-color: #fff;
    transform: rotate(45deg);
    box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.05);
}

/* Tooltip Close Button */
.tooltip-close {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 20px;
    height: 20px;
    background: #E2E8F0;
    border: 1px solid #CBD5E1;
    border-radius: 50%;
    color: #64748B;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.tooltip-close:hover {
    background: #CBD5E1;
    color: #0F172A;
}

/* Mobile: Adjust tooltip position */
@media (max-width: 480px) {
    .widget-tooltip {
        right: 0;
        /* Keep aligned to right */
        white-space: normal;
        /* Allow wrapping on small screens */
        width: 200px;
    }
}

/* Widget Container (Fixed Bottom Right) */
.contact-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
    font-family: 'Inter', sans-serif;
    pointer-events: none; /* Click through empty/invisible areas */
}

/* Toggle Button (FAB) */
.widget-trigger {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #1f4ed4;
    /* Brighter blue (always) */
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    pointer-events: auto; /* Enable clicks on the toggle button */
}

.widget-trigger:hover {
    transform: scale(1.05);
    /* background-color change removed */
}

.widget-trigger svg {
    width: 28px;
    height: 28px;
    stroke-width: 2;
}

/* Close Icon (hidden by default) */
.icon-close {
    display: none;
}

/* Rotator Container */
.icon-rotator {
    position: relative;
    width: 28px;
    height: 28px;
}

/* Individual Rotating Icons */
.rotating-icon {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    stroke-width: 2;
}

.rotating-icon.active {
    opacity: 1;
}

/* When active (open), hide rotator and show close icon */
.contact-widget.is-active .icon-rotator {
    display: none;
}

.contact-widget.is-active .icon-close {
    display: block;
}

/* Menu (Popup) */
.widget-menu {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 16px;
    width: 260px;
    display: flex;
    flex-direction: column;
    gap: 8px;

    /* Animation states */
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: bottom right;
}

.contact-widget.is-active .widget-menu {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto; /* Enable clicks when menu is open */
}

/* Menu Header */
.widget-header {
    font-size: 14px;
    color: #64748B;
    margin-bottom: 4px;
    padding: 0 8px;
}

/* Menu Links */
.widget-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    text-decoration: none;
    color: #0B0D12;
    /* --color-text */
    border-radius: 8px;
    transition: background-color 0.2s ease;
    font-weight: 500;
    font-size: 16px;
}

.widget-link:hover {
    background-color: #F1F5F9;
    /* Light gray hover */
}

/* Icons in menu */
.widget-link svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: #0B1B3A;
    /* --color-navy */
}

/* Specific styling for brand colors (optional, keeping clean mostly) */
.widget-link:hover svg {
    color: #2563EB;
    /* --color-primary */
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .contact-widget {
        bottom: 20px;
        right: 20px;
    }

    .widget-trigger {
        width: 56px;
        height: 56px;
    }
}