/* ═══════════════════════════════════════════════
   Global Navigation — Luna Whale
   Apple Liquid Glass Design (iOS 26 / WWDC25)
   ═══════════════════════════════════════════════ */

/* ─── Shimmer & Glow Effects ─── */
@keyframes silverRipple {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes silverGlowPulse {
    0% { filter: drop-shadow(0 0 2px rgba(200, 215, 255, 0.4)); }
    50% { filter: drop-shadow(0 0 8px rgba(220, 230, 255, 0.7)); }
    100% { filter: drop-shadow(0 0 2px rgba(200, 215, 255, 0.4)); }
}
@keyframes silverShimmer {
    0% { text-shadow: 0 0 6px rgba(200, 210, 230, 0.4); }
    50% { text-shadow: 0 0 12px rgba(220, 230, 255, 0.6); }
    100% { text-shadow: 0 0 6px rgba(200, 210, 230, 0.4); }
}

.shimmer-text {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.8) 0%,
        rgba(255, 255, 255, 1) 20%,
        rgba(200, 210, 255, 1) 50%,
        rgba(255, 255, 255, 1) 80%,
        rgba(255, 255, 255, 0.8) 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: silverRipple 4s linear infinite;
}
.shimmer-icon {
    animation: silverGlowPulse 3s ease-in-out infinite;
    color: #fff !important;
}

/* Google Material Symbols */
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=swap');

/* ─── Root wrapper ─── */
#gnav-root {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2147483647 !important;
    pointer-events: none !important;
    overflow: visible !important;
}
#gnav-root .gnav-pill,
#gnav-root .gnav-sidebar {
    pointer-events: auto;
}

/* ─── Liquid Glass Pill (Trigger) ─── */
.gnav-pill {
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 64px;
    background: linear-gradient(165deg, rgba(180, 185, 200, 0.45), rgba(120, 125, 150, 0.3)) !important;
    backdrop-filter: blur(60px) saturate(200%) brightness(1.05);
    -webkit-backdrop-filter: blur(60px) saturate(200%) brightness(1.05);
    border-radius: 18px 0 0 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: -2px 4px 20px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.45);
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    color: white;
}
.gnav-pill.open {
    right: -60px;
    opacity: 0;
    pointer-events: none;
}
.gnav-pill .material-symbols-rounded { font-size: 18px; }

/* ─── Liquid Glass Sidebar (Panel) ─── */
.gnav-sidebar {
    position: absolute;
    right: -220px;
    top: 50%;
    transform: translateY(-50%);
    width: 124px; /* 정확한 데스크탑 규격 */
    background: linear-gradient(160deg, rgba(60, 65, 85, 0.55), rgba(45, 50, 70, 0.45)) !important;
    backdrop-filter: blur(80px) saturate(200%) brightness(0.95);
    -webkit-backdrop-filter: blur(80px) saturate(200%) brightness(0.95);
    border-radius: 28px;
    padding: 10px 6px 10px;
    z-index: 9;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.3);
    transition: right 0.5s cubic-bezier(0.19, 1, 0.22, 1), transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    max-height: 92vh;
    overflow-y: auto;
    scrollbar-width: none;
}
.gnav-sidebar::-webkit-scrollbar { display: none; }
.gnav-sidebar.open { right: 16px; }

/* ─── Top Bar (Fullscreen + Close + Language) ─── */
.gnav-top-bar {
    grid-column: span 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 4px;
}

/* ─── Close Button ─── */
.gnav-close {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: rgba(220, 225, 245, 0.7);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.25s;
    padding: 0;
    flex-shrink: 0;
}
.gnav-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}
.gnav-close .material-symbols-rounded { font-size: 14px; }

