/* ==========================================================================
   Floating Menu - Vertical Theme
   ========================================================================== */

/* Container */
.floating-menu-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100; /* Ensure it's above most content */
}

/* Main UL */
.floating-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column; /* Stack top-level items vertically */
    align-items: flex-end;  /* Align items to the right */
}

/* All List Items (Top + Sub) */
.floating-menu li.menu-item {
    margin: 0;
    padding: 0;
    position: relative; /* Needed for absolute positioning of submenu and tooltips */
    margin-top: 10px;   /* Spacing between bubbles */
}

/* ==========================================================================
   MUTUALIZED "BUBBLE" STYLES (shared between top-level bubbles and subitems)
   ========================================================================== */

/* Base bubble styles for any menu link (top-level + sub-menu items) */
.floating-menu li.menu-item > a {
    display: flex; /* Use flex for centering content */
    justify-content: center;
    align-items: center;
    border-radius: 50%; /* Make it round */
    background-color: var(--floating-btn-bg-color, var(--bg-color, white));
    color: var(--floating-btn-text-color, var(--main-color, black));
    text-decoration: none;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    position: relative; /* For tooltip positioning */
    z-index: 2;         /* Above submenu */
    padding: 0;
    white-space: normal;
    font-size: inherit;
}

/* Base hover (shadow differs by level, so only bg/text here) */
.floating-menu li.menu-item > a:hover {
    background-color: var(--floating-btn-hover-bg-color, var(--hover-bg-color, #CCC));
    color: var(--floating-btn-hover-text-color, var(--hover-text-color, black));
}

/* ==========================================================================
   TOP LEVEL (Bubbles)
   ========================================================================== */

.floating-menu > li.menu-item > a {
    width: 50px;  /* Bubble size */
    height: 50px; /* Bubble size */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.floating-menu > li.menu-item > a svg{
    width: 22px;
    height: 22px;
}
.floating-menu > li.menu-item > a:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

/* Title inside the link (if not icon-only) */
.floating-menu a .menu-item-title {
    /* This span will be empty for icon-only items due to PHP filter */
    font-size: 12px; /* Example size if shown */
    text-align: center;
}

/* ==========================================================================
   SUBMENU CONTAINER
   ========================================================================== */

.floating-menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0; /* Remove padding */
    position: absolute;
    bottom: calc(100% + 10px); /* Position above the parent bubble with gap */
    right: 0; /* Align with the right edge of the parent */

    /* Hidden by default */
    display: none;
    z-index: 1; /* Below the main toggle button */
    opacity: 0;
    transform: translateY(10px); /* Start slightly lower */
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;

    /* Layout when shown */
    flex-direction: column;
    align-items: flex-end; /* Align bubbles to the right */
}

.floating-menu li.menu-item.is-open > .sub-menu {
    display: flex; /* Show as flex container when parent has .is-open */
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   SUBMENU ITEMS (Bubbles)
   ========================================================================== */

.floating-menu .sub-menu li.menu-item > a {
    width: 45px; /* Slightly smaller bubbles */
    height: 45px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Submenu hover shadow is intentionally lighter than top-level  */
.floating-menu .sub-menu li.menu-item > a:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Submenu Icons (if svg-icons.js injects an svg) */
.floating-menu .sub-menu li.menu-item a svg {
    width: 20px; /* Adjust icon size for smaller bubble */
    height: 20px;
    fill: currentColor;
    margin-right: 0; /* No margin needed */
}

/* Hide title text in submenu bubbles */
.floating-menu .sub-menu li.menu-item a .menu-item-title {
    display: none;
}

/* ==========================================================================
   TOOLTIPS (using data-description) - preserves original positioning logic
   ========================================================================== */
.floating-menu a[data-description]::after {
    content: attr(data-description);
    position: absolute;
    bottom: 50%; /* Center vertically (original top-level behavior) */
    right: calc(100% + 10px); /* Position to the left of the item */
    transform: translateY(50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none; /* Prevent tooltip from interfering with hover */
    z-index: 10; /* Above other elements */
}

/* Tooltips for Submenu Items (adjust position) */
.floating-menu .sub-menu a[data-description]::after {
    bottom: auto; /* Reset bottom */
    top: 50%;     /* Center vertically */
    right: calc(100% + 10px); /* Position to the left */
    transform: translateY(-50%); /* Adjust vertical centering */
}

.floating-menu a[data-description]:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Hide WP Core Classes visually if needed (though filtering them out in PHP is better) */
.floating-menu .current-menu-item > a,
.floating-menu .current-menu-parent > a,
.floating-menu .current-menu-ancestor > a {
    /* Add specific styling for active states if desired, e.g., different background */
}

/* Print styles */
@media print {
    .floating-menu-container {
        display: none;
    }
}
