/* Scope all custom styles to prevent leakage to other pages */
#team-members-page {
    font-family: 'Raleway', 'Roboto', sans-serif;
    background-color: #ffffff;
    color: #333333;
    padding-bottom: 0;
    overflow-x: hidden;
}

/* ==========================================================================
   1. Hero Banner
   ========================================================================== */
#team-members-page .team-hero {
    position: relative;
    background-image: linear-gradient(rgba(10, 48, 20, 0.85), rgba(10, 48, 20, 0.85)), url('../../images/about/about_hero_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 90px 0 80px;
    text-align: center;
    color: #ffffff;
}

#team-members-page .team-hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 12px;
    text-transform: uppercase;
}

#team-members-page .team-hero .hero-underline {
    width: 90px;
    height: 4px;
    background-color: #ffcc00;
    margin: 0 auto 22px;
    border-radius: 2px;
}

#team-members-page .team-hero p {
    font-size: 1.25rem;
    max-width: 800px;
    margin: 0 auto;
    font-weight: 400;
    line-height: 1.8;
}

/* ==========================================================================
   2. Section Headers
   ========================================================================== */
#team-members-page .org-chart-section {
    padding: 15px 0 70px;
    background-color: #ffffff;
}

#team-members-page .section-title-wrap {
    text-align: center;
    margin-bottom: 15px;
    position: relative;
}

#team-members-page .section-title-wrap h2 {
    font-size: 25px;
    font-weight: 700;
    color: #0b3c16;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
    display: inline-block;
}

#team-members-page .section-title-wrap .star-divider-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    max-width: 400px;
    margin: 0 auto;
}

#team-members-page .section-title-wrap .star-line {
    flex: 1;
    height: 1.5px;
    background-color:#ffcc00;
}

#team-members-page .section-title-wrap .star-icon {
    font-size: 1rem;
    color: #ffcc00;
}

/* ==========================================================================
   3. Member Profile Cards (Matching Mockup Colors & Shapes)
   ========================================================================== */
#team-members-page .org-chart-section .container {
    max-width: 1400px;
}

#team-members-page .leader-grid {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: 14px !important;
    width: 100% !important;
    margin-top: 25px;
}

/* Tablet (768px - 991px): 3 Cards per row */
@media (min-width: 768px) and (max-width: 991px) {
    #team-members-page .leader-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }
}

/* Mobile & Phone (<= 767px): Exactly 2 Cards per row */
@media (max-width: 767px) {
    #team-members-page .leader-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
        margin-top: 15px;
    }
}

#team-members-page .leader-grid-item {
    min-width: 0;
    height: 100%;
}

#team-members-page .leader-card {
    background: #ffffff;
    border: 1px solid #e1e9e3;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(11, 60, 22, 0.04);
    transition: all 0.25s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

#team-members-page .leader-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 24px rgba(11, 60, 22, 0.1);
    border-color: #0b3c16;
}

/* ==========================================================================
   Popup Modal Styles (Matching Associate Page Modal)
   ========================================================================== */
.leader-modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(15, 23, 42, 0.75) !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9999999 !important;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.leader-modal-backdrop.is-active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.leader-modal-dialog {
    background: #ffffff;
    width: 100%;
    max-width: 440px;
    max-height: 85vh;
    border-radius: 20px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.35);
    position: relative;
    overflow: hidden;
    transform: scale(0.92) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

/* Gradient fade at bottom of card */
.leader-modal-dialog::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 38px;
    background: linear-gradient(to top, rgba(255, 255, 255, 1) 15%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
    z-index: 10;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

/* Content Scroll Area */
.leader-modal-scroll-area {
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    padding-bottom: 55px;
    box-sizing: border-box;
}

/* Custom smooth scrollbar */
.leader-modal-scroll-area::-webkit-scrollbar {
    width: 5px;
}
.leader-modal-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}
.leader-modal-scroll-area::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.leader-modal-scroll-area::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.leader-modal-backdrop.is-active .leader-modal-dialog {
    transform: scale(1) translateY(0);
}