/* ─── Utility Buttons (Fullscreen + Language) ─── */
.gnav-util {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(220, 225, 245, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
    padding: 0;
    flex-shrink: 0;
    font-family: inherit;
}
.gnav-util:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    transform: translateY(-1px);
    border-color: rgba(255,255,255,0.2);
}
.gnav-util .material-symbols-rounded { font-size: 13px; }
.gnav-lang-text {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* ─── Nav Items ─── */
.gnav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 40px;
    border-radius: 14px;
    cursor: pointer;
    text-decoration: none;
    color: rgba(220, 225, 245, 0.9);
    transition: all 0.35s;
    background: transparent;
}
.gnav-item:hover, .gnav-item.active {
    background: rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
}
.gnav-item .material-symbols-rounded { font-size: 17px; }
.gnav-item-label {
    font-size: 7.5px;
    font-weight: 700;
    margin-top: 0.5px;
    text-transform: uppercase;
    color: rgba(200, 210, 235, 0.8);
    animation: silverShimmer 5s ease-in-out infinite;
}

.gnav-divider {
    grid-column: span 2;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 10px;
}

/* ─── Mobile Overrides ─── */
@media (max-width: 767px) {
    .gnav-sidebar {
        width: auto;
        left: 12px;
        right: 12px;
        top: auto;
        bottom: -100%;
        transform: none;
        max-height: 70vh;
        border-radius: 28px;
        grid-template-columns: repeat(5, 1fr);
        transition: bottom 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .gnav-sidebar.open { bottom: 12px; right: 12px; }
    .gnav-item { height: 60px; }
    .gnav-item-label { font-size: 10px; }
    .gnav-pill { bottom: 24px; top: auto; right: 12px; border-radius: 50%; width: 48px; height: 48px; transform: none; }
    .gnav-divider { display: none; }
}

/* ─── Backdrop (Mobile Only) ─── */
.gnav-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
}
.gnav-backdrop.open { opacity: 1; pointer-events: auto; }


/* ─── Legacy Navigation Removal ─── */
.hide-old-nav .app-sidebar,
.hide-old-nav .bottom-nav,
.hide-old-nav #header-math-btn,
.hide-old-nav #header-tech-btn,
.hide-old-nav #header-en-btn,
.hide-old-nav #header-korean-btn,
.hide-old-nav #header-playground-btn,
.hide-old-nav #sidebar,
.hide-old-nav .sidebar,
.hide-old-nav #techSidebar,
.hide-old-nav .tech-sidebar,
.hide-old-nav #luna-nav-trigger,
.hide-old-nav #luna-nav-popup,
.hide-old-nav .hub-nav-bar,
.hide-old-nav #hub-nav-bar,
.hide-old-nav .acw-btn,
.hide-old-nav .acw-panel {
    display: none !important;
}

.hide-old-nav .main-content,
.hide-old-nav .math-content,
.hide-old-nav .tech-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
}

/* ─── Language Selector Dropdown (Apple Liquid Glass Style) ─── */
.gnav-lang-dropdown {
    position: fixed;
    width: 170px;
    background: linear-gradient(160deg, rgba(40, 45, 65, 0.85), rgba(30, 35, 50, 0.8)) !important;
    backdrop-filter: blur(40px) saturate(200%) brightness(0.95);
    -webkit-backdrop-filter: blur(40px) saturate(200%) brightness(0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 6px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    opacity: 0;
    transform: scale(0.9) translateY(4px);
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.19, 1, 0.22, 1), transform 0.25s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 2147483647;
}

.gnav-lang-dropdown.show {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.gnav-lang-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    border-radius: 14px;
    border: none;
    background: transparent;
    color: rgba(220, 225, 245, 0.85);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.gnav-lang-opt:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.gnav-lang-opt.active {
    background: rgba(255, 255, 255, 0.18) !important;
    color: #fff !important;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.gnav-lang-opt-flag {
    font-size: 16px;
    line-height: 1;
}

.gnav-lang-opt-name {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Adjust font size of flag inside the sidebar button */
#gnavLang .gnav-lang-text {
    font-size: 16px;
    line-height: 1;
    display: inline-block;
}
