/* ==========================================================================
   Collections («Подборки») — landing design language (--l-* tokens, .sui-*)
   ========================================================================== */

.page-collections .mono,
.coll-section__num,
.coll-tag {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ==========================================================================
   List page — /collections
   ========================================================================== */

.coll-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.coll-card {
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.coll-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
    min-height: 18px;
}

/* level indicator — three colored dots, color depends on collection level */

.coll-level {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.coll-level__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.coll-level--basic .coll-level__dot {
    background: #34B95B;
}

.coll-level--intermediate .coll-level__dot {
    background: #FFCA28;
}

.coll-level--advanced .coll-level__dot {
    background: #F95337;
}

/* badges */

.coll-badge {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
}

.coll-badge--new {
    color: #60A5FA;
    background: rgba(96, 165, 250, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.35);
}

html[data-theme="light"] .coll-badge--new {
    color: #2563EB;
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.30);
}

.coll-badge--hidden {
    font-weight: 500;
    text-transform: none;
    color: #FBBF24;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.coll-card__title {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.coll-card__title a {
    color: var(--l-text);
    text-decoration: none;
    transition: color 0.15s ease;
}

.coll-card__title a:hover {
    color: var(--l-accent-hover);
}

.coll-card__desc {
    margin: 8px 0 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--l-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.coll-card__meta {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 16px;
    font-size: 13px;
    color: var(--l-dim);
}

.coll-card__meta i {
    margin-right: 6px;
    font-size: 12px;
}

.coll-card__progress {
    margin-top: 14px;
}

.coll-card__progress-label {
    display: block;
    font-size: 12.5px;
    color: var(--l-muted);
    margin-bottom: 8px;
}

.coll-card__btn {
    margin-top: 18px;
    padding: 11px 20px;
    font-size: 14px;
    align-self: flex-start;
}

/* shared progress bar */

.coll-progress {
    height: 8px;
    border-radius: 999px;
    background: var(--l-raise);
    border: 1px solid var(--l-border);
    overflow: hidden;
}

.coll-progress__fill {
    height: 100%;
    border-radius: 999px;
    background: #34B95B;
    transition: width 0.3s ease;
}

/* empty state */

.coll-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 56px 24px;
    margin-top: 40px;
    color: var(--l-dim);
    text-align: center;
}

.coll-empty i {
    font-size: 28px;
}

.coll-empty p {
    margin: 0;
    font-size: 14px;
}

/* ==========================================================================
   Detail page — /collections/{slug}
   ========================================================================== */

.coll-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    font-size: 13.5px;
    color: var(--l-dim);
}

.coll-breadcrumbs a {
    color: var(--l-muted);
    text-decoration: none;
    transition: color 0.15s ease;
}

.coll-breadcrumbs a:hover {
    color: var(--l-text);
}

.coll-breadcrumbs i {
    font-size: 9px;
}

.coll-breadcrumbs span {
    color: var(--l-text);
}

.coll-detail__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    align-items: start;
}

.sui-h1--collection {
    font-size: clamp(26px, 3vw, 34px);
}

.coll-detail__badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.coll-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--l-muted);
    background: var(--l-raise);
    border: 1px solid var(--l-border);
}

.coll-pill i {
    font-size: 11px;
}

.coll-pill--basic {
    color: #34B95B;
    background: rgba(52, 185, 91, 0.08);
    border-color: rgba(52, 185, 91, 0.35);
}

.coll-pill--intermediate {
    color: #FFCA28;
    background: rgba(255, 202, 40, 0.08);
    border-color: rgba(255, 202, 40, 0.35);
}

.coll-pill--advanced {
    color: #F95337;
    background: rgba(249, 83, 55, 0.08);
    border-color: rgba(249, 83, 55, 0.35);
}

.coll-detail__progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 24px;
    padding: 16px 20px;
}

.coll-detail__progress-info {
    flex: 1;
    min-width: 0;
}

.coll-detail__progress-label {
    display: block;
    font-size: 13.5px;
    color: var(--l-muted);
    margin-bottom: 9px;
}

.coll-detail__progress-hint {
    display: block;
    margin-top: 9px;
    font-size: 12.5px;
    color: var(--l-dim);
}

.coll-detail__progress-hint a {
    color: var(--l-accent-hover);
    text-decoration: none;
}

.coll-detail__progress-hint a:hover {
    text-decoration: underline;
}

.coll-detail__cta {
    flex-shrink: 0;
    padding: 11px 24px;
    font-size: 14px;
}

.coll-detail__subtitle {
    margin: 30px 0 16px;
    font-size: 16px;
    font-weight: 600;
    color: var(--l-text);
}

/* sections */

.coll-sections {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.coll-section {
    overflow: hidden;
}

.coll-section__head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--l-border);
    background: var(--l-raise);
}

html[data-theme="light"] .coll-section__head {
    background: #FAFBFC;
}

.coll-section__num {
    font-size: 13px;
    font-weight: 500;
    color: var(--l-dim);
}

