:host {
    display: block;
    height: 100%;
    width: 100%;
    overflow: hidden;
    container-type: inline-size;
    border-right: 1px solid var(--app-separator);
}

.channels-list {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    width: 100%;
}

.scroll-viewport-portals {
    height: 100%;
    width: 100%;
    padding: 4px 8px 12px;
    box-sizing: border-box;

    ::ng-deep .cdk-virtual-scroll-content-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        contain: layout style;
    }
}

.search-panel {
    padding: 10px 12px;
    flex-shrink: 0;
    height: 56px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    background: var(--app-widget-header-bg, var(--mat-sys-surface-container-high));
    border-bottom: 1px solid var(--app-separator);
    app-region: drag;
}

.search-field {
    flex: 1;
    width: 100%;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(127, 127, 127, 0.22);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0)),
        rgba(127, 127, 127, 0.08);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    box-sizing: border-box;
    cursor: text;
    transition:
        border-color 0.15s ease,
        background-color 0.15s ease,
        box-shadow 0.15s ease;

    &:focus-within {
        border-color: var(--app-selection-border);
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--app-selection-color) 16%, transparent);
    }

    mat-icon {
        width: 18px;
        height: 18px;
        font-size: 18px;
        opacity: 0.68;
        flex-shrink: 0;
    }

    input {
        flex: 1;
        border: none;
        outline: none;
        background: transparent;
        color: inherit;
        font: inherit;
        font-size: 0.875rem;

        &:disabled {
            cursor: not-allowed;
            opacity: 0.5;
        }

        &::placeholder {
            opacity: 0.62;
        }
    }
}

.empty-search-state {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
    color: var(--app-muted-color);
    animation: fade-in 0.3s ease-out;

    .empty-state-icon {
        width: 48px;
        height: 48px;
        font-size: 48px;
        opacity: 0.5;
        margin-bottom: 16px;
    }

    .empty-state-title {
        font-size: 1.05rem;
        font-weight: 520;
        letter-spacing: -0.01em;
        margin: 0 0 8px;
        text-wrap: balance;
    }

    .empty-state-hint {
        font-size: 0.85rem;
        margin: 0;
        opacity: 0.65;
        line-height: 1.4;
        max-width: 240px;
        text-wrap: pretty;
    }
}

.channels-loading-state {
    display: grid;
    gap: 14px;
    height: 100%;
    padding: 16px 12px 18px;
}

.channels-loading-state__copy {
    padding: 0 4px;
}

.channels-loading-state__title {
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--mat-sys-on-surface);
}

.channels-loading-state__list {
    min-height: 0;
    overflow: hidden;
}

@container (max-width: 350px) {
    .scroll-viewport-portals {
        padding-inline: 6px;
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
