/* Shared Components */

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gray-200);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}
.nav-logo    { justify-self: start; }
.nav-links   { justify-self: center; }
.nav-auth    { justify-self: end; }

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 800;
    font-size: 18px;
    color: var(--primary);
}

.logo-img {
    height: 32px;
    width: 32px;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-link {
    text-decoration: none;
    color: var(--gray-500);
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-btn {
    background: var(--primary);
    color: #fff;
    padding: 8px 18px;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}

.nav-btn-outline {
    background: none;
    border: 1.5px solid var(--gray-200);
    color: var(--gray-600);
    padding: 7px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.nav-user {
    color: var(--gray-800);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}

/* ── User avatar dropdown ── */
.nav-user-menu { position: relative; }

.nav-avatar-btn {
    display: flex; align-items: center; gap: 8px;
    background: none; border: 1.5px solid var(--gray-200);
    border-radius: 100px; padding: 5px 12px 5px 6px;
    cursor: pointer; font-family: inherit;
    transition: border-color 0.15s, background 0.15s;
}
.nav-avatar-btn:hover { border-color: var(--primary); background: var(--primary-light); }

.nav-avatar-circle {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--primary-light); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
}
.nav-username { font-size: 13px; font-weight: 700; color: var(--gray-800); max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-chevron  { font-size: 10px; color: var(--gray-400); transition: transform 0.2s; }

.nav-dropdown {
    display: none; position: absolute; top: calc(100% + 8px); right: 0;
    background: #fff; border: 1.5px solid var(--gray-200); border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.12); min-width: 220px;
    padding: 6px; z-index: 2000; opacity: 0; transform: translateY(-6px);
    transition: opacity 0.15s, transform 0.15s;
}
.nav-dropdown.open { display: block; opacity: 1; transform: translateY(0); }

.dd-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 9px;
    text-decoration: none; color: var(--gray-800);
    font-size: 13px; transition: background 0.12s;
    background: none; border: none; width: 100%; cursor: pointer; font-family: inherit;
    text-align: left;
}
.dd-item:hover { background: var(--gray-50); }
.dd-icon { width: 20px; text-align: center; color: var(--primary); font-size: 14px; flex-shrink: 0; }
.dd-text { display: flex; flex-direction: column; gap: 1px; }
.dd-title { font-weight: 700; font-size: 13px; line-height: 1.2; }
.dd-sub   { font-size: 11px; color: var(--gray-400); line-height: 1.2; }
.dd-divider { height: 1px; background: var(--gray-100); margin: 4px 0; }
.dd-danger .dd-icon { color: #EF4444; }
.dd-danger .dd-title { color: #EF4444; }
.dd-danger:hover { background: #FEF2F2; }

/* Common UI */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease forwards;
}

/* ── Mobile: hide desktop nav links, show bottom tab bar ── */
@media (max-width: 768px) {
    .nav-links { display: none !important; }
    .nav-auth  { display: none !important; }
    /* Extra bottom padding so content isn't hidden under tab bar */
    body { padding-bottom: 64px; }
}

/* Bottom tab bar (mobile only) */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 60px;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--gray-200);
    z-index: 1100;
    align-items: stretch;
}
@media (max-width: 768px) {
    .bottom-nav { display: flex; }
}
.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: var(--gray-400);
    font-size: 10px;
    font-weight: 600;
    transition: color 0.15s;
    padding: 8px 4px;
}
.bottom-nav-item i { font-size: 18px; }
.bottom-nav-item.active, .bottom-nav-item:hover { color: var(--primary); }