.coll-section__title {
    flex: 1;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--l-text);
}

.coll-section__count {
    font-size: 13px;
    color: var(--l-dim);
    white-space: nowrap;
}

.coll-section__empty {
    margin: 0;
    padding: 18px 20px;
    font-size: 13.5px;
    color: var(--l-dim);
}

/* task rows */

.coll-task-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.coll-task {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px;
    transition: background 0.12s ease;
}

.coll-task + .coll-task {
    border-top: 1px solid var(--l-border);
}

.coll-task:hover {
    background: rgba(148, 163, 184, 0.05);
}

html[data-theme="light"] .coll-task:hover {
    background: rgba(117, 67, 244, 0.04);
}

.coll-task__check {
    flex-shrink: 0;
    width: 18px;
    font-size: 15px;
    color: var(--l-dim);
    text-align: center;
}

.coll-task__check.is-solved {
    color: #34B95B;
}

.coll-task__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.coll-task__title {
    font-size: 14.5px;
    font-weight: 500;
    color: var(--l-text);
    text-decoration: none;
    transition: color 0.15s ease;
}

.coll-task__title:hover {
    color: var(--l-accent-hover);
}

.coll-task__num {
    color: var(--l-dim);
    font-weight: 400;
    margin-right: 4px;
}

.coll-task__topic {
    font-size: 12px;
    color: var(--l-dim);
}

.coll-task__meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.coll-task__premium {
    width: 16px;
    height: 16px;
    object-fit: contain;
    user-select: none;
}

.coll-difficulty {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--l-muted);
    white-space: nowrap;
}

.coll-difficulty__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* aside */

.coll-detail__aside {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 88px;
}

.coll-side {
    padding: 18px 20px;
}

.coll-side__title {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--l-text);
}

.coll-side__text {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--l-muted);
}

.coll-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.coll-tag {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 7px;
    background: var(--l-bg);
    border: 1px solid var(--l-border);
    color: var(--l-muted);
}

/* ==========================================================================
   Theme transition
   ========================================================================== */

html.theme-transition .page-collections,
html.theme-transition .page-collections header,
html.theme-transition .page-collections footer,
html.theme-transition .page-collections main,
html.theme-transition .page-collections a,
html.theme-transition .page-collections p,
html.theme-transition .page-collections h1,
html.theme-transition .page-collections h2,
html.theme-transition .page-collections h3,
html.theme-transition .page-collections h4,
html.theme-transition .page-collections input,
html.theme-transition .page-collections button,
html.theme-transition .page-collections span,
html.theme-transition .page-collections li,
html.theme-transition .page-collections .sui-card,
html.theme-transition .page-collections .coll-card,
html.theme-transition .page-collections .coll-section,
html.theme-transition .page-collections .coll-task,
html.theme-transition .page-collections .coll-tag,
html.theme-transition .page-collections .coll-pill,
html.theme-transition .page-collections .user-menu-panel,
html.theme-transition .page-collections .profile-modal-panel,
html.theme-transition .page-collections .site-more-panel {
    transition:
        background-color 0.35s ease,
        color 0.35s ease,
        border-color 0.35s ease,
        box-shadow 0.35s ease,
        filter 0.35s ease;
}

@media (prefers-reduced-motion: reduce) {
    html.theme-transition .page-collections,
    html.theme-transition .page-collections * {
        transition: none;
    }
}

/* ==========================================================================
   Light theme — shared fragments (header / menus / footer)
   ========================================================================== */

html[data-theme="light"] .page-collections {
    background-color: var(--jc-bg);
    color: var(--jc-text-muted);
}

html[data-theme="light"] .page-collections .site-logo--dark {
    display: none;
}

html[data-theme="light"] .page-collections .site-logo--light {
    display: block !important;
}

html[data-theme="light"] .page-collections header {
    background: rgba(248, 249, 251, 0.92);
    border-bottom: var(--jc-border-width) solid var(--jc-border);
}

html[data-theme="light"] .page-collections [data-main-nav] a {
    color: #525252;
}

html[data-theme="light"] .page-collections [data-main-nav] a.text-white,
html[data-theme="light"] .page-collections [data-main-nav] a:hover {
    color: #222222;
}

html[data-theme="light"] .page-collections .site-more-toggle {
    color: #525252;
}

html[data-theme="light"] .page-collections .site-more-toggle:hover,
html[data-theme="light"] .page-collections .site-more-toggle[aria-expanded="true"],
html[data-theme="light"] .page-collections .site-more-toggle.is-active {
    color: #222222;
    background: rgba(82, 82, 82, 0.06);
}

html[data-theme="light"] .page-collections .site-more-panel {
    background: #ffffff;
    border: var(--jc-border-width) solid var(--jc-border);
    box-shadow: 0 18px 40px rgba(34, 34, 34, 0.08);
}

html[data-theme="light"] .page-collections .site-more-link {
    color: #222222;
}

html[data-theme="light"] .page-collections .site-more-link:hover,
html[data-theme="light"] .page-collections .site-more-link.is-current {
    background: rgba(117, 67, 244, 0.08);
    color: #222222;
}

