/* Современные стили для кафедры ИНИТ 2025 - Ограниченная область видимости */

/* CSS-переменные только для страниц кафедры */
.kafedra-page,
.teachers-page,
.departments-page,
.documents-page,
.about-page {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --bg-light: #f7fafc;
    --bg-white: #ffffff;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* Темная тема (опционально) */
@media (prefers-color-scheme: dark) {
    .kafedra-page,
    .teachers-page,
    .departments-page,
    .documents-page,
    .about-page {
        --bg-white: #1a202c;
        --bg-light: #2d3748;
        --text-primary: #f7fafc;
        --text-secondary: #e2e8f0;
        --border-color: #4a5568;
    }
}

/* Общие стили - ограничены областью кафедры */
.kafedra-page {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 2rem 0;
}

.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: var(--radius-xl);
    padding: 3rem;
    margin-bottom: 3rem;
    color: white;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s ease-out;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
    pointer-events: none;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

/* ========================= */
/* Детальная страница преподавателя */
/* ========================= */
.teacher-detail-page {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 2rem 0;
}

.teacher-profile-card {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.teacher-profile-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    padding: 3rem 2rem 2rem;
    position: relative;
}

.teacher-profile-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grain)"/></svg>');
}

.teacher-profile-content { position: relative; z-index: 2; }

