/* Базовые стили */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* Кастомный скроллбар */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #E8ECF0; }
::-webkit-scrollbar-thumb { background: #3A6B8C; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #1A2A3A; }

body {
    font-family: 'Inter', sans-serif;
    background: #E8ECF0;
    color: #1A2A3A;
    line-height: 1.5;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== ШАПКА ========== */
.header {
    background: rgba(26, 42, 58, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.header-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; transition: transform 0.3s ease; }
.logo:hover { transform: scale(1.03); }

.logo-icon { width: 45px; height: 45px; background: linear-gradient(135deg, #3A6B8C, #1A2A3A); border-radius: 12px; position: relative; box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
.logo-icon::before { content: "🏛"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 24px; color: #FFFFFF; }

.logo-text { display: flex; flex-direction: column; }
.logo-small { font-size: 11px; letter-spacing: 1.5px; color: #A0C4D8; text-transform: uppercase; font-weight: 600; }
.logo-large { font-size: 18px; font-weight: 700; font-family: 'Playfair Display', serif; color: #FFFFFF; }

.nav { display: flex; gap: 32px; }
.nav-link { color: #D0DCE8; text-decoration: none; font-size: 15px; font-weight: 500; transition: color 0.3s; position: relative; }
.nav-link::after { content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 2px; background: #A0C4D8; transition: width 0.3s ease-in-out; }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-link:hover, .nav-link.active { color: #FFFFFF; }

/* ========== ОБЩИЕ ЭЛЕМЕНТЫ ========== */
.back-to-halls {
    display: inline-flex; align-items: center; gap: 10px;
    background: #3A6B8C; border: none; color: #FFFFFF;
    padding: 10px 28px; border-radius: 40px; font-size: 15px;
    font-weight: 600; cursor: pointer; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    margin: 20px 0; text-decoration: none;
    box-shadow: 0 4px 15px rgba(58, 107, 140, 0.3);
}
.back-to-halls:hover { background: #2c5a78; transform: translateY(-3px); box-shadow: 0 8px 25px rgba(58, 107, 140, 0.4); }

.hall-header { margin-bottom: 30px; }
.hall-main-title { font-family: 'Playfair Display', serif; font-size: 42px; font-weight: 700; color: #1A2A3A; margin-bottom: 16px; letter-spacing: -0.5px; }
.hall-description { font-size: 18px; color: #5A6E7A; max-width: 650px; line-height: 1.6; }

/* ========== МИНИ-ОТДЕЛЫ (Уникально для 3 зала) ========== */
.rooms-nav { display: flex; justify-content: center; gap: 15px; margin-bottom: 35px; flex-wrap: wrap; }
.room-btn { 
    background: rgba(26, 42, 58, 0.08); border: 1px solid rgba(58, 107, 140, 0.2); 
    padding: 10px 28px; border-radius: 40px; color: #1A2A3A; font-size: 15px; font-weight: 600; 
    cursor: pointer; transition: all 0.3s ease; font-family: 'Inter', sans-serif; backdrop-filter: blur(8px); 
}
.room-btn:hover { background: rgba(58, 107, 140, 0.15); transform: translateY(-2px); }
.room-btn.active { background: #3A6B8C; color: #FFFFFF; box-shadow: 0 6px 15px rgba(58,107,140,0.3); border-color: transparent; }

/* ========== ГАЛЕРЕЯ И ХОТСПОТЫ ========== */
.photo-gallery {
    position: relative; background: #1A2A3A; border-radius: 20px;
    overflow: visible; box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.photo-container { display: none; position: relative; }
.photo-container.active { display: block; }
.gallery-image { width: 100%; height: auto; display: block; border-radius: 20px; }

.photo-layer {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(26, 42, 58, 0.85); backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px);
    z-index: 50; display: none; border-radius: 20px; overflow: visible;
}
.photo-layer.active { display: block !important; }
.photo-layer .layer-header {
    position: absolute; top: 15px; right: 20px; z-index: 105;
    width: 100%; max-width: 100%; pointer-events: none;
}
.photo-layer .layer-image { width: 100%; height: auto; display: block; border-radius: 20px; box-shadow: 0 15px 40px rgba(0,0,0,0.6); }

/* Кнопки закрытия общие */
.layer-close, .modal-close, .tooltip-close {
    position: absolute; background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.2);
    color: white; font-size: 14px; width: 32px; height: 32px; border-radius: 50%; 
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); backdrop-filter: blur(5px); z-index: 50;
}
.layer-close:hover, .modal-close:hover, .tooltip-close:hover {
    background: #FFC107; color: #1A2A3A; border-color: #FFC107; transform: scale(1.15) rotate(90deg);
}
.layer-close { pointer-events: auto; right: 20px; top: 0; }

/* УЛУЧШЕННЫЕ Хотспоты */
.hotspot { position: absolute; transform: translate(-50%, -50%); background: transparent; border: none; cursor: pointer; z-index: 10; padding: 10px; }
.hotspot-ring {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 50px; height: 50px; background: rgba(122, 184, 212, 0.3); border-radius: 50%;
    animation: smoothPulse 2.5s infinite cubic-bezier(0.215, 0.61, 0.355, 1); border: 1px solid rgba(122, 184, 212, 0.5);
}
.hotspot-dot {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 16px; height: 16px; background: radial-gradient(circle, #FFFFFF 30%, #A0C4D8 100%);
    border-radius: 50%; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    box-shadow: 0 0 15px rgba(58,107,140,0.8), inset 0 -2px 4px rgba(0,0,0,0.2);
}
.hotspot:hover .hotspot-dot { width: 22px; height: 22px; background: radial-gradient(circle, #FFFFFF 20%, #7AB8D4 100%); }

.hotspot-label {
    position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%) translateY(15px);
    margin-bottom: 8px; padding: 8px 18px; 
    background: rgba(26, 42, 58, 0.95); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    color: #FFFFFF; font-size: 13px; font-weight: 600; white-space: nowrap; border-radius: 10px;
    opacity: 0; visibility: hidden; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); pointer-events: none;
    border: 1px solid rgba(255,255,255,0.15); box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}
.hotspot-label::after {
    content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    border-width: 6px; border-style: solid; border-color: rgba(26, 42, 58, 0.95) transparent transparent transparent;
}
.hotspot:hover .hotspot-label { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

.hotspot.special { z-index: 15; }
.hotspot.special .hotspot-ring { width: 65px; height: 65px; background: rgba(255, 193, 7, 0.25); border-color: rgba(255, 193, 7, 0.5); animation: smoothPulseSpecial 2s infinite cubic-bezier(0.215, 0.61, 0.355, 1); }
.hotspot.special .hotspot-dot { width: 20px; height: 20px; background: radial-gradient(circle, #FFFDE7 20%, #FFC107 100%); box-shadow: 0 0 20px rgba(255, 193, 7, 0.8), inset 0 -2px 4px rgba(0,0,0,0.2); }
.hotspot.special:hover .hotspot-dot { width: 26px; height: 26px; }
.hotspot.special .hotspot-label { background: linear-gradient(135deg, #FFD54F, #FFC107); color: #1A2A3A; border: none; box-shadow: 0 10px 25px rgba(255, 193, 7, 0.4); }
.hotspot.special .hotspot-label::after { border-color: #FFC107 transparent transparent transparent; }

/* ТОЧКИ ДЛЯ ШКОЛЫ */
.photo-layer .hotspot.school-dop .hotspot-dot { background: radial-gradient(circle, #8CA5C1 20%, #384361 100%); box-shadow: 0 0 15px rgba(46, 66, 104, 0.9), inset 0 -2px 4px rgba(0,0,0,0.3); }
.photo-layer .hotspot.school-dop .hotspot-ring { background: rgba(60, 90, 145, 0.4); border-color: rgba(60, 90, 145, 0.6); }
.photo-layer .hotspot.school-dop:hover .hotspot-dot { width: 22px; height: 22px; background: radial-gradient(circle, #A6BEDD 20%, #446796 100%); }
.photo-layer .hotspot.school-dop .hotspot-label { background: rgba(56, 67, 97, 0.95); border-color: rgba(140, 165, 193, 0.3); color: #FFF; }
.photo-layer .hotspot.school-dop .hotspot-label::after { border-color: rgba(56, 67, 97, 0.95) transparent transparent transparent; }

@keyframes smoothPulse { 0% { transform: translate(-50%, -50%) scale(0.6); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1.8); opacity: 0; } }
@keyframes smoothPulseSpecial { 0% { transform: translate(-50%, -50%) scale(0.6); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(2); opacity: 0; } }

/* ========== ТУЛТИП ========== */
.exhibit-tooltip {
    position: absolute; max-width: 340px; 
    background: rgba(255, 255, 255, 0.97); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    border-radius: 16px; padding: 0; box-shadow: 0 30px 60px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.8); z-index: 60; pointer-events: auto;
    overflow: hidden; opacity: 0; visibility: hidden; transform-origin: center top;
}
.exhibit-tooltip.visible { opacity: 1; visibility: visible; }
.tooltip-header { background: linear-gradient(135deg, #3A6B8C, #2c5a78); padding: 18px 20px; position: relative; }
.tooltip-header h3 { font-family: 'Playfair Display', serif; font-size: 18px; color: #FFFFFF; margin: 0; padding-right: 35px; line-height: 1.3; font-weight: 600;}
.tooltip-close { top: 12px; right: 12px; background: rgba(255,255,255,0.2); border: none;}
.tooltip-body { padding: 22px; }
.tooltip-desc { font-size: 14.5px; line-height: 1.6; color: #2A3A4A; margin: 0; }

/* ========== НАВИГАЦИЯ ФОТО ========== */
.photo-nav {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
    margin-top: 35px; background: #FFFFFF; padding: 12px 25px; border-radius: 60px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08); border: 1px solid rgba(208, 216, 224, 0.6);
}
.photo-nav-btn {
    display: inline-flex; align-items: center; gap: 10px; background: #3A6B8C; border: none;
    padding: 12px 30px; border-radius: 40px; color: #FFFFFF; font-size: 15px; font-weight: 600;
    cursor: pointer; transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.photo-nav-btn.prev { justify-self: start; }
.photo-nav-btn.next { justify-self: end; }
.photo-nav-btn svg { width: 18px; height: 18px; stroke: white; stroke-width: 2.5; transition: transform 0.3s ease; }
.photo-nav-btn.prev:hover svg { transform: translateX(-3px); }
.photo-nav-btn.next:hover svg { transform: translateX(3px); }
.photo-nav-btn:hover:not(:disabled) { background: #2c5a78; transform: translateY(-2px); box-shadow: 0 6px 15px rgba(58,107,140,0.35); }
.photo-nav-btn:disabled { background: #E8ECF0; color: #A0C4D8; box-shadow: none; cursor: not-allowed; }
.photo-nav-btn:disabled svg { stroke: #A0C4D8; }

.photo-counter { font-size: 16px; font-weight: 600; color: #1A2A3A; background: #F8FAFC; padding: 10px 28px; border-radius: 40px; border: 1px solid #E2E8F0; justify-self: center; letter-spacing: 1px; }
.photo-dots { display: flex; justify-content: center; gap: 14px; margin-top: 30px; }
.dot { width: 10px; height: 10px; background: #D0DCE8; border-radius: 50%; cursor: pointer; transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.dot.active { width: 40px; background: #3A6B8C; border-radius: 5px; }
.dot:hover:not(.active) { background: #A0C4D8; transform: scale(1.3); }

/* ========== VUE TIMELINE (С CSS GRID MAGIC И FLEX EXPANSION) ========== */
.vue-timeline-block {
    margin-top: 30px;
    background: linear-gradient(180deg, #1A2A3A 0%, #0F1A24 100%);
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.timeline-header-block { margin-bottom: 35px; }
.timeline-header-block h2 { font-family: 'Playfair Display', serif; font-size: 28px; color: #FFFFFF; margin-bottom: 10px; }
.vue-subtitle { font-size: 15px; color: #A0C4D8; border-left: 3px solid #3A6B8C; padding-left: 18px; display: flex; justify-content: space-between; align-items: center; }
.desktop-hint { font-size: 13px; color: #7AB8D4; opacity: 0.8; }

.timeline-cards { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 20px; 
    align-items: flex-start; /* Убираем растягивание соседних карточек */
}

/* КАРТОЧКИ */
.era-card {
    flex: 1 1 0;
    min-width: 200px;
    background: linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);
    border-radius: 18px;
    padding: 24px;
    cursor: pointer;
    transition: flex 0.6s cubic-bezier(0.25, 1, 0.2, 1), background 0.3s ease, transform 0.3s ease, filter 0.3s ease, opacity 0.3s ease;
    border: 1px solid rgba(255,255,255,0.08);
    border-left: 4px solid #3A6B8C;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.era-card:hover:not(.expanded-card) {
    background: linear-gradient(145deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 100%);
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.25);
    border-left-color: #7AB8D4;
}

/* Развернутая карточка */
.era-card.expanded-card {
    flex: 3 1 0;
    min-width: 480px;
    background: linear-gradient(145deg, rgba(26, 42, 58, 0.95) 0%, rgba(15, 26, 36, 0.95) 100%);
    cursor: default;
    border-left-color: #FFC107;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
    z-index: 10;
}

/* Свернутые соседи */
.era-card.collapsed-card { opacity: 0.4; filter: blur(1px) grayscale(40%); pointer-events: auto; }
.era-card.collapsed-card:hover { opacity: 0.8; filter: blur(0); }

/* Кнопка закрытия (Крестик) */
.close-card-btn {
    position: absolute; top: 20px; right: 20px;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #FFF; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 20;
    opacity: 0; pointer-events: none; backdrop-filter: blur(5px);
}
.close-card-btn.is-visible { opacity: 1; pointer-events: auto; }
.close-card-btn:hover { background: #FFC107; color: #1A2A3A; transform: rotate(90deg); border-color: #FFC107; }

/* Внутренний контент */
.card-content-wrapper { position: relative; z-index: 2; display: flex; flex-direction: column; height: 100%; }

.era-name { font-weight: 700; font-size: 20px; color: #FFFFFF; margin-bottom: 12px; font-family: 'Playfair Display', serif; transition: all 0.4s ease; padding-right: 35px; line-height: 1.3; }
.era-name.expanded-text { color: #FFC107; font-size: 28px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 16px; margin-bottom: 20px; }

/* Анимация исчезновения короткого описания */
.era-collapsed-content {
    display: flex; flex-direction: column; flex-grow: 1;
    transition: opacity 0.3s ease, max-height 0.4s ease, margin 0.3s ease;
    opacity: 1; max-height: 200px; overflow: hidden;
}
.era-collapsed-content.is-hidden { opacity: 0; max-height: 0; margin: 0; pointer-events: none; }

.era-desc { font-size: 14px; line-height: 1.6; color: #B0C4D8; opacity: 0.9; margin-bottom: 20px; }

.click-hint { font-size: 13px; color: #7AB8D4; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; opacity: 0; transform: translateX(-10px); transition: all 0.3s ease; margin-top: auto; }
.era-card:hover:not(.expanded-card) .click-hint { opacity: 1; transform: translateX(0); }
.click-hint .arrow { transition: transform 0.3s ease; }
.era-card:hover:not(.expanded-card) .click-hint .arrow { transform: translateX(4px); }

/* GRID MAGIC - Плавное появление развернутого контента */
.expanded-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}
.expanded-wrapper.is-open { grid-template-rows: 1fr; }

.expanded-details {
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease 0.1s, visibility 0.4s;
    display: flex; flex-direction: column; gap: 24px;
}
.expanded-wrapper.is-open .expanded-details {
    opacity: 1;
    visibility: visible;
    margin-top: 15px; /* Заменяем padding-top чтобы не ломать 0fr */
}

.expanded-text-content { padding-right: 15px; }
.expanded-full-desc { font-size: 16px; line-height: 1.7; color: #E8ECF0; margin: 0; }

.expanded-facts { 
    background: rgba(0,0,0,0.25); 
    padding: 24px; 
    border-radius: 14px; 
    border-left: 3px solid #7AB8D4; 
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.1);
}
.facts-title { color: #7AB8D4; margin-bottom: 16px; font-size: 15px; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.expanded-facts ul { margin-left: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.expanded-facts li { font-size: 15px; color: #D0DCE8; line-height: 1.5; position: relative; padding-left: 20px; }
.expanded-facts li::before { content: "•"; color: #FFC107; font-size: 20px; position: absolute; left: 0; top: -4px; }

/* ========== ПОДВАЛ ========== */
.footer { background: #0F1A24; border-top: 1px solid rgba(255,255,255,0.05); padding: 70px 0 30px; margin-top: 50px; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 50px; justify-content: space-between; margin-bottom: 50px; }
.footer-col { flex: 1; min-width: 220px; }
.footer-logo { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; }
.footer-logo .logo-icon { width: 50px; height: 50px; }
.footer-logo span { font-size: 16px; font-weight: 600; line-height: 1.4; color: #FFFFFF; font-family: 'Playfair Display', serif;}
.footer-year { font-size: 14px; color: #6B8EA0; }
.footer-col h4 { font-size: 18px; font-weight: 600; margin-bottom: 25px; color: #FFFFFF; font-family: 'Playfair Display', serif;}
.footer-col p { font-size: 14.5px; color: #B0C4D8; margin-bottom: 12px; }
.footer-copyright { text-align: center; font-size: 13.5px; color: #6B8EA0; padding-top: 30px; border-top: 1px solid rgba(255,255,255,0.05); }

/* ========== АДАПТИВ ========== */
@media (max-width: 992px) {
    .era-card.expanded-card { min-width: 100%; flex: 1 1 100%; }
}

@media (max-width: 768px) {
    .container { padding: 0 15px; }
    .header-inner { flex-direction: column; text-align: center; gap: 15px; }
    .nav { gap: 15px; flex-wrap: wrap; justify-content: center;}
    .hall-main-title { font-size: 32px; }
    .photo-nav-btn { padding: 10px 20px; font-size: 14px; }
    
    .timeline-cards { flex-direction: column; }
    .era-card.expanded-card { min-width: 100%; }
    
    /* Vue Адаптив */
    .vue-subtitle { flex-direction: column; align-items: flex-start; gap: 8px; }
    .era-name.expanded-text { font-size: 22px; padding-right: 30px; }
    .close-card-btn { top: 16px; right: 16px; width: 32px; height: 32px; font-size: 12px; }
    .expanded-facts { padding: 18px; }
    
    .footer-grid { flex-direction: column; gap: 40px; text-align: center; }
    .footer-logo { justify-content: center; }
    .rooms-nav { gap: 10px; }
    .room-btn { padding: 8px 20px; font-size: 13px; }
}
/* Контейнер для позиционирования кнопки внизу */
.bottom-nav-container {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

/* Стиль кнопки, основанный на вашем скриншоте */
.back-link-bottom {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background-color: #1A2A3A; /* Темно-синий из вашей шапки */
    color: #FFFFFF !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.back-link-bottom:hover {
    background-color: #3A6B8C; /* Цвет из вашего скроллбара */
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(58, 107, 140, 0.2);
}

.back-link-bottom svg {
    transition: transform 0.3s ease;
}

.back-link-bottom:hover svg {
    transform: translateX(-5px); /* Стрелочка немного двигается влево */
}

/* Адаптив для телефонов */
@media (max-width: 768px) {
    .back-link-bottom {
        width: 100%;
        justify-content: center;
    }
}