/* Enhanced Team Page Styles */
.main-content {
    background: linear-gradient(135deg, var(--dark-bg) 0%, #2a2a2a 100%);
    min-height: 100vh;
    padding: 2rem 5%;
}

.team-container {
    padding: 3rem 5%;
    background-color: var(--dark-bg);
    color: white;
}

.team-header {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
}

.team-header::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-red), var(--beige));
    border-radius: 2px;
}

.team-header h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, white, var(--beige));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.team-header p {
    font-size: 1.3rem;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0.9;
    line-height: 1.8;
}

.team-section {
    margin-bottom: 5rem;
    position: relative;
}

.team-section::before {
    content: '';
    position: absolute;
    top: -2rem;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.section-header {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--dark-red) 100%);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 20px;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(179, 27, 27, 0.3);
    overflow: hidden;
}

.section-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.6s ease;
}

.section-header:hover::before {
    left: 100%;
}

.section-header h2 {
    font-size: 2.2rem;
    margin: 0;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    z-index: 2;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 3rem;
    padding: 2rem 0;
    position: relative;
}

.team-grid::before {
    content: '';
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 80px;
    background: linear-gradient(180deg, 
        var(--primary-red) 0%, 
        rgba(179, 27, 27, 0.5) 50%, 
        transparent 100%);
    border-radius: 1px;
    animation: connectingLine 2s ease-out forwards;
    animation-delay: 0.5s;
    opacity: 0;
}

@keyframes connectingLine {
    0% {
        opacity: 0;
        height: 20px;
        transform: translateX(-50%) translateY(20px);
    }
    100% {
        opacity: 0.6;
        height: 80px;
        transform: translateX(-50%) translateY(0);
    }
}

/* Section Transition Connectors */
.team-section:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: -4rem;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 100px;
    background: linear-gradient(180deg,
        rgba(179, 27, 27, 0.4) 0%,
        rgba(192, 185, 173, 0.3) 30%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(192, 185, 173, 0.3) 70%,
        rgba(179, 27, 27, 0.4) 100%);
    animation: verticalFlow 3s ease-in-out infinite;
    z-index: 0;
}

@keyframes verticalFlow {
    0%, 100% { 
        opacity: 0.3; 
        transform: translateX(-50%) scaleY(0.8); 
    }
    50% { 
        opacity: 0.8; 
        transform: translateX(-50%) scaleY(1.2); 
    }
}

/* Floating Connection Dots */
.team-section:not(:last-child) .team-grid::after {
    content: '';
    position: absolute;
    bottom: -120px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, var(--primary-red) 30%, rgba(179, 27, 27, 0.3) 70%, transparent);
    border-radius: 50%;
    box-shadow: 
        0 0 20px rgba(179, 27, 27, 0.4),
        inset 0 0 10px rgba(255, 255, 255, 0.2);
    animation: floatingDot 4s ease-in-out infinite;
    z-index: 1;
}

@keyframes floatingDot {
    0%, 100% { 
        opacity: 0.6; 
        transform: translateX(-50%) translateY(0) scale(0.8); 
        box-shadow: 0 0 15px rgba(179, 27, 27, 0.3);
    }
    50% { 
        opacity: 1; 
        transform: translateX(-50%) translateY(-8px) scale(1.2); 
        box-shadow: 0 0 25px rgba(179, 27, 27, 0.6);
    }
}

