/* ===== СПЕЦИФИЧНЫЕ СТИЛИ ДЛЯ СТРАНИЦЫ ХРОНОЛОГИИ ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.7;
    color: #333;
    background: linear-gradient(135deg, #f8f9fa 0%, #e8ebef 100%);
    font-size: 16px;
    min-height: 100vh;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ===== ТИПОГРАФИЯ ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: #2c3e50;
}

h1 {
    font-size: 2.8rem;
}

h2 {
    font-size: 2.2rem;
    color: #597d89;
}

h3 {
    font-size: 1.8rem;
}

p {
    margin-bottom: 1.5rem;
}

a {
    text-decoration: none;
    color: #597d89;
    transition: color 0.3s ease;
}

a:hover {
    color: #4a6a75;
}

/* ===== ШАПКА САЙТА ===== */
.header {
    background-color: #fff;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1001;
    padding: 0;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 15px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: #597d89;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    font-weight: 600;
    position: relative;
}

.nav a:hover,
.nav a.active {
    color: #4a6a75;
}

/* ===== ПОДВАЛ САЙТА ===== */
.footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 3rem 0 2rem;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-nav {
    display: flex;
    gap: 1.5rem;
}

.footer-nav a {
    color: #bdc3c7;
}

.footer-nav a:hover {
    color: #ecf0f1;
}

