:root {
    --primary-color: #1a2e1a; /* Глубокий лесной зеленый */
    --accent-color: #c5a059;  /* Золото */
    --accent-dark: #a68546;   /* Темное золото */
    --bg-color: #f9f4e8;      /* Кремовый/старая бумага */
    --text-color: #2c2c2c;    /* Темно-серый для текста */
    --header-font: 'Cormorant Garamond', serif;
    --body-font: 'Ysabeau Office', sans-serif;
    --border-gold: 2px solid var(--accent-color);
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--body-font);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, .title-block h1 {
    font-family: var(--header-font);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Header Style */
.site-header {
    background-color: var(--primary-color);
    color: var(--bg-color);
    padding: 1rem 2rem;
    border-bottom: 4px double var(--accent-color);
    box-shadow: var(--shadow);
    position: relative;
    z-index: 1000;
}

.header-content {
    width: 100%;
    max-width: none;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.title-block {
    border-left: 2px solid var(--accent-color);
    padding-left: 1.5rem;
}

.title-block h1 {
    font-size: 2.8rem;
    line-height: 1.1;
    color: var(--accent-color);
    letter-spacing: 2px;
}

.subtitle {
    font-family: var(--header-font);
    font-style: italic;
    font-size: 1.1rem;
    opacity: 0.9;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.main-nav a {
    color: var(--bg-color);
    text-decoration: none;
    font-family: var(--header-font);
    font-size: 1.2rem;
    text-transform: uppercase;
    position: relative;
    transition: color 0.3s;
}

.main-nav a:hover, .main-nav a.active {
    color: var(--accent-color);
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--accent-color);
    transition: width 0.3s;
}

.main-nav a:hover::after, .main-nav a.active::after {
    width: 100%;
}

/* Map Container */
.map-container {
    height: calc(100vh - 120px);
    position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

#map {
    width: 100%;
    height: 100%;
    border-top: 5px solid var(--primary-color);
    border-bottom: 5px solid var(--primary-color);
    border-left: none;
    border-right: none;
    outline: none;
    background: #f4ecd8; /* Цвет старой бумаги для фона */
}

/* Стилизация карты под старую книгу */
.book-style-map .leaflet-tile-container {
    filter: sepia(0.6) brightness(0.9) contrast(1.1) grayscale(0.2);
}

.book-style-map::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    box-shadow: inset 0 0 100px rgba(0,0,0,0.3); /* Виньетка */
    z-index: 1000;
}

.book-style-map {
    background-image: url('https://www.transparenttextures.com/patterns/parchment.png'); /* Текстура пергамента поверх */
}

/* Custom Popup Style (Inspired by Kufar/Modern UI) */
.leaflet-popup-content-wrapper {
    background: white;
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: none;
}

.leaflet-popup-content {
    margin: 0;
    width: 280px !important;
}

.poet-card {
    display: flex;
    flex-direction: column;
}

.poet-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background-color: #eee;
    display: block;
}

.poet-card-info {
    padding: 15px;
}

.poet-card-name {
    font-family: var(--header-font);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
    line-height: 1.2;
}

.poet-card-years {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 8px;
}

.poet-card-place {
    font-size: 0.95rem;
    color: var(--text-color);
    margin-bottom: 15px;
}

.poet-card-btn {
    display: block;
    width: 100%;
    padding: 10px;
    text-align: center;
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--primary-color);
    text-decoration: none;
    font-family: var(--header-font);
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s;
}

.poet-card-btn:hover {
    background: var(--accent-color);
    color: white;
}

.leaflet-popup-tip-container {
    display: none; /* Hide the tip for a cleaner look */
}

/* Remove old sidebar styles */
.poet-sidebar {
    display: none;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--bg-color);
    margin: 5% auto;
    padding: 0;
    border: var(--border-gold);
    width: 80%;
    max-width: 800px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    max-height: 85vh;
    overflow-y: auto;
    animation: modalSlide 0.4s ease-out;
}

@keyframes modalSlide {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 25px;
    color: var(--primary-color);
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
}

.close-modal:hover {
    color: var(--accent-color);
}

.modal-inner-content {
    padding: 3rem;
}

.modal-header {
    text-align: center;
    margin-bottom: 2rem;
}

