/* ==========================================================================
   TEAM PAGE - PURE CARD GRID LAYOUT
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto; /* Enable vertical scroll */
}

body {
    font-family: "Arial", sans-serif !important;
    background: linear-gradient(
        135deg,
        var(--bg-dark) 0%,
        var(--bg-dark-secondary) 50%,
        var(--bg-dark-tertiary) 100%
    ) !important;
    color: var(--text-primary) !important;
    min-height: 100vh;
    padding: 2rem 1rem 150px 1rem; /* Add bottom padding for bottom menu */
}

/* Background Pattern */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(
            rgba(var(--primary-rgb), 0.2) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(var(--primary-rgb), 0.2) 1px,
            transparent 1px
        );
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

/* Container */
.team-container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    overflow: visible; /* Allow content to be visible */
}

/* Header */
.team-header {
    text-align: center;
    margin-bottom: 2rem;
}

.team-name {
    color: var(--secondary-color);
    font-size: clamp(1.5rem, 2.5vw, 1.7rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.team-title {
    font-size: clamp(2rem, 4vw, 4rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 0 30px rgba(var(--primary-rgb), 0.6);
    margin-bottom: 1rem;
}

/* Team Members Grid - Card Layout */
.team-members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    justify-items: center;
    margin-bottom: 4rem; /* Extra space before bottom menu */
    padding-bottom: 2rem;
}

/* Auto-center when 2 cards in row on tablet */
@media (min-width: 768px) and (max-width: 1199px) {
    .team-members-grid {
        grid-template-columns: repeat(2, minmax(250px, 350px));
        justify-content: center;
    }
}

/* 4 cards per row on desktop */
@media (min-width: 1200px) {
    .team-members-grid {
        grid-template-columns: repeat(4, minmax(250px, 320px));
        justify-content: center;
        gap: 1.2rem;
    }
}

/* Member Card */
.member-card {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    width: 100%;
    max-width: 320px;
    position: relative;
}

.member-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(var(--primary-rgb), 0.1) 0%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
    pointer-events: none;
}

.member-card:hover {
    transform: translateY(-10px);
    border-color: var(--secondary-color);
    box-shadow: 0 20px 40px rgba(var(--primary-rgb), 0.4),
        0 0 60px rgba(var(--secondary-rgb), 0.2);
}

.member-card:hover::before {
    opacity: 1;
}

/* Card Image Container */
.member-card-image {
    width: 100%;
    height: 350px; /* Reduce height for smaller cards */
    overflow: hidden;
    background: rgba(var(--primary-rgb), 0.05);
    position: relative;
}

.member-card-image::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.8) 0%,
        transparent 100%
    );
    pointer-events: none;
}

.member-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Change to contain to show full image */
    object-position: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.member-card:hover .member-card-image img {
    transform: scale(1.08);
}

.member-card-image .member-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--primary-rgb), 0.1);
}

.member-card-image .member-avatar-placeholder i {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.3);
}

/* Card Content */
.member-card-content {
    padding: 1.2rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 2;
    height: 100%;
}

.member-card-info {
    text-align: center;
    margin-bottom: 0.8rem;
}

.member-card-name {
    font-size: clamp(0.95rem, 2vw, 1.2rem);
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    margin-bottom: 0.3rem;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

.member-card:hover .member-card-name {
    color: var(--secondary-color);
}

.member-card-handle {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 0.3rem;
    letter-spacing: 0.5px;
}

.member-card-role {
    font-size: clamp(0.75rem, 1.5vw, 0.9rem);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* Social Links */
.member-card-socials {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    flex-wrap: wrap;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.member-card-social-link {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.member-card-social-link::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--secondary-color);
    transform: scale(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
}

.member-card-social-link i {
    position: relative;
    z-index: 1;
}

.member-card-social-link:hover {
    transform: translateY(-3px);
    border-color: var(--secondary-color);
    box-shadow: 0 5px 15px rgba(var(--secondary-rgb), 0.4);
}

.member-card-social-link:hover::before {
    transform: scale(1);
}

.member-card-social-link:hover i {
    color: var(--text-dark);
}

/* Mobile Responsive */
@media (max-width: 767px) {
    body {
        padding: 1.5rem 0.5rem 180px 0.5rem; /* More bottom padding on mobile */
    }

    .team-header {
        margin-bottom: 2rem;
    }

    .team-members-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 0.5rem 3rem 0.5rem; /* Extra padding bottom */
    }

    .member-card {
        max-width: 100%;
    }

    .member-card-image {
        height: 300px;
    }

    .member-card-content {
        padding: 1.2rem;
    }

    .member-card-socials {
        gap: 0.6rem;
    }

    .member-card-social-link {
        width: 38px;
        height: 38px;
        font-size: 0.9rem;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 991px) {
    .team-members-grid {
        gap: 1.8rem;
    }

    .member-card-image {
        height: 320px;
    }
}

/* Large Desktop */
@media (min-width: 1400px) {
    .team-container {
        max-width: 1600px;
    }

    .team-members-grid {
        gap: 2.5rem;
    }

    .member-card-image {
        height: 380px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}
