/* Team Page Specific Styles - FIXED FOR MOBILE TOUCH */

/* Force Space Mono Font for all elements except Font Awesome icons */
*:not(.fas):not(.fab):not(.far):not(.fal):not(.fa) {
    font-family: 'Space Mono', monospace !important;
}

/* Page Header Styles */
.page-header {
    background: url('Team_header.png') center center/cover no-repeat;
    color: white;
    padding: 8rem 5% 7rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 65vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Enforce desktop/mobile visibility for team header and section images */
.page-header .desktop-only { display: none !important; }
.page-header .mobile-only {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}
.team-image-left .desktop-only,
.team-image-right .desktop-only { display: block !important; }
.team-image-left .mobile-only,
.team-image-right .mobile-only { display: none !important; }

@media (max-width: 768px) {
	/* Use mobile header asset by hiding background and showing mobile image */
	.page-header { background: none; }
	.page-header .desktop-only { display: none !important; }
	.page-header .mobile-only {
		display: block !important;
		visibility: visible !important;
		opacity: 1 !important;
		height: auto !important;
		overflow: visible !important;
	}
	.team-image-left .desktop-only,
	.team-image-right .desktop-only { display: none !important; }
	.team-image-left .mobile-only,
	.team-image-right .mobile-only { display: block !important; }
}

.page-header-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.page-header h1 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, white, #20c997);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGlow 3s ease-in-out infinite alternate;
    font-weight: 600;
}

@keyframes titleGlow {
    0% { filter: brightness(1); }
    100% { filter: brightness(1.2); }
}

.page-header p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.9);
    animation: fadeInUp 1s ease-out 0.5s both;
}

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

/* Floating particles background */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #0057B8;
    border-radius: 50%;
    animation: float 20s infinite linear;
    opacity: 0.3;
}

@keyframes float {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100px) translateX(100px);
        opacity: 0;
    }
}

/* Team Section Styles */
.team-section {
    padding: 3rem 5% 2rem;
    position: relative;
}

.section-container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.section-title {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    color: white;
    text-align: center !important;
    position: relative;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: block !important;
}

.section-title::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(135deg, #0057B8, #20c997);
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1rem;
    color: #20c997;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 400;
    opacity: 0.9;
}

/* Team Layout Structure */
.team-layout {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: stretch !important;
    gap: 3rem !important;
    margin-top: 2rem;
    width: 100% !important;
    padding: 2rem 0;
}

/* Board of Directors and Advisors - Reverse order */
.board-directors-layout,
.board-advisors-layout {
    flex-direction: row-reverse !important;
}

.team-members-left,
.team-members-right {
    flex: 1 1 50%;
    max-width: 50%;
}

.team-image-left,
.team-image-right {
    flex: 1 1 50%;
    max-width: 50%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    height: 100%;
}

.section-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Grid Layouts */
.team-grid-2x2 {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2rem !important;
}

.team-grid-3x2 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
}

.advisor-grid-3x2 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
    max-width: 100%;
}

/* Executive Team - 3x2 grid with centered second row */
.executive-team .team-grid-3x2 {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1.5rem !important;
    justify-items: center;
}

.executive-team .team-grid-3x2 .team-card:nth-child(4),
.executive-team .team-grid-3x2 .team-card:nth-child(5) {
    grid-column: 1.5 / span 1;
}

.executive-team .team-grid-3x2 .team-card:nth-child(5) {
    grid-column: 2.5 / span 1;
}

/* UNIFIED CARD STYLES - Fixed for Mobile Touch */
.team-card, .advisor-card {
    background: transparent;
    border-radius: 18px;
    position: relative;
    height: 350px;
    perspective: 1000px;
    cursor: pointer;
    transition: transform 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation; /* Changed from pan-y for better touch handling */
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.320, 1);
    transform-style: preserve-3d;
}

