/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   WIE Floating Menu – Frontend Styles
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ─── Base / Reset ─── */
.wfm-menu {
    --wfm-bg: #ffffff;
    --wfm-text: #0099FF;
    --wfm-icon: #0099FF;
    --wfm-radius: 16px;
    --wfm-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);

    position: fixed;
    z-index: 999999;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    transition: opacity 0.4s ease, transform 0.3s ease;
    opacity: 0;
}

.wfm-menu *,
.wfm-menu *::before,
.wfm-menu *::after {
    box-sizing: border-box;
}

/* ─── Menu Item ─── */
.wfm-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    padding: 20px 20px;
    /* border-radius: 12px; */
    transition: background 0.25s ease, transform 0.2s ease;
    position: relative;
    border-bottom: 1px solid #bfe0ff;
}

.wfm-item:last-child {
    border-bottom: 0;
}

.wfm-item:hover {
    background: rgba(0, 153, 255, 0.07);
    /* transform: scale(1.06); */
}

.wfm-item:active {
    transform: scale(0.96);
}

/* Icon */
.wfm-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    width: 42px;
    height: 42px;
    margin-bottom: 4px;
    line-height: 1;
    color: var(--wfm-icon);
}

.wfm-icon-img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 6px;
}

/* Label */
.wfm-label {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
    color: var(--wfm-text);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   DESKTOP — Side Menu (min-width: 769px)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (min-width: 769px) {
    .wfm-menu {
        top: 50%;
        transform: translateY(-50%);
        display: flex;
        flex-direction: column;
        gap: 0px;
        padding: 0px;
        background: var(--wfm-bg);
        border-radius: var(--wfm-radius);
        box-shadow: var(--wfm-shadow);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    /* Position */
    .wfm-menu.wfm-position-right {
        right: 0px;
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
        border: 1px solid #0b7be3;
    }

    .wfm-menu.wfm-position-left {
        left: 0px;
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
        border: 1px solid #0b7be3;
    }

    /* Hover: show slight left/right shift */
    .wfm-menu.wfm-position-right:hover {
        /* transform: translateY(-50%) translateX(-2px); */
    }

    .wfm-menu.wfm-position-left:hover {
        /* transform: translateY(-50%) translateX(2px); */
    }

    /* Hide on desktop if set */
    .wfm-menu.wfm-hide-desktop {
        display: none !important;
    }

    /* Hide mobile class does nothing on desktop */
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   MOBILE / TABLET — Bottom Menu (max-width: 768px)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media (max-width: 768px) {
    .wfm-menu {
        bottom: 0;
        left: 0;
        right: 0;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: stretch;
        align-items: stretch;
        padding: 0;
        background: var(--wfm-bg);
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.10);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid #0b7be3;
    }

    .wfm-item {
        flex: 1 0 25%;
        padding: 8px 4px;
        min-width: 0;
        border-right: 1px solid #bfe0ff;
        border-bottom: 1px solid #bfe0ff;
        box-sizing: border-box;
    }

    /* Remove right border on every 4th item (end of full row) and last item (end of partial row) */
    .wfm-item:nth-child(4n),
    .wfm-item:last-child {
        border-right: 0;
    }

    /* Remove bottom border on last row items */
    .wfm-item:nth-last-child(-n+4):nth-child(4n+1),
    .wfm-item:nth-last-child(-n+4):nth-child(4n+1)~.wfm-item {
        border-bottom: 0;
    }

    .wfm-icon {
        font-size: 22px;
        width: 36px;
        height: 36px;
        margin-bottom: 2px;
    }

    .wfm-icon-img {
        width: 30px;
        height: 30px;
    }

    .wfm-label {
        font-size: 10px;
        max-width: 72px;
    }

    .wfm-item:hover {
        transform: none;
    }

    .wfm-item:active {
        background: rgba(0, 153, 255, 0.1);
        transform: scale(0.95);
    }

    /* Hide on mobile if set */
    .wfm-menu.wfm-hide-mobile {
        display: none !important;
    }

    /* Body padding set dynamically by floating-menu.js based on menu height */
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Toggle Button (Show/Hide)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* Base toggle button styles */
.wfm-toggle {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--wfm-bg, #ffffff);
    border: 1px solid #0b7be3;
    color: var(--wfm-icon, #0099FF);
    cursor: pointer;
    padding: 0;
    font-size: 12px;
    z-index: 10;
    transition: transform 0.3s ease;
}

.wfm-toggle:hover {
    background: #EDF8FF;
}

/* Desktop toggle: tab on the side */
@media (min-width: 769px) {
    .wfm-toggle {
        top: 50%;
        transform: translateY(-50%);
        width: 18px;
        height: 44px;
        border-radius: 8px 0 0 8px;
    }

    /* Right-positioned menu: tab on the left edge */
    .wfm-position-right .wfm-toggle {
        left: -18px;
        border-right: 0;
    }

    /* Left-positioned menu: tab on the right edge */
    .wfm-position-left .wfm-toggle {
        right: -18px;
        left: auto;
        border-left: 0;
        border-radius: 0 8px 8px 0;
    }

    .wfm-position-left .wfm-toggle i {
        transform: rotate(180deg);
    }

    /* Collapsed desktop: slide off-screen */
    .wfm-menu.wfm-collapsed.wfm-position-right {
        transform: translateY(-50%) translateX(100%);
    }

    .wfm-menu.wfm-collapsed.wfm-position-left {
        transform: translateY(-50%) translateX(-100%);
    }

    .wfm-menu.wfm-collapsed .wfm-toggle {
        /* keep toggle visible when collapsed */
    }

    /* Rotate arrow icon when collapsed */
    .wfm-menu.wfm-collapsed.wfm-position-right .wfm-toggle i {
        transform: rotate(180deg);
    }

    .wfm-menu.wfm-collapsed.wfm-position-left .wfm-toggle i {
        transform: rotate(0deg);
    }
}

/* Mobile toggle: tab on top center */
@media (max-width: 768px) {
    .wfm-menu {
        transition: transform 0.3s ease, opacity 0.4s ease;
    }

    .wfm-toggle {
        top: -22px;
        left: 50%;
        transform: translateX(-50%);
        width: 44px;
        height: 22px;
        border-radius: 8px 8px 0 0;
        border-bottom: 0;
    }

    .wfm-toggle i {
        transform: rotate(90deg);
    }

    /* Collapsed mobile: slide down off screen */
    .wfm-menu.wfm-collapsed {
        transform: translateY(100%);
    }

    .wfm-menu.wfm-collapsed .wfm-toggle {
        /* keep toggle visible */
        transform: translateX(-50%);
    }

    /* Rotate arrow when collapsed */
    .wfm-menu.wfm-collapsed .wfm-toggle i {
        transform: rotate(-90deg);
    }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Print: hide
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
@media print {
    .wfm-menu {
        display: none !important;
    }
}