/* profile-header-footer.css - chrome for the logged-in dashboard header/footer
   (_RedesignHeaderLogged.cshtml / _RedesignFooterLogged.cshtml). Loads after redesign-core.css,
   which already supplies header.nav/.nav-inner/.brand/.footer-grid/.footer-brand/.footer-social/
   .footer-col/.mobile-menu/.theme-toggle/.reveal - this file adds the mega menus, user avatar
   dropdown and favourites panel that the marketing header (_RedesignHeader.cshtml) doesn't have.
   Extracted from redesign/startpage-redesign-kopi.html. */

/* The dropdown panels below are positioned relative to .nav-inner (not header.nav) so they line
   up with the actual right edge of the visible nav content instead of the fixed header's full
   viewport-wide edge (which drifts far right of the user-chip/fav button on wide screens once
   .container's max-width leaves empty space on either side). */
#site-header .nav-inner { position: relative; }

.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-btn {
    display: inline-flex; align-items: center; gap: 4px; padding: 9px 14px; border: none; background: none;
    border-radius: 9px; cursor: pointer; font-family: inherit; font-weight: 600; font-size: 0.95rem;
    color: var(--ink-2); transition: background var(--dur-2), color var(--dur-2);
}
.nav-btn:hover, .nav-btn.active { color: var(--orange); background: var(--orange-soft); }
.nav-btn .material-icons { font-size: 19px; transition: transform var(--dur-2) var(--ease-out); }
.nav-btn .lead-ic { font-size: 20px; color: var(--muted); margin-right: 3px; transition: color var(--dur-2); }
.nav-btn:hover .lead-ic, .nav-btn.active .lead-ic { color: var(--orange); }
.nav-btn.active .material-icons.arrow { transform: rotate(180deg); }

/* Quick search (real /Home/GetAllEntitiesAndPersons lookup - see profile-header.js). Sits between
   the nav links and the avatar/favourites icons; margin-left:auto absorbs the row's free space so
   it and .nav-cta stay flush against the right edge regardless of how many nav-links there are. */
