/* ============================================
   Team Page - 領航猿團隊
   A sporty, modern team roster design
   ============================================ */

/* CSS Variables */
:root {
    --team-primary: #FF6B35;
    --team-primary-dark: #E85A24;
    --team-navy: #1a1f3c;
    --team-navy-light: #2a3050;
    --team-gold: #FFB800;
    --team-white: #ffffff;
    --team-off-white: #f8f9fa;
    --team-gray: #6b7280;
    --team-gray-light: #e5e7eb;
    --team-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --team-shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
    --team-transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --team-font-display: 'Poppins', 'Noto Sans TC', sans-serif;
}

/* Base Page Styles */
.team-page {
    background: var(--team-off-white);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   Hero Section
   ============================================ */
.team-hero {
    position: relative;
    height: 70vh;
    min-height: 500px;
    max-height: 700px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--team-navy) 0%, var(--team-navy-light) 100%);
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.team-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 107, 53, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 184, 0, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 31, 60, 0.7);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 20px;
    max-width: 800px;
}

.hero-badge {
    display: inline-block;
    padding: 8px 20px;
    background: var(--team-primary);
    color: var(--team-white);
    font-family: var(--team-font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    border-radius: 50px;
    margin-bottom: 25px;
    animation: fadeInUp 0.8s ease forwards;
}

.hero-title {
    font-family: var(--team-font-display);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    color: var(--team-white);
    margin: 0 0 15px;
    line-height: 1.1;
    letter-spacing: -1px;
    animation: fadeInUp 0.8s ease 0.1s forwards;
    opacity: 0;
}

.hero-subtitle {
    font-family: var(--team-font-display);
    font-size: clamp(1rem, 2vw, 1.3rem);
    font-weight: 600;
    color: var(--team-primary);
    letter-spacing: 4px;
    margin: 0 0 20px;
    animation: fadeInUp 0.8s ease 0.2s forwards;
    opacity: 0;
}

.hero-description {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    animation: fadeInUp 0.8s ease 0.3s forwards;
    opacity: 0;
}

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

/* ============================================
   Navigation Tabs
   ============================================ */
.team-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--team-white);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.team-nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.team-nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--team-font-display);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--team-gray);
    letter-spacing: 1px;
    transition: var(--team-transition);
    position: relative;
}

.team-nav-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--team-primary);
    transition: var(--team-transition);
    border-radius: 3px 3px 0 0;
}

.team-nav-btn:hover {
    color: var(--team-navy);
}

.team-nav-btn.active {
    color: var(--team-primary);
}

.team-nav-btn.active::after {
    width: 60%;
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.nav-icon svg {
    width: 18px;
    height: 18px;
}

.nav-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: var(--team-gray-light);
    color: var(--team-gray);
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 12px;
    transition: var(--team-transition);
}

.team-nav-btn.active .nav-count {
    background: var(--team-primary);
    color: var(--team-white);
}

/* ============================================
   Sections Wrapper - Fixed height to prevent shaking
   ============================================ */
.team-sections-wrapper {
    min-height: 800px;
    position: relative;
}

/* ============================================
   Section Base Styles
   ============================================ */
.team-section {
    display: none;
    padding: 80px 0;
    opacity: 0;
}

.team-section.active {
    display: block;
    animation: sectionFadeIn 0.4s ease forwards;
}

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

.section-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-badge {
    display: inline-block;
    padding: 6px 16px;
    background: linear-gradient(135deg, var(--team-primary), var(--team-primary-dark));
    color: var(--team-white);
    font-family: var(--team-font-display);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-radius: 20px;
    margin-bottom: 15px;
}

.section-title {
    font-family: var(--team-font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    color: var(--team-navy);
    margin: 0;
    letter-spacing: -0.5px;
}

/* ============================================
   Position Filters
   ============================================ */
.position-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 24px;
    background: var(--team-white);
    border: 2px solid var(--team-gray-light);
    border-radius: 50px;
    cursor: pointer;
    font-family: var(--team-font-display);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--team-gray);
    letter-spacing: 1px;
    transition: var(--team-transition);
}

.filter-btn:hover {
    border-color: var(--team-primary);
    color: var(--team-primary);
}

.filter-btn.active {
    background: var(--team-navy);
    border-color: var(--team-navy);
    color: var(--team-white);
}

/* ============================================
   Unified Members Grid (for all categories)
   ============================================ */
.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