.modal-header h2 {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.modal-image-container {
    float: left;
    width: 300px;
    margin-right: 2rem;
    margin-bottom: 1rem;
}

.modal-image {
    width: 100%;
    border: 1px solid var(--accent-color);
    padding: 8px;
    background: white;
}

.modal-bio {
    font-size: 1.2rem;
    line-height: 1.8;
    text-align: justify;
}

.modal-works {
    clear: both;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--accent-color);
}

.modal-works h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Документы (PDF) */
.modal-documents {
    clear: both;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--accent-color);
}

.modal-documents h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-documents h3 i {
    font-size: 1.4rem;
}

.doc-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.doc-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.8rem 1.2rem;
    background: rgba(139, 69, 19, 0.06);
    border: 1px solid rgba(139, 69, 19, 0.15);
    border-radius: 8px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.05rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.doc-link:hover {
    background: rgba(139, 69, 19, 0.12);
    border-color: var(--accent-color);
    transform: translateX(4px);
}

.doc-link i {
    color: #c0392b;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.doc-link span {
    flex: 1;
}

/* Hide Leaflet Attribution */
.leaflet-control-attribution {
    display: none !important;
}

/* Ensure no logo */
.logo-img {
    display: none !important;
}

/* Footer */
.site-footer {
    background-color: var(--primary-color);
    color: var(--accent-color);
    padding: 1rem;
    text-align: center;
    border-top: 2px solid var(--accent-color);
    font-family: var(--header-font);
    width: 100%;
}

.cremniy-link {
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Leaflet Overrides */
.leaflet-popup-content-wrapper {
    background: var(--bg-color);
    border: 2px solid var(--accent-color);
    border-radius: 0;
    font-family: var(--header-font);
}

.leaflet-popup-tip {
    background: var(--accent-color);
}

/* Suggest Form Styles */
.suggest-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-family: var(--header-font);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.form-group input, .form-group textarea {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: var(--body-font);
    font-size: 1rem;
    background: white;
    transition: border-color 0.3s;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 5px rgba(197, 160, 89, 0.3);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1rem;
    align-items: flex-end;
}

.btn-small {
    padding: 12px 15px;
    background: var(--primary-color);
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--header-font);
    font-weight: 600;
    transition: all 0.3s;
}

.btn-small:hover {
    background: var(--accent-color);
    color: white;
}

.btn-submit {
    padding: 15px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-family: var(--header-font);
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 1rem;
}

.btn-submit:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-highlight {
    background: var(--accent-color) !important;
    color: white !important;
    padding: 8px 15px !important;
    border-radius: 6px;
    margin-top: -8px;
}

.btn-highlight:hover {
    background: white !important;
    color: var(--accent-color) !important;
}

.btn-highlight::after {
    display: none !important;
}

/* Coordinates Picker Visual Aid */
.picking-mode #map {
    cursor: crosshair;
    outline: 5px solid var(--accent-color);
}

/* Splash Screen & Book Animation */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #2a1a0e 0%, #1a1a1a 70%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 1s ease-out, visibility 1s;
}

.splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.book-container {
    perspective: 2000px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    width: 100%;
    height: 100%;
}

.book {
    width: 280px;
    height: 380px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 2s cubic-bezier(0.4, 0, 0.2, 1);
    transform: rotateY(-20deg) rotateX(5deg);
}

/* Фаза 1: Книга слегка покачивается при ожидании */
.book.ready {
    animation: bookReady 1.5s forwards ease;
}

/* Фаза 2: Книга открывается */
.book.opening {
    animation: bookOpen 4s forwards cubic-bezier(0.645, 0.045, 0.355, 1);
}

.book-cover, .book-back {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    border-radius: 4px 12px 12px 4px;
    transform-origin: left;
    transition: transform 1.2s ease;
}

.book-cover {
    background: #5c2626;
    background-image: linear-gradient(135deg, #6b2e2e 0%, #3d1818 100%);
    border-left: 8px solid #2d1212;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--accent-color);
    box-shadow: 15px 15px 40px rgba(0,0,0,0.6), inset 0 0 30px rgba(0,0,0,0.2);
    backface-visibility: hidden;
}

.book.opening .book-cover {
    transform: rotateY(-160deg);
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
    transition: transform 2s cubic-bezier(0.4, 0, 0.2, 1);
}

.book-title {
    text-align: center;
    padding: 20px;
    border: 2px solid rgba(197, 160, 89, 0.35);
    margin: 15px;
    height: calc(100% - 30px);
    width: calc(100% - 30px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.1);
    box-shadow: inset 0 0 30px rgba(0,0,0,0.2);
}

.book-title h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    line-height: 1.2;
    color: var(--accent-color);
}

