/* Блок: базовая типографика и фон страницы */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap');

html,
body {
    height: 100%;
    margin: 0;
}

body {
    font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
    background: #f4f6fa;
    color: #28426b;
    font-size: 13px;
}

/* Блок: оболочка и контейнер страницы клана */
.detail-page-shell {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 32px 16px;
    box-sizing: border-box;
}

.detail-container {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 32px 0 rgb(40 66 107 / 9%);
    padding: 24px 24px 30px;
    box-sizing: border-box;
    max-width: 1500px;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Блок: хлебные крошки */
.breadcrumbs {
    font-size: 0.8rem;
    color: #7a86a8;
    margin-bottom: 10px;
}

.breadcrumbs a {
    color: #4285f4;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs-sep {
    margin: 0 4px;
    opacity: 0.6;
}

/* Блок: hero шапка клана */
.detail-header {
    margin-bottom: 18px;
}

.detail-hero {
    display: flex;
    gap: 16px;
    align-items: center;
    background: #f7fbff;
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 4px 18px rgba(40, 66, 107, 0.08);
}

.detail-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #28426b, #3a7bd5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 26px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.detail-avatar.clan {
    background: linear-gradient(135deg, #0077ff, #24c4ff);
}

.detail-hero-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-title {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 700;
    color: #222;
}

.detail-tag {
    font-size: 0.95rem;
    font-weight: 600;
    color: #6676a2;
    margin-left: 6px;
}

.detail-subtitle {
    margin: 2px 0 4px;
    font-size: 0.9rem;
    color: #4a5670;
}

.detail-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.meta-pill {
    padding: 4px 10px;
    border-radius: 999px;
    background: #e5efff;
    font-size: 0.78rem;
    color: #28426b;
}

.meta-pill-success {
    background: #28a745;
    color: #ffffff;
    font-size: 0.75rem;
}

/* Блок: summary-карточки (если используются) */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.summary-card {
    background: #fafbfc;
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 2px 12px rgba(40, 66, 107, 0.08);
    box-sizing: border-box;
}

.summary-label {
    font-size: 0.78rem;
    color: #757b90;
    margin-bottom: 4px;
}

.summary-value {
    font-size: 0.98rem;
    font-weight: 600;
    color: #283044;
}

/* Блок: панель подсветки неактивных игроков */
.table-controls {
    margin: 20px 0 12px;
    background: #f7fbff;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 2px 10px rgba(40, 66, 107, 0.06);
    border: 1px solid rgba(40, 66, 107, 0.08);
}

.inactive-filter-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.inactive-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: flex-start;
}

.inactive-filter-group {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: #2c3e5a;
}

/* строка с подписью и полями порогов */
.inactive-filter-range {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    color: #2c3e5a;
}

.inactive-filter-label {
    font-weight: 600;
    color: #283044;
}

.inactive-filter-range label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.inactive-filter-range input[type="number"] {
    width: 60px; /* около 5 символов */
    padding: 4px 5px;
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid #d0d4dd;
    background-color: #f9fafc;
    color: #283044;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.inactive-filter-range input[type="number"]:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.16);
    background-color: #ffffff;
}

/* легенда цветов в одной строке с формой */
.inactive-filter-legend.inline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: 16px;
    font-size: 12px;
    color: #6b7280;
}

.legend-box {
    display: inline-block;
    width: 18px;
    height: 10px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.08);
}

.legend-soft {
    background-color: #fff8d8;
}

.legend-hard {
    background-color: #ffe0dd;
}

/* блок кнопок под формой */
.inactive-filter-actions.below {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

/* Блок: таблица состава клана и hover-подсветка */
.table-section {
    margin-top: 18px;
}

.table-title {
    margin: 0 0 4px;
    font-size: 1.3rem;
    font-weight: 600;
}

.table-subtitle {
    margin: 0 0 8px;
    font-size: 0.85rem;
    color: #666;
}

.delta-pos-demo { color: #1b5e20; }
.delta-neg-demo { color: #b71c1c; }

.table-wrapper {
    margin-top: 4px;
    background: #f7fbff;
    border-radius: 16px;
    box-shadow: 0 2px 16px 0 rgb(49 53 93 / 7%);
    overflow-x: auto;
    max-height: none;
    overflow-y: visible;
}

.my-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    font-size: 0.8rem;
}

/* ширины колонок */
.my-table col.col-index { min-width: 40px; }
.my-table col.col-name { min-width: 150px; }
.my-table col.col-date { min-width: 115px; }
.my-table col.col-role { min-width: 105px; }
.my-table col.col-num  { min-width: 90px; }

.my-table th,
.my-table td {
    padding: 8px 12px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border: 1px solid #e2e6ea;
    vertical-align: middle;
}

.my-table thead th {
    background: #e5efff;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 2;
}

/* заголовки-ссылки */
.my-table th a {
    color: inherit;
    text-decoration: none;
    position: relative;
    padding-bottom: 2px;
    display: inline-block;
}

.my-table th a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    border-bottom: 1.5px solid currentColor;
    transition: width 0.3s ease;
}

.my-table th a:hover::after {
    width: 100%;
}

/* дата в две строки */
.my-table td.date-cell {
    white-space: normal;
    line-height: 1.25;
    word-wrap: break-word;
}

/* ссылки в таблице */
a.player-link,
a.clan-link {
    color: inherit;
    text-decoration: none;
    position: relative;
    cursor: pointer;
}

a.player-link::after,
a.clan-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    border-bottom: 1.5px solid currentColor;
    transition: width 0.3s ease;
}

