
/*  Основні стилі */
.sitemap-wrapper {
    max-width: 100%;
    margin: 0 auto;
    font-family: Arial, sans-serif;
    line-height: 1.4;
    position: relative;
    padding-left: 20px;
}

/* Загальний стиль */
.sitemap-top-line {
    display: flex;
    align-items: center;
    gap: 10px;
}

/*  Заголовок та лічильники */
.sitemap-header {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    background-color: #2c3e50;
    padding: 15px;
    border-radius: 8px;
    color: white;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
}

.sitemap-counters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}


.sitemap-counter-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #34495e;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 2px 4px rgba(210, 197, 197, 0.75);
    min-width: 190px;
}

.sitemap-counter-number {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 4px;
    font-family: 'Orbitron', 'DS-Digital', 'Courier New', monospace;
    letter-spacing: 1px; /* для ефекту електронного табло */
}


#totalMenuItems {
    color: #3498db; /* синій */
}

#skippedPages {
    color: #f39c12; /* помаранчевий */
}

#pageOK {
    color: #27ae60; /* зелений */
}

#pageNotFound {
    color: #e74c3c; /* червоний */
}

.sitemap-counter-label {
    font-size: 12px;
    color: #bdc3c7;
    text-align: center;
}


/* ✅ Оновлено через Grid */
.sitemap-button-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Завжди 3 кнопки в ряд */
    gap: 10px;
    justify-content: center;
    align-items: center;
    background: transparent;
    padding: 0;
    margin: 0;
}

.sitemap-button-container-wrapper {
    background: transparent;
    border: 2px solid #3498db;
    border-radius: 12px;
    padding: 20px 15px;
    margin: 20px auto;
    max-width: 100%;
    transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

.sitemap-button-container-wrapper.hovered {
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.4);
    border-color: #2ecc71;
}

/* Кнопка */
/* Загальні кнопки */
.sitemap-nav-button {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    height: 42px;
    background: linear-gradient(145deg, #f0f0f0, #dcdcdc);
    color: #2c3e50;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
    font-family: 'Orbitron', 'DS-Digital', 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    border: 2px solid #aab7b8;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
    white-space: nowrap;
    box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.5);
    padding-left: 40px;
    background: linear-gradient(145deg, #f0f0f0, #dcdcdc),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.4), transparent 70%);
    background-blend-mode: overlay;
}

.sitemap-nav-button.hovered {
    background: linear-gradient(145deg, #e8e8e8, #cfd8dc);
    transform: translateY(-2px);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    color: #2980b9;
    text-shadow: 0 0 4px rgba(255, 255, 255, 1);
}

/* Іконка в кнопці */
.sitemap-nav-button i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    pointer-events: none;
}


.sitemap-nav-button i.fa-spin-custom {
    transition: transform 0.3s linear;
}


.fa-spin-custom {
    animation: fa-spin 1s linear infinite;
}

@keyframes fa-spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}


/* Загальні іконки в кнопках */
.sitemap-nav-button i {
    color: #2c3e50; /* темно-синій базовий колір */
}

/* Іконка будиночка (головна) */
#home-button i {
    color: #3498db; /* яскраво-синій */
}

/* Іконка оновлення (перевірка) */
#refresh-check i {
    color: #27ae60; /* зелений */
}

/* Іконка плюса (розгорнути) */
#expand-all i {
    color: #2980b9; /* насичений синій */
}

/* Іконка мінуса (згорнути) */
#collapse-all i {
    color: #e67e22; /* помаранчевий */
}

/* Іконка PDF */
#export-pdf i {
    color: #e74c3c; /* червоний */
}

/* Іконка Excel */
#export-excel i {
    color: #27ae60; /* зелений */
}

/* Заблокована кнопка */
.sitemap-nav-button:disabled {
    cursor: not-allowed;
}


/*  Прогрес-бар */
.sitemap-progress-wrapper {
    position: relative;
    height: 18px;
    width: 100%;
    background-color: #2c3e50;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 10px;
}

