.collections-page {
    width: min(1500px, calc(100% - 32px));
    margin: 0 auto;
    padding: 36px 0 60px;
}

.collections-header,
.collection-detail-title {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
}

.section-label {
    display: block;
    margin-bottom: 6px;
    color: #63a6f5;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.collections-header h1,
.collection-detail-header h1 {
    margin: 0;
    color: #f4f7fa;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.05;
}

.collections-header p {
    margin: 9px 0 0;
    color: #8ea0b1;
    font-size: 0.95rem;
}

.collections-count {
    display: flex;
    align-items: baseline;
    gap: 7px;
    color: #8091a2;
}

.collections-count strong {
    color: #f4f7fa;
    font-size: 1.8rem;
}

.collections-count span {
    font-size: 0.85rem;
}

.collections-toolbar {
    margin-top: 30px;
}

.collection-search {
    position: relative;
    width: min(460px, 100%);
}

.collection-search i {
    position: absolute;
    top: 50%;
    left: 15px;
    color: #64788c;
    transform: translateY(-50%);
    pointer-events: none;
}

.collection-search input {
    width: 100%;
    height: 44px;
    padding: 0 16px 0 42px;
    border: 1px solid #253342;
    border-radius: 9px;
    outline: none;
    background: #0d1319;
    color: #edf3f8;
    font: inherit;
    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}

.collection-search input::placeholder {
    color: #607386;
}

.collection-search input:focus {
    border-color: #4e86c8;
    background: #101820;
}

.collections-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 22px;
}

.collection-card {
    overflow: hidden;
    border: 1px solid #263441;
    border-radius: 12px;
    background: #0e151c;
    color: inherit;
    text-decoration: none;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease;
}

.collection-card:hover {
    border-color: #3b5e80;
    background: #111a23;
    transform: translateY(-3px);
}

.collection-posters {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: 210px;
    overflow: hidden;
    background: #090e13;
}

.collection-poster {
    min-width: 0;
    overflow: hidden;
}

.collection-poster img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.collection-posters.count-1 {
    grid-template-columns: 1fr;
}

.collection-posters.count-2 {
    grid-template-columns: repeat(2, 1fr);
}

.collection-posters.count-3 {
    grid-template-columns: repeat(3, 1fr);
}

.collection-no-poster {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #29435e;
    font-size: 3.5rem;
}

.collection-poster-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 40%,
        rgba(7, 11, 15, 0.9) 100%
    );
    pointer-events: none;
}

.collection-card-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 90px;
    padding: 17px 19px;
}

.collection-card-content h2 {
    margin: 0;
    color: #f0f4f8;
    font-size: 1.15rem;
}

.collection-card-content p {
    margin: 7px 0 0;
    color: #8193a4;
    font-size: 0.8rem;
}

.collection-card-content p span {
    margin: 0 4px;
    color: #48617a;
}

.collection-open {
    display: flex;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #101f2f;
    color: #6ba9f0;
    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.collection-card:hover .collection-open {
    background: #17304a;
    transform: translateX(3px);
}

.collection-detail-header {
    margin-bottom: 28px;
}

.collection-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
    color: #7fa5ca;
    font-size: 0.85rem;
    text-decoration: none;
}

.collection-back:hover {
    color: #69a9f3;
}

.collection-detail-stats {
    display: flex;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid #263442;
    border-radius: 10px;
    background: #0d141b;
}

.collection-detail-stats > div {
    min-width: 115px;
    padding: 13px 18px;
    text-align: center;
}

.collection-detail-stats > div + div {
    border-left: 1px solid #263442;
}

.collection-detail-stats strong {
    display: block;
    color: #f0f5fa;
    font-size: 1.2rem;
}

.collection-detail-stats span {
    display: block;
    margin-top: 3px;
    color: #76899b;
    font-size: 0.72rem;
}

.collection-films-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.collection-films-toolbar h2 {
    margin: 0;
    color: #edf3f8;
    font-size: 1.3rem;
}

.collection-films-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 18px;
}

.collection-film-card {
    min-width: 0;
}

.collection-film-poster {
    position: relative;
    overflow: hidden;
    aspect-ratio: 2 / 3;
    border: 1px solid #263442;
    border-radius: 10px;
    background: #0c1218;
}

.collection-film-poster img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.collection-film-card:hover .collection-film-poster img {
    transform: scale(1.035);
}

.poster-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #29435e;
    font-size: 2.5rem;
}

.watch-count {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    background: rgba(5, 9, 13, 0.86);
    color: #dce8f3;
    font-size: 0.72rem;
    backdrop-filter: blur(5px);
}

.watch-count i {
    color: #6aa9f1;
}

.collection-film-info {
    padding: 10px 2px 0;
}

.collection-film-info h3 {
    margin: 0;
    overflow: hidden;
    color: #e9eff5;
    font-size: 0.9rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.collection-film-meta {
    display: flex;
    gap: 7px;
    margin-top: 5px;
    color: #73879a;
    font-size: 0.73rem;
}

.collection-film-meta span + span::before {
    content: "·";
    margin-right: 7px;
    color: #43586d;
}

.collection-empty,
.collection-empty-search {
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #718497;
    text-align: center;
}

.collection-empty {
    display: flex;
    min-height: 350px;
}

.collection-empty-search {
    display: none;
    min-height: 200px;
}

.collection-empty i,
.collection-empty-search i {
    margin-bottom: 12px;
    color: #31506e;
    font-size: 2.5rem;
}

.collection-empty h2 {
    margin: 0;
    color: #dce5ed;
}

.collection-empty p,
.collection-empty-search p {
    margin: 8px 0 0;
}

@media (max-width: 1200px) {
    .collections-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .collection-films-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .collection-films-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .collection-detail-title {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 700px) {
    .collections-page {
        width: min(100% - 24px, 1500px);
        padding-top: 24px;
    }

    .collections-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 15px;
    }

    .collections-grid {
        grid-template-columns: 1fr;
    }

    .collection-posters {
        height: 190px;
    }

    .collection-films-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .collection-search {
        width: 100%;
    }

    .collection-films-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }

    .collection-detail-stats {
        width: 100%;
    }

    .collection-detail-stats > div {
        flex: 1;
        min-width: 0;
        padding: 11px 8px;
    }
}

@media (max-width: 480px) {
    .collection-films-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .collection-posters {
        height: 165px;
    }

    .collection-card-content {
        min-height: 80px;
        padding: 14px 15px;
    }

    .collection-detail-stats strong {
        font-size: 1rem;
    }

    .collection-detail-stats span {
        font-size: 0.65rem;
    }
}


.collection-films-tools {
    display: flex;
    align-items: center;
    gap: 12px;
}

.collection-sort {
    display: flex;
    align-items: center;
    gap: 7px;
}

.collection-sort select {
    height: 44px;
    padding: 0 38px 0 13px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    color: #c9d1d9;
    font-size: 13px;
    outline: none;
    cursor: pointer;
}

.collection-sort select:focus {
    border-color: #58a6ff;
}

.sort-direction {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    color: #8b949e;
    font-size: 15px;
    cursor: pointer;
    transition:
        color 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease;
}

.sort-direction:hover {
    background: #161b22;
    border-color: #58a6ff;
    color: #58a6ff;
}

@media (max-width: 800px) {
    .collection-films-tools {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .collection-sort {
        width: 100%;
    }

    .collection-sort select {
        flex: 1;
        min-width: 0;
    }
}