/* mod_repo_popular */

.mod-repo-popular {
    font-family: 'Roboto Condensed', sans-serif;
    margin: 10px 0;
}

.mod-repo-popular__table {
    width: 100%;
    border-collapse: collapse;
    background: #fafafa;
}

.mod-repo-popular__table thead th {
    background-color: #007bff;
    color: #fff;
    text-align: left;
    padding: 8px 10px;
    font-weight: 700;
    font-size: 0.95em;
}

.mod-repo-popular__table thead th.rp-uniq,
.mod-repo-popular__table thead th.rp-views,
.mod-repo-popular__table thead th.rp-rank {
    text-align: center;
    white-space: nowrap;
}

.mod-repo-popular__table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e2e2e2;
    vertical-align: top;
}

.mod-repo-popular__table tr.rp-item:hover {
    background: #f0f6ff;
}

.mod-repo-popular .rp-rank {
    text-align: center;
    width: 36px;
    color: #888;
    font-weight: 700;
}

.mod-repo-popular .rp-title a {
    color: #f34b0a;
    text-decoration: none;
    font-weight: 700;
}

.mod-repo-popular .rp-title a:hover {
    color: #fc662c;
    text-decoration: underline;
}

.mod-repo-popular .rp-uniq,
.mod-repo-popular .rp-views {
    text-align: center;
    white-space: nowrap;
    width: 70px;
}

.mod-repo-popular .rp-views {
    color: #777;
}

/* Кнопка раскрытия стран */
.mod-repo-popular .rp-toggle {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    font-size: 0.78em;
    line-height: 1.6;
    color: #fff;
    background: #28a745;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
    vertical-align: middle;
}

.mod-repo-popular .rp-toggle:hover {
    background: #2ebd4f;
}

.mod-repo-popular .rp-toggle-icon {
    display: inline-block;
    transition: transform 0.2s;
}

.mod-repo-popular .rp-toggle[aria-expanded="true"] .rp-toggle-icon {
    transform: rotate(180deg);
}

/* Блок стран */
.mod-repo-popular .rp-countries-row td {
    background: #f4f4f4;
}

.mod-repo-popular .rp-countries-switch {
    margin-bottom: 8px;
}

.mod-repo-popular .rp-cs-btn {
    padding: 2px 12px;
    font-size: 0.82em;
    border: 1px solid #007bff;
    background: #fff;
    color: #007bff;
    cursor: pointer;
}

.mod-repo-popular .rp-cs-btn:first-child {
    border-radius: 3px 0 0 3px;
}

.mod-repo-popular .rp-cs-btn:last-child {
    border-radius: 0 3px 3px 0;
    border-left: none;
}

.mod-repo-popular .rp-cs-btn.is-active {
    background: #007bff;
    color: #fff;
}

.mod-repo-popular .rp-countries-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mod-repo-popular .rp-country {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    padding: 2px 8px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.85em;
}

.mod-repo-popular .rp-country.is-ua {
    background: #fff7e6;
    border-color: #ffd479;
}

.mod-repo-popular .rp-country-code {
    font-weight: 700;
    color: #333;
}

.mod-repo-popular .rp-country-uniq {
    color: #007bff;
    font-weight: 700;
}

.mod-repo-popular .rp-country-views {
    color: #999;
    font-size: 0.9em;
}

/* Скрытие Украины в режиме "без України" */
.mod-repo-popular .rp-countries.mode-noua .rp-country.is-ua {
    display: none;
}

.mod-repo-popular__empty,
.mod-repo-popular-empty,
.mod-repo-popular-error {
    padding: 10px;
    font-family: 'Roboto Condensed', sans-serif;
}

/* === Панель переключателей === */
.mod-repo-popular .rp-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.mod-repo-popular .rp-ctl-label {
    font-weight: 700;
    color: #555;
    margin-right: 6px;
    font-size: 0.9em;
}

.mod-repo-popular .rp-period,
.mod-repo-popular .rp-scope {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.mod-repo-popular .rp-period-btn,
.mod-repo-popular .rp-scope-btn,
.mod-repo-popular .rp-month-btn {
    padding: 3px 10px;
    font-size: 0.85em;
    border: 1px solid #007bff;
    background: #fff;
    color: #007bff;
    border-radius: 3px;
    cursor: pointer;
    font-family: 'Roboto Condensed', sans-serif;
}

.mod-repo-popular .rp-period-btn:hover,
.mod-repo-popular .rp-scope-btn:hover,
.mod-repo-popular .rp-month-btn:hover {
    background: #eaf3ff;
}

.mod-repo-popular .rp-period-btn.is-active,
.mod-repo-popular .rp-scope-btn.is-active,
.mod-repo-popular .rp-month-btn.is-active {
    background: #007bff;
    color: #fff;
}

.mod-repo-popular .rp-year-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Месяцы скрыты, пока не выбран год */
.mod-repo-popular .rp-months {
    display: none;
    flex-wrap: wrap;
    gap: 3px;
    margin-left: 4px;
    padding-left: 6px;
    border-left: 1px dashed #cbd6e2;
}

.mod-repo-popular .rp-months.is-open {
    display: inline-flex;
}

.mod-repo-popular .rp-month-btn {
    padding: 2px 7px;
    font-size: 0.78em;
}

/* Индикатор загрузки */
.mod-repo-popular .rp-loading {
    padding: 6px 0;
    color: #888;
    font-style: italic;
    font-size: 0.9em;
}

/* Сообщение в пустой таблице */
.mod-repo-popular .rp-msg {
    padding: 14px 10px;
    color: #777;
    text-align: center;
}