/* Full Width Image with Padding */
.leader-modal-img-wrap {
    width: 100%;
    padding: 14px 14px 0 14px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

.leader-modal-img-wrap img {
    max-width: 100%;
    max-height: 380px;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    border-radius: 14px;
    display: block;
    margin: 0 auto;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    background: #f8fafc;
}

/* Details Section */
.leader-modal-details {
    padding: 18px 20px 10px 20px;
    display: flex;
    flex-direction: column;
}

.leader-modal-name {
    color: #e31e24 !important; /* Red Name */
    font-size: 22px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 4px;
    line-height: 1.25;
}

.leader-modal-id {
    color: #16a34a !important; /* Green Title */
    font-size: 18px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.leader-modal-divider {
    height: 1px;
    background: #e2e8f0;
    margin-bottom: 14px;
}

.leader-modal-bio-title {
    color: red;
    font-size: 13px;
    font-weight: 800;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.leader-modal-bio-text {
    color: #475569;
    font-size: 13.5px;
    line-height: 1.6;
    margin-bottom: 12px;
    text-align: justify;
}

/* Close Button Fixed at Bottom Right Corner */
.leader-modal-close-btn {
    position: absolute;
    bottom: 12px;
    right: 14px;
    top: auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 50;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.16);
    transition: all 0.22s ease;
}

.leader-modal-close-btn:hover {
    background: #e31e24;
    color: #ffffff;
    border-color: #e31e24;
    transform: rotate(90deg) scale(1.05);
}

@media (max-width: 767px) {
    .leader-modal-dialog {
        max-width: 92%;
        max-height: 85vh;
        border-radius: 16px;
    }

    .leader-modal-dialog::after {
        border-bottom-left-radius: 16px;
        border-bottom-right-radius: 16px;
    }

    .leader-modal-scroll-area {
        max-height: 85vh;
        padding-bottom: 50px;
    }

    .leader-modal-close-btn {
        bottom: 10px;
        right: 12px;
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    .leader-modal-img-wrap {
        padding: 12px 12px 0 12px;
    }

    .leader-modal-img-wrap img {
        max-height: 270px;
        max-width: 100%;
        width: auto;
        height: auto;
        border-radius: 12px;
    }

    .leader-modal-name {
        font-size: 19px;
    }

    .leader-modal-id {
        font-size: 17px;
    }

    .leader-modal-bio-text {
        font-size: 13px;
        margin-bottom: 8px;
    }
}

/* Card Image Wrap (Full view image - no cutting) */
#team-members-page .leader-card-img-wrap {
    width: 100% !important;
    position: relative;
    padding-top: 100% !important; /* Square 1:1 ratio for leadership portrait cards */
    overflow: hidden;
    background-color: #f8fafc;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#team-members-page .leader-card-img-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    object-position: center;
    display: block;
    padding: 6px;
    box-sizing: border-box;
    transition: transform 0.3s ease;
}

#team-members-page .leader-card:hover .leader-card-img-wrap img {
    transform: scale(1.03);
}

/* Card Body */
#team-members-page .leader-card-body {
    padding: 10px 8px 12px 8px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    text-align: center;
    background: #ffffff;
}

#team-members-page .leader-card-body .leader-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #111111;
    margin-bottom: 3px;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#team-members-page .leader-card-body .leader-title-hindi {
    font-size: 0.8rem;
    color: #0b3c16;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#team-members-page .leader-card-body .leader-desc {
    font-size: 0.75rem;
    color: #555555;
    line-height: 1.35;
    margin-bottom: 2px;
}

#team-members-page .single-leader-card {
    width: 220px;
    max-width: 100%;
    margin: 0 auto;
}

/* President Card Layout */
#team-members-page .president-card {
    max-width: 620px;
    width: 100%;
    margin: 0 auto;
    border: 1px solid #cce3d4;
    box-shadow: 0 4px 15px rgba(11, 60, 22, 0.03);
    padding: 20px 22px;
    display: block;
}

