/* =============================================
   WHO IS WHO - MODERN STYLES (v8.1 - Fix Clipping)
   ============================================= */

/* * Assumes home.css is loaded first for :root variables * */

/* =============================================
   PAGE LAYOUT & INTRO
   ============================================= */
:root {
    /* India Theme Color Palette */
    --saffron-primary: #FF9933;
    --saffron-light: #FFB366;
    --saffron-dark: #E67300;
    --saffron-pale: #FFE5CC;
    --white-primary: #FFFFFF;
    --white-warm: #FAFAF9;
    --white-cream: #F5F5F4;
    --green-primary: #138808;
    --green-light: #22C55E;
    --green-dark: #0F6606;
    --green-pale: #D1FAE5;
    --navy-chakra: #000080;
    --navy-dark: #00005C;

    /* Semantic Colors */
    --color-primary: var(--navy-chakra);
    --color-secondary: var(--green-primary);
    --color-accent: var(--saffron-primary);
    --color-error: #ef4444;
    --color-error-pale: #fef2f2;
    --color-info-pale: #EBF4FF;

    /* Text & Background */
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #64748B;
    --text-on-dark: var(--white-primary);
    --text-on-accent: var(--white-primary);
    --bg-base: var(--white-warm);
    --bg-elevated: var(--white-primary);
    --bg-subtle: var(--white-cream);
    --bg-muted: #F1F5F9;
    --border-light: #E2E8F0;
    --border-medium: #CBD5E1;

    /* Gradients */
    --gradient-hero: linear-gradient(135deg, var(--saffron-light) 0%, var(--white-primary) 50%, var(--green-light) 100%);
    --gradient-saffron: linear-gradient(135deg, var(--saffron-primary) 0%, var(--saffron-dark) 100%);
    --gradient-green: linear-gradient(135deg, var(--green-light) 0%, var(--green-primary) 100%);
    --gradient-navy: linear-gradient(135deg, var(--navy-chakra) 0%, var(--navy-dark) 100%);

    /* Shadows & Radii */
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}


.main {
    min-height: 100vh;
    background: var(--bg-base);
    position: relative;
    overflow: hidden;
    top: calc(60px + 1rem * 2);
    /* Aligned with new fixed header height */
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.page-intro {
    text-align: center;
    padding: 1rem 1.5rem 2rem;
}

.page-intro h2 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--navy-chakra);
    margin: 0 0 12px 0;
}

.page-intro p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* =============================================
   NAVIGATION BAR (Breadcrumbs & Back)
   ============================================= */
.navigation-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    margin: 0 auto 2rem;
    max-width: 1200px;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.btn-back {
    background: none;
    border: none;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: background-color 0.2s ease;
}

.btn-back:hover {
    background-color: var(--bg-subtle);
}

.breadcrumbs {
    font-size: 1rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.breadcrumbs span {
    color: var(--text-primary);
    font-weight: 600;
}

.breadcrumbs a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs i {
    margin: 0 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* =============================================
   ****** EXECUTIVE TEAM SECTION (UPDATED) ******
   ============================================= */
.executive-team-section {
    padding: 4rem 0;
    margin-bottom: 3rem;
    margin-left: 1rem;
    margin-right: 1rem;
    position: relative;
    overflow: hidden;
    background: var(--gradient-hero);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-lg);
}

.executive-team-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 2;
}

.executive-team-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--navy-chakra);
    text-align: center;
    margin: 0 0 3rem 0;
}

/* NEW: Heads Container - Full width, centered */
.executive-heads-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

/* NEW: Heads Grid - Only for the two head cards */
.executive-heads-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(250px, 300px));
    gap: 2rem;
    justify-content: center;
    max-width: 700px;
    width: 100%;
}

/* NEW: Regular Members Grid - Below heads */
.executive-members-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* Tablet and up */
@media (min-width: 768px) {
    .executive-members-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

/* Desktop and up */
@media (min-width: 1024px) {
    .executive-members-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Executive Card - Base Style */
.executive-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    transition: var(--transition-bounce);
    border: 1px solid var(--border-light);
    text-align: center;
    padding: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.5s ease-out forwards;
}

/* Head Card - Larger, more prominent */
.executive-card.head-card {
    transform: scale(1.05);
    box-shadow: var(--shadow-xl);
    border: 2px solid var(--color-primary);
    animation-duration: 0.6s;
    animation-delay: 0ms !important;
    /* No delay for heads */
}

.executive-card.head-card .exec-name {
    font-size: 1.3rem;
    font-weight: 800;
}

.executive-card.head-card .exec-role {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-primary);
}

