/* ==========================================================================
   PRIMA FINANCE — TEAM & BOARD PAGES
   Premium design with wow effects: 3D tilt, gradient reveal, staggered
   entrance, glassmorphism, parallax shapes, social hover reveal
   ========================================================================== */

/* ─── FLOATING SHAPES (background decoration) ──────────────────────── */
.pf-tp-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.pf-tp-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.04;
    background: var(--app-them, #072890);
}

.pf-tp-shape:nth-child(1) {
    width: 400px; height: 400px;
    top: -120px; right: -80px;
    animation: pf-tp-float 20s ease-in-out infinite;
}

.pf-tp-shape:nth-child(2) {
    width: 280px; height: 280px;
    bottom: -60px; left: -60px;
    animation: pf-tp-float 16s ease-in-out infinite reverse;
}

.pf-tp-shape:nth-child(3) {
    width: 160px; height: 160px;
    top: 40%; left: 50%;
    background: var(--app-second-them, #e30613);
    animation: pf-tp-float 12s ease-in-out infinite 3s;
}

@keyframes pf-tp-float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25%  { transform: translate(20px, -30px) rotate(5deg); }
    50%  { transform: translate(-15px, 15px) rotate(-3deg); }
    75%  { transform: translate(10px, 20px) rotate(4deg); }
}

