/* =====================================================================
   Team Member profile — Apple iOS / macOS "glass material" restyle
   ---------------------------------------------------------------------
   Sober, professional light-material look (NOT a vibrant social gradient):
   frosted near-white surfaces, hairline borders, soft shadows and a single
   restrained iOS-blue accent (#007aff). Flips to a dark material under the
   1E202D dark theme.

   Scoped to `.nz-tm-profile` (set on #page-content of team_members/view.php
   and team_members/profile_card.php) so it never leaks into the shared
   clients/leads contact views that reuse users/profile_image_section.php.
   ===================================================================== */

.nz-tm-profile {
    --tm-radius-hero: 26px;
    --tm-radius-tile: 18px;
    --tm-radius-tab: 15px;
    --tm-blur: saturate(160%) blur(20px);

    /* ink */
    --tm-ink: #1d1d1f;
    --tm-ink-2: #43434a;
    --tm-ink-dim: #86868b;

    /* accent (Apple system blue), used sparingly */
    --tm-accent: #007aff;
    --tm-accent-strong: #0a6fe0;

    /* surfaces */
    --tm-hairline: rgba(0, 0, 0, 0.08);
    --tm-panel: rgba(255, 255, 255, 0.72);
    --tm-tile: rgba(255, 255, 255, 0.62);
    --tm-hero-1: #ffffff;
    --tm-hero-2: #eef1f6;
}

/* ----------------------------------------------------------------- HERO */
.nz-tm-profile .nz-tm-hero {
    position: relative;
    isolation: isolate;
    margin-bottom: 18px;
    border-radius: var(--tm-radius-hero);
    overflow: hidden;
    background: linear-gradient(180deg, var(--tm-hero-1) 0%, var(--tm-hero-2) 100%);
    border: 1px solid var(--tm-hairline);
    box-shadow:
        0 18px 42px -26px rgba(30, 40, 70, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

/* whisper-quiet neutral sheen — no bold colour */
.nz-tm-profile .nz-tm-hero-glow {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(58% 78% at 90% -12%, rgba(0, 122, 255, 0.05), transparent 60%),
        radial-gradient(50% 70% at 4% 112%, rgba(0, 0, 0, 0.03), transparent 60%);
}

.nz-tm-profile .nz-tm-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.5), transparent 22%);
}

.nz-tm-profile .nz-tm-hero-inner {
    position: relative;
    z-index: 2;
    padding: 12px 10px;
}

.nz-tm-profile .nz-tm-hero .row {
    align-items: center;
}

/* ------------------------------------------------------- AVATAR + IDENTITY */
.nz-tm-profile #profile-image-section .profile-image {
    width: auto;
    position: relative;
}

.nz-tm-profile #profile-image-section .avatar-lg {
    width: 138px;
    height: 138px;
    padding: 5px;
    border-radius: 50%;
    background: #f5f5f7;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow:
        0 12px 26px -14px rgba(30, 40, 70, 0.35),
        inset 0 1px 0 #ffffff;
}

.nz-tm-profile #profile-image-section .avatar-lg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 3px solid #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.nz-tm-profile #profile-image-section h4 {
    margin-top: 16px;
    color: var(--tm-ink);
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* only the camera (upload + crop) remains — the direct 200x200 upload is dropped */
.nz-tm-profile .profile-image-direct-upload {
    display: none !important;
}

.nz-tm-profile .profile-image-upload {
    margin: 0 !important;
}

.nz-tm-profile .profile-image-upload:not(.profile-image-direct-upload) {
    position: absolute;
    top: 6px;
    left: calc(50% + 40px);
    z-index: 4;
}

.nz-tm-profile .profile-image-upload .btn {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.92) !important;
    border: 1px solid var(--tm-hairline);
    -webkit-backdrop-filter: var(--tm-blur);
    backdrop-filter: var(--tm-blur);
    box-shadow: 0 6px 16px -6px rgba(30, 40, 70, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.nz-tm-profile .profile-image-upload .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px -8px rgba(0, 122, 255, 0.4);
}

