/* ========================================
   ATLAS WRAPPER — каркас страницы Атласа
   (шапка/табы — общая палитра платформы;
    рабочая область .atl-root — темы --atl-*)
   ======================================== */

.atlas-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── HEADER (паттерн hadith-header) ── */
.atlas-header {
    text-align: center;
    padding: 13px 20px;
    background: var(--white);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 100;
}

.atlas-header-inner {
    max-width: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 16px;
}

.atlas-header-left {
    display: flex;
    align-items: center;
}

.atlas-title {
    font-family: var(--font-arabic-display, 'Amiri', serif);
    font-size: 28px;
    font-weight: 700;
    color: var(--emerald);
    direction: rtl;
    cursor: pointer;
    transition: color var(--transition-fast);
}
.atlas-title:hover { color: var(--emerald-dark); }

.atlas-header-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.atlas-logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    text-decoration: none;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}
.atlas-logo-link:hover { opacity: 0.85; }
.atlas-logo-link img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.22));
    transition: filter 0.2s ease;
}
.atlas-logo-link:hover img { filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3)); }

.atlas-header-right {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.lang-switcher { position: relative; }

[dir="rtl"] .atlas-header-left { text-align: end; }
[dir="rtl"] .atlas-header-right { justify-content: flex-end; }

/* ── NAV-TABS (стиль Quran/Hadith nav-tabs) ── */
.atlas-nav-tabs {
    display: flex;
    align-items: center;
    padding: 0 12px 0 24px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    border-bottom: 2px solid #e5e7eb;
    background: var(--page-bg, #f0f2f0);
    gap: 0;
}

.atlas-nav-tabs-left {
    display: flex;
    gap: 0;
    margin-inline-end: auto;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    margin-bottom: -2px;
}
.atlas-nav-tabs-left::-webkit-scrollbar { display: none; }

.atlas-tab {
    padding: 10px 22px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: color 0.2s, background 0.2s;
    font-family: 'Inter', sans-serif;
    flex-shrink: 0;
}
.atlas-tab::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--emerald, #059669);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}
.atlas-tab:hover {
    color: var(--emerald-dark, #065f46);
    background: color-mix(in srgb, var(--emerald, #059669) 6%, transparent);
    border-radius: 6px 6px 0 0;
}
.atlas-tab.active { color: var(--emerald, #059669); }
.atlas-tab.active::after { transform: scaleX(1); }

.atlas-nav-tabs-right {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
}

.atl-theme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}
.atl-theme-btn:hover {
    color: var(--emerald-dark, #065f46);
    background: color-mix(in srgb, var(--emerald, #059669) 8%, transparent);
}

/* ── Рабочая область (темы применяются здесь) ── */
.atl-root {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--atl-bg);
    color: var(--atl-text);
}

.atl-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 24px 40px;
    box-sizing: border-box;
}

/* ── Tab panels ── */
.atl-tab-panel { display: none; flex: 1; }
.atl-tab-panel.active { display: flex; flex-direction: column; }

/* ── Контейнеры карты и древа ── */
.atl-map-wrap,
.atl-tree-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.atl-map,
.atl-tree {
    flex: 1;
    min-height: 480px;
    height: 62vh;
    border: 1px solid var(--atl-border);
    border-radius: 12px;
    background: var(--atl-sea);
    box-shadow: var(--atl-shadow);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.atl-map-placeholder {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--atl-text-muted);
    opacity: 0.75;
    user-select: none;
}

.atl-loading {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: var(--atl-text-muted);
    padding: 8px 0;
}

/* ── Мобильная адаптация ── */
@media (max-width: 767px) {
    .atl-main { padding: 12px 12px 28px; }
    .atl-map, .atl-tree { min-height: 340px; height: 56vh; }
}
