/* --- Shared Navigation & Side Menu --- */

.portal-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: rgba(18, 18, 18, 0.7);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    display: flex; 
    align-items: center;
}

body.auth-active .portal-header {
    display: none;
}

body.auth-active .side-menu,
body.auth-active .side-menu-overlay,
body.auth-active .native-footer,
body.auth-active .bottom-nav {
    display: none !important;
}

.header-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.header-logo {
    height: 32px;
    width: 32px;
    filter: drop-shadow(0 0 8px rgba(227, 176, 75, 0.3));
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}

.system-status {
    font-size: 0.65rem;
    color: var(--text-desc);
    display: flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
    font-weight: 700;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #2ed573;
    border-radius: 50%;
    box-shadow: 0 0 8px #2ed573;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-trigger {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.profile-trigger:active {
    transform: scale(0.9);
}

/* --- Side Menu (Drawer) --- */
.side-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.side-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.side-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: #181818;
    border-left: 1px solid var(--glass-border);
    z-index: 2001;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
}

.side-menu.active {
    transform: translateX(0);
}

.side-menu-header {
    padding: 2.5rem 1.5rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.user-profile-mini {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 48px;
    height: 48px;
    background: var(--gold-trend);
    color: #000;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.user-info h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.user-info p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-desc);
}

.close-menu-btn {
    background: none;
    border: none;
    color: var(--text-desc);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 5px;
}

.side-menu-nav {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.menu-group {
    margin-bottom: 2rem;
}

.menu-group label {
    display: block;
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-desc);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
    padding-left: 12px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-desc);
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    margin-bottom: 4px;
    position: relative;
    overflow: hidden;
}

.menu-item i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.menu-item:hover, .menu-item.active {
    background: rgba(227, 176, 75, 0.1);
    color: var(--gold-trend);
}

.menu-item.active {
    font-weight: 700;
    padding-left: 24px;
}

.menu-item.active::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 999px;
    background: var(--gold-trend);
}

.menu-item.logout {
    color: #ff4757;
}

.menu-item.logout:hover {
    background: rgba(255, 71, 87, 0.1);
}

.badge-new {
    margin-left: auto;
    background: var(--gold-trend);
    color: #000;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
}

.side-menu-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.system-tag {
    font-size: 0.7rem;
    color: var(--text-desc);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

/* --- Bottom Navigation --- */
.bottom-nav {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 3rem);
    max-width: 450px;
    height: 65px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    z-index: 1000;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

body.auth-active .bottom-nav {
    display: none;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: var(--text-desc);
    font-size: 0.7rem;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
}

.nav-item-btn {
    border: none;
    background: transparent;
    padding: 0;
    font-family: inherit;
    cursor: pointer;
}

.nav-item i {
    font-size: 1.2rem;
}

.nav-item.active {
    color: var(--gold-trend);
}

.nav-item.center-add {
    background: var(--gold-trend);
    color: #000;
    width: 50px;
    height: 50px;
    border-radius: 18px;
    justify-content: center;
    font-size: 1.4rem;
    margin-top: -30px;
    box-shadow: 0 8px 20px rgba(227, 176, 75, 0.4);
    border: 4px solid var(--bg-deep);
}

.nav-item.center-add i {
    font-size: 1.4rem;
}

.header-icon-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-desc);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
}

.header-icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.2);
}

.menu-item:focus-visible,
.nav-item:focus-visible,
.nav-pill-item:focus-visible,
.header-icon-btn:focus-visible,
.close-menu-btn:focus-visible,
.profile-trigger:focus-visible {
    outline: 2px solid var(--gold-trend);
    outline-offset: 2px;
    border-radius: 12px;
}

.header-icon-btn.logout:hover {
    background: rgba(255, 82, 82, 0.1);
    color: #FF5252;
    border-color: rgba(255, 82, 82, 0.2);
}

/* --- Native Style Footer --- */
.native-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 85px;
    background: rgba(18, 18, 18, 0.7);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-top: 1px solid var(--glass-border);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 1.5rem;
    padding-bottom: env(safe-area-inset-bottom);
}

.footer-nav-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 5px;
    display: flex;
    gap: 5px;
}

.nav-pill-item {
    background: transparent;
    border: none;
    color: var(--text-desc);
    padding: 8px 16px;
    border-radius: 40px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.nav-pill-item i { font-size: 1rem; }

.nav-pill-item.active {
    background: var(--gold-trend);
    color: #000;
    box-shadow: 0 4px 12px rgba(227, 176, 75, 0.3);
}

.footer-summary-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.footer-summary-item .label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-desc);
    font-weight: 700;
}

.footer-summary-item .value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--gold-trend);
}

.footer-action-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.footer-action-btn.primary {
    background: var(--gold-trend);
    color: #000;
    box-shadow: 0 8px 20px rgba(227, 176, 75, 0.3);
}

.footer-action-btn:active { transform: scale(0.9); }

.hidden { display: none !important; }
