/* =================================================================== */
/* СТИЛІ ДЛЯ ДЕСКТОПУ ТА ЗАГАЛЬНІ ЕЛЕМЕНТИ                             */
/* =================================================================== */
html, body {
    height: auto !important;
    min-height: 100% !important;
}

/* === ПОЧАТОК ЗМІН: Новий макет для фільтрів === */
.search-container {
    display: grid;
    grid-template-columns: 40% 40% 1fr; /* 40% Пошук, 40% Категорії, решта - К-сть */
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    font-family: Arial, sans-serif;
}
.search-input-wrapper {
    position: relative;
    grid-column: 1 / 2; /* Займає першу колонку */
}
#specFilter {
    grid-column: 2 / 3; /* Займає другу колонку */
}
#postsPerPageFilter {
    grid-column: 3 / 4; /* Займає третю колонку */
}
#searchInput, #specFilter, #postsPerPageFilter {
    width: 100%;
    box-sizing: border-box;
}
/* === КІНЕЦЬ ЗМІН === */

#searchInput {
    padding: 10px 15px 10px 40px;
    border: 1px solid #E0E5EB;
    border-radius: 5px;
    font-size: 16px;
}
.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    pointer-events: none;
}

/* === ПОЧАТОК ЗМІН: Кастомні стрілки для select === */
#specFilter, #postsPerPageFilter {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding: 10px 30px 10px 15px; /* Більше місця справа для стрілки */
    border: 1px solid #E0E5EB;
    border-radius: 5px;
    font-size: 16px;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}
/* === КІНЕЦЬ ЗМІН === */

.custom-table-wrapper { position: relative; }
.table-loader {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.7); display: flex;
    justify-content: center; align-items: center; z-index: 10;
    opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s;
}
.table-loader.is-loading { opacity: 1; visibility: visible; }
.table-loader::after {
    content: ''; width: 40px; height: 40px; border: 4px solid #f3f3f3;
    border-top: 4px solid #53B75F; border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.custom-table {
    width: 100%; border-collapse: separate; border-spacing: 0;
    border-radius: 8px; overflow: hidden; font-size: 16px;
    text-align: left;
}
.custom-table thead tr {
    background: linear-gradient(to right, #5cb85c, #388e3c);
}
.custom-table th {
    color: white; text-align: left; padding: 12px 15px;
    font-weight: 500; /* ВИПРАВЛЕННЯ: Насиченість medium */
}
.custom-table tr { transition: all 0.3s ease; }
.custom-table tr:nth-child(even) { background-color: #f2f8f2; }
.custom-table tr:nth-child(odd) { background-color: #ffffff; }
.custom-table td {
    padding: 10px 15px; border-bottom: 1px solid #E0E5EB;
    text-align: left; vertical-align: middle;
}
.custom-table td + td { border-left: 1px solid #E0E5EB; }
.custom-table tr:last-child td { border-bottom: none; }
.custom-table tr:hover { background-color: #BDEDC3; cursor: pointer; }
.custom-table thead tr:hover { background: linear-gradient(to right, #5cb85c, #388e3c); cursor: default; }
.custom-table .cert-list, .custom-table .qual-list {
    list-style: none !important; margin: 0 !important; padding: 0 !important;
    line-height: 1.4; text-align: left;
}
.social-icons-container { display: flex; justify-content: flex-start; align-items: center; gap: 8px; }
.social-icon-link {
    display: inline-flex; justify-content: center; align-items: center;
    width: 32px; height: 32px;
    border-radius: 50%;
    transition: transform 0.2s ease-in-out, background-color 0.2s;
    background-color: var(--ast-global-color-0) !important;
}
.social-icon-link:hover { transform: scale(1.1); background-color: var(--ast-global-color-1) !important; }
.social-icon-link svg { width: 16px; height: 16px; fill: white; }
.pagination-container { margin-top: 20px; display: flex; justify-content: center; align-items: center; gap: 5px; }
.pagination-container .page-numbers {
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid #E0E5EB;
    border-radius: 50px;
    text-decoration: none; color: #333333;
    transition: background-color 0.3s, color 0.3s;
    height: 48px;
    min-width: 48px;
    padding: 0 15px;
}
.pagination-container .page-numbers:not(.prev):not(.next):not(.dots) {
    width: 48px; padding: 0;
}
.pagination-container .page-numbers:hover { background-color: #f2f8f2; }
.pagination-container .page-numbers.current {
    background-color: var(--ast-global-color-0) !important;
    color: white; border-color: var(--ast-global-color-0) !important;
}

/* =================================================================== */
/* АДАПТИВНІ СТИЛІ ДЛЯ ПЛАНШЕТІВ І ТЕЛЕФОНІВ (max-width: 922px)      */
/* =================================================================== */
@media screen and (max-width: 922px) {
    /* === ПОЧАТОК ЗМІН: Макет фільтрів на мобільних === */
    .search-container {
        display: flex;
        flex-direction: column;
        align-items: stretch; /* Розтягуємо елементи на всю ширину */
    }
    /* === КІНЕЦЬ ЗМІН === */

    .custom-table, .custom-table td, .custom-table th {
        border: none !important;
    }
    .custom-table thead { display: none; }
    .custom-table, .custom-table tbody, .custom-table tr, .custom-table td {
        display: block; width: 100%; box-sizing: border-box;
    }
    .custom-table tr {
        margin-bottom: 20px;
        border: 1px solid rgba(118, 206, 83, 0.5); 
        border-radius: 8px; overflow: hidden; padding: 0;
    }
    .custom-table tr:nth-child(even), .custom-table tr:nth-child(odd) {
        background-color: #ffffff;
    }
    .custom-table tr:hover { background-color: transparent; }
    .custom-table td {
        padding: 10px 15px; border-bottom: 1px solid #e0e5eb;
        text-align: left; display: flex; align-items: center;
        justify-content: flex-start;
    }
    .custom-table tr td:last-child { border-bottom: none; }
    .custom-table td::before {
        content: attr(data-label); font-weight: 600;
        width: 130px; flex-shrink: 0; padding-right: 15px; color: #555;
    }
    .custom-table td:first-child {
        font-size: 1.2em; font-weight: 600; background-color: #f7f7f8; margin: 0;
    }
    .custom-table td:first-child::before { display: none; }
    .social-icons-container { justify-content: flex-start !important; margin-left: 0; }
    .custom-table .social-icon-link { width: 32px; height: 32px; }
    .custom-table .social-icon-link svg { width: 16px; height: 16px; }
}

/* =================================================================== */
/* СТИЛІ ДЛЯ ПОВІДОМЛЕННЯ "НЕ ЗНАЙДЕНО"                              */
/* =================================================================== */
.specialists-not-found {
    text-align: center; padding: 60px 20px; margin-top: 20px;
    border: 1px dashed #cccccc; border-radius: 8px; background-color: #f9f9f9;
}
.specialists-not-found .not-found-icon {
    width: 48px; height: 48px; stroke: #aaaaaa; margin-bottom: 20px;
}
.specialists-not-found .not-found-title {
    font-size: 1.4em; font-weight: 600; color: #555555; margin: 0 0 10px 0;
}
.specialists-not-found .not-found-suggestion {
    font-size: 1em; color: #777777; margin: 0;
}