/* Desktop hover effects - ONLY on devices that support hover */
@media (hover: hover) and (pointer: fine) {
.team-card:hover .card-inner,
.advisor-card:hover .card-inner {
    transform: rotateY(180deg);
    }
    
    .team-card:hover,
    .advisor-card:hover {
        transform: translateY(-8px) scale(1.01);
        filter: drop-shadow(0 15px 30px rgba(0, 87, 184, 0.25));
    }
    
    .team-card:hover .member-image,
    .advisor-card:hover .member-image {
        transform: scale(1.08);
        border-color: #20c997;
        box-shadow: 0 0 20px rgba(0, 87, 184, 0.4);
    }
    
    .team-card:hover .member-image img,
    .advisor-card:hover .member-image img {
        transform: scale(1.1);
    }
}

/* Mobile/Touch specific flip states */
.card-flipped .card-inner {
    transform: rotateY(180deg) !important;
}

.card-not-flipped .card-inner {
    transform: rotateY(0deg) !important;
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(0, 87, 184, 0.2);
    backdrop-filter: blur(20px);
}

.card-front {
    background: linear-gradient(145deg, rgba(10, 10, 35, 0.8), rgba(26, 26, 46, 0.4));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.2rem;
}

.card-back {
    background: linear-gradient(145deg, rgba(26, 26, 46, 0.9), rgba(10, 10, 35, 0.8));
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
    position: relative;
}

.card-back::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(32, 201, 151, 0.1), transparent);
    opacity: 0.7;
    z-index: 1;
}

.card-back-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Member Image Container */
.member-image-container {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0.6rem auto;
}

.member-image {
    width: 140px;
    height: 140px;
    position: relative;
    border-radius: 50%;
    transition: all 0.6s ease;
    overflow: hidden;
    border: 3px solid #0057B8;
}

.member-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

/* Text Styles */
.member-name {
    font-size: 1.2rem;
    color: white;
    margin-bottom: 0.4rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    line-height: 1.3;
}

.member-title {
    color: #20c997;
    font-weight: 600;
    margin-bottom: 0.8rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.member-bio {
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.5;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    text-align: justify;
    position: relative;
    max-height: 80px;
    overflow: hidden;
}

.bio-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.bio-fade {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(transparent, rgba(26, 26, 46, 0.9));
    pointer-events: none;
}

.read-more-btn {
    background: linear-gradient(135deg, #0057B8, #20c997);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s ease;
    font-family: 'Space Mono', monospace;
    font-weight: 500;
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
}

.read-more-btn:hover {
    background: linear-gradient(135deg, #20c997, #0057B8);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 87, 184, 0.3);
}

.iit-highlight {
    color: #20c997;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(32, 201, 151, 0.3);
}

/* Background wave animations */
.wave-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    opacity: 0.08;
    overflow: hidden;
}

.wave {
    position: absolute;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #0057B8, #20c997, transparent);
    animation: wave-animation 15s linear infinite;
    opacity: 0.2;
}

.wave-1 {
    top: 10%;
    height: 15%;
    animation-duration: 15s;
}

.wave-2 {
    top: 40%;
    height: 12%;
    animation-duration: 18s;
    animation-delay: 2s;
}

.wave-3 {
    top: 65%;
    height: 18%;
    animation-duration: 20s;
    animation-delay: 4s;
}

@keyframes wave-animation {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0%); }
}

/* Modal Styles */
.bio-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.bio-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: linear-gradient(135deg, rgba(10, 10, 35, 0.95), rgba(26, 26, 46, 0.95));
    border: 1px solid rgba(0, 87, 184, 0.3);
    border-radius: 20px;
    padding: 4rem;
    max-width: 1000px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 87, 184, 0.3);
    animation: slideIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 87, 184, 0.2);
    padding-bottom: 1rem;
}

.modal-title {
    color: #20c997;
    font-size: 4rem;
    font-weight: 600;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: #20c997;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(32, 201, 151, 0.1);
    transform: rotate(90deg);
}

