/**
 * collections-brand.css — коллекции (/collection, /collection/{id}, /collection/{id}/votes, /collection/{id}/edit)
 * в стиле /blog и /team/all: цвет логотипа (#9a4669, в тёмной теме #e9a6bc), белые карточки, мягкие кнопки.
 * Подключается после collections-redesign.css в views/collection/{index,index_side,collection,votes,edit}.php.
 * Скоуп — обёртка .col-brand (страница) и .col-brand.col-side (правая панель поиска).
 * Откат — убрать подключение файла и класс col-brand из шаблонов.
 */

html body .col-brand {
    --col-brand: #9a4669;
    --col-brand-strong: #7d3655;
    --col-brand-hover: #833a59;
    --col-soft: #f7edf2;
    --col-soft-hover: #f0dde7;
    --col-line: #ecd3df;
    --col-on: #ffffff;
    --col-card: #ffffff;
    --col-card-line: #ececec;
    --col-text: #2b2f33;
    --col-body: #3d4751;
    --col-muted: #8a9099;
    --col-danger: #b4232f;
    --col-danger-soft: #fbeaec;
    color: var(--col-text);
}
html body.dark-theme .col-brand {
    --col-brand: #e9a6bc;
    --col-brand-strong: #f0bfd0;
    --col-brand-hover: #f3c6d5;
    --col-soft: #362732;
    --col-soft-hover: #43303d;
    --col-line: #4a3442;
    --col-on: #241b23;
    --col-card: var(--dark-bg-card, #2a2a2a);
    --col-card-line: var(--dark-border-primary, #404040);
    --col-text: var(--dark-text-primary, #e8e8e8);
    --col-body: var(--dark-text-secondary, #b0b0b0);
    --col-muted: var(--dark-text-muted, #888888);
    --col-danger: #f19aa3;
    --col-danger-soft: #3a2427;
}

/* ===== Заголовок страницы ===== */
html body .col-brand .collections-header-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin: 0 0 16px !important;
    padding: 0 0 10px !important;
    border-bottom: 1px solid var(--col-line) !important;
}
html body .col-brand .collections-main-title,
html body .col-brand.col-edit > h1 {
    margin: 0 !important;
    color: var(--col-text) !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
}
html body .col-brand.col-edit > h1 {
    margin: 0 0 16px !important;
    padding: 0 0 10px;
    border-bottom: 1px solid var(--col-line);
}

/* ===== Кнопки ===== */
html body .col-brand .collections-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border: 0 !important;
    border-radius: 8px !important;
    background: var(--col-soft) !important;
    background-image: none !important;
    box-shadow: none !important;
    color: var(--col-brand-strong) !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none !important;
    text-shadow: none !important;
}
html body .col-brand .collections-button:hover {
    background: var(--col-soft-hover) !important;
}
html body .col-brand .collections-button-primary {
    background: var(--col-brand) !important;
    color: var(--col-on) !important;
}
html body .col-brand .collections-button-primary:hover {
    background: var(--col-brand-hover) !important;
}
html body .col-brand .collections-button-danger {
    background: var(--col-danger-soft) !important;
    color: var(--col-danger) !important;
}
html body .col-brand .collections-button-danger:hover {
    filter: brightness(.97);
}
html body .col-brand a:focus-visible,
html body .col-brand button:focus-visible {
    outline: 2px solid var(--col-brand);
    outline-offset: 2px;
}

/* ===== Карточки списка ===== */
html body .col-brand .collections-list {
    gap: 16px;
}
html body .col-brand .collection-card {
    border: 1px solid var(--col-card-line) !important;
    border-radius: 10px !important;
    background: var(--col-card) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .03) !important;
    color: var(--col-text) !important;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
html body .col-brand .collection-card:hover {
    transform: translateY(-2px);
    border-color: var(--col-line) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .08) !important;
}
html body .col-brand .collection-title {
    margin: 0 0 6px !important;
    padding: 0 !important;
    border: 0 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
}
html body .col-brand .collection-title a {
    color: var(--col-text) !important;
    text-decoration: none !important;
}
html body .col-brand .collection-title a:hover {
    color: var(--col-brand) !important;
}
html body .col-brand .collection-stats {
    gap: 12px;
    color: var(--col-muted) !important;
    font-size: 13px;
}
html body .col-brand .collection-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--col-muted) !important;
}
html body .col-brand .collection-stat .ui-icon {
    color: var(--col-muted);
}
html body .col-brand .collection-rating,
html body .col-brand .collection-rating .ui-icon {
    color: var(--col-brand-strong) !important;
}
html body .col-brand .col-empty {
    padding: 32px 16px;
    border: 1px dashed var(--col-line);
    border-radius: 10px;
    color: var(--col-muted);
    text-align: center;
}