.nz-tm-profile .profile-image-upload .btn i {
    color: var(--tm-accent);
}

/* job title accent chip */
.nz-tm-profile #profile-image-section .badge.bg-info {
    background: rgba(0, 0, 0, 0.05) !important;
    color: var(--tm-ink-2) !important;
    border: 1px solid var(--tm-hairline);
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* email / phone → light frosted pills */
.nz-tm-profile #profile-image-section .tm-contact {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 6px 6px 0 0 !important;
    padding: 8px 15px !important;
    border-radius: 999px;
    background: var(--tm-panel);
    border: 1px solid var(--tm-hairline);
    -webkit-backdrop-filter: var(--tm-blur);
    backdrop-filter: var(--tm-blur);
    color: var(--tm-ink-2);
    font-size: 13px;
    line-height: 1.1;
    box-shadow: 0 4px 10px -8px rgba(30, 40, 70, 0.3);
}

.nz-tm-profile #profile-image-section .tm-contact i {
    color: var(--tm-ink-dim);
}

/* --------------------------------------------------------- SOCIAL BUTTONS */
.nz-tm-profile #profile-image-section .social-icons-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.nz-tm-profile #profile-image-section .tm-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--tm-panel);
    border: 1px solid var(--tm-hairline);
    color: var(--tm-ink-2);
    font-size: 17px;
    line-height: 1;
    text-decoration: none;
    -webkit-backdrop-filter: var(--tm-blur);
    backdrop-filter: var(--tm-blur);
    box-shadow: 0 4px 10px -7px rgba(30, 40, 70, 0.3);
    transition: transform 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.nz-tm-profile #profile-image-section .tm-social-link:hover,
.nz-tm-profile #profile-image-section .tm-social-link:focus-visible {
    transform: translateY(-2px);
    color: var(--tm-accent);
    border-color: rgba(0, 122, 255, 0.4);
    box-shadow: 0 9px 18px -9px rgba(0, 122, 255, 0.45);
    outline: none;
}

.nz-tm-profile #profile-image-section .tm-social-link:focus-visible {
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.35);
}

.nz-tm-profile #profile-image-section .tm-social-link svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* --------------------------------------------------------- ACTION BUTTONS */
/* reminders / secondary → light glass pill */
.nz-tm-profile #profile-image-section .btn-transparent {
    border: 1px solid var(--tm-hairline);
    background: var(--tm-panel);
    color: var(--tm-accent) !important;
    border-radius: 999px;
    padding: 9px 18px;
    font-weight: 500;
    -webkit-backdrop-filter: var(--tm-blur);
    backdrop-filter: var(--tm-blur);
    box-shadow: 0 4px 12px -8px rgba(30, 40, 70, 0.3);
    transition: transform 0.15s ease, background 0.15s ease;
}

.nz-tm-profile #profile-image-section .btn-transparent:hover {
    transform: translateY(-1px);
    background: #ffffff;
}

/* send message → the one filled accent primary action */
.nz-tm-profile #profile-image-section .tm-btn-primary,
.nz-tm-profile #profile-image-section .tm-btn-primary.btn-transparent {
    background: var(--tm-accent) !important;
    color: #ffffff !important;
    border: 0 !important;
    box-shadow: 0 8px 18px -8px rgba(0, 122, 255, 0.6);
}

.nz-tm-profile #profile-image-section .tm-btn-primary:hover {
    background: var(--tm-accent-strong) !important;
    color: #ffffff !important;
}

/* ---------------------------------------------------------- STAT WIDGETS */
.nz-tm-profile .cover-widget .row.p20 {
    display: block;
    padding: 12px 18px;
}

.nz-tm-profile .cover-widget .box {
    display: flex;
    gap: 14px;
    width: 100%;
    margin-bottom: 14px;
    border: 0 !important;
}

.nz-tm-profile .cover-widget .box:last-child {
    margin-bottom: 0;
}