/* Сам прогрес-бар */
#sitemap-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(270deg, #3498db, #2ecc71, #9b59b6, #3498db);
    background-size: 400% 400%;
    animation: sitemap-gradientFlow 6s ease infinite, sitemap-pulseStrong 1.5s infinite ease-in-out;
    border-radius: 999px;
    transition: width 0.4s ease, opacity 0.4s ease;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Текст відсотків всередині бару */
#sitemap-progress-text {
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 12px;
    font-size: 14px;
    border-radius: 20px;
    color: #fff;
    font-weight: bold;
    white-space: nowrap;
    pointer-events: none;
    transition: opacity 0.4s ease;
    opacity: 0.9;
}

/* Анімація градієнта */
@keyframes sitemap-gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Анімація пульсації */
@keyframes sitemap-pulseStrong {
    0%   { box-shadow: 0 0 5px rgba(52, 152, 219, 0.4); }
    50%  { box-shadow: 0 0 15px rgba(46, 204, 113, 0.9); }
    100% { box-shadow: 0 0 5px rgba(52, 152, 219, 0.4); }
}

/* Клас для активації пульсації */
.sitemap-pulse-strong {
    animation: sitemap-pulseStrong 1.5s infinite ease-in-out;
}


/*  Список меню */
.sitemap-main-menu {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.sitemap-main-menu ul {
    list-style-type: none;
    margin: 0;
}

/*  Ієрархія ліній */
.sitemap-menu-card-wrapper {
    position: relative;
    padding-left: 20px;
    margin: 6px 0;
}

/* Вертикальна лінія */
.sitemap-menu-card-wrapper::before {
    content: '';
    position: absolute;
    top: -6px;
    bottom: -6px;
    left: 8px;
    width: 2px;
    background: #ccc;
}

/* Горизонтальна лінія */
.sitemap-menu-card::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 8px;
    width: 12px;
    height: 2px;
    background: #ccc;
}

.sitemap-main-menu > .sitemap-menu-card-wrapper:first-child::before {
    top: 20px;
}

.sitemap-menu-card-wrapper:last-child::before {
    bottom: 15px;
}

/*  Відступи за рівнями */
.sitemap-level-1 .sitemap-menu-card-content {
    margin-left: 0;
}
.sitemap-level-2 .sitemap-menu-card-content {
    margin-left: 20px;
}
.sitemap-level-3 .sitemap-menu-card-content {
    margin-left: 40px;
}
.sitemap-level-4 .sitemap-menu-card-content {
    margin-left: 60px;
}
.sitemap-level-5 .sitemap-menu-card-content {
    margin-left: 80px;
}

/* 🧩 Картка меню */
.sitemap-menu-card {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-top: 1px solid rgba(210, 197, 197, 0.82);
    border-left: 1px solid rgba(210, 197, 197, 0.82);
    border-right: 2px solid rgba(12, 182, 232, 0.74);
    border-bottom: 2px solid rgba(12, 182, 232, 0.74);
    border-radius: 8px;
    padding: 5px 12px;
    gap: 10px;
    overflow: hidden;
    min-width: 0;
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

/* Ніжний діагональний градієнт при наведенні *//* Картка меню */
.sitemap-menu-card.hovered {
    background: linear-gradient(45deg, rgba(235, 245, 251, 0.73) 0%, rgba(214, 234, 248, 0.71) 100%);
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.2);
}



/* 🧩 Вміст картки */
.sitemap-menu-card-content {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    gap: 12px;
}

/* 🏷️ Бейдж рівня */
.sitemap-level-badge {
    flex-shrink: 0;
    font-size: 0.75em;
    padding: 2px 8px;
    color: rgb(255, 255, 255);
    border-radius: 12px;
    font-weight: bold;
    white-space: nowrap;
}

