/* ==========================================================================
   КАРТА САЙТА "КНИГА РЕЛИГИЙ" - Светлая тема с вашими цветами
   Контейнер: 768px
   ========================================================================== */

/* Сброс стилей специфично для карты сайта */
#religions-sitemap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    box-sizing: border-box;
    *,
    *::before,
    *::after {
        box-sizing: inherit;
    }
}

.religions-sitemap {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin: 1.5rem auto;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 768px !important; /* Фиксированная ширина */
    position: relative;
}

/* Шапка */
.sitemap-header {
    background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
    color: #1e293b;
    padding: 1.25rem 1.5rem;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid #e2e8f0;
}

.sitemap-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><path d="M0,50 Q25,40 50,50 T100,50 L100,100 L0,100 Z" fill="%23d4af37" opacity="0.05"/></svg>');
    background-size: cover;
}

.header-content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.title-section {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    flex: 1;
    min-width: 200px;
}

.title-icon {
    background: rgba(212, 175, 55, 0.1);
    padding: 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    flex-shrink: 0;
}

.title-icon svg {
    width: 24px;
    height: 24px;
    color: #d4af37;
}

.sitemap-title {
    margin: 0 0 0.25rem 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.sitemap-subtitle {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 400;
    line-height: 1.4;
}

/* Статистика в шапке */
.header-stats {
    display: flex;
    gap: 1rem;
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    flex-wrap: wrap;
    justify-content: center;
}

.stat-item {
    text-align: center;
    min-width: 70px;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #d4af37;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 400;
    line-height: 1.2;
}

/* Панель управления */
.sitemap-controls {
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-container {
    flex: 1;
    min-width: 200px;
    max-width: 100%;
    position: relative;
}

.search-box {
    position: relative;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    width: 100%;
}

.search-box:focus-within {
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
    background: white;
}

.search-icon {
    width: 16px;
    height: 16px;
    color: #94a3b8;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.sitemap-search-input {
    flex: 1;
    border: none;
    background: none;
    padding: 0.5rem 0;
    font-size: 13px;
    color: #1e293b;
    outline: none;
    min-width: 0;
    width: 100%;
    font-family: inherit;
}

.sitemap-search-input::placeholder {
    color: #94a3b8;
    opacity: 1;
}

.clear-search {
    background: none;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    opacity: 0;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.clear-search:hover {
    color: #64748b;
}

.search-box:focus-within .clear-search,
.search-box:hover .clear-search,
.sitemap-search-input:not(:placeholder-shown) ~ .clear-search {
    opacity: 1;
}

/* Кнопки управления */
.controls-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.control-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: #d4af37;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(212, 175, 55, 0.2);
    text-decoration: none;
    font-family: inherit;
    line-height: 1;
    white-space: nowrap;
}

.control-btn:hover {
    background: #c19b2b;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.3);
}

.control-btn:active {
    transform: translateY(0);
}

.control-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.control-btn.collapse-all {
    background: var(--color-sky-base);
}

.control-btn.collapse-all:hover {
    background: #0ea5e9;
}

.control-btn.print-sitemap {
    background: #10b981;
}

.control-btn.print-sitemap:hover {
    background: #059669;
}

/* Основное содержимое */
.sitemap-content {
    padding: 1.25rem 1.5rem;
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    width: 100%;
}

.sitemap-content::-webkit-scrollbar {
    width: 8px;
}

.sitemap-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.sitemap-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.sitemap-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Firefox scrollbar */
.sitemap-content {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

.sitemap-tree-container {
    position: relative;
    width: 100%;
}

/* Дерево страниц */
.sitemap-tree {
    position: relative;
    width: 100%;
}

.tree-item {
    margin-bottom: 0.375rem;
    position: relative;
    width: 100%;
}

.tree-item::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, 
        transparent 0%,
        rgba(212, 175, 55, 0.3) 10%,
        rgba(212, 175, 55, 0.3) 90%,
        transparent 100%);
    z-index: 1;
}

.tree-item:last-child::before {
    height: 50%;
}

.tree-item:first-child::before {
    top: 50%;
}

.item-content {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-left: 24px;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
    min-height: 48px;
    width: calc(100% - 24px);
    flex-wrap: wrap;
}

.item-content:hover {
    background: #f8fafc;
    border-color: #d4af37;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.1);
}

.tree-item.current-page .item-content {
    background: rgba(212, 175, 55, 0.08);
    border-color: #d4af37;
    border-left: 4px solid #d4af37;
}

/* Отступы для вложенности */
.depth-indent {
    width: 20px;
    height: 100%;
    flex-shrink: 0;
}

/* Кнопки раскрытия */
.toggle-children {
    width: 20px;
    height: 20px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    margin-right: 0.5rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
    z-index: 3;
    padding: 0;
    line-height: 1;
}

.toggle-children:hover {
    background: #d4af37;
    border-color: #d4af37;
    color: white;
}

.toggle-children svg {
    width: 10px;
    height: 10px;
    transition: transform 0.3s ease;
}

.tree-item.expanded .toggle-children svg {
    transform: rotate(90deg);
}

.toggle-placeholder {
    width: 20px;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

/* Иконки страниц */
.page-icon {
    margin-right: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.page-icon svg {
    width: 18px;
    height: 18px;
    color: #d4af37;
}

.page-icon .custom-page-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

/* Ссылки на страницы */
.page-link {
    flex: 1;
    text-decoration: none;
    color: #1e293b;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease;
    min-width: 0;
    overflow: hidden;
    width: 100%;
}

.page-link:hover {
    color: #d4af37;
    text-decoration: none;
}

.page-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Дополнительные элементы */
.child-count {
    background: rgba(212, 175, 55, 0.1);
    color: #d4af37;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
    line-height: 1;
}

.has-image-indicator {
    color: #d4af37;
    opacity: 0.7;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.has-image-indicator svg {
    width: 12px;
    height: 12px;
}

.reading-time {
    font-size: 0.8rem;
    color: #64748b;
    margin-left: 0.75rem;
    padding-left: 0.75rem;
    border-left: 1px solid #e2e8f0;
    flex-shrink: 0;
    white-space: nowrap;
    line-height: 1.4;
}

/* Контейнер дочерних элементов */
.children-container {
    margin-left: 44px;
    padding-left: 0.75rem;
    border-left: 1px solid rgba(212, 175, 55, 0.2);
    margin-top: 0.375rem;
    display: none;
    width: calc(100% - 44px);
}

.tree-item.expanded > .children-container {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Футер */
.sitemap-footer {
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    width: 100%;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    width: 100%;
}

.quick-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.625rem 1rem;
    background: white;
    color: #475569;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: inherit;
    line-height: 1;
    white-space: nowrap;
}

.action-btn:hover {
    background: #d4af37;
    color: white;
    border-color: #d4af37;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.2);
}

.action-btn svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.footer-info {
    flex: 1;
    text-align: right;
    min-width: 150px;
}

.footer-info p {
    margin: 0;
    color: #64748b;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Состояние "нет страниц" */
.no-pages {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: #64748b;
    width: 100%;
}

.no-pages svg {
    width: 48px;
    height: 48px;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.no-pages h3 {
    margin: 0 0 0.5rem 0;
    color: #475569;
    font-size: 1.25rem;
    line-height: 1.2;
}

.no-pages p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Заглушка для админки */
.sitemap-admin-preview {
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    text-align: center;
    color: #475569;
}

.sitemap-admin-preview h3 {
    margin: 0 0 0.5rem 0;
    color: #1e293b;
    font-size: 1.25rem;
    line-height: 1.2;
}

.sitemap-admin-preview p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Анимации для ссылок */
.page-link {
    transition: all 0.2s ease;
    position: relative;
}

.page-link:hover {
    color: #d4af37;
    transform: translateX(3px);
}

.page-link.navigating {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.1), transparent);
    padding-right: 30px;
}

.page-link.navigating::after {
    content: '→';
    position: absolute;
    right: 10px;
    color: #d4af37;
    animation: slideRight 0.5s ease infinite alternate;
}

@keyframes slideRight {
    from { transform: translateX(0); }
    to { transform: translateX(3px); }
}

/* Подсветка текущей страницы */
.tree-item.current-page .item-content {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.08), rgba(212, 175, 55, 0.04));
    border-color: #d4af37;
    border-left: 4px solid #d4af37;
    box-shadow: 0 3px 10px rgba(212, 175, 55, 0.1);
}

.tree-item.current-page .page-title {
    color: #1e293b;
    font-weight: 600;
}

/* Подсветка при поиске */
.tree-item.search-match .item-content {
    background: rgba(212, 175, 55, 0.1);
    border-color: #d4af37;
    animation: pulseSearch 2s ease;
}

@keyframes pulseSearch {
    0% { background: rgba(212, 175, 55, 0); }
    50% { background: rgba(212, 175, 55, 0.2); }
    100% { background: rgba(212, 175, 55, 0.1); }
}

.tree-item.search-highlight .item-content {
    background: rgba(212, 175, 55, 0.15);
    border-color: #d4af37;
    animation: pulseHighlight 1.5s ease-in-out 3;
}

@keyframes pulseHighlight {
    0% { background: rgba(212, 175, 55, 0.15); }
    50% { background: rgba(212, 175, 55, 0.3); }
    100% { background: rgba(212, 175, 55, 0.15); }
}

/* Результаты поиска */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-top: 5px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    width: 100%;
}

.search-results-header {
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: #475569;
    font-size: 0.875rem;
    line-height: 1;
}

.close-results {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    line-height: 1;
    font-family: inherit;
}

.close-results:hover {
    background: #e2e8f0;
    color: #64748b;
}

.search-results-list {
    padding: 0.5rem 0;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 0.625rem 1rem;
    text-decoration: none;
    color: #475569;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    line-height: 1.4;
    width: 100%;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #f8fafc;
    color: #1e293b;
    padding-left: 1.25rem;
}

.result-icon {
    margin-right: 0.625rem;
    font-size: 12px;
    flex-shrink: 0;
    line-height: 1;
}

.result-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.875rem;
}

