* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
    background: #f5f5f5;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Шапка */
header {
    background: #1e3c5c; /* Темно-синий, как на cemetery.su */
    color: white;
    padding: 12px 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 20;
    position: relative;
}

header h1 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.subtitle {
    font-size: 0.8rem;
    opacity: 0.9;
}

.menu-btn {
    display: none;
    background: none;
    border: 1px solid rgba(255,255,255,0.5);
    color: white;
    font-size: 1.8rem;
    padding: 0 10px;
    border-radius: 5px;
    cursor: pointer;
    line-height: 1;
}

/* Основной контент */
.main-content {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
}

/* Сайдбар */
.sidebar {
    width: 360px;
    background: white;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease;
    z-index: 15;
}

.sidebar-header {
    padding: 15px;
    background: #f0f4f8;
    border-bottom: 1px solid #d0d9e2;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    color: #1e3c5c;
}

.search-box input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 0.95rem;
    transition: border 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: #1e3c5c;
    box-shadow: 0 0 0 2px rgba(30, 60, 92, 0.2);
}

.graves-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: #fff;
}

/* Элемент списка захоронения */
.grave-item {
    padding: 12px 15px;
    margin-bottom: 8px;
    background: #f9fafc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 4px solid transparent;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border-bottom: 1px solid #e9ecef;
}

.grave-item:hover {
    background: #e9f0f9;
    transform: translateX(2px);
    border-left-color: #8b9eb0;
}

.grave-item.selected {
    background: #e1eaf2;
    border-left-color: #1e3c5c;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.grave-item .grave-name {
    font-weight: 600;
    color: #1e3c5c;
    margin-bottom: 5px;
    font-size: 1rem;
}

.grave-item .grave-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #5a6e7f;
}

.grave-item .grave-coords {
    font-family: monospace;
    font-size: 0.7rem;
    color: #7f8c8d;
    margin-top: 5px;
    background: #edf2f7;
    padding: 3px 6px;
    border-radius: 4px;
    display: inline-block;
}

.info-block {
    padding: 15px;
    background: #f0f4f8;
    border-top: 1px solid #d0d9e2;
    font-size: 0.9rem;
}

.info-block h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: #1e3c5c;
}

.info-block p {
    color: #2c3e50;
    line-height: 1.4;
    margin-bottom: 5px;
}

.photo-note {
    font-style: italic;
    color: #6c757d;
    margin-top: 8px;
    font-size: 0.85rem;
}

/* Карта */
.map-container {
    flex: 1;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
}

/* Панель маршрута */
.route-panel {
    position: absolute;
    bottom: 25px;
    right: 25px;
    width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    display: none;
    z-index: 30;
    overflow: hidden;
    border: 1px solid #d0d9e2;
}

.route-panel.active {
    display: block;
}

.route-header {
    padding: 15px;
    background: #1e3c5c;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.route-header h3 {
    font-size: 1.1rem;
    font-weight: 500;
}

.route-header button {
    background: none;
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
    opacity: 0.8;
}

.route-header button:hover {
    opacity: 1;
}

.route-content {
    padding: 18px;
    max-height: 250px;
    overflow-y: auto;
    background: #fff;
}

.route-content p {
    margin: 8px 0;
    font-size: 0.95rem;
    line-height: 1.4;
    color: #2c3e50;
}

.route-content strong {
    color: #1e3c5c;
}

.route-content .note {
    color: #e67e22;
    font-style: italic;
    border-left: 3px solid #e67e22;
    padding-left: 10px;
    background: #fef5e7;
    padding: 8px;
    border-radius: 4px;
    margin-top: 10px;
}

/* Мобильная панель */
.mobile-bar {
    display: none;
    background: white;
    border-top: 1px solid #ddd;
    padding: 8px 15px;
    justify-content: space-around;
    gap: 10px;
    z-index: 15;
}

.mobile-bar button {
    flex: 1;
    padding: 12px 10px;
    background: #1e3c5c;
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.2s;
}

.mobile-bar button:hover {
    background: #2b4b6e;
}

/* Кнопка геолокации на карте (кастомная, но можно использовать стандартную) */
.geolocation-btn {
    /* Стили не нужны, используем встроенную кнопку яндекса */
}

/* Загрузка */
.loading, .no-results {
    text-align: center;
    padding: 30px 20px;
    color: #6c757d;
    font-style: italic;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.2rem;
    }
    .subtitle {
        font-size: 0.7rem;
    }
    .menu-btn {
        display: block;
    }
    
    .sidebar {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: 85%;
        max-width: 320px;
        z-index: 25;
        transform: translateX(-100%);
        box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .mobile-bar {
        display: flex;
    }
    
    .route-panel {
        left: 15px;
        right: 15px;
        bottom: 80px;
        width: auto;
    }
}