.nz-tm-profile .cover-widget .box-content {
    display: block;
    flex: 1 1 0;
    border-radius: var(--tm-radius-tile);
    background: var(--tm-tile);
    border: 1px solid var(--tm-hairline) !important;
    -webkit-backdrop-filter: var(--tm-blur);
    backdrop-filter: var(--tm-blur);
    box-shadow:
        0 12px 26px -20px rgba(30, 40, 70, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    overflow: hidden;
}

.nz-tm-profile .cover-widget .box-content .card-body {
    padding: 18px 12px;
    /* neutralise the 1E202D dark theme's forced .card-body background so the
       translucent glass tile shows through in dark mode */
    background: transparent !important;
}

.nz-tm-profile .cover-widget h1 {
    color: var(--tm-ink);
    font-weight: 700;
    font-size: 2.1rem;
    line-height: 1.05;
}

.nz-tm-profile .cover-widget .text-off {
    color: var(--tm-ink-dim) !important;
    opacity: 1;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.09em;
}

.nz-tm-profile .cover-widget .b-r,
.nz-tm-profile .cover-widget .b-t {
    border: 0 !important;
}

/* ------------------------------------------------------------- TAB BAR
   The frosted bar is the wrapper; the <ul> is a horizontal scroller inside
   it, flanked by chevron buttons that only appear when the tabs overflow. */
.nz-tm-profile .nz-tm-tabs-wrap {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0 2px 20px;
    padding: 6px;
    border-radius: var(--tm-radius-tab);
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--tm-hairline);
    -webkit-backdrop-filter: var(--tm-blur);
    backdrop-filter: var(--tm-blur);
    box-shadow:
        0 14px 30px -24px rgba(30, 40, 70, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* edge fades — appear only in the direction there is more to scroll. Absolute
   so they never change the scroller's size (avoids a ResizeObserver loop). */
.nz-tm-profile .nz-tm-tabs-wrap::before,
.nz-tm-profile .nz-tm-tabs-wrap::after {
    content: "";
    position: absolute;
    top: 6px;
    bottom: 6px;
    width: 48px;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    border-radius: var(--tm-radius-tab);
}

.nz-tm-profile .nz-tm-tabs-wrap::before {
    left: 6px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.95) 34%, rgba(255, 255, 255, 0));
}

.nz-tm-profile .nz-tm-tabs-wrap::after {
    right: 6px;
    background: linear-gradient(270deg, rgba(255, 255, 255, 0.95) 34%, rgba(255, 255, 255, 0));
}

.nz-tm-profile .nz-tm-tabs-wrap.can-prev::before {
    opacity: 1;
}

.nz-tm-profile .nz-tm-tabs-wrap.can-next::after {
    opacity: 1;
}

/* chevron scroll buttons — overlaid on the edges, shown only when there is
   more to scroll that way (.can-prev / .can-next), so they never resize the
   scroller and never sit over a fully-visible first/last tab. */
.nz-tm-profile .nz-tm-tab-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--tm-hairline);
    background: #ffffff;
    border-radius: 50%;
    color: var(--tm-ink-2);
    cursor: pointer;
    box-shadow: 0 4px 10px -6px rgba(30, 40, 70, 0.35);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nz-tm-profile .nz-tm-tab-prev {
    left: 6px;
}

.nz-tm-profile .nz-tm-tab-next {
    right: 6px;
}

.nz-tm-profile .nz-tm-tabs-wrap.can-prev .nz-tm-tab-prev,
.nz-tm-profile .nz-tm-tabs-wrap.can-next .nz-tm-tab-next {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.nz-tm-profile .nz-tm-tab-nav i {
    font-size: 14px;
    line-height: 1;
}

.nz-tm-profile .nz-tm-tab-nav:hover {
    color: var(--tm-accent);
    border-color: rgba(0, 122, 255, 0.35);
}

.nz-tm-profile #team-member-view-tabs.nav-tabs {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-wrap: nowrap;
    gap: 3px;
    margin: 0;
    padding: 0;
    border: 0 !important;
    background: transparent;
    box-shadow: none;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
}

