/* --- 1. НАСТРОЙКИ (VARIABLES) --- */
:root {
    --bg-color: #050505;
    --card-bg: #111111;
    --accent: #ff3b30; /* Красный */
    --neon-red: #ff0000; /* Неоновый красный */
    --glass: rgba(10, 10, 10, 0.85);
    --text-main: #ffffff;
    --text-sec: #888888;
}

* { margin: 0; padding: 0; box-sizing: border-box; outline: none; cursor: none; }

body {
    font-family: 'Manrope', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
}

/* --- 2. ЭФФЕКТЫ --- */
/* ОТКЛЮЧАЕМ ШУМ ДЛЯ ПОВЫШЕНИЯ ПРОИЗВОДИТЕЛЬНОСТИ */
/*
body::before {
    content: ""; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("https://grainy-gradients.vercel.app/noise.svg");
    opacity: 0.05; pointer-events: none; z-index: 9999;
    filter: contrast(150%) brightness(100%);
}
*/

/* --- 3. PRELOADER --- */
.preloader {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100dvh;
    background: #000; z-index: 20000;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s;
    overscroll-behavior: none;
}
.loader-content { text-align: center; }
.loader-text { display: block; font-size: 1.2rem; letter-spacing: 4px; margin-bottom: 10px; color: #fff; animation: pulse-text 2s infinite; }
.loader-line {
    width: 0; height: 2px; background: var(--accent); margin: 0 auto;
    animation: load-line 2s ease-in-out forwards;
}
@keyframes load-line { 0% { width: 0; } 100% { width: 150px; } }
@keyframes pulse-text { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }

/* --- 4. CUSTOM CURSOR --- */
.cursor-dot, .cursor-circle {
    position: fixed; top: 0; left: 0; border-radius: 50%; pointer-events: none; z-index: 10001;
    transform: translate(-50%, -50%);
}
.cursor-dot { width: 6px; height: 6px; background: var(--accent); }
.cursor-circle {
    width: 40px; height: 40px; border: 1px solid rgba(255, 255, 255, 0.5);
    transition: width 0.2s, height 0.2s, background 0.2s;
    mix-blend-mode: exclusion;
}
body.hovered .cursor-circle {
    width: 60px; height: 60px; background: rgba(255, 255, 255, 0.1); border-color: transparent;
}

/* --- 5. AUDIO CONTROL --- */
.sound-control {
    position: fixed; bottom: 30px; left: 30px; z-index: 10000;
    display: flex; align-items: center; gap: 15px; cursor: pointer;
    padding: 12px 25px;
    border: 2px solid var(--neon-red);
    border-radius: 50px;
    background: rgba(255, 0, 0, 0.1);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.4);
    transition: 0.3s;
}
.sound-control:hover { background: var(--neon-red); box-shadow: 0 0 25px rgba(255, 0, 0, 0.8); }
.sound-control span { font-size: 0.8rem; letter-spacing: 2px; font-weight: 700; color: var(--neon-red); transition: 0.3s; }
.sound-control:hover span { color: #fff; }
.sound-icon { display: flex; gap: 3px; height: 15px; align-items: flex-end; }
.bar { width: 3px; height: 100%; background: var(--neon-red); animation: sound-anim 1s infinite; transition: 0.3s; }
.sound-control:hover .bar { background: #fff; }
.bar:nth-child(2) { animation-delay: 0.1s; }
.bar:nth-child(3) { animation-delay: 0.2s; }
.muted .bar { height: 3px !important; animation: none; opacity: 0.5; }
@keyframes sound-anim { 0%, 100% { height: 20%; } 50% { height: 100%; } }

/* --- 6. ОБЩАЯ АНИМАЦИЯ --- */
.hidden { opacity: 0; filter: blur(5px); transform: translateY(50px); transition: all 1s ease; }
.show { opacity: 1; filter: blur(0); transform: translateY(0); }

/* --- 7. НАВИГАЦИЯ --- */
.navbar {
    position: fixed; top: 0; left: 0; width: 100%; padding: 20px 40px;
    display: flex; justify-content: space-between; align-items: center;
    background: var(--glass); backdrop-filter: blur(12px); z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.logo { font-weight: 600; font-size: 1.5rem; letter-spacing: 2px; text-transform: uppercase; }
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 30px; list-style: none; }
.nav-links a { text-decoration: none; color: var(--text-sec); font-size: 0.85rem; font-weight: 400; text-transform: uppercase; transition: 0.3s; letter-spacing: 1px; }
.nav-links a:hover, .nav-links a.active { color: white; }
.active { border-bottom: 1px solid var(--accent); padding-bottom: 5px; }

/* --- 8. HERO SECTION --- */
.hero {
    height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center;
    text-align: center; padding: 20px; padding-top: 80px; position: relative;
    background: url('../img/my-background.jpg') no-repeat center center/cover;
    border-bottom: 1px solid var(--accent);
}
.hero::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1; }
.hero-content { position: relative; z-index: 2; }
.hero h1 {
    font-size: 6rem; font-weight: 200; line-height: 1; margin-bottom: 20px; letter-spacing: -3px;
    background: linear-gradient(180deg, #ffffff 0%, #666666 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p { color: #ddd; max-width: 500px; font-size: 1.1rem; font-weight: 300; margin-bottom: 40px; letter-spacing: 0.5px; }
.btn {
    padding: 15px 40px; background: transparent; border: 1px solid rgba(255,255,255,0.3);
    color: white; border-radius: 50px; font-weight: 400; text-decoration: none;
    transition: 0.3s; text-transform: uppercase; letter-spacing: 1px; font-size: 0.8rem; cursor: none;
}
.btn:hover { background: white; color: black; border-color: white; }

/* --- 9. СЕКЦИИ --- */
.section { padding: 100px 20px; max-width: 1400px; margin: 0 auto; border-bottom: 1px solid var(--accent); }
.section-title {
    font-size: 3rem; font-weight: 200; margin-bottom: 50px;
    background: linear-gradient(90deg, #fff, #888);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.split-layout { display: flex; gap: 60px; align-items: center; }
.split-text-col { flex: 1; }
.split-img-col { flex: 1; }
.split-img-col img { 
    width: 100%; height: auto; border-radius: 4px; 
    filter: none; transition: 0.5s; 
}
.split-img-col img:hover { transform: scale(1.05); }
.text-block { color: #ccc; font-size: 1.1rem; line-height: 1.6; margin-bottom: 20px; font-weight: 300; }
.reverse-layout { flex-direction: row-reverse; }

/* --- 10. СТАТИСТИКА --- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 20px; }
.stat-item {
    background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px 20px; text-align: center; border-radius: 4px; transition: 0.3s;
}
.stat-item:hover { background: rgba(255, 255, 255, 0.08); transform: translateY(-5px); border-color: var(--accent); }
.stat-num { font-size: 3rem; font-weight: 200; color: #fff; margin-bottom: 10px; line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--text-sec); text-transform: uppercase; letter-spacing: 1.5px; }

/* --- 11. ГАЛЕРЕЯ --- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 30px; }
.card { background: var(--card-bg); border-radius: 4px; overflow: hidden; transition: 0.4s; }
.card:hover { transform: translateY(-10px); }
.card img { 
    width: 100%; height: 250px; object-fit: cover; opacity: 1; 
    transition: 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94); 
}
.card:hover img { transform: scale(1.1); }
.card-info { padding: 20px; }
.card-title { font-size: 1.1rem; font-weight: 400; color: white; }
.card-loc { font-size: 0.85rem; color: var(--text-sec); margin-top: 5px; }

/* --- 12. КАРТА --- */
#map-container { height: 600px; width: 100%; border-radius: 4px; background: #111; z-index: 1; }
.map-tiles-dark { filter: grayscale(100%) invert(100%) contrast(85%); }

.page-museum .history-header { max-width: 1200px; }
.museum-hero-map-wrap{ margin-top: 28px; }
.museum-map-hint{
  text-align: center; color: #888; font-weight: 300; margin: 0 0 18px; font-size: 1.05rem;
}
.page-museum #map-container{
  height: clamp(520px, 60vh, 780px); max-width: 1200px; margin-left: auto; margin-right: auto;
  border: 1px solid rgba(255,255,255,0.10); box-shadow: 0 25px 70px rgba(0,0,0,0.55);
}
.page-museum .custom-popup .leaflet-popup-content{ width: 260px !important; }
@media screen and (max-width: 768px){
  .page-museum #map-container{ height: 420px; }
  .museum-map-hint{ font-size: 0.95rem; }
}
.leaflet-control-attribution { display: none !important; }

.pulse-icon { position: relative; }
.pulse-dot { width: 12px; height: 12px; background-color: var(--accent); border-radius: 50%; box-shadow: 0 0 10px var(--accent); position: relative; z-index: 2; }
.pulse-ring {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 12px; height: 12px; border: 1px solid var(--accent); border-radius: 50%;
    animation: pulse-anim 2s infinite; z-index: 1; opacity: 0;
}
@keyframes pulse-anim { 0% { width: 12px; height: 12px; opacity: 1; border-width: 2px; } 100% { width: 40px; height: 40px; opacity: 0; border-width: 0px; } }

.custom-popup .leaflet-popup-content-wrapper { background: rgba(10, 10, 10, 0.95); color: white; border-radius: 8px; padding: 0; overflow: hidden; border: 1px solid var(--accent); backdrop-filter: blur(5px); }
.custom-popup .leaflet-popup-content { margin: 0 !important; width: 240px !important; }
.custom-popup .leaflet-popup-tip { background: #111; border-top: 1px solid var(--accent); }
.popup-img { width: 100% !important; height: 140px; object-fit: cover; display: block; }
.popup-text { padding: 15px; text-align: center; }

/* КНОПКА ЗАКРЫТИЯ ПОПАПА */
.custom-popup .leaflet-popup-close-button {
    color: var(--neon-red) !important; font-weight: 900 !important; font-size: 24px !important;  
    text-shadow: 0 0 3px rgba(255, 0, 0, 0.5); top: 8px !important; right: 8px !important;
}
.custom-popup .leaflet-popup-close-button:hover {
    color: #ffffff !important; text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

/* --- 13. ФУТЕР --- */
footer { padding: 60px 20px; background: #050505; text-align: center; }
.footer-content h2 { font-size: 1.5rem; font-weight: 200; margin-bottom: 20px; letter-spacing: 2px; text-transform: uppercase; }
.footer-links { display: flex; justify-content: center; gap: 30px; margin-bottom: 40px; }
.footer-links a { color: var(--text-sec); text-decoration: none; font-size: 0.9rem; transition: 0.3s; }
.footer-links a:hover { color: var(--accent); }
.copyright { color: #444; font-size: 0.8rem; }

/* --- 14. VIEWERS & MODALS --- */
.viewer-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: black; z-index: 9999; opacity: 0; pointer-events: none; transition: 0.5s; }
.viewer-modal.active { opacity: 1; pointer-events: all; }
#panorama { width: 100%; height: 100%; }
.close-btn { 
    position: absolute; top: 30px; right: 30px; 
    color: var(--neon-red); font-size: 3rem; line-height: 1; z-index: 10000; transition: 0.3s; cursor: pointer; text-shadow: 0 0 10px rgba(255, 0, 0, 0.6);
}
.close-btn:hover { color: #fff; text-shadow: 0 0 15px rgba(255, 255, 255, 0.8); transform: rotate(90deg) scale(1.1); }

/* --- 15. СТРАНИЦА ИСТОРИИ --- */
.history-item.is-focused{ background: rgba(255, 46, 99, 0.03); border-bottom-color: rgba(255, 46, 99, 0.35); }
.history-header { padding-top: 150px; padding-bottom: 80px; text-align: center; max-width: 800px; margin: 0 auto; }
.history-header h1 { font-size: 4rem; font-weight: 200; letter-spacing: -1px; margin-bottom: 20px; background: linear-gradient(180deg, #fff, #666); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.history-item { display: flex; align-items: center; justify-content: space-between; padding: 100px 0; border-bottom: 1px solid rgba(255,255,255,0.1); gap: 60px; }
.history-item:nth-child(even) { flex-direction: row-reverse; }
.history-text { flex: 1; padding: 20px; }
.history-label { color: var(--accent); text-transform: uppercase; letter-spacing: 2px; font-size: 0.75rem; margin-bottom: 15px; display: block; }
.history-title { font-size: 2.5rem; font-weight: 300; margin-bottom: 30px; line-height: 1.2; }
.history-desc, .history-fact { color: #ccc; font-size: 1rem; line-height: 1.8; margin-bottom: 25px; font-weight: 300; }
.history-fact { border-left: 2px solid var(--accent); padding-left: 20px; font-style: italic; color: #888; }
.history-visual { flex: 1; position: relative; }
.history-img-wrap { width: 100%; height: 400px; overflow: hidden; border-radius: 4px; position: relative; cursor: none; }
.history-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s ease; opacity: 1; }
.history-img-wrap:hover .history-img { transform: scale(1.15); }
.pnlm-ui { top: 90px !important; } :fullscreen .pnlm-ui { top: 0 !important; }
.pnlm-container, .pnlm-grab, .pnlm-grabbing { cursor: none !important; }

/* --- 16. ВИДЕО ФОН --- */
.hero-video-section {
    position: relative; height: 100vh; width: 100%;
    display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
    overflow: hidden; border-bottom: 1px solid var(--accent);
}
.video-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.video-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); z-index: 1; }
.hero-video-section .hero-content { position: relative; z-index: 2; }
.hero-title-large {
    font-size: 6rem; font-weight: 200; line-height: 1; margin-bottom: 20px; letter-spacing: -3px;
    background: linear-gradient(180deg, #ffffff 0%, #aaaaaa 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-video-section .btn { margin-top: 80px; }

/* --- 17. МОБИЛЬНАЯ АДАПТАЦИЯ --- */
@media screen and (max-width: 768px) {
    .navbar { padding: 15px 20px; background: rgba(10, 10, 10, 0.95); }
    .logo { font-size: 1.2rem; } .nav-links { gap: 15px; } .nav-links a { font-size: 0.75rem; }
    .hero h1 { font-size: 3rem; letter-spacing: -1px; line-height: 1.1; }
    .hero p { font-size: 0.9rem; padding: 0 20px; }
    .hero-title-large { font-size: 3rem; }
    .section { padding: 60px 15px; } .section-title { font-size: 2rem; margin-bottom: 30px; }
    .split-layout, .history-item, .history-item:nth-child(even) { flex-direction: column; gap: 30px; padding: 50px 0; }
    .reverse-layout { flex-direction: column; }
    .text-block { font-size: 1rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-num { font-size: 2rem; } .stat-item { padding: 20px 10px; }
    .gallery-grid { grid-template-columns: 1fr; gap: 20px; }
    .card img { height: 200px; }
    #map-container { height: 400px; }
    .history-header { padding-top: 100px; padding-bottom: 40px; }
    .history-header h1 { font-size: 2.5rem; }
    .history-img-wrap { height: 250px; }
    .cursor-dot, .cursor-circle { display: none !important; }
    * { cursor: auto !important; }
    .sound-control { bottom: 20px; left: 20px; padding: 8px 15px; width: 50px; justify-content: center; gap: 0; }
    .sound-control span { display: none; }
}

/* --- 18. МЕНЮ --- */
.burger-btn { display: none; flex-direction: column; gap: 6px; cursor: pointer; z-index: 2000; }
.burger-btn span { width: 30px; height: 3px; background-color: #fff; transition: 0.3s cubic-bezier(0.4, 0.0, 0.2, 1); }
.dropdown { position: relative; cursor: pointer; height: 100%; display: flex; align-items: center; }
.dropdown-title::after { display: none !important; }
.dropdown-menu {
    position: absolute; top: 100%; left: 0; background: #111; border: 1px solid #333; min-width: 220px; padding: 10px 0; border-radius: 4px; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    opacity: 0; visibility: hidden; transform: translateY(15px); transition: all 0.3s ease; pointer-events: none; z-index: 100;
}
.dropdown-menu li { display: block; margin: 0; }
.dropdown-menu a { display: block; padding: 12px 20px; font-size: 0.95rem; color: #bbb; transition: 0.2s; white-space: nowrap; }
.dropdown:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: all; }
.nav-links a:hover, .dropdown:hover .dropdown-title { color: #ff3b30 !important; text-shadow: 0 0 10px rgba(255, 59, 48, 0.7); transition: all 0.3s ease; }
.dropdown-menu a:hover { padding-left: 20px !important; color: #ff3b30 !important; background: #1a1a1a; }
.nav-links > li.dropdown:last-child .dropdown-menu{ left: auto; right: 0; }
@media screen and (max-width: 768px) {
    .burger-btn { display: flex; }
    .nav-links { position: fixed; top: 0; right: -100%; width: 100%; height: 100vh; background: rgba(5, 5, 5, 0.95); backdrop-filter: blur(10px); flex-direction: column; justify-content: center; align-items: center; transition: right 0.5s cubic-bezier(0.77, 0, 0.175, 1); z-index: 1500; padding-top: 60px; }
    .nav-links.active { right: 0; }
    .nav-links li { margin: 15px 0; width: 100%; text-align: center; }
    .dropdown { display: block; height: auto; }
    .dropdown-title { font-size: 1.4rem; display: block; padding: 10px; }
    .dropdown-menu { position: static; background: transparent; border: none; box-shadow: none; transform: none; visibility: visible; pointer-events: all; max-height: 0; opacity: 0; overflow: hidden; transition: max-height 0.5s ease, opacity 0.5s ease; padding: 0; min-width: auto; }
    .dropdown-menu a { font-size: 1.1rem; color: var(--accent); padding: 10px; }
    .dropdown.open .dropdown-menu { max-height: 300px; opacity: 1; }
    .burger-btn.toggle span:nth-child(1) { transform: rotate(-45deg) translate(-7px, 6px); }
    .burger-btn.toggle span:nth-child(2) { opacity: 0; }
    .burger-btn.toggle span:nth-child(3) { transform: rotate(45deg) translate(-7px, -6px); }
}
.history-list { list-style: none; padding: 0; margin-top: 20px; }
.history-list li { margin-bottom: 20px; color: #ccc; font-size: 1rem; font-weight: 300; line-height: 1.6; border-left: 2px solid var(--accent); padding-left: 15px; }
.history-list li span { color: #fff; font-weight: 600; }

/* --- 19. НАВИГАЦИЯ НА КАРТЕ --- */

/* Кнопка "Где я" */
.map-control-btn {
    position: absolute; top: 20px; right: 20px; z-index: 1000;
    width: 44px; height: 44px; background: rgba(10, 10, 10, 0.9);
    border: 1px solid var(--accent); border-radius: 50%;
    color: var(--accent); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s ease; box-shadow: 0 0 15px rgba(0,0,0,0.5);
}
.map-control-btn:hover { background: var(--accent); color: white; box-shadow: 0 0 20px var(--accent); transform: scale(1.1); }
.map-control-btn svg { width: 20px; height: 20px; }

/* Скрытие текстовой панели маршрута */
.leaflet-routing-container { display: none !important; }
/* Кружки маршрута на карте */
.leaflet-routing-icon { border-radius: 50%; border: 2px solid var(--accent); }

/* --- КНОПКИ В ПОПАПЕ (ЕДИНЫЙ СТИЛЬ) --- */
.popup-text div[style*="display:flex"] {
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

/* Общий класс для ВСЕХ кнопок в попапе */
.popup-btn, .popup-btn-route, .popup-btn-nav {
    height: 30px;
    padding: 0 10px; /* Чуть меньше паддинг, чтобы влезли 3 кнопки */
    display: inline-flex; 
    align-items: center;
    justify-content: center;
    
    background: transparent; 
    border: 1px solid var(--accent);
    color: var(--accent);
    font-size: 0.7rem; 
    text-transform: uppercase; 
    font-weight: 600; /* Чуть жирнее текст */
    transition: 0.3s; 
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    margin-top: 10px;
    
    /* Одинаковый шрифт для всех */
    font-family: 'Manrope', sans-serif;
}

.popup-btn:hover, .popup-btn-route:hover, .popup-btn-nav:hover { 
    background: var(--accent); 
    color: white; 
    box-shadow: 0 0 15px var(--accent);
}