/* Стили для временной шкалы на всю ширину */
.timeline-section {
    margin: 30px -20px;
    border-radius: 0;
    width: calc(100% + 40px);
}

.timeline {
    position: relative;
    margin: 0 auto;
    padding: 40px 0;
    max-width: none;
}

/* Центральная вертикальная линия */
.timeline::after {
    content: '';
    position: absolute;
    width: 6px;
    background-color: var(--accent-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -3px;
    border-radius: 3px;
}

/* Контейнеры таймлайна - теперь шире */
.container-timeline {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
    box-sizing: border-box;
}

/* Левая сторона */
.container-timeline.left {
    left: 0;
}

/* Правая сторона */
.container-timeline.right {
    left: 50%;
}

/* Кружки на линии времени */
.container-timeline::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 25px;
    right: -17px;
    background-color: white;
    border: 4px solid var(--accent-color);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}

/* Правые контейнеры - кружки слева */
.container-timeline.right::after {
    left: -17px;
}

/* Контент таймлайна - теперь шире */
.content-timeline {
    padding: 25px 30px;
    background-color: var(--secondary-color);
    position: relative;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    min-height: 200px;
}

.content-timeline:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Изображения в таймлайне */
.timeline-image {
    text-align: center;
    margin-bottom: 15px;
}

.timeline-image img {
    width: 250px;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.timeline-image img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Заголовки в таймлайне */
.content-timeline h3 {
    color: var(--accent-color);
    font-size: 1rem;
    margin-bottom: 6px;
    font-weight: bold;
}

.content-timeline h4 {
    color: var(--text-color);
    font-size: 1.4rem;
    margin-bottom: 8px;
    font-weight: bold;
}

.content-timeline p {
    color: var(--light-text);
    line-height: 1.6;
    margin: 0;
    margin-bottom: 8px;
    font-size: 1rem;
    text-align: center;
}

.container-timeline.left .content-timeline h3 {    
    text-align: right;
}

.container-timeline.left .content-timeline h4 {
    text-align: right;
}

/* Распределение контента внутри карточек */
.container-timeline.left .content-timeline {
    /* display: flex; */
    align-items: flex-start;
    gap: 25px;
}

.container-timeline.right .content-timeline {
    /* display: flex; */
    align-items: flex-start;
    gap: 25px;
    flex-direction: row-reverse;
}

.container-timeline.left .timeline-image,
.container-timeline.right .timeline-image {
    flex-shrink: 0;
}

.container-timeline.left .content-timeline > div:last-child,
.container-timeline.right .content-timeline > div:last-child {
    flex: 1;
}

/* Адаптивность для мобильных устройств */
@media screen and (max-width: 768px) {
    .timeline-section {
        margin: 30px -15px;
        width: calc(100% + 30px);
    }
    
    /* Размещаем линию времени слева */
    .timeline::after {
        left: 31px;
    }
    
    /* Полноширинные контейнеры */
    .container-timeline {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
        font-size: clamp(12px, 4vw, 16px);
        overflow-wrap: break-word;
        hyphens: auto; /* Перенос слов через дефис */
    }
    
    /* Смещаем правые контейнеры как левые */
    .container-timeline.right {
        left: 0%;
    }
    
    /* Кружки слева для всех контейнеров */
    .container-timeline::after {
        left: 15px;
        right: auto;
    }

    .container-timeline.right::after {
        left: 15px;
    }
    
    /* Убираем стрелочки на мобильных */
    .container-timeline .content-timeline::before {
        display: none;
    }
    
    /* Вертикальная компоновка на мобильных */
    .container-timeline.left .content-timeline h3,
    .container-timeline.left .content-timeline h4,
    .container-timeline.right .content-timeline h3,
    .container-timeline.right .content-timeline h4{
        flex-direction: column;
        text-align: center;
    }
    
    /* Уменьшаем изображения на мобильных */
    .timeline-image img {
        width: 150px;
        height: 120px;
        margin: 0 auto;
    }
}

/* Для очень широких экранов */
@media screen and (min-width: 1400px) {
    .container-timeline {
        padding: 10px 60px;
    }
    
    .content-timeline {
        padding: 30px 40px;
    }
    
    .timeline-image img {
        width: 360px;
        height: 180px;
    }
}

/* Стили для модального окна */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    display: block;
    margin: auto;
    max-width: 90%;
    max-height: 90%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.2);
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    transition: color 0.3s ease;
}

.close:hover {
    color: var(--accent-color);
}