.nz-tm-profile #team-member-view-tabs.nav-tabs::-webkit-scrollbar {
    display: none;
}

.nz-tm-profile #team-member-view-tabs.nav-tabs li {
    margin: 0;
    flex: 0 0 auto;
}

.nz-tm-profile #team-member-view-tabs.nav-tabs li a {
    display: block;
    border: 0 !important;
    margin: 0;
    padding: 9px 15px;
    white-space: nowrap;
    border-radius: 11px !important;
    color: var(--tm-ink-2);
    font-weight: 500;
    background: transparent;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.nz-tm-profile #team-member-view-tabs.nav-tabs li a:hover {
    background: rgba(0, 0, 0, 0.045);
    color: var(--tm-ink);
}

.nz-tm-profile #team-member-view-tabs.nav-tabs li a.active {
    color: var(--tm-accent);
    background: #ffffff;
    box-shadow:
        0 4px 12px -6px rgba(30, 40, 70, 0.3),
        inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

/* tab content panel — round the corners to match the material language */
.nz-tm-profile .tab-content > .tab-pane .card {
    border-radius: 20px;
    border: 1px solid var(--tm-hairline);
    box-shadow: 0 18px 38px -30px rgba(30, 40, 70, 0.35);
}

/* ================================================================ ICONS
   FA7 glyphs replace Feather SVGs; .icon-16 only set width/height for
   Feather, so give the <i> a real font-size and release the box. */
.nz-tm-profile .nz-tm-hero i[class*="fa-"],
.nz-tm-profile .profile-image-upload i[class*="fa-"] {
    width: auto;
    height: auto;
    font-size: 15px;
    line-height: 1;
    vertical-align: -0.06em;
}

/* ========================================================= GRID (list alt)
   team_members/profile_card.php — the "all members" grid of mini profile
   cards. Given a matching sober material look via .nz-tm-membercard. */
.nz-tm-profile .nz-tm-membercard {
    position: relative;
    border: 1px solid var(--tm-hairline) !important;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.78);
    -webkit-backdrop-filter: var(--tm-blur);
    backdrop-filter: var(--tm-blur);
    box-shadow: 0 16px 34px -28px rgba(30, 40, 70, 0.4);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.nz-tm-profile .nz-tm-membercard:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 40px -26px rgba(30, 40, 70, 0.42);
}

.nz-tm-profile .nz-tm-membercard .card-body {
    padding-top: 22px;
}

.nz-tm-profile .nz-tm-membercard .avatar-md {
    padding: 3px;
    background: #f5f5f7;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 8px 18px -12px rgba(30, 40, 70, 0.4);
}

.nz-tm-profile .nz-tm-membercard .avatar-md img {
    border: 2px solid #fff;
}

.nz-tm-profile .nz-tm-membercard h4 {
    margin-top: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--tm-ink);
}

.nz-tm-profile .nz-tm-membercard .card-footer {
    background: transparent !important;
    border: 0 !important;
    padding-top: 0;
    padding-bottom: 20px;
}

.nz-tm-profile .nz-tm-membercard .card-footer .btn {
    border-radius: 999px;
    padding: 8px 20px;
    background: var(--tm-accent) !important;
    border: 0 !important;
    color: #fff !important;
    box-shadow: 0 8px 18px -8px rgba(0, 122, 255, 0.55);
}

.nz-tm-profile .nz-tm-membercard .card-footer .btn:hover {
    background: var(--tm-accent-strong) !important;
}

/* view toggle + toolbar icons on the grid page */
.nz-tm-profile .page-title i[class*="fa-"] {
    width: auto;
    height: auto;
    font-size: 15px;
    line-height: 1;
    vertical-align: -0.06em;
}

/* =============================================================== DARK MODE
   NIZU dark = body.color-1E202D (theme stylesheet), not html.dark.
   The hero becomes an elevated dark material; surfaces flip to dark glass. */