.result-title mark {
    background: #ffd700;
    color: #1e293b;
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 600;
}

.result-go {
    color: #cbd5e1;
    font-size: 12px;
    transition: all 0.2s ease;
    margin-left: 0.625rem;
    flex-shrink: 0;
    line-height: 1;
}

.search-result-item:hover .result-go {
    color: #d4af37;
    transform: translateX(3px);
}

.no-search-results {
    padding: 1.25rem;
    text-align: center;
    color: #64748b;
    font-size: 0.875rem;
    line-height: 1.4;
}

.no-search-results p {
    margin: 0;
}

/* Плавные переходы для детей */
.children-container {
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

.tree-item.expanded > .children-container {
    max-height: 5000px;
    opacity: 1;
}

/* Улучшение доступности для клавиатуры */
.page-link:focus,
.toggle-children:focus,
.control-btn:focus,
.action-btn:focus {
    outline: 2px solid #d4af37;
    outline-offset: 2px;
}

/* Плавное появление всей карты сайта */
.religions-sitemap {
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Стили для свернутого состояния */
.religions-sitemap.sitemap-collapsed {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

/* Кнопка показа карты сайта (будет добавлена рядом с картой) */
.show-sitemap-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: #d4af37;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(212, 175, 55, 0.2);
    margin: 1rem 0;
    text-decoration: none;
    font-family: inherit;
    line-height: 1;
    white-space: nowrap;
}

.show-sitemap-btn:hover {
    background: #c19b2b;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.3);
}

.show-sitemap-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ==========================================================================
   АДАПТИВНОСТЬ ДЛЯ ВСЕХ УСТРОЙСТВ
   ========================================================================== */

/* Большие планшеты и маленькие десктопы (992px - 1200px) */
@media (max-width: 1200px) {
    .religions-sitemap {
        margin: 1.25rem auto;
        border-radius: 10px;
    }
}

/* Планшеты (768px - 992px) */
@media (max-width: 992px) {
    .religions-sitemap {
        margin: 1rem auto;
        border-radius: 8px;
        max-width: 100% !important; /* На планшетах занимаем всю ширину */
    }
    
    .header-content {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 1rem;
    }
    
    .title-section {
        justify-content: center;
        text-align: center;
    }
    
    .header-stats {
        justify-content: center;
        gap: 1rem;
        padding: 0.625rem;
    }
    
    .stat-item {
        min-width: 60px;
    }
    
    .stat-number {
        font-size: 1.25rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    .sitemap-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 0.875rem;
    }
    
    .search-container {
        min-width: 100%;
        max-width: 100%;
    }
    
    .controls-buttons {
        justify-content: center;
        width: 100%;
    }
    
    .control-btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.85rem;
    }
    
    .page-title {
        font-size: 0.9rem;
    }
    
    .reading-time {
        font-size: 0.75rem;
    }
}

/* Большие телефоны (576px - 768px) */
@media (max-width: 768px) {
    .religions-sitemap {
        margin: 0.75rem auto;
        border-radius: 6px;
        border-width: 1px;
    }
    
    .sitemap-header,
    .sitemap-controls,
    .sitemap-content,
    .sitemap-footer {
        padding: 0.875rem 1.25rem;
    }
    
    .sitemap-title {
        font-size: 1.125rem;
    }
    
    .sitemap-subtitle {
        font-size: 0.8rem;
    }
    
    .title-icon {
        padding: 0.5rem;
    }
    
    .title-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .header-stats {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.625rem;
        width: 100%;
    }
    
    .stat-item {
        width: 100%;
        min-width: auto;
    }
    
    .stat-number {
        font-size: 1.125rem;
    }
    
    .stat-label {
        font-size: 0.65rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .footer-info {
        text-align: center;
        width: 100%;
        order: -1;
    }
    
    .item-content {
        flex-wrap: wrap;
        gap: 0.375rem;
        padding: 0.625rem;
        min-height: auto;
    }
    
    .page-link {
        order: 2;
        width: 100%;
        margin-top: 0.375rem;
        font-size: 0.9rem;
    }
    
    .page-title {
        font-size: 0.9rem;
    }
    
    .reading-time {
        order: 3;
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        margin-top: 0.375rem;
        width: 100%;
        text-align: right;
        font-size: 0.7rem;
    }
    
    .children-container {
        margin-left: 1.25rem;
        padding-left: 0.625rem;
        width: calc(100% - 1.25rem);
    }
    
    .tree-item::before {
        left: 16px;
    }
    
    .item-content {
        margin-left: 16px;
        width: calc(100% - 16px);
    }
    
    .search-results {
        position: fixed;
        top: 60px;
        left: 10px;
        right: 10px;
        max-height: 50vh;
        z-index: 9999;
    }
    
    .page-link.navigating::after {
        display: none;
    }
    
    .tree-item.current-page .item-content {
        border-left-width: 3px;
    }
    
    .sitemap-content {
        max-height: 400px;
        padding: 1rem;
    }
}

/* Телефоны (480px - 576px) */
@media (max-width: 576px) {
    .religions-sitemap {
        margin: 0.5rem auto;
        border-radius: 4px;
    }
    
    .sitemap-header,
    .sitemap-controls,
    .sitemap-content,
    .sitemap-footer {
        padding: 0.75rem 1rem;
    }
    
    .sitemap-title {
        font-size: 1rem;
        margin-bottom: 0.125rem;
    }
    
    .sitemap-subtitle {
        font-size: 0.75rem;
    }
    
    .title-section {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .title-icon {
        align-self: center;
    }
    
    .controls-buttons,
    .quick-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.375rem;
    }
    
    .control-btn,
    .action-btn {
        width: 100%;
        justify-content: center;
        padding: 0.625rem;
        font-size: 0.85rem;
    }
    
    .tree-item::before {
        left: 12px;
    }
    
    .item-content {
        margin-left: 12px;
        width: calc(100% - 12px);
        padding: 0.5rem;
    }
    
    .toggle-children,
    .toggle-placeholder {
        width: 18px;
        margin-right: 0.375rem;
    }
    
    .page-icon {
        margin-right: 0.375rem;
        width: 18px;
        height: 18px;
    }
    
    .page-icon svg {
        width: 14px;
        height: 14px;
    }
    
    .page-link {
        font-size: 0.85rem;
        gap: 0.25rem;
    }
    
    .page-title {
        font-size: 0.85rem;
    }
    
    .child-count {
        font-size: 0.65rem;
        padding: 0.125rem 0.25rem;
        min-width: 18px;
    }
    
    .has-image-indicator svg {
        width: 10px;
        height: 10px;
    }
    
    .reading-time {
        font-size: 0.65rem;
    }
    
    .children-container {
        margin-left: 0.75rem;
        padding-left: 0.375rem;
        width: calc(100% - 0.75rem);
    }
    
    .search-box {
        padding: 0.375rem 0.75rem;
    }
    
    .sitemap-search-input {
        font-size: 0.85rem;
    }
    
    .search-icon {
        width: 12px;
        height: 12px;
        margin-right: 0.375rem;
    }
    
    .sitemap-content {
        max-height: 350px;
        padding: 0.75rem;
    }
}

/* Очень маленькие телефоны (до 480px) */
@media (max-width: 480px) {
    .religions-sitemap {
        margin: 0.375rem auto;
        border-radius: 4px;
    }
    
    .sitemap-header,
    .sitemap-controls,
    .sitemap-content,
    .sitemap-footer {
        padding: 0.625rem;
    }
    
    .sitemap-title {
        font-size: 0.95rem;
    }
    
    .sitemap-subtitle {
        font-size: 0.7rem;
    }
    
    .stat-number {
        font-size: 1rem;
    }
    
    .stat-label {
        font-size: 0.6rem;
    }
    
    .item-content {
        margin-left: 8px;
        width: calc(100% - 8px);
        padding: 0.5rem;
    }
    
    .tree-item::before {
        left: 8px;
    }
    
    .toggle-children,
    .toggle-placeholder {
        width: 16px;
        margin-right: 0.25rem;
    }
    
    .toggle-children svg {
        width: 8px;
        height: 8px;
    }
    
    .page-icon {
        margin-right: 0.25rem;
        width: 16px;
        height: 16px;
    }
    
    .page-icon svg {
        width: 12px;
        height: 12px;
    }
    
    .page-link {
        font-size: 0.8rem;
        gap: 0.125rem;
    }
    
    .page-title {
        font-size: 0.8rem;
    }
    
    .child-count {
        display: none;
    }
    
    .has-image-indicator {
        display: none;
    }
    
    .reading-time {
        display: none;
    }
    
    .children-container {
        margin-left: 0.5rem;
        padding-left: 0.25rem;
        width: calc(100% - 0.5rem);
    }
    
    .control-btn span,
    .action-btn span {
        display: none;
    }
    
    .control-btn,
    .action-btn {
        padding: 0.5rem;
        justify-content: center;
        width: auto;
        min-width: 40px;
        height: 40px;
    }
    
    .control-btn svg,
    .action-btn svg {
        margin: 0;
        width: 16px;
        height: 16px;
    }
    
    .footer-info p {
        font-size: 0.75rem;
    }
    
    .search-box {
        padding: 0.25rem 0.5rem;
    }
    
    .sitemap-search-input {
        font-size: 0.8rem;
        padding: 0.25rem 0;
    }
    
    .search-results {
        left: 5px;
        right: 5px;
    }
}

/* Print styles */
@media print {
    .religions-sitemap {
        box-shadow: none;
        border: 1px solid #ccc;
        background: white;
        color: black;
        max-width: 100% !important;
    }
    
    .sitemap-header {
        background: white !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
        color: black;
    }
    
    .sitemap-controls,
    .sitemap-footer,
    .search-container,
    .controls-buttons,
    .quick-actions {
        display: none !important;
    }
    
    .sitemap-content {
        max-height: none;
        overflow: visible;
        padding: 0;
    }
    
    .page-link {
        color: black;
        text-decoration: underline;
    }
    
    .item-content:hover {
        transform: none;
        box-shadow: none;
    }
    
    .toggle-children {
        display: none;
    }
    
    .children-container {
        display: block !important;
    }
}