/* ============================================
   Header Component (Standardized)
   ============================================ */

/* CSS Variables specific to Header */
:root {
    --nav-height: 72px;
}

/* Base Navbar — uses theme tokens */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: var(--ap-bg-header);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--ap-border);
    z-index: 100;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

/* Deprecated: .navbar-light kept for backwards compatibility */
.navbar.navbar-light {
    background: var(--ap-bg-header);
    border-bottom: 1px solid var(--ap-border);
    box-shadow: var(--ap-shadow-sm);
}

.navbar-container {
    width: 100%;
    margin: 0 auto;
    padding-left: 48px;
    padding-right: 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Brand/Logo */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    user-select: none;
}

.navbar-brand img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.navbar-brand span {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ap-text-primary);
    letter-spacing: -0.02em;
}

.navbar.navbar-light .navbar-brand span {
    color: var(--ap-text-primary);
    font-size: 1.125rem;
}

.navbar.navbar-light .navbar-brand img {
    width: 30px;
    height: 30px;
}

/* Links */
.navbar-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.navbar-links a {
    font-size: 15px;
    font-weight: 500;
    color: var(--ap-text-muted);
    transition: color 0.2s ease;
    text-decoration: none;
}

.navbar-links a:hover {
    color: var(--ap-text-primary);
}

.navbar.navbar-light .navbar-links a {
    color: var(--ap-text-muted);
}

.navbar.navbar-light .navbar-links a:hover {
    color: var(--ap-text-primary);
}

/* Actions */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Visibility states */
.nav-visitor {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-user {
    display: none;
    align-items: center;
    gap: 12px;
}

body.user-logged-in .nav-visitor {
    display: none;
}

body.user-logged-in .nav-user {
    display: flex;
}

/* Avatar (standalone) */
.nav-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* Profile link */
.nav-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    border-radius: 8px;
    padding: 6px 8px;
    transition: background 0.15s ease;
    text-decoration: none;
}

.nav-profile:hover {
    background: var(--ap-bg-hover);
}

/* Profile name */
.nav-profile-name {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: var(--ap-text-primary);
    white-space: nowrap;
}

.navbar.navbar-light .nav-profile-name {
    color: var(--ap-text-primary);
}

/* Profile picture */
.nav-profile-picture {
    display: inline-block;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.nav-profile-picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Plus avatar glow */
.nav-profile-picture.plus-avatar {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

/* Plus badge */
.nav-plus-badge {
    display: none;
    position: absolute;
    top: 25px;
    right: -18px;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #93c5fd;
    background: var(--ap-bg-card);
    border: 1px solid rgba(59, 130, 246, 0.35);
    border-radius: 4px;
    padding: 2px 6px;
    line-height: 1;
    user-select: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    z-index: 2;
}

.navbar.navbar-light .nav-plus-badge {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
    box-shadow: none;
}

/* Buttons */
.nav-btn-ghost {
    background: transparent;
    border: none;
    color: var(--ap-text-muted);
    font-size: 15px;
    font-weight: 500;
    padding: 10px 16px;
    cursor: pointer;
    transition: color 0.2s ease;
    border-radius: 10px;
    font-family: inherit;
    text-decoration: none;
}

.nav-btn-ghost:hover {
    color: var(--ap-text-primary);
}

.navbar.navbar-light .nav-btn-ghost {
    color: var(--ap-text-muted);
}

.navbar.navbar-light .nav-btn-ghost:hover {
    color: var(--ap-text-primary);
}

.nav-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--ap-accent);
    color: #ffffff;
    border: none;
    font-size: 15px;
    font-weight: 600;
    padding: 10px 22px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-decoration: none;
}

.nav-btn-primary:hover {
    background: var(--ap-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(79, 125, 243, 0.25);
}

.navbar.navbar-light .nav-btn-primary {
    background: var(--ap-accent);
    font-size: 13.5px;
    padding: 8px 16px;
    border-radius: 8px;
}

.navbar.navbar-light .nav-btn-primary:hover {
    background: var(--ap-accent-hover);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

/* Hidden helper */
.nav-hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 1024px) {
    .navbar-container {
        padding-left: 28px;
        padding-right: 28px;
    }
}

@media (max-width: 640px) {
    .navbar-container {
        padding-left: 20px;
        padding-right: 20px;
    }
    .navbar-links {
        display: none;
    }
}

/* ============================================
   Shared Page Footer
   ============================================ */
.ap-footer {
    text-align: center;
    font-size: 12.5px;
    color: #6b7280;
    padding: 32px 24px;
}

.ap-footer a {
    color: #6b7280;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ap-footer a:hover {
    color: #374151;
}

/* Dark page variant */
body:not(.light-page) .ap-footer {
    color: rgba(255, 255, 255, 0.35);
}

body:not(.light-page) .ap-footer a {
    color: rgba(255, 255, 255, 0.4);
}

body:not(.light-page) .ap-footer a:hover {
    color: rgba(255, 255, 255, 0.65);
}
