/**
 * Tashkent University of Technology - Our Team Hub
 * Clean Reference-Matched UI with Dark Grey Rectorate Tab, Orange Tree Hierarchy & Orange Hover Credentials
 */

:root {
    --ttu-navy: #143d5a;
    --ttu-dark-grey: #475569;        /* Sophisticated, refined lighter slate-grey for active tabs & badges */
    --ttu-dark-grey-soft: #64748b;   /* Soft slate for gradients */
    --ttu-dark-grey-hover: #334155;  /* Slightly deeper on hover */
    --ttu-orange: #e54519;
    --ttu-orange-hover: #cf3b12;
    --ttu-orange-light: #ff7a45;
    --ttu-card-border: #dbe2ea;
    --ttu-ink: #0f172a;
    --ttu-heading: #1e293b;
    --ttu-slate: #334155;
    --ttu-muted: #64748b;
    --ttu-bg: #ffffff;
    --ttu-card-bg: #ffffff;
    --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Page Layout */
.our-team-page {
    font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
    color: var(--ttu-ink);
    background: #fbfcfe;
    padding: 30px 0 90px;
}

.our-team-shell {
    width: min(1320px, calc(100% - 40px));
    margin: 0 auto;
}

/* 1. Header (Simple & Clean - No spans, no search) */
.our-team-header {
    text-align: center;
    margin-bottom: 34px;
}

.our-team-header h1 {
    font-size: clamp(28px, 3.8vw, 44px);
    font-weight: 800;
    color: var(--ttu-heading);
    margin: 0 0 10px;
    letter-spacing: -0.025em;
}

.our-team-header p {
    font-size: clamp(14px, 1.4vw, 16px);
    color: var(--ttu-muted);
    max-width: 680px;
    margin: 0 auto;
    line-height: 1.6;
}

/* 2. Horizontal Category Tabs (Screenshot Matched & Fully Responsive) */
.our-team-tabs-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 44px;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding: 0 4px 6px;
}

.our-team-tabs {
    display: inline-flex;
    align-items: stretch;
    background: #ffffff;
    border: 1px solid var(--ttu-card-border);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    max-width: 100%;
    white-space: nowrap;
}

.our-team-tab {
    padding: 11px 18px;
    background: #ffffff;
    border: none;
    border-right: 1px solid var(--ttu-card-border);
    color: var(--ttu-slate);
    font-family: inherit;
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.22s var(--ease-spring);
    user-select: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.our-team-tab:last-child {
    border-right: none;
}

.our-team-tab:hover {
    background: #f8fafc;
    color: var(--ttu-dark-grey-hover);
}

/* Lighter Grey for Rectorate / Active tab */
.our-team-tab.is-active {
    background: var(--ttu-dark-grey);
    color: #ffffff;
}

/* 3. Tab Content Panes */
.our-team-tab-pane {
    display: none;
    animation: paneFade 0.4s var(--ease-spring) both;
}

.our-team-tab-pane.is-active {
    display: block;
}

@keyframes paneFade {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 4. Tree Hierarchy Layout */
.our-team-tree-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    margin-bottom: 20px;
}

/* Top Leader Card (Prominently Larger & Grand) */
.our-team-leader-card {
    position: relative;
    display: flex;
    gap: 32px;
    align-items: center;
    width: min(840px, 100%);
    min-height: 290px;
    background: #ffffff;
    border: 1px solid var(--ttu-card-border);
    border-radius: 12px;
    padding: 28px 34px;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.07);
    transition: transform 0.3s var(--ease-spring), box-shadow 0.3s ease;
    overflow: hidden;
    z-index: 2;
}

.our-team-leader-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 40px rgba(229, 69, 25, 0.16);
}

.our-team-leader-card__photo-wrap {
    position: relative;
    width: 210px;
    height: 260px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #eef2f6;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.our-team-leader-card__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Dark Grey placeholder for Rectorate */
.our-team-leader-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ttu-dark-grey) 0%, var(--ttu-dark-grey-soft) 100%);
    color: #ffffff;
    font-size: 48px;
    font-weight: 850;
}

.our-team-leader-card__info {
    flex: 1;
    min-width: 0;
}