/* Enhanced Section Entrance Animation */
.team-section {
    opacity: 0;
    transform: translateY(30px);
    animation: sectionSlideIn 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.team-section:nth-child(1) { animation-delay: 0.2s; }
.team-section:nth-child(2) { animation-delay: 0.4s; }
.team-section:nth-child(3) { animation-delay: 0.6s; }
.team-section:nth-child(4) { animation-delay: 0.8s; }

@keyframes sectionSlideIn {
    0% {
        opacity: 0;
        transform: translateY(50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Section Intersection Animations */
@media (prefers-reduced-motion: no-preference) {
    .team-section {
        opacity: 0;
        transform: translateY(40px);
        transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    
    .team-section.animate-in {
        opacity: 1;
        transform: translateY(0);
    }
    
    .section-header {
        transform: translateY(20px);
        transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s;
    }
    
    .team-section.animate-in .section-header {
        transform: translateY(0);
    }
    
    .team-grid {
        transform: translateY(30px);
        transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.4s;
    }
    
    .team-section.animate-in .team-grid {
        transform: translateY(0);
    }
}

/* Gradient Overlay Between Sections */
.team-section:not(:last-child) {
    position: relative;
}

.team-section:not(:last-child)::before {
    content: '';
    position: absolute;
    bottom: -6rem;
    left: 20%;
    right: 20%;
    height: 120px;
    background: radial-gradient(ellipse at center,
        rgba(179, 27, 27, 0.03) 0%,
        rgba(192, 185, 173, 0.02) 40%,
        transparent 70%);
    pointer-events: none;
    z-index: 0;
    animation: sectionGradient 6s ease-in-out infinite alternate;
}

@keyframes sectionGradient {
    0% {
        opacity: 0.4;
        transform: scaleX(0.8) scaleY(0.6);
    }
    100% {
        opacity: 0.8;
        transform: scaleX(1.2) scaleY(1);
    }
}

.team-member {
    position: relative;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.team-member::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-red), var(--beige));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    border-radius: 20px;
}

.team-member:hover::before {
    opacity: 0.1;
}

.team-member:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 50px rgba(179, 27, 27, 0.2);
}

.member-image {
    width: 100%;
    height: 350px;
    background: linear-gradient(145deg, #f0f0f0, #e0e0e0);
    border-radius: 20px 20px 0 0;
    padding: 0;
    overflow: hidden;
    position: relative;
}

.member-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, rgba(179, 27, 27, 0.8), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.team-member:hover .member-image::after {
    opacity: 1;
}

.member-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    border-radius: 20px 20px 0 0;
}

.team-member:hover .member-image img {
    transform: scale(1.05);
}

.member-info {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--dark-red) 100%);
    color: white;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    z-index: 2;
}

.member-info h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.member-info p {
    font-size: 1rem;
    font-style: italic;
    margin: 0.2rem 0;
    opacity: 0.9;
    line-height: 1.4;
}

.member-info p:first-of-type {
    font-weight: 500;
    opacity: 1;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    overflow: auto;
    padding: 20px;
    animation: modalBackdropFadeIn 0.3s ease;
}

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

.modal-content {
    background: linear-gradient(145deg, var(--dark-bg), #2a2a2a);
    margin: 5% auto;
    padding: 3rem;
    width: 85%;
    max-width: 900px;
    border-radius: 25px;
    position: relative;
    color: white;
    animation: modalSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 30px 80px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}

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

.close-button {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 32px;
    font-weight: bold;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
}

.close-button:hover {
    color: white;
    background: var(--primary-red);
    transform: rotate(90deg) scale(1.1);
}

.modal-header {
    display: flex;
    align-items: center;
    margin-bottom: 2.5rem;
    gap: 2rem;
}

.modal-image {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--primary-red);
    box-shadow: 0 10px 30px rgba(179, 27, 27, 0.3);
    position: relative;
}

.modal-image::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-red), var(--beige));
    z-index: -1;
}

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

.modal-name {
    flex: 1;
}

.modal-name h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, white, var(--beige));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

.modal-name p {
    font-size: 1.4rem;
    font-style: italic;
    color: var(--beige);
    opacity: 0.9;
    line-height: 1.4;
}

.modal-bio {
    font-size: 1.2rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    padding: 1.5rem 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    opacity: 0.95;
}

.modal-contact {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.contact-button {
    background: linear-gradient(135deg, var(--primary-red), var(--dark-red));
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.contact-button::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.6s ease;
}

.contact-button:hover::before {
    left: 100%;
}

.contact-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(179, 27, 27, 0.4);
}

.contact-button i {
    margin-right: 8px;
    font-size: 1.1rem;
}

/* Responsive Enhancements */
@media (max-width: 1024px) {
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .section-header h2 {
        font-size: 1.8rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem 3%;
    }
    
    .team-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .modal-header {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .modal-image {
        width: 150px;
        height: 150px;
    }
    
    .modal-name h2 {
        font-size: 2rem;
    }
    
    .modal-content {
        padding: 2rem;
        width: 95%;
    }
    
    .modal-contact {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .team-header h1 {
        font-size: 2.2rem;
    }
    
    .section-header {
        padding: 1rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .member-image {
        height: 280px;
    }
    
    .modal-bio {
        font-size: 1.1rem;
    }
    
    .contact-button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

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

.team-member {
    animation: fadeInUp 0.6s ease forwards;
}

.team-member:nth-child(1) { animation-delay: 0.1s; }
.team-member:nth-child(2) { animation-delay: 0.2s; }
.team-member:nth-child(3) { animation-delay: 0.3s; }
.team-member:nth-child(4) { animation-delay: 0.4s; }
.team-member:nth-child(5) { animation-delay: 0.5s; }