/* Общие стили для всего сайта */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Импорт шрифтов с Google Fonts (Roboto для основного текста, Open Sans для заголовков) */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&family=Open+Sans:wght@400;500;600;700&display=swap');

/* 
 * CSS-переменные для единообразия стилей по всему сайту 
 * Использование переменных позволяет легко менять цветовую схему и другие параметры
 */
:root {
    --primary-color: #006DB6;         /* Основной синий цвет университета */
    --secondary-color: #00427A;       /* Темно-синий цвет для акцентов */
    --accent-color: #FFB800;          /* Акцентный золотой цвет */
    --text-color: #212B36;            /* Основной цвет текста (темный) */
    --light-text: #6B7280;            /* Светлый цвет для параграфов */
    --background-color: #FFFFFF;      /* Цвет фона (белый) */
    --section-bg: #F7F9FC;            /* Светлый фон для секций */
    --border-color: #E5E7EB;          /* Цвет границ */
    --success-color: #10B981;         /* Зеленый цвет для успешных уведомлений */
    --warning-color: #F59E0B;         /* Оранжевый для предупреждений */
    --danger-color: #EF4444;          /* Красный для ошибок */
    --container-width: 1280px;        /* Максимальная ширина контейнера */
    --header-height: 80px;            /* Высота шапки сайта */
    --border-radius: 8px;             /* Скругление углов */
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); /* Тень для блоков */
    --transition: all 0.3s ease;      /* Стандартное время перехода анимации */
}

/* 
 * Базовые стили для тега body 
 * Задаем основной шрифт, цвета и размеры для всего сайта
 */
body {
    font-family: 'Roboto', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    font-size: 16px;
    overflow-x: hidden;
    background: url('assets/img/background.webp') top center repeat-y #f7f9fc;
    background-size: 100% auto;
    background-position: top center;
}

/* 
 * Контейнер для центрирования содержимого
 * Используется для ограничения максимальной ширины контента и центрирования на странице
 */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* 
 * Стили для всех заголовков 
 * Используем Open Sans для более читаемых заголовков
 */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Open Sans', Arial, sans-serif;
    margin-bottom: 0.5em;
    line-height: 1.3;
    color: var(--secondary-color);
}

/* Отступы для основных секций сайта */
section {
    padding: 60px 0;
}

/* 
 * Исправление проблемы горизонтальной прокрутки
 * Принудительно устанавливаем правильный overflow-x
 */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Общее исправление для всех мобильных устройств */
@media (max-width: 768px) {
    /* Исправление общего контейнера */
    .container {
        padding-left: 0;
        padding-right: 0;
        width: 100%;
        max-width: 100%;
    }
}

/* Более специфичное исправление для маленьких экранов */
@media (max-width: 480px) {
    /* Полностью сбрасываем отступы для контейнера */
    body {
        overflow-x: hidden;
    }
    
    .container {
        padding: 0;
        margin: 0 auto;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
}

/* Специфические стили для самых маленьких экранов для устранения отступа слева */
@media (max-width: 425px) {
    .container {
        padding: 0;
        width: 100%;
        margin: 0 auto;
    }
}

.custom-breadcrumb {
    width: 80%;
    max-width: 1500px;
    margin: 0 auto 0 auto;
    background: #eceff2;
    color: #3a3a3a;
    font-size: 18px;
    padding: 18px 0 18px 48px;
    font-family: 'Open Sans', Arial, sans-serif;
    letter-spacing: 0.01em;
    border-radius: 0 0 0 0;
}
.breadcrumb-separator {
    color: #b0b0b0;
    margin: 0 8px;
}

.content {
    width: 80%;
    max-width: 1500px;
    margin: 0 auto 0 auto;
    background: #fff;
    border-radius: 0;
    box-shadow: none;
    padding: 40px 40px 32px 40px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    box-sizing: border-box;
}

.content h2 {
    margin-bottom: 32px;
    color: #1a2a3a;
    font-size: 28px;
    font-weight: 700;
    text-align: left;
    font-family: 'Open Sans', Arial, sans-serif;
    width: 100%;
}

.test-table {
    border-collapse: collapse;
    margin-bottom: 32px;
    width: 100%;
    max-width: 400px;
}
.test-table td {
    border: 1px solid #d0d7e2;
    padding: 12px 0;
    text-align: center;
    font-size: 18px;
    background: #f7f9fc;
    color: #222;
}

.file-row {
    margin-top: 12px;
    font-size: 17px;
    color: #444;
    background: #f2f2f2;
    border-radius: 6px;
    padding: 10px 18px;
    font-family: 'Roboto', Arial, sans-serif;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    letter-spacing: 0.01em;
    width: fit-content;
}

@media (max-width: 900px) {
    .content {
        width: 96%;
        padding: 24px 8px 24px 8px;
    }
    .custom-breadcrumb {
        width: 96%;
        padding-left: 16px;
    }
}

@media (max-width: 768px) {
    body {
        background: #f7f9fc !important;
    }
    .content {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        box-shadow: none;
        padding: 18px 4vw 18px 4vw;
    }
    .custom-breadcrumb {
        width: 100%;
        max-width: 100%;
        padding-left: 8px;
        font-size: 16px;
    }
}

/* Welcome Section Styles */
.welcome-section {
    padding: 40px 0;
    margin-bottom: 40px;
    background-color: #f8f9fa;
    border-radius: 15px;
}

.welcome-container {
    display: flex;
    align-items: center;
    gap: 50px;
    max-width: 100%;
}

.welcome-image {
    flex: 1;
    display: flex;
    justify-content: center;
}

.welcome-image img {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.welcome-text {
    flex: 1;
    padding-right: 20px;
}

.welcome-text h1 {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 24px;
    color: #333;
    line-height: 1.2;
}

.welcome-text p {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 30px;
    color: #555;
}

.apply-button {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    font-size: 18px;
    font-weight: 600;
    padding: 15px 40px;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 109, 182, 0.3);
}

.apply-button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 109, 182, 0.4);
}