/* Dark Grey Badge for Rectorate */
.our-team-leader-card__badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 4px;
    background: var(--ttu-dark-grey);
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}

.our-team-leader-card__name {
    font-size: 25px;
    font-weight: 850;
    color: var(--ttu-heading);
    margin: 0 0 8px;
    line-height: 1.25;
}

.our-team-leader-card__role {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--ttu-muted);
    margin: 0 0 20px;
    line-height: 1.45;
}

.our-team-leader-card .ttu-social-icon {
    width: 36px;
    height: 36px;
    font-size: 14px;
}

/* 5. Tree Connecting Lines (ORANGE) */
.our-team-tree-stem-down {
    width: 2px;
    height: 38px;
    background: var(--ttu-orange);
    margin: 0 auto;
    position: relative;
}

.our-team-tree-stem-down::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ttu-orange);
}

.our-team-tree-branch {
    position: relative;
    width: calc(100% - 140px);
    max-width: 980px;
    height: 2px;
    background: var(--ttu-orange);
    margin: 0 auto 38px;
}

.our-team-tree-branch::before,
.our-team-tree-branch::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ttu-orange);
    top: -3px;
}

.our-team-tree-branch::before { left: 0; }
.our-team-tree-branch::after { right: 0; }

.our-team-tree-drops {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 38px;
    display: flex;
    justify-content: space-around;
    pointer-events: none;
}

.our-team-tree-drop-line {
    width: 2px;
    height: 38px;
    background: var(--ttu-orange);
    position: relative;
}

.our-team-tree-drop-line::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ttu-orange);
}

/* 6. Cards Grid */
.our-team-cards-grid {
    display: flex;
    justify-content: center;
    gap: 22px;
    flex-wrap: wrap;
    width: 100%;
}

.our-team-cards-grid--multi {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 280px));
    gap: 24px;
    justify-content: center;
}

/* 7. Individual Team Card */
.ttu-team-card {
    position: relative;
    width: 100%;
    max-width: 280px;
    min-height: 410px;
    background: #ffffff;
    border: 1px solid var(--ttu-card-border);
    border-radius: 8px;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s var(--ease-spring), box-shadow 0.3s ease;
}

.ttu-team-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 36px rgba(229, 69, 25, 0.16);
}

/* Card Front Content */
.ttu-team-card__front {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Top Photo Box */
.ttu-team-card__photo-box {
    position: relative;
    height: 230px;
    background: #f1f5f9;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
}

.ttu-team-card__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

/* Custom Face Alignment (Move faces down so full head, hair & forehead are completely visible) */
img[src*="tsironis"],
.ttu-team-card__photo[src*="tsironis"] {
    object-position: center 0% !important;
}

img[src*="bahrami"],
.ttu-team-card__photo[src*="bahrami"] {
    object-position: center 0% !important;
}

.ttu-team-card__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%);
    color: var(--ttu-dark-grey);
    font-size: 32px;
    font-weight: 850;
    letter-spacing: -0.02em;
}

/* TTU Shield Logo Badge in Top Right (ORANGE) */
.ttu-shield-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 44px;
    height: 52px;
    background: var(--ttu-orange);
    clip-path: polygon(0 0, 100% 0, 100% 75%, 50% 100%, 0 75%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-bottom: 6px;
    box-shadow: 0 4px 10px rgba(229, 69, 25, 0.3);
    z-index: 2;
}

.ttu-shield-badge svg {
    width: 22px;
    height: 22px;
    fill: #ffffff;
}