.nav-search-box {
    position: relative;
    margin-left: auto;
    margin-right: 14px;
    display: flex; align-items: center; gap: 6px;
    width: 200px;
    background: var(--bg);
    border: 1px solid var(--line-2);
    border-radius: 999px;
    padding: 7px 7px 7px 14px;
    transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), width var(--dur-2) var(--ease-out);
}
.nav-search-box:hover { border-color: var(--muted-2); }
.nav-search-box:focus-within { border-color: var(--orange); box-shadow: 0 0 0 4px var(--orange-soft); width: 260px; }
.nav-search-box > .material-icons { font-size: 19px; color: var(--muted-2); flex: 0 0 auto; }
.nav-search-box:focus-within > .material-icons { color: var(--orange); }
.nav-search-box input[type="search"] {
    flex: 1; min-width: 0; border: none; outline: none; background: transparent;
    font-family: inherit; font-size: 0.9rem; color: var(--ink); padding: 4px 0;
}
.nav-search-box input::placeholder { color: var(--muted-2); }
.nav-search-box input::-webkit-search-cancel-button { display: none; }
.nav-search-box button {
    flex: 0 0 auto; display: grid; place-items: center; width: 30px; height: 30px;
    border: none; border-radius: 50%; background: var(--orange); color: #fff; cursor: pointer;
    transition: background var(--dur-2) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.nav-search-box button .material-icons { font-size: 16px; }
.nav-search-box button:hover { background: var(--orange-2); transform: scale(1.06); }
[data-theme="dark"] .nav-search-box { background: var(--bg-soft); }

.nav-search-results {
    display: none;
    position: absolute; top: calc(100% + 8px); left: 0; right: 0;
    background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 6px; max-height: 380px; overflow-y: auto; z-index: 1001;
}
.nav-search-results.show { display: block; }
.nav-search-results .nsr-status { padding: 14px 12px; color: var(--muted); font-size: 0.86rem; font-weight: 600; }
.nav-search-results .nsr-item {
    display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px;
    color: var(--ink); transition: background .15s;
}
.nav-search-results .nsr-item:hover, .nav-search-results .nsr-item.active { background: var(--bg-soft); }
[data-theme="dark"] .nav-search-results .nsr-item:hover, [data-theme="dark"] .nav-search-results .nsr-item.active { background: rgba(255,255,255,0.06); }
.nsr-thumb {
    width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto; overflow: hidden;
    background: var(--bg-soft); display: grid; place-items: center; color: var(--muted-2);
}
.nsr-thumb img { width: 100%; height: 100%; object-fit: cover; }
.nsr-thumb .material-icons { font-size: 18px; }
.nsr-meta { min-width: 0; flex: 1; }
.nsr-name { font-weight: 700; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nsr-type {
    flex: 0 0 auto; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
    color: var(--orange); background: var(--orange-soft); padding: 3px 9px; border-radius: 999px;
}
@media (max-width: 1180px) { .nav-search-box { width: 170px; } .nav-search-box:focus-within { width: 230px; } }
@media (max-width: 1000px) { .nav-search-box { margin-left: 0; } }
/* .nav-inner is a fixed-height single row (see redesign-core.css), so there is no room to wrap
   the search box onto its own line at narrow widths - hide it and rely on the hamburger menu,
   same as .nav-links already does at the 1000px breakpoint above. */
@media (max-width: 640px) { .nav-search-box { display: none; } }

/* ===== Search box is now a trigger button that opens the AI search modal ===== */
.nav-search-trigger { cursor: pointer; text-align: left; font-family: inherit; }
.nav-search-trigger .nav-search-ph {
    flex: 1; min-width: 0; color: var(--muted-2); font-size: 0.9rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 4px 0;
}
.nav-search-trigger .nav-search-go {
    flex: 0 0 auto; display: grid; place-items: center; width: 30px; height: 30px;
    border-radius: 50%; background: var(--orange); color: #fff;
    transition: background var(--dur-2) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.nav-search-trigger .nav-search-go .material-icons { font-size: 16px; }
.nav-search-trigger:hover .nav-search-go { background: var(--orange-2); transform: scale(1.06); }

/* ===== AI Search modal overlay (same live suggestions as the landing hero) ===== */
.nav-search-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(22,22,26,.45);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 9vh 24px 24px;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity var(--dur-2) var(--ease-out), visibility var(--dur-2);
}
.nav-search-overlay.open { opacity: 1; visibility: visible; pointer-events: auto; }
/* The modal is a transparent wrapper - the hosted VIP AI Search card (.vip-ai .ai-card) provides
   the visual surface, so its look stays identical to the dashboard hero. */
.nav-search-modal {
    position: relative;
    width: 100%; max-width: 860px;
    transform: translateY(14px) scale(.985);
    transition: transform var(--dur-2) var(--ease-out);
}
.nav-search-overlay.open .nav-search-modal { transform: translateY(0) scale(1); }
.nav-search-modal .vip-ai { max-width: none; }
.nav-search-modal .vip-ai .ai-card { padding: 30px 34px; }
.nsm-close {
    position: absolute; top: 14px; right: 14px; z-index: 2;
    display: grid; place-items: center; width: 38px; height: 38px;
    border: 1px solid var(--line-2); border-radius: 50%; background: var(--bg); color: var(--muted);
    cursor: pointer; transition: color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.nsm-close:hover { color: var(--orange); border-color: var(--orange); transform: rotate(90deg); }
.nsm-close .material-icons { font-size: 20px; }
/* Give the AI results room to scroll inside the overlay */
.nav-search-modal .vip-ai .ai-results { max-height: 52vh; overflow-y: auto; }
@media (max-width: 640px) {
    .nav-search-modal .vip-ai .ai-card { padding: 22px 18px; }
}

.nav-cta { display: flex; align-items: center; gap: 10px; }
.icon-btn {
    width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-2);
    background: var(--bg); color: var(--ink-2); cursor: pointer; display: flex;
    align-items: center; justify-content: center; transition: all .2s;
}
.icon-btn:hover { border-color: var(--orange); color: var(--orange); }
.icon-btn .material-icons { font-size: 20px; }
[data-theme="dark"] .icon-btn { background: var(--bg-soft); }

/* User chip + dropdown */
.user-chip {
    display: inline-flex; align-items: center; gap: 9px; padding: 6px 12px 6px 7px;
    border: 1.5px solid var(--orange); border-radius: 999px; background: var(--bg); cursor: pointer;
    font-family: inherit; font-weight: 700; font-size: 0.9rem; color: var(--ink);
    transition: box-shadow .2s, background .2s;
}
.user-chip:hover { box-shadow: 0 0 0 3px var(--orange-soft); }
[data-theme="dark"] .user-chip { background: var(--bg-soft); }
.user-chip .avatar {
    width: 29px; height: 29px; border-radius: 50%; background: var(--orange); color: #fff;
    display: grid; place-items: center; font-size: 0.78rem; font-weight: 800;
}
.user-chip .material-icons { font-size: 18px; color: var(--muted-2); }
@media (max-width: 640px) { .user-chip .name { display: none; } }

/* FREE-tier chip badge + "Upgrade to PRO" CTA in the logged-in header */
.user-chip .name .plan-tag {
    margin-left: 6px; padding: 1px 6px; border-radius: 999px; font-size: 0.6rem; font-weight: 800;
    letter-spacing: 0.04em; background: var(--bg-soft); color: var(--muted); vertical-align: middle;
}
.nav-upgrade { background: var(--orange); color: #fff; border: 1.5px solid var(--orange); }
.nav-upgrade:hover { filter: brightness(1.05); }

.user-panel {
    position: absolute; top: calc(100% - 6px); right: 0; width: 240px;
    background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-lg);
    box-shadow: var(--shadow); padding: 10px; z-index: 1001;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out), visibility var(--dur-2);
    /* header.nav has backdrop-filter:blur() + is position:fixed; without a promoted compositing
       layer here, the browser has to recomposite the blurred region every frame of this panel's
       own opacity/transform transition, which shows up as a visible flicker on open (Chrome/Edge
       on Windows especially). will-change pre-promotes the panel to its own layer. */
    will-change: opacity, transform;
}
[data-theme="dark"] .user-panel { background: var(--bg-soft); }
.user-panel.open { opacity: 1; visibility: visible; transform: none; }
.user-panel a {
    display: flex; align-items: center; gap: 13px; padding: 12px 14px; border-radius: 11px;
    font-weight: 600; font-size: 0.98rem; color: var(--ink-2); transition: background .15s, color .15s;
}
.user-panel a:hover { background: var(--bg-soft); color: var(--orange); }
[data-theme="dark"] .user-panel a:hover { background: rgba(255,255,255,0.06); }
.user-panel a .material-icons { font-size: 20px; color: var(--muted-2); }
.user-panel a:hover .material-icons { color: var(--orange); }
.user-panel .sep { height: 1px; background: var(--line); margin: 8px 8px; }
/* Theme toggle relocated here from the top-level icon row (see .nav-search-box above - freeing
   that slot keeps the nav from wrapping to 2 lines once the search box is focused/expanded).
   Same visual recipe as .user-panel a, just on a <button> since it doesn't navigate anywhere. */
.user-panel button.theme-row {
    display: flex; align-items: center; gap: 13px; padding: 12px 14px; border-radius: 11px;
    font-weight: 600; font-size: 0.98rem; color: var(--ink-2); transition: background .15s, color .15s;
    width: 100%; border: none; background: none; cursor: pointer; font-family: inherit; text-align: left;
}
.user-panel button.theme-row:hover { background: var(--bg-soft); color: var(--orange); }
[data-theme="dark"] .user-panel button.theme-row:hover { background: rgba(255,255,255,0.06); }
.user-panel button.theme-row .material-icons { font-size: 20px; color: var(--muted-2); }
.user-panel button.theme-row:hover .material-icons { color: var(--orange); }

.fav-panel { width: 340px; padding: 14px; }
.fav-head { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 0.98rem; color: var(--ink); margin-bottom: 12px; }
.fav-head .material-icons { font-size: 19px; color: var(--orange); }
.fav-close {
    margin-left: auto; width: 30px; height: 30px; border: none; border-radius: 8px;
    background: none; color: var(--muted-2); cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s;
}
.fav-close:hover { background: var(--bg-soft); color: var(--ink); }
[data-theme="dark"] .fav-close:hover { background: rgba(255,255,255,0.06); }
.fav-close .material-icons { font-size: 20px; color: inherit; }
.fav-panel .vip-select { margin-bottom: 8px; }
.fav-panel .row-item { min-height: 54px; padding: 7px 0; }
.fav-panel .row-item a { padding: 0; }
.fav-panel .row-item a:hover { background: none; }

/* Mega menu panels */
.mega-panel {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out), visibility var(--dur-2);
    will-change: opacity, transform;
}
.mega-panel.open { opacity: 1; visibility: visible; transform: none; }
.mega-grid { display: flex; align-items: stretch; gap: 0; padding: 34px 0 38px; }
.mega-col { flex: 1; min-width: 0; padding: 0 26px; }
.mega-col:first-child { padding-left: 0; }
/* Vertical rule between mega columns (matches the navbar template) */
.mega-divider { flex: 0 0 auto; width: 1px; background: var(--line); align-self: stretch; margin: 4px 0; }
.mega-col h3 { font-size: 1.05rem; margin-bottom: 4px; }
.mega-col h3 a:hover { color: var(--orange); }
.mega-ic {
    width: 44px; height: 44px; border-radius: 12px; background: var(--orange-soft); color: var(--orange);
    display: grid; place-items: center; margin-bottom: 14px;
}
.mega-ic .material-icons { font-size: 23px; }
.mega-col ul { list-style: none; padding: 0; margin: 8px 0 0; }
.mega-col ul li a {
    display: flex; align-items: center; gap: 6px; padding: 5px 0; color: var(--muted);
    font-size: 0.93rem; font-weight: 500; transition: color .2s;
}
.mega-col ul li a:hover { color: var(--orange); }
.mega-col ul li a .cnt { margin-left: auto; padding-left: 12px; font-size: 0.78rem; font-weight: 700; color: var(--muted-2); transition: color .2s; }
.mega-col ul li a:hover .cnt { color: var(--orange); }
.mega-count {
    margin-top: 12px; display: inline-block; font-size: 0.76rem; font-weight: 700;
    letter-spacing: 0.05em; text-transform: uppercase; color: var(--orange);
    background: var(--orange-soft); padding: 4px 11px; border-radius: 999px;
}
.mega-callout {
    flex: 0 0 250px; margin-left: 26px;
    background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 22px; display: flex; flex-direction: column; align-self: start;
}
.mega-callout h4 { font-size: 0.98rem; margin-bottom: 8px; }
.mega-callout p { color: var(--muted); font-size: 0.88rem; margin: 0 0 14px; line-height: 1.5; }
.mega-callout a.co-link { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: 0.9rem; color: var(--orange); }
.mega-callout a.co-link .material-icons { font-size: 17px; }

@media (max-width: 1000px) {
    .nav-links { display: none; }
    .mega-grid { flex-wrap: wrap; }
    .mega-col { flex: 1 1 45%; }
    .mega-divider { display: none; }
}

/* Subscription status pill - used in both the dashboard hero and the footer */
.status-pill {
    display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 700;
    letter-spacing: 0.05em; text-transform: uppercase; padding: 4px 12px; border-radius: 999px;
    background: var(--green-soft); color: var(--green);
}
.status-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.footer-bottom { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--muted-2); font-size: 0.85rem; }
.footer-bottom .user-status { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