.executive-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

/* Executive Photo Container */
.exec-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    background-color: var(--bg-subtle);
    border: 3px solid var(--white-primary);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Head Card Photo - Larger */
.executive-card.head-card .exec-photo {
    width: 140px;
    height: 140px;
}

/* Executive Photo Content */
.exec-photo-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--white-primary);
}

/* Executive Photo Images */
.exec-photo-content img {
    display: block !important;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1 !important;
}

.exec-photo-content img.loaded {
    opacity: 1;
}

/* Executive Info */
.exec-info {
    margin-top: 0.5rem;
}

.exec-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.25rem;
}

.exec-role {
    font-size: 0.9rem;
    color: var(--color-primary);
    font-weight: 500;
    margin: 0;
}



/* =============================================
   LEVEL CONTAINERS & TRANSITIONS
   ============================================= */
.level-container-wrapper {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    /* overflow-x: hidden; */
    /* Removed overflow: hidden; */
}

.level-container {
    padding: 1rem 0;
    opacity: 0;
    position: absolute;
    /* Stack levels */
    top: 0;
    left: 0;
    width: 100%;
    transform: translateX(30px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
    pointer-events: none;
    /* Prevent interaction when hidden */
    visibility: hidden;
    /* Ensure it's hidden when not active */
}

.level-container.active {
    opacity: 1;
    position: relative;
    /* Bring active level into flow */
    transform: translateX(0);
    pointer-events: auto;
    visibility: visible;
}

.level-container.exit-left {
    transform: translateX(-30px);
}

.level-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--navy-dark);
    margin: 0 0 1.5rem 0;
    text-align: center;
}

/* =============================================
   UNIFIED CARD GRID & STYLES
   ============================================= */
.card-grid {
    display: grid;
    /* Adjusted minmax for slightly wider cards */
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 2rem;
}

/* Base Card Style - Applied to ALL levels */
.card {
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    transition: var(--transition-bounce);
    border: 1px solid var(--border-light);
    position: relative;
    /* *** REMOVED overflow: hidden; *** */
    cursor: pointer;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    padding-top: 50px;
    /* Space for the overlapping initials */

    /* Animation */
    opacity: 1;
    transform: translateY(0);
    animation: fadeIn 0.5s ease-out forwards;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

/* Initials Circle (Overlapping) */
.card-initials {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    /* Adjusted size */
    font-weight: 700;
    color: var(--white-primary);
    position: absolute;
    top: -40px;
    /* Pulls it halfway up from the top padding start */
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid var(--bg-elevated);
    box-shadow: var(--shadow-md);
    /* Background color set by theme */
    z-index: 1;
    /* Ensure initials are above card content */
}

/* Card Content Area */
.card-content {
    padding: 1.5rem;
    padding-top: 1rem;
    /* Less top padding needed now */
    text-align: center;
    flex-grow: 1;
    /* Allows content to push footer down */
}

.card-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    /* Color set by theme */
}

.card-subtitle {
    /* Used for Counts (Zone/College) or Role (Member) */
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0 0 1rem;
    /* Role color set by theme for members */
}