.teacher-main-info {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.teacher-avatar-large {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.avatar-fallback-large { font-size: 3rem; font-weight: 700; }

.teacher-basic-info h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #0d6efd;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    text-shadow: none;
}

.teacher-basic-info .position {
    font-size: 1.25rem;
    font-weight: 500;
    color: #2b6cb0;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    text-shadow: none;
    display: inline-block;
}

.teacher-basic-info .degree {
    font-size: 1rem;
    color: #4a5568;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    text-shadow: none;
    display: inline-block;
}

.teacher-contact-info {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: #1a202c;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    text-shadow: none;
}

.contact-item i { width: 20px; text-align: center; color: #4a5568; }
.contact-item a { color: #2b6cb0 !important; text-decoration: none; transition: all 0.3s ease; font-weight: 500; }
.contact-item a:hover { color: #1a365d !important; text-decoration: underline; }

.teacher-profile-body { padding: 2rem; }

.bio-section {
    background: #f7fafc;
    border-radius: var(--radius-lg);
    padding: 2rem;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.bio-section h3 {
    color: #1a202c;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bio-content { color: #2d3748; line-height: 1.6; font-size: 1rem; font-weight: 400; }

.back-button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #0d6efd;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    margin-bottom: 2rem;
}

.back-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
    color: #fff;
    text-decoration: none;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border-top: 4px solid var(--primary-color);
}

.stat-card .icon { font-size: 2rem; color: #667eea; margin-bottom: 1rem; }
.stat-card .label { font-size: 0.9rem; color: #4a5568; font-weight: 500; margin-bottom: 0.5rem; }
.stat-card .value { font-size: 1.25rem; font-weight: 700; color: #1a202c; }

/* Адаптив для детальной страницы */
@media (max-width: 768px) {
    .teacher-detail-page { padding: 1rem 0; }
    .teacher-profile-header { padding: 2rem 1rem 1.5rem; }
    .teacher-main-info { flex-direction: column; text-align: center; gap: 1.5rem; }
    .teacher-avatar-large { width: 120px; height: 120px; }
    .teacher-basic-info h1 { font-size: 2rem; padding: 0.375rem 0.75rem; }
    .teacher-basic-info .position { font-size: 1.1rem; padding: 0.25rem 0.5rem; }
    .teacher-contact-info { justify-content: center; gap: 1rem; }
    .contact-item { font-size: 0.9rem; padding: 0.4rem 0.8rem; }
    .contact-item i { font-size: 0.9rem; }
    .teacher-profile-body { padding: 1.5rem; }
    .bio-section { padding: 1.5rem; }
    .stats-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; }
}

@media (max-width: 480px) {
    .teacher-profile-header { padding: 1.5rem 1rem; }
    .teacher-basic-info h1 { font-size: 1.75rem; line-height: 1.3; padding: 0.25rem 0.5rem; }
    .teacher-contact-info { flex-direction: column; gap: 0.75rem; align-items: center; }
    .teacher-profile-body { padding: 1rem; }
    .bio-section { padding: 1rem; }
    .stats-grid { grid-template-columns: 1fr; }
    .back-button { width: 100%; justify-content: center; padding: 1rem 2rem; }
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

/* Карточки */
.modern-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: none;
    transition: all 0.3s ease;
}

.modern-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-header-modern {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    margin: -1.5rem -1.5rem 1.5rem -1.5rem;
    font-weight: 600;
    font-size: 1.125rem;
}

/* Директор секция */
.director-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 2rem;
    border-radius: var(--radius-xl);
    margin-bottom: 2rem;
}

.director-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    border: 4px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
}

.director-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.director-position {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

/* Преподаватели */
.teachers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    justify-items: center;
}

/* Страницы списка преподавателей: общий фон и отступы */
.teachers-page {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 2rem 0;
}

.teacher-card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 100%;
    max-width: 350px;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: none;
    position: relative;
}

.teacher-card::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: all 0.5s;
    z-index: 1;
}

.teacher-card:hover::before {
    left: 100%;
}

.teacher-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.teacher-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    object-position: center 20%;
    transition: transform 0.3s ease;
    background: var(--bg-light);
}

.teacher-card:hover .teacher-image {
    transform: scale(1.05);
}

.teacher-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.teacher-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.teacher-position {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.teacher-degree {
    color: var(--primary-color);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Компактные карточки преподавателей (страницы списка) */
.teacher-card-compact {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.teacher-card-compact:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.teacher-card-compact .teacher-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: var(--bg-light);
}

.teacher-card-compact .teacher-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.teacher-card-compact .teacher-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

.teacher-card-compact .teacher-info {
    padding: 0.75rem 0.9rem 0.9rem;
}

.teacher-card-compact .teacher-name {
    font-size: 1rem;
    margin: 0 0 0.25rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.teacher-card-compact .teacher-position {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(1.3em * 2);
}

.teacher-card-compact .teacher-actions {
    margin-top: 0.6rem;
}

/* Бейджи степени/званий */
.teacher-badges {
    margin-top: .35rem;
    display: flex;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .15rem .45rem;
    font-size: .75rem;
    border-radius: 999px;
    background: var(--bg-light);
    color: #475569;
    border: 1px solid var(--border-color);
}

.badge-chip i {
    color: var(--primary-color);
    font-size: .8rem;
}

/* Переключатель плотности карточек */
.density-toggle {
    display: flex;
    gap: .5rem;
    align-items: center;
}

.btn-density {
    padding: .4rem .7rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    color: #334155;
    font-weight: 600;
    font-size: .9rem;
}

.btn-density.active {
    background: var(--primary-soft);
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

/* Стандартная плотность (чуть крупнее) */
.density-standard .teacher-card-compact .teacher-info { padding: 1rem 1rem 1.1rem; }
.density-standard .teacher-card-compact .teacher-name { font-size: 1.08rem; }
.density-standard .teacher-card-compact .teacher-position { font-size: .92rem; -webkit-line-clamp: 3; line-clamp: 3; min-height: calc(1.3em * 2.2); }
.density-standard .teacher-card-compact .teacher-image-wrapper { aspect-ratio: 1 / 1; }

/* ========================= */
/* Режим списка для страниц преподавателей (включается классом .list-view на .teachers-page) */
/* ========================= */
.teachers-page.list-view .teacher-card-compact {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: .75rem;
}
.teachers-page.list-view .teacher-card-compact .teacher-image-wrapper {
    flex: 0 0 96px;
    width: 96px;
    height: 96px;
    aspect-ratio: auto;
    border-radius: var(--radius-md);
    overflow: hidden;
}
.teachers-page.list-view .teacher-card-compact .teacher-info {
    padding: 0;
}
.teachers-page.list-view .teacher-card-compact .teacher-name { font-size: 1.05rem; margin-bottom: .2rem; }
.teachers-page.list-view .teacher-card-compact .teacher-position { -webkit-line-clamp: 2; line-clamp: 2; }
.teachers-page.list-view .teacher-card-compact .teacher-actions { margin-left: auto; min-width: 140px; }

@media (max-width: 576px) {
    .teachers-page.list-view .teacher-card-compact {
        flex-direction: column;
        align-items: stretch;
    }
    .teachers-page.list-view .teacher-card-compact .teacher-image-wrapper {
        width: 100%;
        height: 180px;
    }
    .teachers-page.list-view .teacher-card-compact .teacher-actions { margin-left: 0; }
}

/* Документы секция */
.documents-section {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
}

/* Поиск и фильтрация */
.search-filter {
    background: linear-gradient(135deg, var(--bg-white) 0%, #f8fafc 100%);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(102, 126, 234, 0.1);
    position: relative;
    overflow: hidden;
}

.search-filter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem 1rem 1rem 3rem;
    width: 100%;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
    outline: none;
    transform: translateY(-2px);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.1rem;
    pointer-events: none;
    z-index: 2;
}

.search-input:focus + .search-icon {
    color: var(--primary-color);
}

.search-stats {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.search-stats .counter {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.document-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
    border: 2px solid transparent;
}

.document-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
    text-decoration: none;
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    border-color: rgba(255, 255, 255, 0.2);
}

.document-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.document-count {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Награды */
.awards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.award-item {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.award-item:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

.award-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.award-title {
    padding: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
}

/* Улучшенные кнопки */
.btn-modern {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.3), rgba(255,255,255,0.1));
    transition: all 0.3s ease;
}

.btn-modern:hover::before {
    left: 0;
}

.btn-modern:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
    color: white;
    text-decoration: none;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .teachers-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 992px) {
    .teachers-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .hero-section {
        padding: 2.5rem 1.5rem;
    }
    
    .modern-card {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .kafedra-page,
    .teachers-page {
        padding: 1rem 0;
    }
    
    .hero-section {
        padding: 2rem 1rem;
        margin-bottom: 2rem;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .teachers-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1rem;
    }
    
    .teacher-card {
        max-width: 100%;
    }
    
    .documents-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .awards-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .director-card {
        padding: 1.5rem;
        text-align: center;
    }
    
    .director-image {
        width: 120px;
        height: 120px;
        margin: 0 auto 1rem;
    }
    
    .modern-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Улучшенная навигация на мобильных */
    .breadcrumb {
        font-size: 0.875rem;
        margin-bottom: 0;
    }
    
    /* Улучшенный поиск на мобильных */
    .search-filter {
        padding: 1rem;
        margin-bottom: 1.5rem;
        border-radius: var(--radius-md);
    }
    
    .search-input {
        padding: 0.875rem 1rem;
        font-size: 1rem;
        border-radius: var(--radius-md);
    }
    
    .search-filter .row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-filter .col-md-8,
    .search-filter .col-md-4 {
        width: 100%;
        margin-top: 0 !important;
    }
    
    .search-filter .d-flex {
        justify-content: center !important;
    }
}

@media (max-width: 576px) {
    .kafedra-page,
    .teachers-page {
        padding: 0.5rem 0;
    }
    
    .hero-section {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
    }
    
    .teachers-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .teacher-card {
        margin-bottom: 1rem;
    }
    
    .teacher-image {
        height: 200px;
        object-position: center top;
    }
    
    .teacher-info {
        padding: 1rem;
    }
    
    .teacher-name {
        font-size: 1rem;
        line-height: 1.3;
    }
    
    .teacher-position,
    .teacher-degree {
        font-size: 0.85rem;
    }
    
    .documents-grid,
    .awards-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .document-item {
        padding: 1.25rem;
    }
    
    .director-image {
        width: 100px;
        height: 100px;
    }
    
    .modern-card {
        padding: 1rem;
        border-radius: var(--radius-md);
    }
    
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    /* Улучшенный поиск для мобильных */
    .search-filter {
        padding: 1.25rem;
        margin-bottom: 1.5rem;
        border-radius: var(--radius-lg);
    }
    
    .search-filter .row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .search-input {
        padding: 0.875rem 0.875rem 0.875rem 2.75rem;
        font-size: 1rem;
        border-radius: var(--radius-md);
    }
    
    .search-icon {
        left: 0.875rem;
        font-size: 1rem;
    }
    
    .search-stats {
        justify-content: center;
        font-size: 0.85rem;
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    
    .search-stats .counter {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
    
    /* Кнопки на мобильных */
    .btn-modern {
        padding: 0.65rem 1.25rem;
        font-size: 0.9rem;
        width: 100%;
        text-align: center;
    }
    
    /* Табы на мобильных */
    .nav-tabs .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Карточки преподавателей для детальной страницы */
    .teacher-card-detailed {
        margin-bottom: 1rem;
        border-radius: var(--radius-md);
    }
    
    .teacher-header,
    .teacher-body {
        padding: 1rem;
    }
    
    .teacher-avatar {
        width: 80px;
        height: 80px;
        margin-right: 1rem;
    }
}

@media (max-width: 400px) {
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .teacher-image {
        height: 180px;
    }
    
    .teacher-info {
        padding: 0.75rem;
    }
    
    .teacher-name {
        font-size: 0.95rem;
    }
    
    .teacher-position,
    .teacher-degree {
        font-size: 0.8rem;
    }
    
    .document-item {
        padding: 1rem;
    }
    
    .modern-card {
        padding: 0.75rem;
    }
    
    .container {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
    
    /* Компактный поиск для очень маленьких экранов */
    .search-filter {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .search-input {
        padding: 0.75rem 0.75rem 0.75rem 2.5rem;
        font-size: 0.95rem;
    }
    
    .search-icon {
        left: 0.75rem;
        font-size: 0.9rem;
    }
    
    .search-stats {
        font-size: 0.8rem;
        gap: 0.2rem;
    }
    
    .search-stats .counter {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
    }
    
    /* Очень маленькие кнопки */
    .btn-modern {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
}

/* Расширенные анимации */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shimmer {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* Мини-сетка преподавателей (для Contacts/About и превью) */
.home-teachers-grid .home-teacher-card {
    background: var(--bg-white, #ffffff);
    border-radius: var(--radius-lg, 0.75rem);
    overflow: hidden;
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.08));
    transition: transform .25s ease, box-shadow .25s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.home-teachers-grid .home-teacher-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg, 0 12px 24px rgba(0,0,0,0.12));
}

.home-teacher-image {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--bg-light, #f1f5f9);
}

.home-teacher-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.home-teacher-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

.home-teacher-info {
    padding: .75rem .9rem .9rem;
}

.home-teacher-name {
    font-size: 1rem;
    margin: 0 0 .2rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-teacher-position {
    font-size: .875rem;
    color: #6b7280;
    margin: 0;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(1.3em * 2);
}

.home-teacher-badges {
    margin-top: .4rem;
    display: flex;
    align-items: center;
    gap: .4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-badge-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .18rem .5rem;
    font-size: .76rem;
    border-radius: 999px;
    background: var(--bg-light, #f8fafc);
    color: #475569;
    border: 1px solid rgba(102,126,234,.25);
}

.home-badge-chip i {
    color: var(--primary-color, #667eea);
    font-size: .8rem;
}

.home-teacher-actions {
    margin-top: .6rem;
}

/* Скелетон загрузка */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.skeleton-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
}

.fade-in {
    animation: fadeInUp 0.6s ease-out;
}

/* Статистика */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.stat-item {
    background: var(--bg-white);
    text-align: center;
    padding: 2rem 1rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    display: block;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Улучшенные навигационные табы */
.nav-tabs-modern {
    border: none;
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nav-tabs-modern .nav-link {
    border: none;
    background: var(--bg-light);
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.nav-tabs-modern .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-tabs-modern .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.nav-tabs-modern .nav-link.active::before {
    width: 100%;
}

.nav-tabs-modern .nav-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}