/* ============================================
   Carol's Homestead — Vine Navigation
   Vertical botanical vine sidebar navigation
   ============================================ */

/* ── Vine Container ── */
.vine-nav {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--vine-width);
    z-index: 900;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 80px 0 2rem;
    pointer-events: none;
}

/* ── Vine Stem ── */
.vine-stem {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3.5rem;
    padding: 1.5rem 0;
    pointer-events: auto;
}

.vine-stem::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    background: linear-gradient(to bottom,
            rgba(45, 80, 22, 0),
            rgba(45, 80, 22, 0.6) 10%,
            var(--primary) 20%,
            var(--primary-light) 50%,
            var(--primary) 80%,
            rgba(45, 80, 22, 0.6) 90%,
            rgba(45, 80, 22, 0));
    transform: translateX(-50%);
    border-radius: 2px;
    animation: vineGrow 1.2s ease-out forwards;
}

@keyframes vineGrow {
    from {
        clip-path: inset(50% 0 50% 0);
        opacity: 0;
    }

    to {
        clip-path: inset(0 0 0 0);
        opacity: 1;
    }
}

/* ── Vine Leaf Item ── */
.vine-leaf {
    position: relative;
    width: 20px;
    height: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    animation: leafAppear 0.5s ease-out backwards;
}

.vine-leaf:nth-child(1) {
    animation-delay: 0.3s;
}

.vine-leaf:nth-child(2) {
    animation-delay: 0.45s;
}

.vine-leaf:nth-child(3) {
    animation-delay: 0.6s;
}

.vine-leaf:nth-child(4) {
    animation-delay: 0.75s;
}

.vine-leaf:nth-child(5) {
    animation-delay: 0.9s;
}

.vine-leaf:nth-child(6) {
    animation-delay: 1.05s;
}

.vine-leaf:nth-child(7) {
    animation-delay: 1.2s;
}

.vine-leaf:nth-child(8) {
    animation-delay: 1.35s;
}

@keyframes leafAppear {
    from {
        opacity: 0;
        transform: scale(0) rotate(-90deg);
    }

    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* ── Leaf Shape ── */
.leaf-shape {
    position: relative;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.leaf-shape::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: var(--primary);
    border-radius: 50% 0 50% 0;
    transform: rotate(45deg);
    transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

/* Leaf vein line */
.leaf-shape::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(45deg);
    z-index: 1;
    transition: background var(--transition);
}

/* ── Hover State ── */
.vine-leaf:hover .leaf-shape::before {
    background: var(--accent);
    transform: rotate(45deg) scale(1.3);
    box-shadow: 0 0 10px rgba(218, 165, 32, 0.3);
}

.vine-leaf:hover .leaf-shape::after {
    background: rgba(255, 255, 255, 0.5);
}

/* ── Active State ── */
.vine-leaf.active .leaf-shape::before {
    background: var(--accent);
    transform: rotate(45deg) scale(1.2);
    box-shadow: 0 0 12px rgba(218, 165, 32, 0.5);
}

.vine-leaf.active .leaf-shape::after {
    background: rgba(255, 255, 255, 0.6);
}

/* ── Leaf Label (Tooltip) ── */
.leaf-label {
    position: absolute;
    left: 100%;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(4px);
    transition: opacity var(--transition), transform var(--transition);
    background: var(--bg-dark);
    color: var(--text-on-dark);
    padding: 4px 12px;
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    margin-left: 4px;
}

.leaf-label::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 4px solid transparent;
    border-right-color: var(--bg-dark);
}

.vine-leaf:hover .leaf-label {
    opacity: 1;
    transform: translateX(8px);
}

/* ── Decorative Tendrils ── */
.vine-tendril {
    position: relative;
    width: 16px;
    height: 12px;
    margin: -0.5rem 0;
}

.vine-tendril::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(74, 124, 41, 0.3);
    border-radius: 0 50% 50% 0;
    border-left: none;
    left: 50%;
    top: 0;
}

.vine-tendril:nth-child(even)::before {
    border-radius: 50% 0 0 50%;
    border-right: none;
    border-left: 2px solid rgba(74, 124, 41, 0.3);
    left: auto;
    right: 50%;
}

/* ── Vine Glow Effect ── */
.vine-stem::after {
    content: '';
    position: absolute;
    top: 20%;
    bottom: 20%;
    left: 50%;
    width: 40px;
    transform: translateX(-50%);
    background: radial-gradient(ellipse, rgba(45, 80, 22, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

/* ── Mobile Layout (Horizontal Bottom Nav) ── */
@media (max-width: 768px) {
    .vine-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        width: 100%;
        height: 60px;
        flex-direction: row;
        padding: 0;
        background: rgba(26, 48, 9, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-top: 1px solid rgba(255,255,255,0.1);
        pointer-events: auto;
        z-index: 1000;
    }

    .vine-stem {
        flex-direction: row;
        width: 100%;
        justify-content: space-evenly;
        padding: 0;
        gap: 0;
    }

    .vine-stem::before {
        top: 50%;
        bottom: auto;
        left: 0;
        right: 0;
        width: 100%;
        height: 3px;
        transform: translateY(-50%);
        background: linear-gradient(to right,
            rgba(45, 80, 22, 0),
            rgba(45, 80, 22, 0.6) 10%,
            var(--primary) 20%,
            var(--primary-light) 50%,
            var(--primary) 80%,
            rgba(45, 80, 22, 0.6) 90%,
            rgba(45, 80, 22, 0));
        animation: vineGrowHorizontal 1.2s ease-out forwards;
    }

    @keyframes vineGrowHorizontal {
        from {
            clip-path: inset(0 50% 0 50%);
            opacity: 0;
        }
        to {
            clip-path: inset(0 0 0 0);
            opacity: 1;
        }
    }

    .leaf-label {
        display: none !important;
    }
}