html[data-theme="light"] .page-collections .site-more-link--premium {
    color: #FFCA28;
}

html[data-theme="light"] .page-collections .site-more-link--premium:hover {
    color: #E6B400;
}

html[data-theme="light"] .page-collections .site-more-link--premium.is-current,
html[data-theme="light"] .page-collections .site-more-link--premium.is-current:hover {
    color: #222222;
}

html[data-theme="light"] .page-collections .landing-search {
    background: #ffffff;
    color: #222222;
    border: var(--jc-border-width) solid var(--jc-border);
}

html[data-theme="light"] .page-collections .landing-search::placeholder {
    color: #525252;
}

html[data-theme="light"] .page-collections .landing-search:focus {
    border-color: #7543F4;
}

html[data-theme="light"] .page-collections .landing-theme-toggle {
    background: #ffffff;
    color: #525252;
    border: var(--jc-border-width) solid var(--jc-border);
}

html[data-theme="light"] .page-collections .landing-theme-toggle:hover {
    color: #222222;
}

html[data-theme="light"] .page-collections .fa-magnifying-glass {
    color: #9CA3AF;
}

html[data-theme="light"] .page-collections header a[href="/login"] {
    color: #222222;
}

html[data-theme="light"] .page-collections .user-menu-panel {
    background: #ffffff;
    border: var(--jc-border-width) solid var(--jc-border);
    box-shadow: 0 18px 40px rgba(34, 34, 34, 0.1);
}

html[data-theme="light"] .page-collections .user-menu-panel .text-white {
    color: #222222;
}

html[data-theme="light"] .page-collections .user-menu-panel nav a {
    color: #525252;
}

html[data-theme="light"] .page-collections .user-menu-panel nav a:hover {
    color: #222222;
    background: rgba(82, 82, 82, 0.06);
}

html[data-theme="light"] .page-collections .user-menu-panel .border-b,
html[data-theme="light"] .page-collections .user-menu-panel .border-t {
    border-color: transparent;
    border-width: 0;
}

html[data-theme="light"] .page-collections .profile-modal-panel {
    background: #ffffff;
    border: var(--jc-border-width) solid var(--jc-border);
    box-shadow: 0 24px 48px rgba(17, 24, 39, 0.16);
}

html[data-theme="light"] .page-collections .profile-modal-panel h2 {
    color: #222222;
}

html[data-theme="light"] .page-collections .profile-modal-panel p {
    color: #525252;
}

html[data-theme="light"] .page-collections .profile-modal-panel [data-logout-confirm-close] {
    color: #6B7280;
}

html[data-theme="light"] .page-collections .profile-modal-panel [data-logout-confirm-close]:hover {
    color: #222222;
    background: #F3F4F6;
}

html[data-theme="light"] .page-collections .profile-modal-panel [data-logout-confirm-cancel] {
    background: #ffffff;
    border: 1px solid #D1D5DB;
    color: #222222;
}

html[data-theme="light"] .page-collections .profile-modal-panel [data-logout-confirm-cancel]:hover {
    background: #F3F4F6;
    color: #111827;
}

html[data-theme="light"] .page-collections .profile-modal-panel [data-logout-confirm-submit] {
    background: #EF4444;
    border: 1px solid #EF4444;
    color: #ffffff;
}

html[data-theme="light"] .page-collections .profile-modal-panel [data-logout-confirm-submit]:hover {
    background: #DC2626;
    border-color: #DC2626;
    color: #ffffff;
}

html[data-theme="light"] .page-collections input:-webkit-autofill,
html[data-theme="light"] .page-collections input:-webkit-autofill:hover,
html[data-theme="light"] .page-collections input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px #ffffff inset !important;
    -webkit-text-fill-color: #222222 !important;
}

html[data-theme="light"] .page-collections .landing-footer {
    background: #F8F9FB;
    border-top: var(--jc-border-width) solid var(--jc-border);
}

html[data-theme="light"] .page-collections .landing-footer a {
    color: #525252;
}

html[data-theme="light"] .page-collections .landing-footer a:hover {
    color: #222222;
}

html[data-theme="light"] .page-collections .landing-footer a:hover.text-\[\#7543F4\],
html[data-theme="light"] .page-collections .landing-footer a[title]:hover {
    color: #7543F4;
}

html[data-theme="light"] .page-collections .landing-footer p {
    color: #525252;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
    .coll-detail__layout {
        grid-template-columns: 1fr;
    }

    .coll-detail__aside {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .coll-detail__aside > * {
        flex: 1 1 260px;
    }
}

@media (max-width: 640px) {
    .coll-grid {
        grid-template-columns: 1fr;
        margin-top: 28px;
    }

    .coll-detail__progress {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .coll-detail__cta {
        align-self: stretch;
        justify-content: center;
    }

    .coll-task {
        flex-wrap: wrap;
        gap: 10px;
    }

    .coll-task__meta {
        margin-left: 32px;
    }
}
