/* Teacher Section - Modern Card Design */
/* ======================================================= */
.teacher {
    background: var(--bg-primary);
    padding: clamp(3rem, 8vw, 5rem) 5%;
}

.section-subtitle {
    text-align: center;
    color: var(--gray);
    font-size: 1.1rem;
    margin-bottom: 3rem;
    max-width: 50rem;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* Teachers Grid */
.teachers-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 45rem;
    margin: 0 auto;
}

/* Teacher Card */
.teacher-card {
    background: var(--white);
    border-radius: 1.25rem;
    box-shadow: 0 8px 32px var(--shadow-light);
    border: 1px solid var(--light-gray);
    overflow: hidden;
    position: relative;
    width: 100%;
}

/* Teacher Header */
.teacher-header {
    padding: 1.75rem;
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    position: relative;
    background: linear-gradient(135deg, var(--bg-accent) 0%, var(--white) 100%);
}

.teacher-avatar {
    flex-shrink: 0;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary);
    box-shadow: 0 6px 20px var(--shadow-medium);
}

.teacher-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.teacher-info {
    flex: 1;
    min-width: 0;
}

.teacher-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.teacher-title {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.teacher-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: var(--primary);
    color: var(--white);
}

.badge-secondary {
    background: var(--secondary);
    color: var(--white);
}

.badge-accent {
    background: var(--accent);
    color: var(--white);
}

/* Expand Button - FIXED FOR TEACHER CARDS */
.expand-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    z-index: 10;
    transition: all 0.3s ease;
    overflow: hidden;
}

.expand-btn:hover {
    color: var(--accent);
}

.expand-btn.expanded {
    color: var(--accent);
}

/* Rotate Animation for Teacher Cards */
.expand-btn i {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: rotate(0deg);
    display: inline-block;
    will-change: transform;
    backface-visibility: hidden;
}

.expand-btn.expanded i {
    transform: rotate(45deg);
}

/* Teacher Details Section */
.teacher-details-section {
    padding: 0 2rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
}

.teacher-details-section.expanded {
    max-height: 50rem;
    padding: 2rem;
    opacity: 1;
    border-top: 1px solid var(--light-gray);
}

.teacher-bio {
    margin-bottom: 2rem;
}

.teacher-bio p {
    color: var(--gray);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Teacher Credentials */
.teacher-credentials {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.credential-item h4 {
    color: var(--primary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.credential-item h4 i {
    font-size: 1.1rem;
}

.credential-item ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.credential-item li {
    color: var(--dark-gray);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.credential-item li::before {
    content: "•";
    color: var(--accent);
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Responsive Design */
@media (max-width: 48rem) {
    .teachers-grid {
        gap: 1.5rem;
        padding: 0 1rem;
        max-width: 100%;
    }
    
    .teacher-header {
        padding: 1.5rem;
        gap: 1rem;
    }
    
    .teacher-avatar {
        width: 3rem;
        height: 3rem;
    }
    
    .teacher-name {
        font-size: 1rem;
    }
    
    .teacher-title {
        font-size: 0.8rem;
    }
    
    .expand-btn {
        top: 1rem;
        right: 1rem;
        width: 2rem;
        height: 2rem;
        font-size: 0.8rem;
    }
    
    .teacher-details-section.expanded {
        padding: 1.5rem;
    }
    
    .teacher-credentials {
        gap: 1.25rem;
    }
    
    .credential-item h4 {
        font-size: 0.95rem;
    }
    
    .credential-item li {
        font-size: 0.85rem;
    }
}

@media (min-width: 49rem) and (max-width: 75rem) {
    .teachers-grid {
        max-width: 50rem;
        gap: 2.5rem;
    }
}

@media (min-width: 76rem) {
    .teachers-grid {
        max-width: 55rem;
        gap: 3rem;
    }
}

@media (min-width: 100rem) {
    .teachers-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2.5rem;
    }
}

/* Mobile Layout for Teacher Cards */
@media (max-width: 48rem) {
    .teacher-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .teacher-avatar {
        width: 3rem;
        height: 3rem;
        align-self: flex-start;
    }
    
    .expand-btn {
        position: relative;
        top: auto;
        right: auto;
        width: 2rem;
        height: 2rem;
        font-size: 0.8rem;
        align-self: flex-end;
        margin-top: -3rem;
    }
    
    .teacher-info {
        width: 100%;
        margin-top: 0.5rem;
    }
}