/* ===== ХЛЕБНЫЕ КРОШКИ ===== */
.breadcrumbs {
    background-color: #f8f9fa;
    padding: 1rem 0;
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.breadcrumbs a {
    color: #597d89;
}

.breadcrumbs span {
    color: #666;
}

/* ===== ОСНОВНЫЕ СТИЛИ СТРАНИЦЫ ХРОНОЛОГИИ ===== */
.timeline-full-page {
    padding: 80px 0;
    min-height: 100vh;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h1 {
    color: #2c3e50;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.2rem;
    color: #666;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Панель фильтров */
.timeline-controls {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
    border: 2px solid #e8ebef;
    scroll-margin-top: 100px;
    position: relative;
    z-index: 1000;
}

.filter-section {
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    scroll-margin-top: 120px;
}

.filter-section.highlighted {
    background: #e8f4f8 !important;
    border-radius: 10px;
    padding: 1rem;
    animation: pulseHighlight 2s ease-in-out;
}

@keyframes pulseHighlight {
    0% { background: #f8f9fa; }
    50% { background: #e8f4f8; box-shadow: 0 0 20px rgba(89, 125, 137, 0.2); }
    100% { background: #f8f9fa; }
}

.filter-section h3 {
    color: #597d89;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 10px 15px;
    border-radius: 8px;
    margin: -10px -15px 1rem -15px;
    background: #f8f9fa;
}

.filter-section h3:hover {
    background: #e8ebef;
    transform: translateX(5px);
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.filter-btn {
    padding: 0.6rem 1.2rem;
    background: #f8f9fa;
    border: 2px solid #e8ebef;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
}

.filter-btn:hover {
    background: #597d89;
    color: white;
    border-color: #597d89;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: #597d89;
    color: white;
    border-color: #597d89;
}

.filter-btn.active::after {
    content: ' ✓';
    font-weight: bold;
}

/* Кнопка возврата к фильтрам */
.back-to-filters-container {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e8ebef;
}

.back-to-filters-btn {
    padding: 0.8rem 1.5rem;
    background: #597d89;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.back-to-filters-btn:hover {
    background: #4a6a75;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Навигация по эпохам */
.era-navigation {
    background: white;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    margin-bottom: 3rem;
    position: relative;
    z-index: 999;
}

.era-nav-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.era-nav-btn {
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border: 2px solid #e8ebef;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
    text-decoration: none;
}

.era-nav-btn:hover {
    background: #597d89;
    color: white;
    border-color: #597d89;
}

/* Основная лента времени */
.timeline-full {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.timeline-full::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #597d89, #4a6a75, #597d89);
    border-radius: 3px;
}

.timeline-era-full {
    margin-bottom: 4rem;
    position: relative;
    scroll-margin-top: 100px;
}

.era-header-full {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.era-header-full h2 {
    display: inline-block;
    background: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    color: #597d89;
    border: 3px solid #597d89;
    font-size: 1.8rem;
}

.era-years {
    display: block;
    margin-top: 0.5rem;
    font-size: 1.1rem;
    color: #666;
    font-weight: 600;
}

.timeline-items {
    display: grid;
    gap: 2rem;
}

.timeline-item {
    position: relative;
    width: 45%;
    padding: 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border-left: 5px solid #597d89;
    scroll-margin-top: 100px;
    opacity: 0;
    transform: translateY(30px);
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-item.highlight-first {
    animation: highlightFirstItem 2s ease-in-out;
}

@keyframes highlightFirstItem {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); box-shadow: 0 10px 30px rgba(89, 125, 137, 0.4); }
    100% { transform: scale(1); }
}

.timeline-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.timeline-item:nth-child(odd) {
    margin-left: auto;
}

.timeline-item:nth-child(even) {
    margin-right: auto;
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background: #597d89;
    border: 4px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 3px #597d89;
}

.timeline-item:nth-child(odd)::before {
    left: -60px;
}

.timeline-item:nth-child(even)::before {
    right: -60px;
}

.item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #eee;
}

.item-book {
    font-weight: 700;
    color: #597d89;
    font-size: 1.1rem;
}

.item-year {
    background: #f8f9fa;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
}

.item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.item-tag {
    padding: 0.3rem 0.8rem;
    background: #f8f9fa;
    border-radius: 15px;
    font-size: 0.8rem;
    color: #666;
    border: 1px solid #e8ebef;
}

/* Цвета тегов */
.item-tag.series-adenium { background: #e8f4f8; border-color: #597d89; color: #2c3e50; }
.item-tag.series-archive { background: #f8e8f4; border-color: #89597d; color: #2c3e50; }
.item-tag.series-ordyn { background: #f4f8e8; border-color: #7d8959; color: #2c3e50; }
.item-tag.series-adapt { background: #fff8e8; border-color: #897959; color: #2c3e50; }
.item-tag.series-standalone { background: #e8f8f4; border-color: #597d75; color: #2c3e50; }
.item-tag.world-mirror { background: #e8e8f8; border-color: #59597d; color: #2c3e50; }
.item-tag.world-archive { background: #f8f8e8; border-color: #7d7d59; color: #2c3e50; }
.item-tag.world-hell { background: #f8e8e8; border-color: #7d5959; color: #2c3e50; }
.item-tag.world-real { background: #e8f8e8; border-color: #597d59; color: #2c3e50; }
.item-tag.world-limb { background: #f0e8f8; border-color: #75597d; color: #2c3e50; }

.item-content h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    line-height: 1.4;
}

.item-content p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.item-significance {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 10px;
    border-left: 3px solid #597d89;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
}

.item-significance strong {
    color: #597d89;
}

/* Кнопка "Наверх" */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #597d89;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    font-size: 1.2rem;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #4a6a75;
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* Сообщение когда нет результатов */
.no-results {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-style: italic;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    display: none;
    margin: 2rem 0;
}

.no-results.visible {
    display: block;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 992px) {
    .timeline-full::before {
        left: 40px;
    }

    .timeline-item {
        width: calc(100% - 80px);
        margin-left: 80px !important;
    }

    .timeline-item::before {
        left: -60px !important;
        right: auto !important;
    }

    .era-header-full h2 {
        font-size: 1.5rem;
        padding: 0.8rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .timeline-controls {
        padding: 1.5rem;
    }

    .filter-buttons {
        justify-content: center;
    }

    .timeline-item {
        width: calc(100% - 60px);
        margin-left: 60px !important;
        padding: 1.5rem;
    }

    .timeline-item::before {
        left: -50px !important;
        width: 16px;
        height: 16px;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    .item-meta {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .era-nav-buttons {
        gap: 0.3rem;
    }
    
    .era-nav-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .timeline-full-page {
        padding: 60px 0;
    }

    .timeline-controls {
        padding: 1rem;
    }

    .filter-section h3 {
        font-size: 1.1rem;
        justify-content: center;
    }

    .timeline-item {
        width: calc(100% - 40px);
        margin-left: 40px !important;
        padding: 1rem;
    }

    .timeline-item::before {
        left: -40px !important;
        width: 14px;
        height: 14px;
    }

    .era-header-full h2 {
        font-size: 1.3rem;
        padding: 0.6rem 1.2rem;
    }

    .back-to-top {
        bottom: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }

    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .era-nav-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .era-nav-btn {
        width: 100%;
        text-align: center;
    }
}