/* ==========================================================================
   BSZ2 JEGYZET PORTÁL - UNIFIED GLOBAL NAVIGATION HEADER
   Ultra-premium glassmorphism, responsive dropdowns, active state tracking,
   and mobile drawer navigation.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
    --gh-bg: rgba(10, 12, 22, 0.88);
    --gh-border: rgba(255, 255, 255, 0.08);
    --gh-text: #f8fafc;
    --gh-text-muted: #94a3b8;
    --gh-accent: #6366f1;
    --gh-accent-glow: rgba(99, 102, 241, 0.35);
    --gh-pink: #ec4899;
    --gh-height: 64px;
    --gh-dropdown-bg: rgba(15, 18, 30, 0.96);
}

/* Base Header Container */
#portal-global-header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--gh-height);
    background: var(--gh-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--gh-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255, 255, 255, 0.05);
    z-index: 99999;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    padding: 0 1.25rem;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.portal-gh-container,
.portal-gh-inner {
    max-width: 1560px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Brand / Logo */
.portal-gh-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: #fff;
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.portal-gh-brand:hover {
    transform: scale(1.03);
}

.portal-gh-logo-badge {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #6366f1, #ec4899);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.portal-gh-brand-title {
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 30%, #c7d2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.portal-gh-brand-sub {
    font-size: 0.68rem;
    font-weight: 600;
    color: #a5b4fc;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Main Navigation Links */
.portal-gh-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: nowrap;
}

.portal-gh-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.75rem;
    color: var(--gh-text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

.portal-gh-link i, .portal-gh-link .gh-icon {
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.portal-gh-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.portal-gh-link:hover i {
    transform: scale(1.15);
}

/* Active Nav Item Glow */
.portal-gh-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(236, 72, 153, 0.2));
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.25);
    font-weight: 700;
}

/* 'Továbbiak' Dropdown Wrapper */
.portal-gh-dropdown-wrapper {
    position: relative;
    padding-bottom: 12px;
    margin-bottom: -12px;
}

.portal-gh-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.85rem;
    background: rgba(255, 255, 255, 0.04);
    color: var(--gh-text);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.portal-gh-dropdown-btn:hover,
.portal-gh-dropdown-wrapper:hover .portal-gh-dropdown-btn,
.portal-gh-dropdown-wrapper.open .portal-gh-dropdown-btn {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
    color: #ffffff;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
}

.portal-gh-dropdown-btn .gh-chevron {
    transition: transform 0.25s ease;
    font-size: 0.8rem;
}

.portal-gh-dropdown-wrapper:hover .portal-gh-dropdown-btn .gh-chevron,
.portal-gh-dropdown-wrapper.open .portal-gh-dropdown-btn .gh-chevron {
    transform: rotate(180deg);
}

/* Dropdown Menu Container */
.portal-gh-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background: var(--gh-dropdown-bg);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 0.75rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(99, 102, 241, 0.15);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.97);
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s ease;
    pointer-events: none;
    z-index: 100000;
}

/* Invisible bridge so moving cursor from button down into menu never breaks hover */
.portal-gh-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -18px;
    left: 0;
    right: 0;
    height: 18px;
    background: transparent;
    display: block;
}

.portal-gh-dropdown-wrapper:hover .portal-gh-dropdown-menu,
.portal-gh-dropdown-wrapper.open .portal-gh-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.portal-gh-dropdown-header {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
    padding: 0.35rem 0.5rem 0.5rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 0.4rem;
}

.portal-gh-dropdown-grid {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 420px;
    overflow-y: auto;
}

.portal-gh-dropdown-grid::-webkit-scrollbar {
    width: 5px;
}
.portal-gh-dropdown-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.portal-gh-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    color: #e2e8f0;
    text-decoration: none;
    transition: all 0.18s ease;
    border: 1px solid transparent;
}

.portal-gh-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(3px);
    color: #ffffff;
}

.portal-gh-dropdown-item.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.35);
    color: #ffffff;
    font-weight: 700;
}

.portal-gh-dropdown-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.portal-gh-dropdown-item-text {
    display: flex;
    flex-direction: column;
}

.portal-gh-dropdown-item-title {
    font-size: 0.88rem;
    font-weight: 600;
}

.portal-gh-dropdown-item-desc {
    font-size: 0.72rem;
    color: #94a3b8;
}

/* Right Section: Auth & Mobile Toggle */
.portal-gh-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
}

.portal-gh-user-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(236, 72, 153, 0.18));
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #ffffff;
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 700;
    transition: all 0.2s ease;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
}

.portal-gh-user-btn:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(236, 72, 153, 0.3));
    border-color: rgba(99, 102, 241, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.portal-gh-user-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

/* Mobile Hamburger Toggle */
.portal-gh-mobile-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.2s ease;
}

.portal-gh-mobile-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Mobile Drawer Overlay */
.portal-gh-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(16px);
    z-index: 100001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    justify-content: flex-end;
}

.portal-gh-drawer.active,
.portal-gh-drawer.open {
    opacity: 1;
    visibility: visible;
}

.portal-gh-drawer-card {
    width: 100%;
    max-width: 360px;
    height: 100%;
    background: #0d0f18;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    padding: 1.5rem 1.25rem;
}

.portal-gh-drawer.active .portal-gh-drawer-card,
.portal-gh-drawer.open .portal-gh-drawer-card {
    transform: translateX(0);
}

.portal-gh-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.portal-gh-drawer-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
}

.portal-gh-drawer-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    overflow-y: auto;
    flex: 1;
}

.portal-gh-drawer-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    color: #e2e8f0;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.18s ease;
    border: 1px solid transparent;
}

.portal-gh-drawer-link:hover, .portal-gh-drawer-link.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    color: #ffffff;
}

/* Responsive Breakpoints */
@media (max-width: 1280px) {
    .portal-gh-nav {
        gap: 0.2rem;
    }
    .portal-gh-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.82rem;
    }
}

@media (max-width: 1100px) {
    .portal-gh-nav {
        display: none;
    }
    .portal-gh-mobile-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    #portal-global-header .portal-gh-brand .portal-gh-brand-title {
        display: none !important;
    }
}
.portal-gh-logout-btn {
    background: rgba(239, 68, 68, 0.14) !important;
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
    color: #fca5a5 !important;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.15) !important;
}

.portal-gh-logout-btn:hover {
    background: rgba(239, 68, 68, 0.28) !important;
    border-color: rgba(239, 68, 68, 0.8) !important;
    color: #ffffff !important;
    box-shadow: 0 0 18px rgba(239, 68, 68, 0.4) !important;
    transform: translateY(-1px);
}
/* Global Layout Safeguard: Ensure pages with flex body stack vertically */
body.portal-gh-ready {
    flex-direction: column !important;
}