/* Кольори рівнів */
.sitemap-level-1 .sitemap-level-badge {
    background-color: #2ecc71;
}
.sitemap-level-2 .sitemap-level-badge {
    background-color: #f1c40f;
}
.sitemap-level-3 .sitemap-level-badge {
    background-color: #3498db;
}

/* 🔗 Посилання */
.sitemap-menu-link {
    flex-grow: 0;
    flex-shrink: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-weight: bold;
    color: #4a1aa8;
    min-width: 0;
    max-width: 60%;
}

/* Посилання */
.sitemap-menu-link.hovered {
    color: #0d8397;
}

/* 📁 Шлях файлу */
.sitemap-file-path {
    flex-grow: 0;
    flex-shrink: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 0.75em;
    color: #7f8c8d;
    min-width: 0;
    max-width: 30%;
}

/* 📌 Статусний бейдж */
.sitemap-status-indicator {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 0.75em;
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: bold;
    margin-left: auto;
}

/* Спочатку ховаємо mobile версію */
.sitemap-status-indicator.mobile-status {
    display: none;
}

/* А ПК версію лишаємо */
.sitemap-status-indicator.desktop-status {
    display: inline-block;
}


/* 🧩 Обгортка під кнопку або іконку */
/* Базова обгортка кнопки */
.sitemap-toggle-placeholder {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
    opacity: 1;
    border: 2px dashed rgba(77, 107, 254, 0.7); /* Синій пунктир */
    transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;

}

/* Пульсація синім тільки для тих, де є has-toggle */
.sitemap-toggle-placeholder.has-toggle {
    animation: sitemap-pulseGlow 2s infinite ease-in-out;
}

/* Якщо li відкритий — зелена пульсація */
.sitemap-menu-card-wrapper.expanded > .sitemap-menu-card > .sitemap-menu-card-content > .sitemap-top-line > .sitemap-toggle-placeholder.has-toggle {
    border: 2px dashed rgba(46, 204, 113, 0.8);
    animation: sitemap-pulseGlowGreen 2s infinite ease-in-out;
}

/* Кнопка-заглушка (закрита) */
.sitemap-toggle-placeholder.has-toggle.hovered {
    animation: none;
    background: rgba(77, 107, 254, 0.1);
    border: 2px solid rgba(77, 107, 254, 0.9);
    box-shadow: 0 0 8px rgba(77, 107, 254, 0.7);
}

/* Кнопка-заглушка (відкрита) */
.sitemap-menu-card-wrapper.expanded > .sitemap-menu-card > .sitemap-menu-card-content > .sitemap-top-line > .sitemap-toggle-placeholder.has-toggle.hovered {
    animation: none;
    background: rgba(46, 204, 113, 0.15);
    border: 2px solid rgba(46, 204, 113, 1);
    box-shadow: 0 0 12px rgba(46, 204, 113, 0.9);
}

/* Пульсація синім */
@keyframes sitemap-pulseGlow {
    0%   { box-shadow: 0 0 0px rgba(77, 107, 254, 0.6); }
    50%  { box-shadow: 0 0 8px rgba(77, 107, 254, 0.8); }
    100% { box-shadow: 0 0 0px rgba(77, 107, 254, 0.6); }
}

/* Пульсація зеленим */
@keyframes sitemap-pulseGlowGreen {
    0%   { box-shadow: 0 0 0px rgba(46, 204, 113, 0.6); }
    50%  { box-shadow: 0 0 8px rgba(46, 204, 113, 0.8); }
    100% { box-shadow: 0 0 0px rgba(46, 204, 113, 0.6); }
}



/* 🧩 Кнопка SVG "+" або "×" */
.sitemap-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    transition: transform 0.3s ease, color 0.3s ease;
    color: #3498db; /* Колір іконки */
}

/* SVG всередині кнопки */
.toggle-icon {
    width: 20px;
    height: 20px;
}

/* Обертання кнопки при розгортанні */
.sitemap-toggle-btn.rotated {
    transform: rotate(45deg);
}