.ttu-shield-badge span {
    color: #ffffff;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

/* Card Info */
.ttu-team-card__info {
    padding: 16px 16px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ttu-team-card__name {
    font-size: 15px;
    font-weight: 750;
    color: var(--ttu-heading);
    margin: 0 0 6px;
    line-height: 1.3;
}

.ttu-team-card__role {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ttu-muted);
    margin: 0 0 16px;
    line-height: 1.45;
}

/* Social / Contact Icons Row */
.ttu-social-row {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ttu-social-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ttu-social-icon:hover {
    background: var(--ttu-orange);
    color: #ffffff;
    transform: translateY(-2px);
}

/* ==========================================================================
   8. HOVER CREDENTIALS ANIMATION (ORANGE BACKGROUND)
   ========================================================================== */
.ttu-team-card__credentials {
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, #e54519 0%, #cc3a12 100%);
    color: #ffffff;
    padding: 24px 20px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    opacity: 0;
    visibility: hidden;
    transform: translateY(100%);
    transition: all 0.35s var(--ease-spring);
    z-index: 10;
}

.ttu-team-card:hover .ttu-team-card__credentials,
.our-team-leader-card:hover .ttu-team-card__credentials {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Credentials Content */
.our-team-leader-card .ttu-team-card__credentials {
    padding: 30px 34px 24px;
}

.our-team-leader-card .ttu-cred-name {
    font-size: 24px;
    margin-bottom: 6px;
}

.our-team-leader-card .ttu-cred-role {
    font-size: 14.5px;
    margin-bottom: 20px;
}

.our-team-leader-card .ttu-cred-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px 28px;
}

.our-team-leader-card .ttu-cred-item {
    font-size: 14px;
}

.ttu-cred-top {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ttu-cred-name {
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 4px;
    line-height: 1.3;
}

.ttu-cred-role {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    margin: 0 0 16px;
    line-height: 1.4;
}

.ttu-cred-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ttu-cred-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #ffffff;
    opacity: 0;
    transform: translateY(12px);
}

.ttu-cred-item a {
    color: #ffffff;
    text-decoration: none;
    word-break: break-all;
    transition: opacity 0.2s ease;
}

.ttu-cred-item a:hover {
    text-decoration: underline;
    opacity: 0.95;
}

.ttu-cred-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

/* Staggered animation when card is hovered */
.ttu-team-card:hover .ttu-cred-item:nth-child(1),
.our-team-leader-card:hover .ttu-cred-item:nth-child(1) {
    animation: credSlideIn 0.35s ease 0.08s both;
}

.ttu-team-card:hover .ttu-cred-item:nth-child(2),
.our-team-leader-card:hover .ttu-cred-item:nth-child(2) {
    animation: credSlideIn 0.35s ease 0.14s both;
}

.ttu-team-card:hover .ttu-cred-item:nth-child(3),
.our-team-leader-card:hover .ttu-cred-item:nth-child(3) {
    animation: credSlideIn 0.35s ease 0.20s both;
}

.ttu-team-card:hover .ttu-cred-item:nth-child(4),
.our-team-leader-card:hover .ttu-cred-item:nth-child(4) {
    animation: credSlideIn 0.35s ease 0.26s both;
}

@keyframes credSlideIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Credentials Bottom Social Icons */
.ttu-cred-social {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.ttu-cred-social-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ttu-cred-social-btn:hover {
    background: #ffffff;
    color: var(--ttu-orange);
    transform: scale(1.1);
}

/* Responsive Rules */
@media (max-width: 1250px) {
    .our-team-tab {
        padding: 10px 13px;
        font-size: 11px;
        letter-spacing: 0.015em;
    }
}

@media (max-width: 992px) {
    .our-team-tabs-wrapper {
        justify-content: flex-start;
        padding-bottom: 10px;
    }

    .our-team-tabs {
        width: max-content;
    }

    .our-team-tab {
        padding: 10px 15px;
        font-size: 11.5px;
    }

    .our-team-tree-branch,
    .our-team-tree-drops,
    .our-team-tree-stem-down {
        display: none;
    }

    .our-team-cards-grid {
        gap: 18px;
    }
}

@media (max-width: 640px) {
    .our-team-tab {
        padding: 9px 13px;
        font-size: 11px;
    }

    .our-team-leader-card {
        flex-direction: column;
        text-align: center;
        padding: 24px 20px;
        gap: 20px;
    }

    .our-team-leader-card__photo-wrap {
        width: 170px;
        height: 210px;
    }

    .our-team-leader-card__name {
        font-size: 20px;
    }

    .our-team-leader-card .ttu-social-row {
        justify-content: center;
    }

    .our-team-leader-card .ttu-cred-list {
        grid-template-columns: 1fr;
    }
}