/* ===== Пагинация (TbPager) ===== */
html body .col-brand .collections-pagination ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    list-style: none;
}
html body .col-brand .collections-pagination li {
    margin: 0 !important;
}
html body .col-brand .collections-pagination li > a,
html body .col-brand .collections-pagination li > span {
    float: none;
    display: inline-block;
    min-width: 32px;
    height: 32px;
    padding: 0 10px !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: var(--col-soft) !important;
    color: var(--col-brand-strong) !important;
    font-size: 13px !important;
    font-weight: 600;
    line-height: 32px;
    text-align: center;
    box-sizing: border-box;
}
html body .col-brand .collections-pagination li.active > a {
    background: var(--col-brand) !important;
    color: var(--col-on) !important;
}
html body .col-brand .collections-pagination li.disabled > a {
    opacity: .5;
}

/* ===== Правая панель поиска ===== */
html body .col-brand.col-side {
    padding: 14px 16px !important;
    border: 1px solid var(--col-card-line) !important;
    border-radius: 10px !important;
    background: var(--col-card) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .03) !important;
}
html body .col-brand.col-side .sidebar-title {
    margin: 0 0 12px !important;
    padding: 0 0 8px !important;
    border-bottom: 1px solid var(--col-line) !important;
    color: var(--col-text) !important;
    font-size: 16px !important;
    font-weight: 700 !important;
}
html body .col-brand.col-side .form-label {
    color: var(--col-muted) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: .03em;
}
html body .col-brand .form-input,
html body .col-brand .form-select,
html body .col-brand .add-book-input,
html body .col-brand .ms-ctn {
    border: 1px solid var(--col-line) !important;
    border-radius: 8px !important;
    background-color: var(--col-card) !important;
    box-shadow: none !important;
    color: var(--col-text) !important;
}
html body .col-brand .form-input,
html body .col-brand .form-select {
    width: 100% !important;
    max-width: 100%;
    box-sizing: border-box;
}
html body .col-brand .form-input:focus,
html body .col-brand .form-select:focus,
html body .col-brand .add-book-input:focus,
html body .col-brand .ms-ctn-focus {
    border-color: var(--col-brand) !important;
    outline: 0;
    box-shadow: 0 0 0 3px var(--col-soft) !important;
}
html body .col-brand .ms-sel-ctn .ms-sel-item {
    border: 0 !important;
    border-radius: 999px !important;
    background: var(--col-soft) !important;
    color: var(--col-brand-strong) !important;
}
html body .col-brand .ms-res-ctn {
    border-color: var(--col-line) !important;
    background: var(--col-card) !important;
}
html body .col-brand .ms-res-ctn .ms-res-item {
    color: var(--col-text) !important;
}
html body .col-brand .ms-res-ctn .ms-res-item-active {
    background: var(--col-soft) !important;
    color: var(--col-brand-strong) !important;
}
html body .col-brand input[type="radio"],
html body .col-brand input[type="checkbox"] {
    accent-color: var(--col-brand);
}
html body .col-brand.col-side .form-actions {
    margin-top: 16px !important;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
}

/* ===== Страница коллекции ===== */
html body .col-brand .collection-detail,
html body .col-brand .add-book-form {
    margin: 0 0 16px !important;
    padding: 16px !important;
    border: 1px solid var(--col-card-line) !important;
    border-radius: 10px !important;
    background: var(--col-card) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .03) !important;
    color: var(--col-text) !important;
}
html body .col-brand .collection-detail-image {
    border-radius: 10px !important;
}
html body .col-brand .collection-detail-meta-label {
    color: var(--col-muted) !important;
    font-size: 13px;
}
html body .col-brand .collection-detail-meta-value,
html body .col-brand .collection-detail-description {
    color: var(--col-body) !important;
}
html body .col-brand .collection-detail-meta-value a,
html body .col-brand .collection-detail-description a {
    color: var(--col-brand-strong) !important;
}
html body .col-brand .add-book-title,
html body .col-brand .collection-detail > .sidebar-title {
    margin: 0 0 12px !important;
    padding: 0 0 8px !important;
    border-bottom: 1px solid var(--col-line) !important;
    color: var(--col-text) !important;
    font-size: 16px !important;
    font-weight: 700 !important;
}
html body .col-brand .add-book-help {
    color: var(--col-muted) !important;
}
html body .col-brand .collection-hidden-notice,
html body .col-brand .collection-hidden-badge {
    border: 1px solid var(--col-line) !important;
    border-radius: 8px !important;
    background: var(--col-soft) !important;
    color: var(--col-brand-strong) !important;
}