a.player-link:hover::after,
a.clan-link:hover::after {
    width: 100%;
}

a.player-link:hover,
a.clan-link:hover,
a.player-link:visited,
a.clan-link:visited {
    color: inherit;
    text-decoration: none;
}

/* hover-эффект строки */
.my-table tbody tr:hover td {
    background-color: #d5e4fb;
}

/* подсветка неактивных игроков */
.my-table tr.row-inactive-soft td {
    background-color: #fff8d8;
}

.my-table tr.row-inactive-hard td {
    background-color: #ffe0dd;
}

/* служебные классы */
.cell-index { font-weight: 600; }
.cell-num   { font-variant-numeric: tabular-nums; }

.cell-empty {
    text-align: center;
    padding: 16px;
}

/* дельты */
.delta-pos,
.delta-neg {
    display: inline-block;
    padding: 1px 4px;
    margin-left: 3px;
    border-radius: 999px;
    font-size: 0.75em;
    font-weight: 500;
}

.delta-pos {
    color: #1b5e20;
    background-color: rgba(76, 175, 80, 0.12);
}

.delta-neg {
    color: #b71c1c;
    background-color: rgba(244, 67, 54, 0.12);
}

/* Блок: маленькие кнопки (совместимы с .btn, .btn-ghost) */
.btn.btn-small {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 999px;
    border-width: 1px;
    line-height: 1.3;
    background-color: #4285f4;
    border-color: #4285f4;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(66, 133, 244, 0.35);
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.btn.btn-small:hover {
    background-color: #2469b7;
    box-shadow: 0 3px 10px rgba(36, 105, 183, 0.45);
    transform: translateY(-1px);
}

.btn.btn-ghost.btn-small {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 999px;
    background-color: #f3f8ff;
    color: #4285f4;
    border-color: #bcd1f1;
    box-shadow: none;
}

.btn.btn-ghost.btn-small:hover {
    background-color: #e2edff;
    border-color: #4285f4;
}

/* Блок: пагинация */
.pagination {
    margin-top: 20px;
    margin-bottom: 10px;
    text-align: center;
}

.pagination a,
.pagination span {
    margin: 0 4px;
    padding: 8px 14px;
    background-color: #f3f8ff;
    border: 1.5px solid #bcd1f1;
    border-radius: 9px;
    color: #4285f4;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
    display: inline-block;
    font-size: 13px;
    min-width: 34px;
    line-height: 20px;
}

.pagination a:hover {
    background-color: #2469b7;
    color: #fff;
    border-color: #2469b7;
}

.pagination span.active {
    background-color: #28426b;
    border-color: #28426b;
    color: #fff;
}

.pagination span.ellipsis {
    background: none;
    border: none;
    color: #999;
    cursor: default;
    padding: 8px 6px;
}

/* Блок: футер */
.page-footer {
    background-color: #222;
    color: #ccc;
    padding: 20px 0;
    font-size: 0.9rem;
    text-align: center;
    margin-top: 26px;
}

.footer-container {
    max-width: 900px;
    margin: 0 auto;
}

.footer-nav {
    margin: 10px 0;
}

.footer-nav a {
    color: #79c784;
    text-decoration: none;
    margin: 0 12px;
    font-weight: 500;
}

.footer-nav a:hover {
    text-decoration: underline;
}

.footer-note {
    margin-top: 12px;
    font-style: italic;
}

/* Блок: адаптив */
@media (max-width: 768px) {
    .detail-container {
        padding: 20px 14px 26px;
        margin: 10px auto;
    }

    .detail-hero {
        flex-direction: row;
    }

    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .my-table {
        font-size: 12px;
    }

    .my-table th,
    .my-table td {
        padding: 4px 6px;
    }

    .inactive-filter-range {
        flex-wrap: wrap;
    }

    .inactive-filter-legend.inline {
        margin-left: 0;
        margin-top: 6px;
    }

    .inactive-filter-actions.below {
        flex-wrap: wrap;
    }
}

@media (max-width: 500px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .my-table {
        font-size: 11px;
    }

    .my-table th,
    .my-table td {
        padding: 3px 5px;
    }

    .pagination a,
    .pagination span {
        padding: 6px 10px;
        font-size: 13px;
    }
}