.modal-bio {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.8;
    font-size: 2.8rem;
    margin: 0;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Scroll animation class */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* RESPONSIVE DESIGN - Mobile First Approach */

/* Large screens - Desktop breakpoints preserved */
@media screen and (max-width: 1200px) {
    .team-grid-3x2, .advisor-grid-3x2 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .executive-team .team-grid-3x2 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    .executive-team .team-grid-3x2 .team-card:nth-child(4),
    .executive-team .team-grid-3x2 .team-card:nth-child(5) {
        grid-column: auto;
    }
    
    .team-grid-2x2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media screen and (max-width: 900px) {
    .team-grid-3x2, .advisor-grid-3x2 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .executive-team .team-grid-3x2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .executive-team .team-grid-3x2 .team-card:nth-child(4),
    .executive-team .team-grid-3x2 .team-card:nth-child(5) {
        grid-column: auto;
    }
    
    .team-grid-2x2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Tablet responsiveness */
@media (max-width: 900px) and (min-width: 601px) {
    .modal-content {
        padding: 3rem;
        margin: 1.5rem;
        max-height: 90vh;
        max-width: 95%;
    }
    
    .modal-title {
        font-size: 3.5rem;
    }
    
    .modal-bio {
        font-size: 2.4rem;
    }
}

/* Mobile Layout Changes */
@media screen and (max-width: 768px) {
    /* Stack team layout on mobile */
    .team-layout {
        flex-direction: column !important;
        gap: 2rem !important;
    }

    .team-members-left,
    .team-members-right,
    .team-image-left,
    .team-image-right {
        max-width: 100% !important;
        flex: 1 1 100% !important;
    }
    
    /* 2 cards per row on mobile */
    .advisor-grid-3x2 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    
    .team-grid-2x2 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    
    .executive-team .team-grid-3x2 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    
    /* Mobile improvements */
    .team-card, .advisor-card {
        height: 280px;
    }
    
    .team-section {
        padding: 2rem 5% 1rem;
    }
    
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }
    
    .section-image {
        width: 100%;
        height: 200px;
        object-fit: cover;
        border-radius: 15px;
        margin-bottom: 1rem;
    }
    
    .page-header {
        padding: 3rem 5% 2rem;
        min-height: 35vh;
    }
    
    .page-header h1 {
        font-size: 2.2rem;
        line-height: 1.2;
    }
    
    .member-bio {
        line-height: 1.5;
    }
    
    .read-more-btn {
        font-size: 0.9rem;
        padding: 10px 18px;
    }
}

/* Mobile modal responsiveness */
@media (max-width: 600px) {
    .modal-content {
        padding: 2rem;
        margin: 0.5rem;
        max-height: 95vh;
        max-width: 98%;
        border-radius: 15px;
    }
    
    .modal-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .modal-bio {
        font-size: 1.8rem;
        line-height: 1.6;
    }
    
    .close-btn {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .bio-modal {
        padding: 1rem;
    }
    
    .modal-header {
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
    }
}

/* Small mobile screens */
@media screen and (max-width: 480px) {
    .team-grid-3x2, .advisor-grid-3x2, .team-grid-2x2 {
        grid-template-columns: 1fr !important;
    }
    
    .executive-team .team-grid-3x2 {
        grid-template-columns: 1fr !important;
    }
    
    .page-header h1 {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .team-card, .advisor-card {
        height: auto;
        min-height: 280px;
    }
    
    .member-image-container {
        width: 100px;
        height: 100px;
    }
    
    .member-image {
        width: 100px;
        height: 100px;
    }
}

/* Extra small mobile */
@media (max-width: 320px) {
    .modal-content {
        padding: 1.5rem;
        margin: 0.25rem;
        max-height: 98vh;
        max-width: 99%;
    }
    
    .modal-title {
        font-size: 2rem;
    }
    
    .modal-bio {
        font-size: 1.5rem;
    }
    
    .close-btn {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
    
    .team-section {
        padding: 1rem 3% 0.5rem;
    }
    
    .section-title {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }
    
    .team-card, .advisor-card {
        height: 280px;
    }
    
    .member-image-container {
        width: 90px;
        height: 90px;
    }
    
    .member-image {
        width: 90px;
        height: 90px;
    }
    
    .member-name {
        font-size: 0.9rem;
    }
    
    .member-bio {
        font-size: 0.75rem;
    }
}