/* ============================================
   Unified Member Card (for all categories)
   ============================================ */
.member-card {
    opacity: 0;
    animation: cardFadeIn 0.6s ease forwards;
    animation-delay: var(--delay);
}

.member-card.hidden {
    display: none;
}

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

.member-card-inner {
    position: relative;
    background: var(--team-white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--team-shadow);
    transition: var(--team-transition);
}

.member-card-inner:hover {
    transform: translateY(-10px);
    box-shadow: var(--team-shadow-lg);
}

.member-image-wrapper {
    position: relative;
    aspect-ratio: 3/4;
    background: var(--team-white);
    overflow: hidden;
}

.member-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--team-transition);
}

.member-card-inner:hover .member-image {
    transform: scale(1.05);
}

.member-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--team-gray-light);
}

.member-placeholder svg {
    width: 80px;
    height: 80px;
    color: var(--team-gray);
    opacity: 0.4;
}

/* Cheerleader placeholder gradient */
.member-placeholder.cheer-placeholder {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.1), rgba(255, 184, 0, 0.1));
}

.member-placeholder.cheer-placeholder svg {
    color: var(--team-primary);
    opacity: 0.5;
}

/* Badge on top left (jersey number for players) */
.member-badge-top {
    position: absolute;
    top: 15px;
    left: 15px;
    font-family: var(--team-font-display);
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--team-white);
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
    line-height: 1;
    letter-spacing: -2px;
}

/* Badge on top right corner (position/role) */
.member-badge-corner {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 14px;
    background: var(--team-primary);
    color: var(--team-white);
    font-family: var(--team-font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 20px;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-info {
    padding: 25px 20px;
    text-align: center;
}

.member-name {
    font-family: var(--team-font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--team-navy);
    margin: 0 0 5px;
}

.member-name-en {
    font-family: var(--team-font-display);
    font-size: 0.85rem;
    color: var(--team-gray);
    margin: 0 0 12px;
    letter-spacing: 0.5px;
}

.member-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--team-font-display);
    font-size: 0.85rem;
    color: var(--team-gray);
}

.stat-divider {
    color: var(--team-gray-light);
}

.member-subtitle {
    font-size: 0.85rem;
    color: var(--team-gray);
    margin: 8px 0 0;
    line-height: 1.4;
}

/* ============================================
   Responsive Styles
   ============================================ */
@media (max-width: 1024px) {
    .team-nav-container {
        gap: 5px;
    }
    
    .team-nav-btn {
        padding: 15px 20px;
        flex-direction: column;
        gap: 5px;
    }
    
    .nav-text {
        font-size: 0.7rem;
    }
    
    .nav-count {
        display: none;
    }
}

@media (max-width: 768px) {
    .team-hero {
        height: 60vh;
        min-height: 400px;
    }
    
    .team-nav-container {
        justify-content: flex-start;
        overflow-x: auto;
        padding: 0 15px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .team-nav-container::-webkit-scrollbar {
        display: none;
    }
    
    .team-nav-btn {
        flex: 0 0 auto;
        padding: 15px 20px;
    }
    
    .team-section {
        padding: 50px 0;
    }
    
    .section-container {
        padding: 0 20px;
    }
    
    .section-header {
        margin-bottom: 40px;
    }
    
    .members-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .position-filters {
        gap: 8px;
        margin-bottom: 30px;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 0.7rem;
    }
    
    .team-sections-wrapper {
        min-height: 600px;
    }
}

@media (max-width: 480px) {
    .team-hero {
        height: 50vh;
        min-height: 350px;
    }
    
    .hero-badge {
        padding: 6px 15px;
        font-size: 0.65rem;
    }
    
    .members-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .member-badge-top {
        font-size: 1.8rem;
        top: 10px;
        left: 10px;
    }
    
    .member-badge-corner {
        padding: 4px 10px;
        font-size: 0.65rem;
        top: 10px;
        right: 10px;
        max-width: 80px;
    }
    
    .member-info {
        padding: 15px;
    }
    
    .member-name {
        font-size: 1rem;
    }
    
    .member-name-en {
        font-size: 0.75rem;
        margin-bottom: 8px;
    }
    
    .member-stats {
        font-size: 0.75rem;
    }
    
    .team-sections-wrapper {
        min-height: 500px;
    }
}

/* Ensure proper z-index stacking */
.page-template-page-team .team-nav {
    z-index: 100;
}
