/* 
 * Ultimate Contact Button - Frontend Styles
 * Version 2.0.0
 */

/* Main Container (FAB) - Desktop & Mobile */
.ucb-main-container {
    position: fixed;
    z-index: 999998;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    pointer-events: none;
    /* Allow clicks to pass through to elements below */
}

/* Main Trigger (Shake & Dynamic) */
.ucb-main-trigger {
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(30, 115, 190, 0.4);
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: ucb-shake 2.5s infinite;
    pointer-events: auto;
    /* Re-enable clicks for the trigger itself */
}

@keyframes ucb-shake {

    0%,
    100% {
        transform: scale(1) rotate(0);
    }

    10%,
    20% {
        transform: scale(1.15) rotate(-6deg);
    }

    30%,
    50%,
    70%,
    90% {
        transform: scale(1.15) rotate(6deg);
    }

    40%,
    60%,
    80% {
        transform: scale(1.15) rotate(-6deg);
    }
}

.ucb-main-trigger span {
    font-size: 32px;
    color: #fff;
    transition: all 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ucb-main-trigger span svg,
.ucb-main-trigger span img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* Sub-buttons List */
.ucb-sub-buttons-list {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 5;
    pointer-events: none;
    /* Default to click-through */
}

/* Toggle Logic for CLICKING / HOVER Mode */
.ucb-mode-click .ucb-sub-buttons-list {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
}

.ucb-mode-click.active .ucb-sub-buttons-list,
.ucb-mode-click:hover .ucb-sub-buttons-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    /* Enable clicks when visible */
}

/* ALWAYS MODE LOGIC */
.ucb-mode-always .ucb-sub-buttons-list {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    /* Enable clicks in always show mode */
}

/* Sub Button Pill Style */
.ucb-sub-btn {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    background: #ffffff;
    padding: 6px;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    min-width: 52px;
    height: 52px;
    justify-content: center;
}

.ucb-sub-btn:hover {
    transform: translateX(-5px);
    background: #fdfdfd;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.ucb-icon {
    width: 40px;
    height: 40px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    /* Base for pulse effect */
    animation: ucb-icon-shake 1s infinite ease-in-out;
}

@keyframes ucb-icon-shake {

    0%,
    50%,
    100% {
        transform: rotate(0deg);
    }

    10%,
    30% {
        transform: rotate(-10deg);
    }

    20%,
    40% {
        transform: rotate(10deg);
    }
}

.ucb-icon::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(30, 115, 190, 0.5);
    animation: ucb-ripple 2s infinite;
    pointer-events: none;
}

@keyframes ucb-ripple {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

.ucb-icon svg,
.ucb-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.ucb-label {
    color: #333;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
}

/* Visibility based on Display Mode */
.ucb-mode-always .ucb-main-trigger {
    display: none;
}

.ucb-mode-always .ucb-label {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-right: 0;
}

.ucb-mode-always .ucb-sub-btn:hover .ucb-label {
    max-width: 250px;
    opacity: 1;
    margin-right: 15px;
    margin-left: 15px;
}

.ucb-mode-click .ucb-label {
    opacity: 1;
    margin-right: 15px;
}

.ucb-mode-click .ucb-sub-btn {
    padding-left: 7px;
    justify-content: flex-end;
    padding-right: 7px;
}

/* Specific Sides Alignment */
.ucb-btn-left {
    flex-direction: row;
}

.ucb-btn-left .ucb-label {
    margin-right: 0;
    /* margin-left: 15px; */
}

/* Bottom Mobile Menu Styles */
.ucb-bottom-menu-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background: #ffffff;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -3px 15px rgba(0, 0, 0, 0.12);
    z-index: 999999;
    padding: 0 5px;
    border-radius: 15px 15px 0 0;
}

.ucb-bottom-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #444;
    font-size: 12px;
    font-weight: 600;
    gap: 4px;
    flex: 1;
    transition: all 0.2s ease;
}

.ucb-bottom-menu-item:active {
    transform: scale(0.95);
    opacity: 0.8;
}

.ucb-menu-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ucb-menu-icon svg,
.ucb-menu-icon img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

/* Media Queries */
@media (min-width: 769px) {
    .ucb-bottom-menu-container {
        display: none;
    }
}

@media (max-width: 768px) {
    .ucb-hide-mobile {
        display: none !important;
    }

    /* If Bottom Menu is enabled, elevate FAB slightly if needed */
    .ucb-main-container {
        /* Optional: move FAB higher so it doesn't overlap Bottom Menu */
        /* bottom: 85px !important; */
    }
}