.card-location {
    /* Only used for members */
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.card-location i {
    color: var(--text-muted);
    width: 14px;
    text-align: center;
}

/* Card Footer (Only for Member Cards) */
.card-footer {
    padding: 0 1.5rem 1.5rem;
    border-top: 1px solid var(--border-light);
    margin-top: 1rem;
}

.btn-view-details {
    display: block;
    width: 100%;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    text-align: center;
    border: 2px solid transparent;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease-in-out;
    background: var(--saffron-primary);
    /* Default color */
    color: var(--text-on-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-view-details i {
    transition: transform 0.2s ease;
}

.btn-view-details:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.btn-view-details:hover i {
    transform: translateX(4px);
}


/* Card Filtering/Level Animation */
.card.hidden {
    opacity: 0 !important;
    transform: scale(0.9);
    width: 0;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
    gap: 0;
    border: none;
}

/* Lazy Load Placeholder (Still needed, applied by JS) */
.card.placeholder {
    background: var(--bg-subtle);
    opacity: 1;
    animation: none;
    background: linear-gradient(-90deg, var(--bg-elevated) 0%, var(--bg-subtle) 50%, var(--bg-elevated) 100%);
    background-size: 400% 400%;
    animation: pulse 1.2s ease-in-out infinite;
    min-height: 250px;
}

@keyframes pulse {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: -135% 0%;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================
   SUBTLE TRICOLOR THEME (nth-child based)
   ============================================= */

/* Apply theme based on index */
/* Card 1, 4, 7... : Saffron Theme */
.card:nth-child(3n + 1) {
    .card-initials {
        background: var(--gradient-saffron);
    }

    .card-name {
        color: var(--saffron-dark);
    }

    /* Member Card Specific */
    &.member-card .card-subtitle {
        color: var(--saffron-primary);
    }

    .btn-view-details {
        background: var(--saffron-primary);
    }

    .btn-view-details:hover {
        background: var(--saffron-dark);
    }
}

/* Card 2, 5, 8... : Navy Theme */
.card:nth-child(3n + 2) {
    .card-initials {
        background: var(--gradient-navy);
    }

    .card-name {
        color: var(--navy-chakra);
    }

    &.member-card .card-subtitle {
        color: var(--navy-chakra);
    }

    .btn-view-details {
        background: var(--navy-chakra);
        color: var(--white-primary);
    }

    .btn-view-details:hover {
        background: var(--navy-dark);
    }
}

/* Card 3, 6, 9... : Green Theme */
.card:nth-child(3n + 3) {
    .card-initials {
        background: var(--gradient-green);
    }

    .card-name {
        color: var(--green-dark);
    }

    &.member-card .card-subtitle {
        color: var(--green-primary);
    }

    .btn-view-details {
        background: var(--green-primary);
        color: var(--white-primary);
    }

    .btn-view-details:hover {
        background: var(--green-dark);
    }
}

/* =============================================
   MODAL & LOADING STATES
   ============================================= */
.loading-indicator {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-indicator .spinner {
    border: 4px solid var(--border-light);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.state-message {
    text-align: center;
    padding: 4rem 1rem;
    font-size: 1.1rem;
    color: var(--color-error);
    font-weight: 500;
}

/* Modal Styles - UPDATED */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* * ===== CHANGE =====
     * Increased z-index from 1000 to 9999 to ensure it's on top of all content,
     * including the site header.
     */
    z-index: 9999;
    background: rgba(0, 0, 80, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    /* Start hidden */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-backdrop.visible {
    display: flex !important;
    /* Force display when visible */
    opacity: 1;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-2xl);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 80, 0.2);
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-backdrop.visible .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.modal-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--gradient-navy);
    color: var(--white-primary);
    font-size: 2.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.modal-header-info h3 {
    font-size: 1.75rem;
    color: var(--text-primary);
    margin: 0;
}

.modal-header-info p {
    font-size: 1.1rem;
    color: var(--color-primary);
    margin: 0.25rem 0 0 0;
}

.modal-body {
    padding-top: 1.5rem;
}

.modal-body .info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.modal-body .info-item {
    font-size: 1rem;
    color: var(--text-secondary);
}

.modal-body .info-item strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

/* =============================================
   RESPONSIVENESS
   ============================================= */
@media (max-width: 768px) {
    .main {
        padding: 1rem 1rem;
        top: calc(60px + 1rem);
        /* Adjust if header smaller */
    }

    .page-intro h2 {
        font-size: 2rem;
    }

    .page-intro p {
        font-size: 1rem;
    }

    .navigation-bar {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .breadcrumbs {
        max-width: 100%;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
        gap: 1.5rem;
    }

    .executive-team-section {
        margin-left: 0;
        margin-right: 0;
    }



    /* Stack members on mobile */
    .card {
        padding-top: 40px;
    }

    /* Adjust for smaller initials */
    .card-initials {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        top: -30px;
        border-width: 3px;
    }

    .card-name {
        font-size: 1.15rem;
    }

    .card-subtitle {
        font-size: 0.9rem;
    }

    .modal-content {
        padding: 1.5rem;
    }

    .modal-header {
        gap: 1rem;
    }

    .modal-photo {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
    }

    .modal-header-info h3 {
        font-size: 1.3rem;
    }

    /* Executive Section Adjustments */
    .executive-team-title {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .executive-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    le

    /* Stack to 2 columns earlier */
    .exec-photo {
        width: 100px;
        height: 100px;
    }

    .exec-name {
        font-size: 1rem;
    }

    .exec-role {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .executive-grid {
        /* Use the same auto-fit rule as card-grid to prevent overflow */
        grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
        gap: 1.5rem;
    }

    .card-grid {
        /* This min(250px, 100%) stops overflow on very narrow screens */
        grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
        gap: 1.5rem;
    }

    /* Stack to 1 column on smallest screens */

    .member-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}