/* Overlay container */
#overlayMenu {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
    transition: opacity 0.25s ease;
}

/* Hidden state (JS toggles this) */
.hidden {
    display: none !important;
}

/* Prevent background scroll (JS toggles this on <body>) */
.overflow-hidden {
    overflow: hidden;
}

/* Slide-in panel */
#menuPanelRight {
    position: absolute;
    top: 4rem;
    right: 0;
    height: calc(100% - 4rem);
    width: 75%;
    max-width: 22rem;

    /* Modern look */
    background: linear-gradient(
    to bottom,
    rgba(255,255,255,0.78),
    rgba(255,255,255,0.72)
);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    border-left: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);

    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);

    box-shadow:
        -4px 0 20px rgba(0,0,0,0.15),
        inset 1px 0 0 rgba(255,255,255,0.4);
}


/* Matches Tailwind's translate-x-full */
.translate-x-full {
    transform: translateX(100%);
}

/* When JS removes translate-x-full, panel slides in */
#menuPanelRight:not(.translate-x-full) {
    transform: translateX(0);
    animation: panelSlideIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Navigation layout */
#overlayMenu nav {
    display: flex;
    flex-direction: column;
    margin: 0 0.5rem;
    padding: 0.5rem 0;
     gap: 0.85rem; /* 14px */
}

/* Navigation links */
#overlayMenu nav a {
    display: flex;
    align-items: center;
    justify-content: space-between; /* consistent */
    gap: 0.75rem;

    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.4);

    padding: 0.9rem 1.1rem; /* ~14px vertical, 18px horizontal */
    border-radius: 0.85rem;

    text-decoration: none;
    color: #1e293b;
    font-weight: 600;

    transition: transform 0.2s ease, background 0.2s ease;

    opacity: 1;
    transform: translateX(0);
}

#overlayMenu nav a .item-left {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}


#menuPanelRight:not(.translate-x-full) nav a {
    animation: fadeInSlide 0.4s ease forwards;
    opacity: 1; /* ensure visible after animation */
}

#menuPanelRight:not(.translate-x-full) nav a:nth-child(1) { animation-delay: 0.05s; }
#menuPanelRight:not(.translate-x-full) nav a:nth-child(2) { animation-delay: 0.10s; }
#menuPanelRight:not(.translate-x-full) nav a:nth-child(3) { animation-delay: 0.15s; }
#menuPanelRight:not(.translate-x-full) nav a:nth-child(4) { animation-delay: 0.20s; }
#menuPanelRight:not(.translate-x-full) nav a:nth-child(5) { animation-delay: 0.25s; }
#menuPanelRight:not(.translate-x-full) nav a:nth-child(6) { animation-delay: 0.30s; }
#menuPanelRight:not(.translate-x-full) nav a:nth-child(7) { animation-delay: 0.35s; }

@keyframes fadeInSlide {
    to   { transform: translateX(0); opacity: 1; }
}

@keyframes panelSlideIn {
    0%   { transform: translateX(100%); }
    80%  { transform: translateX(-4px); }
    100% { transform: translateX(0); }
}

#overlayMenu nav a .icon {
    font-size: 1.75rem;
}

#overlayMenu nav a .label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
}

#overlayMenu nav a:hover {
    background: rgba(255,255,255,0.9);
    transform: translateX(10px);
}

#overlayMenu nav a:active {
    transform: translateX(2px) scale(0.98);
    background: rgba(255,255,255,0.85);
}

.menu-header {
    display: flex;
    justify-content: flex-end;
    padding: 1rem 1rem 1rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.25);
    margin-bottom: 1rem;
}

.pdf-icon {
    font-size: 1.1rem;
    opacity: 0.8;
    color: #b91c1c;
    border: 1px solid rgba(220, 38, 38, 0.4);
    padding: 0.15rem 0.45rem;
    border-radius: 0.35rem;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(4px);
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

/* Close button */
#closeMenu {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.4);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    color: #334155;
    transition: all 0.2s ease;
}

#closeMenu:hover {
    background: rgba(255,255,255,0.9);
    color: #0f172a;
}

#closeMenu svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

#closeMenu:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}