#team-members-page .president-row {
    align-items: center;
    display: flex;
}

#team-members-page .president-img-wrap {
    width: 140px;
    height: 160px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid #0b3c16;
    margin: 0 auto;
}

#team-members-page .president-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#team-members-page .president-info {
    padding-left: 20px;
    text-align: left;
}

@media (max-width: 767px) {
    #team-members-page .president-card {
        padding: 15px 12px;
        max-width: 100%;
    }
    #team-members-page .president-img-wrap {
        width: 100%;
        height: 100%;
    }
    #team-members-page .president-row {
        flex-direction: column;
        text-align: center;
    }
    #team-members-page .president-info {
        padding-left: 0;
        margin-top: 12px;
        text-align: center;
    }
}

/* Legacy Image Container support */
#team-members-page .leader-img-container {
    width: 105px;
    height: 120px;
    margin: 0 auto 10px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid #0b3c16;
    background-color: #f7faf8;
    flex-shrink: 0;
}

#team-members-page .leader-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Profile Text Classes */
#team-members-page .leader-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #111111;
    margin-bottom: 3px;
    word-break: break-word;
    line-height: 1.25;
}

/* Hindi Role text: Green color matching the mockup */
#team-members-page .leader-title-hindi {
    font-size: 0.82rem;
    color: #0b3c16;
    font-weight: 700;
    margin-bottom: 2px;
    text-align: center;
    line-height: 1.25;
}

#team-members-page .leader-desc {
    font-size: 0.78rem;
    color: #555555;
    line-height: 1.4;
    margin-bottom: 0;
}

/* ==========================================================================
   4. Organization Chart Connector Lines Layout (Desktop viewports >= 992px)
   ========================================================================== */
#team-members-page .org-tree {
    position: relative;
    width: 100%;
}

/* Base connector line block styling */
#team-members-page .tree-connector {
    width: 100%;
    text-align: center;
    position: relative;
}

#team-members-page .line-vert {
    width: 2px;
    background-color: #b0c2b5;
    margin: 0 auto;
    position: relative;
}

/* Vertical parent line height variations */
#team-members-page .line-vert.height-20 { height: 20px; }
#team-members-page .line-vert.height-30 { height: 30px; }
#team-members-page .line-vert.height-40 { height: 40px; }
#team-members-page .line-vert.height-60 { height: 60px; }

/* Node label absolute positioned on vertical line */
#team-members-page .tree-label-node {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #0b3c16;
    color: #ffffff;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.5px;
    z-index: 5;
    box-shadow: 0 2px 6px rgba(11, 60, 22, 0.15);
}

/* Top-level President Badge */
#team-members-page .president-badge {
    display: inline-block;
    background-color: #0b3c16;
    color: #ffffff;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(11, 60, 22, 0.15);
    margin-bottom: 25px;
    text-transform: uppercase;
}

/* Horizontal connector line span bar */
#team-members-page .line-horiz {
    height: 2px;
    background-color: #b0c2b5;
    margin: 0 auto;
}

/* Spans to match column alignments mathematically */
#team-members-page .line-horiz.span-80 { width: 80%; }
#team-members-page .line-horiz.span-75 { width: 75%; }
#team-members-page .line-horiz.span-50 { width: 50%; }

/* Multi-branch vertical lines flex container */
#team-members-page .line-branches-row {
    display: flex;
    width: 100%;
    justify-content: space-between;
}

#team-members-page .line-branch-col {
    flex: 1;
    display: flex;
    justify-content: center;
}

#team-members-page .line-branch-col::after {
    content: '';
    width: 2px;
    height: 25px;
    background-color: #b0c2b5;
    display: block;
}

/* Multi-branch vertical lines height variation */
#team-members-page .line-branches-row.height-15 .line-branch-col::after {
    height: 15px;
}

#team-members-page .line-branches-row.height-20 .line-branch-col::after {
    height: 20px;
}

