/* =============================================
   TEAM PAGE - REDESIGNED
   Color Palette: #141d2a (dark), #8186d5 (primary), #F5875D (accent)
   ============================================= */

:root {
    --team-dark: #141d2a;
    --team-dark-light: rgba(20, 29, 42, 0.95);
    --team-primary: #8186d5;
    --team-accent: #F5875D;
    --team-gradient-start: #6366f1;
    --team-gradient-end: #8b5cf6;
    --team-text: #ffffff;
    --team-text-muted: rgba(255, 255, 255, 0.7);
    --team-border: rgba(129, 134, 213, 0.3);
    --team-shadow: rgba(0, 0, 0, 0.09) 0px 2px 1px,
    rgba(0, 0, 0, 0.09) 0px 4px 2px,
    rgba(0, 0, 0, 0.09) 0px 8px 4px,
    rgba(0, 0, 0, 0.09) 0px 16px 8px,
    rgba(0, 0, 0, 0.09) 0px 32px 16px;
}

/* =============================================
   LAYOUT
   ============================================= */
.parallax-container {
    position: relative;
}

.parallax-section1 {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    padding: 120px 0;
    position: relative;
    color: white;
}

.parallax-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
}

.main-team-container {
    position: relative;
    margin-top: 2em;
}

/* =============================================
   TEAM CAROUSEL SECTION
   ============================================= */
#team-carousel-section {
    position: relative;
    padding: 4rem 0 4.5rem;
    background: linear-gradient(135deg, var(--team-dark) 0%, rgba(20, 29, 42, 0.98) 100%);
    overflow: hidden;
}

/* Decorative Elements - Changed to purple/indigo */
#team-carousel-section::before,
#team-carousel-section::after {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    background: rgba(129, 134, 213, 0.08);
    border: 1px solid rgba(129, 134, 213, 0.15);
    border-radius: 24px;
    transform: rotate(12deg);
    z-index: 0;
}

#team-carousel-section::before {
    top: 40px;
    left: 6%;
}

#team-carousel-section::after {
    bottom: 30px;
    right: 8%;
}

/* Header Badge */
#team-carousel-section .badge {
    background: linear-gradient(135deg, var(--team-gradient-start), var(--team-gradient-end)) !important;
    color: white !important;
    font-weight: 600;
    padding: 8px 16px;
    font-size: 0.85rem;
}

.team-carousel-header {
    position: relative;
    z-index: 1;
}

.team-carousel-header .text-white-50 {
    color: var(--team-text-muted) !important;
}

/* =============================================
   CAROUSEL TRACK
   ============================================= */
.carousel-track {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    padding: 1.5rem 0 2rem;
    scroll-snap-type: x mandatory;
    position: relative;
    z-index: 1;
    --carousel-fade-size: 90px;
    -webkit-mask-image: linear-gradient(
            90deg,
            transparent 0,
            #000 var(--carousel-fade-size),
            #000 calc(100% - var(--carousel-fade-size)),
            transparent 100%
    );
    mask-image: linear-gradient(
            90deg,
            transparent 0,
            #000 var(--carousel-fade-size),
            #000 calc(100% - var(--carousel-fade-size)),
            transparent 100%
    );
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-spacer {
    flex: 0 0 16px;
}

/* =============================================
   TEAM CARD (Carousel)
   ============================================= */
.team-card-glass {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 0 0 clamp(240px, 26vw, 340px);
    scroll-snap-align: center;
    border-radius: 1.5rem;
    background: rgba(129, 134, 213, 0.1);
    border: 1px solid var(--team-border);
    backdrop-filter: blur(14px);
    overflow: hidden;
    transition: transform 280ms ease, box-shadow 280ms ease, filter 280ms ease, opacity 280ms ease;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.2);
    filter: grayscale(1);
    opacity: 0.55;
    cursor: pointer;
}

.team-card-glass::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(20, 29, 42, 0.5);
    transition: opacity 280ms ease;
    pointer-events: none;
}

.team-card-glass.is-active {
    filter: none;
    opacity: 1;
    transform: scale(1.02);
    box-shadow: 0 10px 22px rgba(99, 102, 241, 0.18);
    border-color: rgba(129, 134, 213, 0.5);
}

.team-card-glass.is-active::after {
    opacity: 0;
}

.team-card-glass:not(.is-active):hover {
    opacity: 0.75;
}

.team-card-glass:not(.is-active):hover::after {
    opacity: 0.3;
}

/* Card Image */
.team-card-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.team-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
}