/* ─── SECTION LAYOUT ───────────────────────────────────────────────── */
.pf-tp-section {
    padding: 96px 0;
    position: relative;
    background: var(--pf-surface, #fff);
    overflow: hidden;
}

.pf-tp-section--alt {
    background: var(--pf-surface-alt, #f4f6fc);
}

.pf-tp-section-header {
    text-align: center;
    margin-bottom: 56px;
}

.pf-tp-section-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--app-them, #072890);
    background: rgba(7,40,144,.06);
    padding: 8px 20px;
    border-radius: 9999px;
    margin-bottom: 18px;
    border: 1px solid rgba(7,40,144,.1);
}

.pf-tp-section-label i { font-size: 11px; }

.pf-tp-section-header h2 {
    font-size: clamp(26px, 3.5vw, 40px);
    font-weight: 800;
    color: var(--pf-text, #0d1226);
    margin: 0 0 12px;
    letter-spacing: -0.025em;
    line-height: 1.15;
}

.pf-tp-section-header p {
    font-size: 16px;
    color: var(--pf-text-secondary, #505878);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.65;
}

/* ─── MEMBERS GRID ─────────────────────────────────────────────────── */
.pf-tp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 32px;
    max-width: 1140px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ─── STAGGER ENTRANCE ─────────────────────────────────────────────── */
.pf-tp-card-wrap {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    transition: opacity 0.6s cubic-bezier(0.22,1,0.36,1),
                transform 0.6s cubic-bezier(0.22,1,0.36,1);
}

.pf-tp-card-wrap.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ─── THE CARD — 3D Perspective container ──────────────────────────── */
.pf-tp-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: var(--pf-surface-card, #fff);
    border: 1px solid var(--pf-border-light, #edf0f7);
    box-shadow: var(--pf-shadow-sm, 0 2px 6px rgba(7,40,144,.06));
    transition: transform 0.5s cubic-bezier(0.22,1,0.36,1),
                box-shadow 0.5s cubic-bezier(0.22,1,0.36,1);
    cursor: pointer;
    transform-style: preserve-3d;
    will-change: transform;
}

.pf-tp-card:hover {
    transform: translateY(-10px);
    box-shadow:
        0 20px 50px rgba(7,40,144,.15),
        0 8px 20px rgba(7,40,144,.08);
}

/* ─── PHOTO ZONE ───────────────────────────────────────────────────── */
.pf-tp-photo {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
    background: linear-gradient(160deg, #072890 0%, #0a3ab8 50%, #051c66 100%);
}

.pf-tp-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 0.7s cubic-bezier(0.22,1,0.36,1);
}

.pf-tp-card:hover .pf-tp-photo img {
    transform: scale(1.08);
}

/* Gradient overlay on photo (bottom) */
.pf-tp-photo::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top,
        rgba(0,0,0,.5) 0%,
        rgba(0,0,0,.15) 50%,
        transparent 100%);
    pointer-events: none;
    transition: opacity 0.4s ease;
}

/* Animated gradient border on hover */
.pf-tp-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(135deg, #072890, #0a3ab8, #e30613, #072890);
    background-size: 300% 300%;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 5;
    pointer-events: none;
    animation: pf-tp-border-spin 4s linear infinite paused;
}

.pf-tp-card:hover::before {
    opacity: 1;
    animation-play-state: running;
}

@keyframes pf-tp-border-spin {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Initials fallback */
.pf-tp-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 52px;
    font-weight: 800;
    color: rgba(255,255,255,.12);
    letter-spacing: 6px;
    user-select: none;
}

/* Name overlay on photo (bottom of photo) */
.pf-tp-photo-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 16px 20px;
    color: #fff;
}

.pf-tp-photo-name h4 {
    font-size: 17px;
    font-weight: 700;
    margin: 0 0 2px;
    line-height: 1.3;
    text-shadow: 0 1px 8px rgba(0,0,0,.4);
}

.pf-tp-photo-name span {
    font-size: 12px;
    font-weight: 600;
    opacity: .85;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-shadow: 0 1px 6px rgba(0,0,0,.3);
}

/* ─── CARD BODY ────────────────────────────────────────────────────── */
.pf-tp-body {
    padding: 18px 20px 20px;
    position: relative;
}

.pf-tp-bio {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--pf-text-secondary, #505878);
    margin: 0 0 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── SOCIAL BAR — slides up from bottom on hover ──────────────────── */
.pf-tp-socials {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 14px 0 0;
    border-top: 1px solid var(--pf-border-light, #edf0f7);
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.22,1,0.36,1);
}

.pf-tp-card:hover .pf-tp-socials {
    transform: translateY(0);
    opacity: 1;
}

.pf-tp-socials a {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(7,40,144,.06);
    color: var(--app-them, #072890);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.pf-tp-socials a:hover {
    background: var(--app-them, #072890);
    color: #fff;
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 16px rgba(7,40,144,.35);
}

/* "View profile" button */
.pf-tp-view {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--app-them, #072890);
    padding: 10px 0 0;
    transition: all 0.3s ease;
}

.pf-tp-view i {
    font-size: 11px;
    transition: transform 0.3s ease;
}

.pf-tp-card:hover .pf-tp-view {
    color: var(--app-primary-light, #0a3ab8);
}

.pf-tp-card:hover .pf-tp-view i {
    transform: translateX(4px);
}

/* ─── STAT STRIP (members count) ───────────────────────────────────── */
.pf-tp-stats {
    display: flex;
    justify-content: center;
    gap: 48px;
    margin-bottom: 48px;
}

.pf-tp-stat {
    text-align: center;
}

.pf-tp-stat-val {
    font-size: 42px;
    font-weight: 800;
    color: var(--app-them, #072890);
    line-height: 1;
    margin-bottom: 4px;
}

.pf-tp-stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--pf-text-muted, #8b93b0);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ─── EMPTY STATE ──────────────────────────────────────────────────── */
.pf-tp-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--pf-text-secondary, #505878);
}

.pf-tp-empty i {
    font-size: 56px;
    color: rgba(7,40,144,.1);
    margin-bottom: 20px;
    display: block;
}

.pf-tp-empty p {
    font-size: 17px;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ─── LOADING SKELETON ─────────────────────────────────────────────── */
.pf-tp-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 32px;
    max-width: 1140px;
    margin: 0 auto;
}

.pf-tp-skeleton {
    border-radius: 20px;
    overflow: hidden;
    background: var(--pf-surface-card, #fff);
    border: 1px solid var(--pf-border-light, #edf0f7);
}

.pf-tp-skeleton-photo {
    width: 100%;
    height: 280px;
    background: linear-gradient(90deg, rgba(7,40,144,.04) 25%, rgba(7,40,144,.08) 50%, rgba(7,40,144,.04) 75%);
    background-size: 200% 100%;
    animation: pf-tp-shimmer 1.5s ease-in-out infinite;
}

.pf-tp-skeleton-body {
    padding: 20px;
}

.pf-tp-skeleton-line {
    height: 14px;
    border-radius: 7px;
    background: linear-gradient(90deg, rgba(7,40,144,.04) 25%, rgba(7,40,144,.08) 50%, rgba(7,40,144,.04) 75%);
    background-size: 200% 100%;
    animation: pf-tp-shimmer 1.5s ease-in-out infinite;
    margin-bottom: 10px;
}

.pf-tp-skeleton-line:nth-child(1) { width: 70%; }
.pf-tp-skeleton-line:nth-child(2) { width: 50%; }
.pf-tp-skeleton-line:nth-child(3) { width: 90%; height: 10px; }

@keyframes pf-tp-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─── MEMBER DETAIL MODAL ──────────────────────────────────────────── */
.pf-tp-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s ease;
}

.pf-tp-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.pf-tp-modal {
    background: var(--pf-surface-card, #fff);
    border-radius: 28px;
    max-width: 760px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 32px 100px rgba(0,0,0,.3);
    transform: scale(0.88) translateY(30px);
    transition: transform 0.45s cubic-bezier(0.22,1,0.36,1);
}

.pf-tp-modal-overlay.active .pf-tp-modal {
    transform: scale(1) translateY(0);
}

.pf-tp-modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,.92);
    color: #333;
    font-size: 17px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
    transition: all 0.3s ease;
}

.pf-tp-modal-close:hover {
    background: var(--app-second-them, #e30613);
    color: #fff;
    transform: rotate(90deg);
}

.pf-tp-modal-body {
    display: flex;
}

/* Modal photo side */
.pf-tp-modal-photo {
    width: 300px;
    min-height: 400px;
    flex-shrink: 0;
    background: linear-gradient(160deg, #072890, #0a3ab8, #051c66);
    border-radius: 28px 0 0 28px;
    overflow: hidden;
    position: relative;
}

.pf-tp-modal-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.pf-tp-modal-initials {
    width: 100%;
    height: 100%;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    font-weight: 800;
    color: rgba(255,255,255,.1);
    letter-spacing: 8px;
}

/* Modal info side */
.pf-tp-modal-info {
    flex: 1;
    padding: 40px 36px;
    display: flex;
    flex-direction: column;
}

.pf-tp-modal-cat {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--app-them, #072890);
    background: rgba(7,40,144,.07);
    padding: 5px 16px;
    border-radius: 9999px;
    margin-bottom: 16px;
}

.pf-tp-modal-info h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--pf-text, #0d1226);
    margin: 0 0 6px;
    line-height: 1.2;
}

.pf-tp-modal-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--app-them, #072890);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pf-tp-modal-bio {
    font-size: 15px;
    line-height: 1.75;
    color: var(--pf-text-secondary, #505878);
    margin-bottom: 24px;
    flex: 1;
}

.pf-tp-modal-contact {
    margin-bottom: 18px;
}

.pf-tp-modal-contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--pf-text-secondary, #505878);
    margin-bottom: 10px;
}

.pf-tp-modal-contact-item i {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(7,40,144,.06);
    color: var(--app-them, #072890);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.pf-tp-modal-contact-item a {
    color: var(--app-them, #072890);
    text-decoration: none;
    font-weight: 500;
}

.pf-tp-modal-contact-item a:hover {
    text-decoration: underline;
}

.pf-tp-modal-socials {
    display: flex;
    gap: 10px;
}

.pf-tp-modal-socials a {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(7,40,144,.06);
    color: var(--app-them, #072890);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.pf-tp-modal-socials a:hover {
    background: var(--app-them, #072890);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(7,40,144,.35);
}

/* ─── DARK MODE ────────────────────────────────────────────────────── */
.sa-dark .pf-tp-section { background: #0c0d1a; }
.sa-dark .pf-tp-section--alt { background: #101120; }
.sa-dark .pf-tp-section-header h2 { color: #e2e8f0; }
.sa-dark .pf-tp-section-header p { color: #94a3b8; }
.sa-dark .pf-tp-card { background: #181930; border-color: rgba(255,255,255,.06); }
.sa-dark .pf-tp-bio { color: #94a3b8; }
.sa-dark .pf-tp-photo-name h4 { text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.sa-dark .pf-tp-socials { border-top-color: rgba(255,255,255,.06); }
.sa-dark .pf-tp-socials a { background: rgba(7,40,144,.15); }
.sa-dark .pf-tp-view { color: #60a5fa; }
.sa-dark .pf-tp-stat-val { color: #60a5fa; }
.sa-dark .pf-tp-stat-label { color: #64748b; }
.sa-dark .pf-tp-skeleton { background: #181930; border-color: rgba(255,255,255,.06); }
.sa-dark .pf-tp-skeleton-photo,
.sa-dark .pf-tp-skeleton-line {
    background: linear-gradient(90deg, rgba(255,255,255,.03) 25%, rgba(255,255,255,.06) 50%, rgba(255,255,255,.03) 75%);
    background-size: 200% 100%;
    animation: pf-tp-shimmer 1.5s ease-in-out infinite;
}
.sa-dark .pf-tp-modal { background: #181930; }
.sa-dark .pf-tp-modal-info h2 { color: #e2e8f0; }
.sa-dark .pf-tp-modal-title { color: #60a5fa; }
.sa-dark .pf-tp-modal-bio { color: #94a3b8; }
.sa-dark .pf-tp-modal-close { background: rgba(30,30,60,.92); color: #e2e8f0; }
.sa-dark .pf-tp-modal-contact-item { color: #94a3b8; }
.sa-dark .pf-tp-modal-contact-item i { background: rgba(7,40,144,.15); }
.sa-dark .pf-tp-modal-socials a { background: rgba(7,40,144,.15); }
.sa-dark .pf-tp-shape { opacity: 0.03; }

/* ─── RESPONSIVE ───────────────────────────────────────────────────── */
@media (max-width: 1200px) {
    .pf-tp-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 24px;
    }
}

@media (max-width: 992px) {
    .pf-tp-section { padding: 72px 0; }
    .pf-tp-photo { height: 240px; }
    .pf-tp-stats { gap: 32px; }
    .pf-tp-stat-val { font-size: 34px; }
}

@media (max-width: 768px) {
    .pf-tp-section { padding: 56px 0; }
    .pf-tp-section-header { margin-bottom: 40px; }
    .pf-tp-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
    }
    .pf-tp-photo { height: 240px; }
    .pf-tp-stats { gap: 24px; flex-wrap: wrap; }
    .pf-tp-stat-val { font-size: 30px; }

    /* Modal responsive */
    .pf-tp-modal-body { flex-direction: column; }
    .pf-tp-modal-photo {
        width: 100%;
        min-height: 260px;
        max-height: 300px;
        border-radius: 28px 28px 0 0;
    }
    .pf-tp-modal-initials { min-height: 260px; }
    .pf-tp-modal-info { padding: 28px 24px; }
    .pf-tp-modal-info h2 { font-size: 22px; }
}

@media (max-width: 520px) {
    .pf-tp-section { padding: 44px 0; }
    .pf-tp-grid {
        grid-template-columns: 1fr;
        max-width: 340px;
        margin: 0 auto;
    }
    .pf-tp-photo { height: 300px; }
    .pf-tp-card:hover { transform: translateY(-6px); }
}
