/* Team Page Specific Styles */

.team-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 120px 0 80px;
    text-align: center;
}

.team-hero h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-on-colored);
}

.team-hero p {
    font-size: 20px;
    max-width: 600px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.9);
}

.team-grid {
    display: grid;
    /* Fixed three columns on wide screens */
    grid-template-columns: repeat(3, 1fr);
    column-gap: 0;
    row-gap: 24px;
    padding: 80px 0;
}

/* Responsive: 2 columns for medium screens, 1 column for small screens */
@media (max-width: 992px) {
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .team-grid {
        grid-template-columns: 1fr;
    }
}

.team-member {
    background: rgba(127, 127, 127, 0.1);
    border-radius: 12px;
    padding: 30px;
    /* Limit card width so members appear smaller on wide screens */
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.team-member:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.member-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 0 auto 20px;
    overflow: hidden;
    border: 4px solid var(--accent-color);
}

.member-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Compatibility with older HTML structure (no .member-photo / .member-info wrappers) */
.team-member img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    margin: 0 auto 20px;
    border: 4px solid var(--accent-color);
    background-color: var(--primary-color);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.team-member img:hover {
    transform: scale(1.05);
    border-color: var(--text-white);
}

/* Loading and error states for images */
.team-member img[src*="placeholder"],
.team-member img[src*="ui-avatars"] {
    background-color: var(--primary-color);
}

/* Ensure images don't break layout if they fail to load */
.team-member img:not([src]),
.team-member img[src=""] {
    background: var(--primary-color) url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgdmlld0JveD0iMCAwIDEwMCAxMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiBmaWxsPSIjMkM1RjJEIi8+Cjx0ZXh0IHg9IjUwIiB5PSI1NSIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjE0IiBmaWxsPSJ3aGl0ZSIgdGV4dC1hbmNob3I9Im1pZGRsZSI+VGVhbTwvdGV4dD4KPC9zdmc+') center/cover no-repeat;
}

.team-member h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-white);
}

.team-member h4 {
    color: var(--accent-color);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
}

.team-member p {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(0, 0, 0, 0.75);
    margin-bottom: 18px;
}

.team-social, .member-social {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.team-social a, .member-social a {
    color: var(--accent-color);
    font-size: 18px;
    transition: color 0.25s ease, transform 0.2s ease;
}

.team-social a:hover, .member-social a:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* Small adjustment for RTL: ensure spacing/order looks correct */
[dir="rtl"] .team-member p, [dir="rtl"] .team-member h3, [dir="rtl"] .team-member h4 {
    text-align: right;
}

.member-info h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-white);
}

.member-role {
    color: var(--accent-color);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
}

.member-bio {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(0, 0, 0, 0.75);
    margin-bottom: 20px;
}

.member-social {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.member-social a {
    color: var(--accent-color);
    font-size: 18px;
    transition: color 0.3s ease;
}

.member-social a:hover {
    color: var(--primary-color);
}

.team-stats {
    background: var(--primary-color);
    padding: 60px 0;
    margin: 80px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    text-align: center;
}

.stat-item h3 {
    font-size: 48px;
    font-weight: 900;
    color: var(--text-on-colored);
    margin-bottom: 10px;
}

.stat-item p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
}

.team-values {
    padding: 80px 0;
}

.team-values h2 {
    text-align: center;
    font-size: 36px;
    margin-bottom: 50px;
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.value-item {
    text-align: center;
    padding: 30px 20px;
}

.value-icon {
    width: 80px;
    height: 80px;
    background: var(--secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.value-icon i {
    font-size: 32px;
    color: var(--text-on-colored);
}

.value-item h4 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
}

.value-item p {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
}

/* CTA Section specific to team page */
.cta-section {
    background: var(--primary-color);
    padding: 80px 16px;
    margin-top: 40px;
}

.cta-content {
    max-width: 700px;
    text-align: center;
    margin: 0 auto;
}

.cta-content h2 {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--text-on-colored);
}

.cta-content p {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 35px;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-content .cta-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 15px 35px;
    font-size: 16px;
    background: var(--button-gradient);
    color: var(--text-on-colored);
    border-radius: 50px;
    text-decoration: none;
    transition: transform 0.3s ease, filter 0.3s ease;
    box-shadow: 0 12px 30px rgba(238, 94, 69, 0.35);
}

.cta-content .cta-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-2px);
}

/* Ensure proper spacing for bilingual content */
.cta-content span {
    display: block;
    line-height: 1.6;
}

.cta-content h2 span {
    display: inline;
}

/* Responsive adjustments for team CTA */
@media (max-width: 768px) {
    .cta-content h2 {
        font-size: 32px;
        margin-bottom: 15px;
    }
    
    .cta-content p {
        font-size: 16px;
        margin-bottom: 25px;
        padding: 0 10px;
    }
    
    .cta-content .cta-btn {
        padding: 12px 25px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .cta-section {
        padding: 60px 16px;
    }
    
    .cta-content h2 {
        font-size: 28px;
    }
    
    .cta-content p {
        font-size: 15px;
        margin-bottom: 20px;
    }
}