/* Card Body */
.team-card-body {
    padding: 1.25rem 1.5rem 1.75rem;
    background: var(--team-dark);
    display: flex;
    flex-direction: column;
    flex: 1;
    border-top: 1px solid var(--team-border);
}

.team-card-body h3 {
    color: var(--team-text) !important;
}

/* Tags */
.team-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.team-position-text {
    font-size: 0.8rem;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: var(--team-accent);
    font-weight: 700;
    border: none;
    letter-spacing: 0.02em;
}

.team-tags-stack {
    flex-direction: column;
    align-items: flex-start;
}

.team-tag {
    font-size: 0.75rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: rgba(129, 134, 213, 0.2);
    color: var(--team-primary);
    font-weight: 600;
    border: 1px solid rgba(129, 134, 213, 0.3);
}

.team-card-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

/* More Button */
.team-more-button {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    border: none;
    border-radius: 999px;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--team-gradient-start), var(--team-gradient-end));
    transition: transform 500ms ease, box-shadow 500ms ease;
    white-space: nowrap;
    box-shadow:
            0 6px 22px rgba(99, 102, 241, 0.5),
            0 0 0 2px rgba(129, 134, 213, 0.25) inset;
    cursor: pointer;
    appearance: none;
}

.team-more-button:hover,
.team-more-button:focus-visible {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.team-more-button:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* =============================================
   CAROUSEL DOTS
   ============================================= */
.team-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

.team-carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    border: none;
    background: rgba(129, 134, 213, 0.4);
    transition: background 200ms ease, transform 200ms ease;
    cursor: pointer;
}

.team-carousel-dot:hover {
    background: rgba(129, 134, 213, 0.6);
}

.team-carousel-dot.is-active {
    background: var(--team-primary);
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(129, 134, 213, 0.5);
}

/* =============================================
   DIRECTOR CARD — Desktop: side-by-side (unchanged)
   ============================================= */
.director-card {
    border-radius: 18px;
    overflow: hidden;
    background: var(--team-dark);
    border: 1px solid var(--team-border);
    box-shadow: var(--team-shadow);
}

.director-card .col-md-4 {
    position: relative;
}

.director-card .card-body {
    padding: 2rem;
}

.director-card .card-title {
    color: var(--team-text);
    font-weight: 700;
    font-size: 1.5rem;
}

.director-card .text-muted {
    color: var(--team-primary) !important;
    font-weight: 600;
}

.director-card .director-description {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--team-text-muted);
    margin: 0;
    white-space: pre-line;
}

.director-achievements-title {
    color: var(--team-accent);
    font-weight: 600;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
}

.director-img {
    object-fit: cover;
    height: 100%;
    width: 100%;
}

/* Overlay — hidden by default (desktop), shown on mobile */
.director-card__overlay {
    display: none;
}

/* =============================================
   TEAM GRID CARDS
   ============================================= */
.team-card {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    background: var(--team-dark);
    border: 1px solid var(--team-border);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.team-card:hover,
.team-card:focus-within {
    transform: translateY(-6px);
    box-shadow: 0 20px 50px rgba(99, 102, 241, 0.2);
    border-color: rgba(129, 134, 213, 0.5);
}

.image-container {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 5;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.team-card .card-body {
    padding: 1.5rem 1.25rem;
    background: var(--team-dark);
}

.team-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--team-text);
}

.team-card .text-muted {
    color: var(--team-text-muted) !important;
}

/* Highlight effect */
.team-card-highlight {
    box-shadow: 0 0 0 4px rgba(129, 134, 213, 0.5) !important;
    transform: translateY(-6px);
    transition: box-shadow 200ms ease, transform 200ms ease;
}

/* =============================================
   TEAM MODAL - BIGGER & STYLED
   ============================================= */
.team-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    pointer-events: none;
    z-index: 1200;
    padding: 1.5rem;
}

.team-modal.is-visible {
    visibility: visible;
    pointer-events: auto;
}

.team-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 29, 42, 0.85);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 150ms ease;
}

.team-modal.is-visible .team-modal-backdrop {
    opacity: 1;
}

/* Modal Content - BIGGER */
.team-modal-content {
    position: relative;
    max-width: 850px;
    width: 100%;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(20, 29, 42, 0.95), rgba(30, 40, 55, 0.95));
    border: 1px solid var(--team-border);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(129, 134, 213, 0.1);
    backdrop-filter: blur(20px);
    padding: 2.5rem;
    z-index: 1;
    color: var(--team-text);
    opacity: 0;
    transform: translateY(12px) scale(0.97);
    transition: opacity 180ms ease, transform 180ms ease;
}

