/* ===== TEAM DROPDOWN FUNCTIONALITY ===== */
.team-dropdown-toggle {
    text-align: center;
    margin: 3rem 0;
    position: relative;
    z-index: 10;
    display: block !important;
}

.team-dropdown-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 2.5rem;
    background: linear-gradient(135deg, #462c61 0%, #de4185 100%) !important;
    color: white !important;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(70, 44, 97, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    min-width: 280px;
    justify-content: center;
    font-family: inherit;
    text-decoration: none;
    outline: none;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 1000 !important;
    pointer-events: auto !important;
}

.team-dropdown-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.team-dropdown-btn:hover::before {
    left: 100%;
}

.team-dropdown-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(70, 44, 97, 0.4);
    background: linear-gradient(135deg, #de4185 0%, #462c61 100%) !important;
}

.team-dropdown-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(70, 44, 97, 0.3);
}

.team-dropdown-btn .btn-text {
    color: white !important;
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.team-dropdown-btn .dropdown-icon {
    color: white !important;
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.team-dropdown-btn.active .dropdown-icon {
    transform: rotate(180deg);
}

.team-dropdown-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(-20px);
    visibility: hidden;
    display: block;
    padding: 0 2rem;
}


.team-dropdown-content.show {
    max-height: 5000px; /* Increased from 2000px to ensure all team members are visible */
    opacity: 1 !important;
    transform: translateY(0) !important;
    visibility: visible !important;
    display: block !important;
}

.remaining-team {
    margin-top: 2rem;
    animation: fadeInUp 0.6s ease-out;
    gap: 3rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

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

/* Enhanced Team Grid Layout */
.leadership-team {
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.leadership-team .team-member {
    animation: fadeInScale 0.8s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Mobile-Specific Team Dropdown Enhancements */
@media (max-width: 767px) {
    .team-dropdown-btn {
        width: 100%;
        max-width: 350px;
        justify-content: center;
        padding: 1rem 2rem;
        font-size: 1rem;
    }
    
    .team-dropdown-content {
        padding: 0 1rem;
    }
    
    .remaining-team {
        gap: 2rem;
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }
    
    .leadership-team {
        gap: 2rem;
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }
    
    .team-dropdown-content.show {
        max-height: 8000px; /* Even larger for mobile to ensure all members are visible */
    }
}

/* Desktop - Enhanced styling for team dropdown */
@media (min-width: 768px) {
    .team-dropdown-toggle {
        margin: 4rem 0;
    }
    
    .team-dropdown-btn {
        padding: 1.5rem 3rem;
        font-size: 1.2rem;
        min-width: 320px;
        box-shadow: 0 10px 30px rgba(70, 44, 97, 0.4);
        border-radius: 35px;
    }
    
    .team-dropdown-btn:hover {
        transform: translateY(-5px);
        box-shadow: 0 15px 40px rgba(70, 44, 97, 0.5);
        background: linear-gradient(135deg, #de4185 0%, #462c61 100%) !important;
    }
    
    .team-dropdown-content {
        padding: 0 3rem;
    }
    
    .team-dropdown-content.show {
        margin-top: 3rem;
    }
    
    .remaining-team {
        gap: 4rem;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .leadership-team {
        gap: 4rem;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

/* Large Desktop - Ensure proper spacing and visibility */
@media (min-width: 1200px) {
    .remaining-team {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 3rem;
    }
    
    .leadership-team {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 3rem;
    }
}

/* Ensure team members are always visible when dropdown is open */
.team-dropdown-content.show .team-member {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    display: block !important;
}

/* Fix for any potential overflow issues */
.team-showcase {
    overflow: visible;
    position: relative;
}

/* Ensure proper spacing between team sections */
.team-dropdown-content.show .remaining-team {
    margin-top: 3rem;
    margin-bottom: 2rem;
}

/* Additional fixes for team member visibility */
.team-member {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Ensure proper grid display */
.remaining-team,
.leadership-team {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
}

/* Fix for mobile grid layout */
@media (max-width: 767px) {
    .remaining-team,
    .leadership-team {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    .team-member {
        width: 100% !important;
        max-width: none !important;
    }
}

/* Ensure dropdown content is properly sized */
.team-dropdown-content.show {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
}

/* Fix for any potential clipping issues */
.team-dropdown-content {
    clip-path: none !important;
    -webkit-clip-path: none !important;
}

/* Ensure smooth transitions */
.team-dropdown-content,
.team-dropdown-content.show {
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Final fixes to ensure all team members are visible */
.team-dropdown-content.show {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

/* Force visibility of all team members when dropdown is open */
.team-dropdown-content.show .team-member,
.team-dropdown-content.show .remaining-team .team-member {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    transform: none !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Ensure proper grid layout for all screen sizes */
@media (max-width: 767px) {
    .team-dropdown-content.show .remaining-team {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
        max-height: none !important;
        overflow: visible !important;
    }
    
    .team-dropdown-content.show .team-member {
        width: 100% !important;
        max-width: none !important;
        margin-bottom: 2rem !important;
    }
}

@media (min-width: 768px) {
    .team-dropdown-content.show .remaining-team {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
        gap: 3rem !important;
        max-height: none !important;
        overflow: visible !important;
    }
}

/* Override any conflicting styles */
.team-dropdown-content.show * {
    visibility: visible !important;
}

/* Ensure smooth animation */
.team-dropdown-content.show .remaining-team {
    animation: fadeInUp 0.8s ease-out !important;
}