/* Зміна кольору іконки при наведенні */
.sitemap-toggle-btn.hovered {
    color: #2980b9;
}

/* Маленька іконка у кружечках без дітей */
.sitemap-small-icon {
    font-size: 8px;
    color: #bdc3c7;
    opacity: 0.7;
}



/* 📂 Підменю */
.sitemap-submenu {
    margin-left: 10px;
    padding-left: 10px;
    border-left: 2px solid #eee;
    display: none;
}

.expanded > .sitemap-submenu {
    display: block;
}

/* 🖨️ Адаптація для друку */
@media print {
    .sitemap-nav-button, .sitemap-toggle-btn {
        display: none;
    }

    .sitemap-submenu {
        display: block !important;
    }

    .sitemap-main-menu li {
        page-break-inside: avoid;
    }
}


@media (max-width: 768px) {
    .sitemap-wrapper {
        padding-left: 0;
    }
    /* КНОПКИ */
    .sitemap-button-container {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .sitemap-button-container-wrapper {
        padding: 10px 10px;
    }

    .sitemap-nav-button {
        position: relative;
        padding-left: 40px;
        text-align: center;
        height: 30px;
    }

    /* ЛІЧИЛЬНИКИ */
    .sitemap-header {
        display: block;
        text-align: center;
        padding: 10px;
    }

    .sitemap-counters {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        width: 100%;
    }

    .sitemap-counter-item {
        min-height: 50px;
        min-width: auto;
        width: auto;
        background-color: #34495e;
        padding: 12px 8px;
        border-radius: 10px;
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
    }

}

@media (max-width: 768px) {
    /* Картка */
    .sitemap-menu-card {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 4px 8px;
        border-radius: 10px;
        background: #ffffff;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
        margin-bottom: 3px;
    }


    .sitemap-level-2 .sitemap-menu-card-content,
    .sitemap-level-3 .sitemap-menu-card-content {
        margin-left: 0;
    }

    /* Вміст картки */
    .sitemap-menu-card-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        text-align: center;
        gap: 6px;
    }

    .sitemap-menu-card-wrapper:last-child::before {
        bottom: 70px;
    }


    /* Верхній рядок */
    .sitemap-top-line {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: relative;
        width: 100%;
        gap: 8px;
        padding: 0 10px;
        min-height: 32px; /* мінімальна висота для центрування статусу */
    }

    /* Бейдж рівня */
    .sitemap-level-badge {
        background: #2ecc71;
        padding: 1px 8px;
        border-radius: 10px;
        font-size: 0.7em;
        font-weight: bold;
        white-space: nowrap;
        flex-shrink: 0;
        order: 1;
    }

    /* Кнопка + */
    .sitemap-toggle-placeholder {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 22px;
        height: 22px;
        border: 2px dashed #3498db;
        border-radius: 50%;
        background: transparent;
        flex-shrink: 0;
        order: 3;
    }

    .sitemap-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 22px;
        height: 22px;
        font-size: 18px;
        border: none;
        background: transparent;
        color: #3498db;
        cursor: pointer;
        padding: 0;
        margin: 0;
        line-height: 1;
    }

    /* Статус */
    .sitemap-status-indicator.mobile-status {
        display: inline-block;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        font-size: 0.65em;
        padding: 2px 6px;
        border-radius: 10px;
        font-weight: bold;
        white-space: nowrap;
        color: #fff;
        pointer-events: none;
    }


    /* Назва меню */
    .sitemap-menu-link {
        text-align: left;
        width: 100%;
        font-size: 0.9rem;
        box-sizing: border-box;
        flex: none;
        max-width: 100%;
        white-space: normal;
        word-break: break-word;
    }

    /* Шлях */
    .sitemap-file-path {
        text-align: left;
        width: 100%;
        padding: 0 10px;
        box-sizing: border-box;
        flex: none;
        max-width: 100%;
    }

    /* ПК-версія статусу прихована */
    .sitemap-status-indicator.desktop-status {
        display: none;
    }
}