body.color-1E202D .nz-tm-profile {
    --tm-ink: #f5f5f7;
    --tm-ink-2: #d1d1d6;
    --tm-ink-dim: #8e8e93;
    --tm-accent: #0a84ff;
    --tm-accent-strong: #409cff;
    --tm-hairline: rgba(255, 255, 255, 0.1);
    --tm-panel: rgba(255, 255, 255, 0.08);
    --tm-tile: rgba(255, 255, 255, 0.06);
}

body.color-1E202D .nz-tm-profile .nz-tm-hero {
    background: linear-gradient(180deg, #2c2e39 0%, #23242e 100%);
    border-color: rgba(255, 255, 255, 0.09);
    box-shadow:
        0 22px 46px -28px rgba(0, 0, 0, 0.75),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.color-1E202D .nz-tm-profile .nz-tm-hero::after {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 22%);
}

body.color-1E202D .nz-tm-profile #profile-image-section .avatar-lg {
    background: #33343f;
    border-color: rgba(255, 255, 255, 0.12);
}

body.color-1E202D .nz-tm-profile #profile-image-section .avatar-lg img {
    border-color: rgba(255, 255, 255, 0.14);
}

body.color-1E202D .nz-tm-profile .profile-image-upload .btn {
    background: rgba(60, 62, 74, 0.92) !important;
    border-color: rgba(255, 255, 255, 0.14);
}

body.color-1E202D .nz-tm-profile #profile-image-section .btn-transparent:hover {
    background: rgba(255, 255, 255, 0.14);
}

body.color-1E202D .nz-tm-profile .nz-tm-tabs-wrap {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.09);
    box-shadow:
        0 16px 34px -26px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.color-1E202D .nz-tm-profile .nz-tm-tab-nav {
    background: #34363f;
    border-color: rgba(255, 255, 255, 0.14);
    color: #f5f5f7;
    box-shadow: 0 4px 10px -6px rgba(0, 0, 0, 0.6);
}

body.color-1E202D .nz-tm-profile .nz-tm-tabs-wrap::before {
    background: linear-gradient(90deg, rgba(30, 32, 45, 0.96) 34%, rgba(30, 32, 45, 0));
}

body.color-1E202D .nz-tm-profile .nz-tm-tabs-wrap::after {
    background: linear-gradient(270deg, rgba(30, 32, 45, 0.96) 34%, rgba(30, 32, 45, 0));
}

body.color-1E202D .nz-tm-profile #team-member-view-tabs.nav-tabs {
    background: transparent;
}

body.color-1E202D .nz-tm-profile #team-member-view-tabs.nav-tabs li a:hover {
    background: rgba(255, 255, 255, 0.08);
}

body.color-1E202D .nz-tm-profile #team-member-view-tabs.nav-tabs li a.active {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

body.color-1E202D .nz-tm-profile .tab-content > .tab-pane .card {
    border-color: rgba(255, 255, 255, 0.07);
    box-shadow: 0 18px 38px -30px rgba(0, 0, 0, 0.75);
}

body.color-1E202D .nz-tm-profile .nz-tm-membercard {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.09) !important;
    box-shadow: 0 18px 36px -28px rgba(0, 0, 0, 0.7);
}

body.color-1E202D .nz-tm-profile .nz-tm-membercard .avatar-md {
    background: #33343f;
    border-color: rgba(255, 255, 255, 0.12);
}

/* ------------------------------------------------------------ RESPONSIVE */
@media (max-width: 767.98px) {
    .nz-tm-profile .nz-tm-hero {
        border-radius: 22px;
    }

    .nz-tm-profile .profile-image-upload:not(.profile-image-direct-upload) {
        left: calc(50% + 36px);
    }

    .nz-tm-profile .cover-widget .row.p20 {
        padding: 4px 14px 14px;
    }

    .nz-tm-profile .nz-tm-tabs-wrap {
        border-radius: 13px;
    }
}