/* Reverse multi-branch row (from card bottom centers down to horizontal line) */
#team-members-page .line-branches-row.reverse {
    transform: scaleY(-1);
}

/* Side-by-side branch boxes connecting split sections */
#team-members-page .split-connector-row {
    display: flex;
    width: 100%;
}

#team-members-page .split-connector-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Hide connecting lines and branch containers on tablet/mobile screens */
@media (max-width: 991px) {
    #team-members-page .tree-connector,
    #team-members-page .line-vert,
    #team-members-page .line-horiz,
    #team-members-page .line-branches-row,
    #team-members-page .split-connector-row {
        display: none !important;
    }
}

/* ==========================================================================
   5. Row & Columns Flex Settings (Fidelity to Mockup Layout)
   ========================================================================== */
#team-members-page .row-leaders-5 {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    width: 100%;
}

#team-members-page .row-leaders-5 .col-leader {
    flex: 0 0 calc(20% - 16px);
    max-width: calc(20% - 16px);
}

@media (max-width: 1199px) {
    #team-members-page .row-leaders-5 .col-leader {
        flex: 0 0 calc(33.333% - 14px);
        max-width: calc(33.333% - 14px);
    }
}

@media (max-width: 767px) {
    #team-members-page .row-leaders-5 .col-leader {
        flex: 0 0 calc(50% - 10px);
        max-width: calc(50% - 10px);
    }
}

@media (max-width: 480px) {
    #team-members-page .row-leaders-5 .col-leader {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Sc Secretaries & Spokespersons grouped boxes styling */
#team-members-page .branch-box {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 20px 15px;
    border: 1px dashed #d1e2d7;
    height: 100%;
    text-align: center;
}

#team-members-page .branch-box-title {
    margin-bottom: 25px;
}

#team-members-page .branch-box-title span {
    background-color: #0b3c16;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 7px 18px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   6. Incharges Responsive Section
   ========================================================================== */
#team-members-page .incharges-section {
    padding: 70px 0;
    background-color: #f6faf7;
    border-top: 1px solid #edf2ef;
    border-bottom: 1px solid #edf2ef;
}

#team-members-page .incharge-card {
    background: #ffffff;
    border: 1px solid #e1ebd5;
    border-radius: 10px;
    padding: 25px 20px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(11, 60, 22, 0.01);
    transition: all 0.25s ease;
    height: 100%;
}

#team-members-page .incharge-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 18px rgba(11, 60, 22, 0.04);
    border-color: #bcdbb7;
}

#team-members-page .incharge-icon {
    font-size: 2.2rem;
    color: #0b3c16;
    margin-bottom: 12px;
    display: inline-block;
}

#team-members-page .incharge-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0b3c16;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#team-members-page .incharge-desc {
    font-size: 0.88rem;
    color: #555555;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: center;
}

#team-members-page .incharge-badge {
    background-color: #0b3c16;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    padding: 5px 18px;
    border-radius: 20px;
    display: inline-block;
    min-width: 90px;
    box-shadow: 0 3px 6px rgba(11, 60, 22, 0.1);
}

/* ==========================================================================
   7. CTA Banner
   ========================================================================== */
.cta-banner {
    background-color: #ffdf7a;
    padding: 35px 0;
    border-top: 1px solid #ffd452;
}

.cta-text {
    font-size: 1.45rem;
    font-weight: 700;
    color: #2b2b2b;
    margin: 0;
    text-align: center;
}

.cta-btn {
    background-color: #0b3c16;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    padding: 11px 32px;
    border-radius: 30px;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 4px 8px rgba(11, 60, 22, 0.15);
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.cta-btn:hover {
    background-color: #ffffff;
    color: #0b3c16;
    border-color: #0b3c16;
    box-shadow: 0 5px 12px rgba(11, 60, 22, 0.2);
}

@media (max-width: 767px) {
    .cta-text {
        font-size: 1.25rem;
        margin-bottom: 15px;
    }
}