/* Список книг коллекции (общий виджет BooksPaginationWidget): переключатель вида и «Убрать» */
html body .col-brand .books-view-mode-switcher .btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0 !important;
    border: 1px solid var(--col-line) !important;
    border-radius: 8px !important;
    background: var(--col-card) !important;
    background-image: none !important;
    box-shadow: none !important;
}
html body .col-brand .books-view-mode-switcher .btn.btn-info {
    border-color: var(--col-brand) !important;
    background: var(--col-soft) !important;
}
html body .col-brand .books-view-mode-switcher .btn [class*="icon-"] {
    width: 15px;
    height: 15px;
    color: var(--col-muted);
}
html body .col-brand .books-view-mode-switcher .btn.btn-info [class*="icon-"] {
    color: var(--col-brand);
}
html body .col-brand a.btn-danger[href*="/remove_book/"] {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 0 !important;
    border-radius: 8px !important;
    background: var(--col-danger-soft) !important;
    background-image: none !important;
    box-shadow: none !important;
    color: var(--col-danger) !important;
    font-weight: 600;
    text-shadow: none !important;
}
html body .col-brand a.btn-danger[href*="/remove_book/"] [class*="icon-"] {
    width: 12px;
    height: 12px;
}

/* ===== История рейтинга ===== */
html body .col-brand .votes-table {
    width: 100%;
    border-collapse: collapse;
}
html body .col-brand .votes-table th,
html body .col-brand .votes-table td {
    padding: 8px 10px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--col-card-line) !important;
    background: transparent !important;
    color: var(--col-text) !important;
    font-size: 14px;
    text-align: left;
    vertical-align: middle;
}
html body .col-brand .votes-table th {
    color: var(--col-muted) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: .03em;
}
html body .col-brand .votes-table tbody tr:hover td {
    background: var(--col-soft) !important;
}
html body .col-brand .votes-table td a:not(.collections-button) {
    color: var(--col-text) !important;
    font-weight: 600;
}
/* Пустой список книг («Тут пока ничего нет») из BooksPaginationWidget */
html body .col-brand > .alert-info {
    margin: 0 0 16px !important;
    padding: 14px 16px !important;
    border: 1px solid var(--col-card-line) !important;
    border-radius: 12px !important;
    background: var(--col-card) !important;
    color: var(--col-muted) !important;
    text-shadow: none !important;
}
html body .col-brand .col-vote-rm {
    display: inline;
    margin: 0;
}
html body .col-brand .col-vote-rm button {
    cursor: pointer;
    font: inherit;
}
html body .col-brand .col-back {
    margin-top: 16px;
}

/* ===== Форма создания/изменения ===== */
html body .col-brand.col-edit .form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0 0 !important;
    padding: 16px 0 0 !important;
    border-top: 1px solid var(--col-line) !important;
    background: none !important;
}
html body .col-brand.col-edit .form-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    margin: 0 !important;
    padding: 0 16px;
    border: 0 !important;
    border-radius: 8px !important;
    background: var(--col-soft) !important;
    background-image: none !important;
    box-shadow: none !important;
    color: var(--col-brand-strong) !important;
    font-weight: 600;
    text-shadow: none !important;
}
html body .col-brand.col-edit .form-actions .btn-primary {
    background: var(--col-brand) !important;
    color: var(--col-on) !important;
}
html body .col-brand.col-edit .form-actions .btn-danger {
    background: var(--col-danger-soft) !important;
    color: var(--col-danger) !important;
}
html body .col-brand.col-edit .control-label {
    color: var(--col-body) !important;
}

@media (max-width: 640px) {
    html body .col-brand .collections-main-title {
        font-size: 20px !important;
    }
}