.book-ornament {
    font-size: 1.6rem;
    color: rgba(197, 160, 89, 0.6);
    margin: 8px 0;
    letter-spacing: 4px;
}

.book-title p {
    font-family: var(--header-font);
    font-style: italic;
    font-size: 0.95rem;
    opacity: 0.85;
    color: #ddd;
}

/* Внутренняя страница книги */
.book-inner-page {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2.5rem 2rem;
    text-align: center;
    box-sizing: border-box;
    overflow: hidden;
    background: #fdf6e3;
    background-image: linear-gradient(90deg, #e8dcc8 0%, #f5eed8 4%, #fdf6e3 100%);
    border-radius: 4px 12px 12px 4px;
    box-shadow: inset 3px 0 15px rgba(0,0,0,0.06);
}

.page-ornament {
    color: rgba(139, 105, 20, 0.4);
    font-size: 1.2rem;
    letter-spacing: 8px;
    margin: 0.6rem 0;
}

.page-ornament-line {
    width: 50%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #c5a059, transparent);
    margin: 0.7rem auto;
}

.page-subtitle {
    font-family: var(--header-font);
    font-size: 1.2rem;
    color: #3d2b1f;
    line-height: 1.5;
    margin-bottom: 0.3rem;
}

.page-year {
    font-family: var(--header-font);
    font-size: 2rem;
    color: #5c2626;
    letter-spacing: 5px;
    font-weight: bold;
    margin-bottom: 0.3rem;
}

.page-dedication {
    font-family: var(--header-font);
    font-style: italic;
    font-size: 0.85rem;
    line-height: 1.7;
    color: #4a3520;
}

.book-back {
    background: linear-gradient(135deg, #3d1818, #2d1212);
    z-index: 1;
    transform: translateZ(-4px);
    border-radius: 4px 12px 12px 4px;
    box-shadow: -2px 2px 10px rgba(0,0,0,0.3);
}

.loader-text {
    color: var(--accent-color);
    font-family: var(--header-font);
    font-size: 1.1rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    animation: pulse 2s infinite;
    margin-top: 1rem;
}

.loader-text.loaded {
    animation: none;
    opacity: 1;
}

.loader-dots {
    display: inline-block;
    animation: dots 1.5s steps(4, end) infinite;
    width: 1.5em;
    text-align: left;
    overflow: hidden;
    vertical-align: bottom;
}

@keyframes dots {
    0% { width: 0; }
    25% { width: 0.5em; }
    50% { width: 1em; }
    75% { width: 1.5em; }
}

@keyframes bookReady {
    0% { transform: rotateY(-20deg) rotateX(5deg) scale(1); }
    100% { transform: rotateY(-15deg) rotateX(3deg) scale(1.02); }
}

@keyframes bookOpen {
    0% { transform: rotateY(-15deg) rotateX(3deg) scale(1.02); }
    40% { transform: rotateY(-5deg) rotateX(0deg) scale(1.2); }
    100% { transform: rotateY(0deg) rotateX(0deg) scale(1.3); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* Form Select style */
.form-select {
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: var(--body-font);
    font-size: 1rem;
    background: white;
    cursor: pointer;
}

/* Custom Marker Icons */
.marker-pin {
    width: 30px;
    height: 30px;
    border-radius: 50% 50% 50% 0;
    background: var(--accent-color);
    position: absolute;
    transform: rotate(-45deg);
    left: 50%;
    top: 50%;
    margin: -15px 0 0 -15px;
    border: 2px solid white;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.marker-pin i {
    transform: rotate(45deg);
    color: white;
    font-size: 14px;
}

.marker-pin.type-work {
    background: #3498db;
}

.marker-pin.type-death {
    background: #95a5a6;
}
#app {
    opacity: 0;
    transition: opacity 1s ease-in;
}

#app.visible {
    opacity: 1;
}
@media screen and (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .logo-container {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .title-block h1 {
        font-size: 1.6rem;
    }
    
    .main-nav ul {
        gap: 1rem;
    }
    
    .map-container {
        flex-direction: column;
        height: auto;
    }
    
    #map {
        height: 50vh;
        width: calc(100% - 20px);
    }
    
    .poet-sidebar {
        width: calc(100% - 20px);
        height: auto;
        margin: 10px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 2000;
        max-height: 70vh;
    }
    
    .poet-sidebar.hidden {
        transform: translateY(100%);
    }
}
