/**
 * Floating Vertical Navigation Component Styles
 * Theme: Artima Child (RizQ Group)
 * Brand Color: #906E50 (theme primary)
 *
 * @version 2.0.0
 */

/* ==========================================================================
   Floating Vertical Navigation
   ========================================================================== */

.floating-vertical-nav {
    position: fixed;
    right: 0;
    top: 80%;
    transform: translateY(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

.floating-vertical-nav * {
    box-sizing: border-box;
}

.floating-vertical-nav ul,
.floating-vertical-nav li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.floating-nav-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: auto;
}

/* ==========================================================================
   Navigation Button Base
   ========================================================================== */

.floating-nav-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background-color: #572f20;
    color: #ffffff;
    text-decoration: none;
    /* Rounded left edges — looks like a side tab */
    border-radius: 10px 0 0 10px;
    /* Smooth cubic-bezier for a premium feel */
    transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        background-color 0.25s ease,
        box-shadow 0.25s ease;
    overflow: visible;
    outline: none;
}

.floating-nav-btn:hover,
.floating-nav-btn:focus-visible {
    background-color: #572f20;
    /* ~15% darker shade of #906E50 */
    width: 58px;
    box-shadow: -4px 4px 18px rgba(144, 110, 80, 0.38);
    color: #ffffff;
    text-decoration: none;
}

.floating-nav-btn:active {
    transform: scale(0.94);
    transition: transform 0.1s ease;
}

/* ==========================================================================
   SVG Icons
   ========================================================================== */

.floating-nav-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    /* Keep icon centered even when button width grows */
    position: relative;
    z-index: 1;
}

.floating-nav-btn:hover svg,
.floating-nav-btn:focus-visible svg {
    transform: scale(1.12);
}

/* ==========================================================================
   CSS-Only Tooltip
   Slides out to the left on hover.
   ========================================================================== */

.floating-nav-btn::before {
    /* Text content set via data-tooltip attribute */
    content: attr(data-tooltip);
    position: absolute;
    /* Start just off the left edge, hidden */
    right: calc(100% + 6px);
    top: 50%;
    transform: translateY(-50%) translateX(8px);
    /* Styling */
    background-color: #7a5c42;
    color: #ffffff;
    padding: 5px 12px;
    border-radius: 6px;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
    white-space: nowrap;
    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    /* Animate slide + fade */
    transition: opacity 0.22s ease,
        visibility 0.22s ease,
        transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
}

/* Small arrow pointing right toward the button */
.floating-nav-btn::after {
    content: '';
    position: absolute;
    right: calc(100% + 2px);
    top: 50%;
    transform: translateY(-50%) translateX(8px);
    border: 5px solid transparent;
    border-left-color: #7a5c42;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease,
        visibility 0.22s ease,
        transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
}

/* Reveal tooltip on hover */
.floating-nav-btn:hover::before,
.floating-nav-btn:focus-visible::before {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

.floating-nav-btn:hover::after,
.floating-nav-btn:focus-visible::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* ==========================================================================
   Responsive — Tablet (≤ 768px): smaller buttons, hide tooltips
   ========================================================================== */

@media (max-width: 768px) {
    .floating-vertical-nav {
        right: 0;
    }

    .floating-nav-btn {
        width: 40px;
        height: 40px;
    }

    .floating-nav-btn:hover,
    .floating-nav-btn:focus-visible {
        width: 46px;
    }

    .floating-nav-btn svg {
        width: 17px;
        height: 17px;
    }

    /* Tooltips are awkward on touch/small screens — hide them */
    .floating-nav-btn::before,
    .floating-nav-btn::after {
        display: none;
    }
}

/* ==========================================================================
   Responsive — Mobile (≤ 480px): keep vertical on right side, just slightly smaller
   ========================================================================== */

@media (max-width: 480px) {
    .floating-vertical-nav {
        top: 80%;
        bottom: auto;
        right: 0;
        transform: translateY(-50%);
    }

    .floating-nav-list {
        flex-direction: column;
        gap: 4px;
    }

    .floating-nav-btn {
        width: 38px;
        height: 38px;
        border-radius: 8px 0 0 8px;
    }

    .floating-nav-btn:hover,
    .floating-nav-btn:focus-visible {
        width: 42px;
    }

    .floating-nav-btn svg {
        width: 16px;
        height: 16px;
    }
}

/* ==========================================================================
   Accessibility — respect reduced motion preference
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

    .floating-nav-btn,
    .floating-nav-btn svg,
    .floating-nav-btn::before,
    .floating-nav-btn::after {
        transition: none !important;
    }
}