/* ============================================================
   SHARED HEADER — Unified header for all pages
   ============================================================ */

/* Hide Alpine x-cloak elements until Alpine initialises */
[x-cloak] { display: none !important; }

/* ===== NAVBAR ===== */
.sh-navbar {
    position: sticky; top: 0; z-index: 60;
    backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5);
    background: rgba(254,255,249,0.92); border-bottom: 1px solid #f2f2f7;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); padding: 0 1.5rem; height: 64px;
}
.sh-nav-scrolled { background: rgba(254,255,249,0.97); box-shadow: 0 4px 20px rgba(0,0,0,0.06); }
.sh-nav-inner { display: flex; align-items: center; gap: 1rem; max-width: 1200px; margin: 0 auto; height: 100%; }

/* ===== LOGO ===== */
.sh-logo-link { flex-shrink: 0; display: flex; align-items: center; }
.sh-logo-svg { width: 120px; height: auto; }

/* ===== DESKTOP NAV ===== */
.sh-desktop-nav { display: none; flex: 1; align-items: center; gap: 0.5rem; }
@media (min-width: 768px) { .sh-desktop-nav { display: flex; } }

.sh-nav-btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.5rem 1rem; border-radius: 9999px;
    font-size: 0.875rem; font-weight: 600; color: rgba(50,46,78,0.6);
    border: 1px solid #e4e4e4; background: transparent; text-decoration: none;
    transition: all 0.2s; cursor: pointer;
}
.sh-nav-btn:hover { color: #322E4E; background: rgba(0,0,0,0.03); }
.sh-nav-btn-accent { background: #4147D5; color: #fff !important; font-weight: 700; border-color: #4147D5; }
.sh-nav-btn-accent:hover { background: #5258e0; box-shadow: 0 4px 16px rgba(65,71,213,0.25); }

/* ===== NAV RIGHT ===== */
.sh-nav-right { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
@media (max-width: 640px) { .sh-nav-right { gap: 0.5rem; } .sh-hide-mobile { display: none !important; } }

/* ===== POINTS BADGE ===== */
.sh-points-badge {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.25rem 0.75rem; border-radius: 9999px;
    background: rgba(65,71,213,0.08); text-decoration: none;
    font-size: 0.75rem; font-weight: 700; color: #4147D5;
    transition: all 0.25s ease;
}
.sh-points-badge:hover { background: rgba(65,71,213,0.12); }
.sh-points-label { color: rgba(50,46,78,0.5); display: none; }
@media (min-width: 768px) { .sh-points-label { display: inline; } }
.sh-points-value { font-weight: 700; color: #4147D5; }
.sh-points-icon img { border-radius: 9999px; }

/* ===== LANGUAGE BUTTON ===== */
.sh-lang-btn {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.4rem 0.5rem; border-radius: 9999px;
    background: rgba(254,247,236,0.65); border: 1px solid rgba(0,0,0,0.06);
    cursor: pointer; transition: all 0.2s ease; color: rgba(50,46,78,0.7);
}
.sh-lang-btn:hover { background: rgba(0,0,0,0.04); }

/* ===== LANGUAGE DROPDOWN ===== */
.sh-lang-dropdown {
    position: absolute; top: 100%; right: 0; margin-top: 0.5rem;
    width: 240px; max-height: 360px; border-radius: 12px;
    background: #fff; border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12); backdrop-filter: blur(24px);
    overflow: hidden; z-index: 100;
}
.sh-lang-search {
    width: 100%; padding: 0.5rem 0.75rem; border: 1px solid rgba(0,0,0,0.08);
    background: rgba(0,0,0,0.02); border-radius: 8px; color: #322E4E;
    font-size: 16px; caret-color: #4147D5; outline: none;
}
.sh-lang-search:focus { border-color: rgba(65,71,213,0.4); }
.sh-lang-search::placeholder { color: rgba(50,46,78,0.5); }
.sh-lang-list { overflow-y: auto; max-height: 300px; padding: 0.25rem; }
.sh-lang-item {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.45rem 0.75rem; border-radius: 6px; color: rgba(50,46,78,0.8);
    text-decoration: none; font-size: 0.85rem; transition: all 0.15s ease;
    border-left: 2px solid transparent;
}
.sh-lang-item:hover { background: rgba(65,71,213,0.06); }
.sh-lang-item.active { background: rgba(65,71,213,0.1); border-left-color: #4147D5; font-weight: 600; }

/* ===== AVATAR DROPDOWN (auth) ===== */
.sh-avatar-btn {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 2px; border-radius: 9999px; background: transparent;
    border: none; cursor: pointer;
}
.sh-avatar-btn:hover img { box-shadow: 0 0 0 3px rgba(65,71,213,0.2); }
.sh-avatar-dropdown {
    position: absolute; top: 100%; right: 0; margin-top: 0.5rem;
    width: 260px; border-radius: 12px;
    background: #fff; border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12); backdrop-filter: blur(24px);
    overflow: hidden; z-index: 100; padding: 0.25rem;
}
.sh-avatar-dropdown-header { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; }
.sh-avatar-dropdown-divider { height: 1px; background: rgba(0,0,0,0.06); margin: 0.25rem 0.5rem; }
.sh-avatar-dropdown-item {
    display: flex; align-items: center; gap: 0.6rem; width: 100%;
    padding: 0.55rem 0.75rem; border-radius: 6px; color: rgba(50,46,78,0.8);
    text-decoration: none; font-size: 0.85rem; font-weight: 500;
    transition: all 0.15s ease; border: none; background: none; cursor: pointer; text-align: left;
}
.sh-avatar-dropdown-item:hover { background: rgba(65,71,213,0.06); color: #322E4E; }
.sh-avatar-dropdown-logout { color: #ff6b6b; }
.sh-avatar-dropdown-logout:hover { background: rgba(255,107,107,0.1); color: #ff6b6b; }

/* ===== GUEST AUTH BUTTONS (desktop only) ===== */
.sh-desktop-auth { display: none; }
@media (min-width: 768px) { .sh-desktop-auth { display: flex !important; } }
.sh-auth-btn {
    font-size: 0.82rem; font-weight: 600; color: rgba(50,46,78,0.8);
    text-decoration: none; padding: 0.4rem 0.75rem; border-radius: 9999px; transition: all 0.2s;
}
.sh-auth-btn:hover { color: #322E4E; }
.sh-auth-btn-accent { background: #4147D5; color: #fff; }
.sh-auth-btn-accent:hover { background: #5258e0; }

/* ===== HAMBURGER MENU (guest mobile) ===== */
.sh-mobile-hamburger { display: block; }
@media (min-width: 768px) { .sh-mobile-hamburger { display: none; } }

.sh-hamburger-btn {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 10px;
    background: transparent; border: 1px solid rgba(0,0,0,0.08);
    cursor: pointer; color: #322E4E; transition: all 0.2s;
}
.sh-hamburger-btn:hover { background: rgba(0,0,0,0.03); }

.sh-mobile-menu {
    position: absolute; top: 100%; right: 0; margin-top: 0.5rem;
    width: 220px; border-radius: 12px;
    background: #fff; border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 12px 40px rgba(0,0,0,0.12); backdrop-filter: blur(24px);
    overflow: hidden; z-index: 100; padding: 0.25rem;
}
.sh-mobile-menu-item {
    display: flex; align-items: center; gap: 0.6rem; width: 100%;
    padding: 0.65rem 0.75rem; border-radius: 6px; color: rgba(50,46,78,0.8);
    text-decoration: none; font-size: 0.9rem; font-weight: 500;
    transition: all 0.15s ease;
}
.sh-mobile-menu-item:hover { background: rgba(65,71,213,0.06); color: #322E4E; }
.sh-mobile-menu-accent { color: #4147D5; font-weight: 600; }
.sh-mobile-menu-accent:hover { background: rgba(65,71,213,0.08); }
.sh-mobile-menu-divider { height: 1px; background: rgba(0,0,0,0.06); margin: 0.25rem 0.5rem; }

/* ===== MOBILE PADDING ===== */
@media (max-width: 767px) {
    .sh-navbar { padding: 0 1rem; }
}

/* ===== POINTS ANIMATION ===== */
@keyframes shPop {
    0% { transform: scale(1) rotate(0); }
    20% { transform: scale(1.35) rotate(10deg); }
    60% { transform: scale(0.9) rotate(-8deg); }
    100% { transform: scale(1) rotate(0); }
}
.sh-avatar-pop { animation: shPop 0.8s cubic-bezier(.34,1.56,.64,1); }

@keyframes shPulseText {
    0% { transform: scale(1); filter: drop-shadow(0 0 0 #ffd700); }
    50% { transform: scale(1.6); filter: drop-shadow(0 0 8px #ffd700); }
    100% { transform: scale(1); filter: drop-shadow(0 0 0 #ffd700); }
}
.sh-points-pulse { animation: shPulseText 0.8s ease-out; }

.sh-points-pulse::after {
    content: ""; position: absolute; left: 50%; top: 0.2rem;
    width: 10px; height: 10px; background: transparent;
    box-shadow: 0 -10px #f6d743, 0 10px #e57f98, 12px 0 #5fd9bc, -12px 0 #f6d743, 8px 8px #e57f98, -8px -8px #5fd9bc;
    animation: shConfetti 0.6s ease-out forwards;
}
@keyframes shConfetti {
    0% { opacity: 1; transform: translate(-50%,0) scale(1); }
    100% { opacity: 0; transform: translate(-50%,60px) scale(0); }
}
