.team-section {
    padding: 4rem 0;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.member-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.member-card:hover {
    background: #f8f9fa;
}

.member-photo {
    height: 70%;
    overflow: hidden;
}

.member-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.member-card:hover .member-photo img {
    transform: scale(1.05);
}

.member-info {
    padding: 1.5rem;
    height: 30%;
}

.member-info h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.member-info .role {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0.5rem 0;
}

.member-details-btn {
    position: absolute;
    right: 1.5rem;
    top: calc(70% - 25px);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #fff;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2;
}

.member-details-btn i {
    color: var(--primary-color);
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.member-card:hover .member-details-btn {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.member-card:hover .member-details-btn i {
    transform: rotate(-45deg);
}

.team-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.team-modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: #fff;
    border-radius: 10px;
    width: 90%;
    max-width: 1000px;
    position: relative;
    overflow: hidden;
    display: flex;
    transform: scale(0.8);
    animation: modalFadeIn 0.3s ease forwards;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    transition: all 0.3s ease;
}

.modal-close:hover {
    transform: rotate(90deg);
}

.modal-body {
    display: flex;
    width: 100%;
}

.modal-photo {
    flex: 0 0 40%;
    position: relative;
    overflow: hidden;
}

.modal-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-info {
    flex: 0 0 60%;
    padding: 3rem;
    display: flex;
    flex-direction: column;
}

.modal-info h2 {
    font-size: 2.5rem;
    margin: 0 0 0.5rem 0;
    color: var(--text-color);
    font-weight: 600;
}

.modal-info .role {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 2rem 0;
}

.modal-info .bio {
    font-size: 1rem;
    line-height: 1.8;
    color: #666;
}

.modal-info .bio p {
    margin-bottom: 1.5rem;
}

.modal-info .social-links {
    margin-top: auto;
    padding-top: 2rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
}

.puzzle-team-section {
    padding: 4rem 0;
    background-color: #fff;
}

.puzzle-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
}

.puzzle-piece {
    position: relative;
    aspect-ratio: 1;
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    cursor: pointer;
}

.puzzle-piece img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.puzzle-piece.filler {
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    font-size: 1.25rem;
    font-weight: 500;
    background: linear-gradient(45deg, #f8f9fa, #fff);
}

.puzzle-piece:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.puzzle-piece:hover img {
    transform: scale(1.05);
}

/* Адаптивность */
@media (max-width: 840px) {
    .puzzle-grid {
        max-width: 100%;
        padding: 0 1rem;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .puzzle-grid {
        grid-template-columns: repeat(1, 1fr);
        grid-template-rows: auto;
    }
    .modal-body {
        flex-direction: column;
    }
}

.team-carousel-section {
    padding: 6rem 0;
    background: linear-gradient(135deg, #F8F9FF 0%, #F0F3FF 100%);
    overflow: hidden;
}

.team-carousel {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 60px;
}

.team-carousel-track {
    display: flex;
    transition: transform 0.5s ease-out;
    gap: 2rem;
}

.team-slide {
    flex: 0 0 calc(33.333% - 1.33rem); /* Показываем по 3 карточки */
    min-width: calc(33.333% - 1.33rem);
}

.team-member-card {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(91, 58, 243, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
}

.team-member-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 30px rgba(91, 58, 243, 0.15);
}

.member-image {
    width: 100%;
    padding-top: 100%; /* Квадратное соотношение сторон */
    position: relative;
    overflow: hidden;
}

.member-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.team-member-card:hover .member-image img {
    transform: scale(1.05);
}

.member-info {
    padding: 1.5rem;
    text-align: center;
}

.member-info h3 {
    font-size: 1.25rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.member-info p {
    color: #666;
    font-size: 1rem;
}

.team-carousel-section .container {
    width: 100%;
    max-width: 100%;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    border: none;
    box-shadow: 0 4px 12px rgba(91, 58, 243, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    transition: all 0.3s ease;
    z-index: 2;
}

.carousel-nav:hover {
    background: var(--primary-color);
    color: white;
}

.carousel-nav.prev {
    left: 0;
}

.carousel-nav.next {
    right: 0;
}

@media (max-width: 1200px) {
    .team-slide {
        flex: 0 0 calc(50% - 1rem);
        min-width: calc(50% - 1rem);
    }
}

@media (max-width: 768px) {
    .team-slide {
        flex: 0 0 100%;
        min-width: 100%;
    }
    
    .team-carousel {
        padding: 0 40px;
    }
}

/* Добавляем стили для заголовка */
.team-section-title {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 1.5rem;
}

.team-section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.team-section-title .highlight {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

@media (max-width: 768px) {
    .team-section-title {
        font-size: 2.25rem;
        margin-bottom: 2rem;
    }
}