/* Responsive styles for welcome section */
@media (max-width: 992px) {
    .welcome-container {
        flex-direction: column;
        gap: 30px;
    }
    
    .welcome-text {
        text-align: center;
        padding-right: 0;
    }
    
    .welcome-text h1 {
        font-size: 36px;
    }
}

/* Education Level Section Styles */
.education-level-section {
    padding: 60px 0;
    margin-bottom: 40px;
    background-color: #f8f9fa;
    border-radius: 15px;
    overflow: hidden;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

.education-level-section h2 {
    font-size: 36px;
    text-align: center;
    margin-bottom: 40px;
    color: #333;
}

.education-options {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 50px;
    flex-wrap: wrap;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.education-option {
    flex: 1;
    max-width: 300px;
    min-width: 220px;
    height: 220px;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.education-option:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.option-background {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
}

.option-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 109, 182, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.education-option:not(.active) .option-overlay {
    background: rgba(0, 0, 0, 0.7);
}

.education-option:hover .option-overlay, 
.education-option.active .option-overlay {
    background: rgba(0, 109, 182, 0.8);
}

.education-option h3 {
    color: white;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    position: relative;
    z-index: 2;
    padding: 20px;
}

.education-option.active {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.education-option.active .option-overlay {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 109, 182, 0.9));
}

/* Benefits Container Styles */
.benefits-container {
    background-color: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    margin-top: 20px;
    display: none;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.benefits-container.active {
    display: block;
    animation: fadeIn 0.5s ease forwards;
}

.benefits-container h3 {
    font-size: 28px;
    margin-bottom: 30px;
    text-align: center;
    color: var(--secondary-color);
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.benefit-item {
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 25px 20px;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.benefit-item-wide {
    grid-column: span 2;
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 25px 20px;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    text-align: left;
}

.benefit-item-wide .benefit-icon {
    flex-shrink: 0;
    margin-bottom: 0;
}

.benefit-item-wide .benefit-content {
    flex: 1;
}

.benefit-item:hover, .benefit-item-wide:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    background-color: white;
    border-color: rgba(0, 109, 182, 0.2);
}

.benefit-icon {
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: white;
    font-size: 24px;
    box-shadow: 0 5px 15px rgba(0, 109, 182, 0.2);
}

.benefit-item h4, .benefit-item-wide h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    line-height: 1.3;
}

.benefit-item p, .benefit-item-wide p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

@media (max-width: 992px) {
    .education-options {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
    }
    
    .education-option {
        flex: 0 0 calc(33.33% - 20px);
        max-width: calc(33.33% - 20px);
        min-width: 200px;
        height: 180px;
    }
    
    .education-option h3 {
        font-size: 20px;
    }
    
    /* Exactly 2 columns on medium screens */
    .benefits-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .benefit-item-wide {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .education-options {
        gap: 15px;
    }
    
    .education-option {
        flex: 0 0 calc(50% - 15px);
        max-width: calc(50% - 15px);
        min-width: 160px;
        height: 160px;
    }
    
    .education-option h3 {
        font-size: 18px;
    }
}

/* Single column on mobile */
@media (max-width: 576px) {
    .education-option {
        flex: 0 0 100%;
        max-width: 100%;
        height: 150px;
    }
    
    .benefits-grid {
        grid-template-columns: 1fr;
    }
    
    .benefit-item-wide {
        grid-column: span 1;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .benefit-item-wide .benefit-icon {
        margin-bottom: 15px;
    }
    
    .benefits-container {
        padding: 20px;
    }
}