.team-modal.is-visible .team-modal-content {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Close Button */
.team-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--team-text-muted);
    font-size: 1.8rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 150ms ease;
}

.team-modal-close:hover,
.team-modal-close:focus-visible {
    background: transparent;
    color: var(--team-text);
}

/* Modal Body */
.team-modal-body {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

/* Modal Image - BIGGER */
.team-modal-image img {
    width: 280px;
    border-radius: 18px;
    object-fit: cover;
    aspect-ratio: 4 / 5;
    border: 2px solid var(--team-border);
    flex-shrink: 0;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.team-modal-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Modal Title - BIGGER */
.team-modal-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--team-text);
}

.team-modal-position {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--team-primary);
    margin-bottom: 0.5rem;
}

.team-modal-subject {
    font-size: 1rem;
    color: var(--team-accent);
    margin-bottom: 1rem;
}

.team-modal-description {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--team-text-muted);
    margin-bottom: 0;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--team-border);
}

body.modal-open {
    overflow: hidden;
}

/* =============================================
   CAROUSEL WRAPPER (for Bootstrap carousel if used)
   ============================================= */
.team-carousel-wrapper {
    padding: 1.5rem 0 2.5rem;
}

.team-carousel .carousel-inner {
    padding: 0.5rem 0 2.5rem;
}

.team-carousel .carousel-indicators {
    margin-bottom: -0.5rem;
}

.team-carousel-card {
    transform: scale(1.02);
}

.team-carousel .carousel-control-prev-icon,
.team-carousel .carousel-control-next-icon {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 992px) {
    .main-team-container {
        padding-left: 1.75rem;
        padding-right: 1.75rem;
    }

    .main-team-container .row.g-4 {
        --bs-gutter-x: 1.75rem;
        --bs-gutter-y: 1.75rem;
    }

    .team-modal-content {
        max-width: 90%;
        padding: 2rem;
    }

    .team-modal-image img {
        width: 240px;
    }

    .team-modal-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .teamContainer {
        overflow-x: hidden;
    }

    /* ---- Director card: switch to vertical + overlay ---- */
    .director-card .row.g-0 {
        flex-direction: column;
    }

    .director-card .col-md-4 {
        max-height: none;
    }

    .director-card .director-img {
        aspect-ratio: 3 / 4;
        object-position: center top;
    }

    /* Show the overlay on mobile */
    .director-card__overlay {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 2.5rem 1.5rem 1.25rem;
        background: linear-gradient(to top,
        rgba(20, 29, 42, 0.95) 0%,
        rgba(20, 29, 42, 0.6) 50%,
        transparent 100%);
    }

    .director-card__overlay-name {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--team-text);
        margin: 0;
        line-height: 1.2;
    }

    .director-card__overlay-position {
        font-size: 1rem;
        font-weight: 600;
        color: var(--team-primary);
    }

    /* Hide desktop header (name + position) inside card-body */
    .director-card .director-desktop-header {
        display: none;
    }

    .director-card .card-body {
        border-top: 1px solid var(--team-border);
        padding: 1.25rem;
    }

    /* Modal */
    .team-modal-body {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .team-modal-image img {
        width: 240px;
    }

    .team-modal-info {
        align-items: center;
    }
}

@media (max-width: 576px) {
    .main-team-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .main-team-container .row.g-4 {
        --bs-gutter-x: 0.75rem;
        --bs-gutter-y: 1rem;
    }

    .carousel-track {
        gap: 16px;
        padding-bottom: 1.5rem;
        --carousel-fade-size: 60px;
    }

    .team-card-image {
        height: 200px;
    }

    .team-modal-content {
        padding: 1.5rem;
        max-width: 95%;
    }

    .image-container {
        aspect-ratio: 3 / 3.5;
    }

    .team-card .card-body {
        padding: 0.75rem 0.6rem 1rem;
    }

    .team-card .card-title {
        font-size: 0.9rem;
    }

    .team-card .text-muted {
        font-size: 0.75rem;
    }

    .team-modal-image img {
        width: 200px;
    }

    .team-modal-title {
        font-size: 1.3rem;
    }

    .team-modal-position {
        font-size: 1rem;
    }

    #team-carousel-section::before,
    #team-carousel-section::after {
        width: 120px;
        height: 120px;
    }

    /* Director mobile fine-tuning */
    .director-card__overlay {
        padding: 2rem 1.25rem 1rem;
    }

    .director-card__overlay-name {
        font-size: 1.3rem;
    }

    .director-card__overlay-position {
        font-size: 0.9rem;
    }
}