:host {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow-x: hidden;
    background: transparent;
}

#date-navigator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px 10px;
    gap: 8px;

    button {
        border-radius: 10px;
        opacity: 0.84;
        transition:
            opacity 0.15s ease,
            background-color 0.15s ease,
            transform 0.15s ease;

        &:hover:not([disabled]) {
            opacity: 1;
            background: color-mix(in srgb, currentColor 10%, transparent);
            transform: translateY(-1px);
        }

        &[disabled] {
            opacity: 0.3;
        }
    }
}

.selected-date {
    flex: 1;
    text-align: center;
    font-size: 0.83rem;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: 0.01em;
    opacity: 0.8;
}

#program-list {
    flex: 1;
    overflow-y: scroll;
    overflow-x: hidden;
    padding: 4px 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.program-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.18s ease,
        color 0.15s ease;
    cursor: default;

    & + .program-item {
        position: relative;

        &::before {
            content: '';
            position: absolute;
            top: 0;
            left: 12px;
            right: 12px;
            height: 1px;
            background: var(--app-separator);
            opacity: 0.5;
        }
    }

    &.current-program {
        background: color-mix(
            in srgb,
            var(--app-selection-color) 6%,
            transparent
        );

        &::before,
        & + .program-item::before {
            display: none;
        }
    }

    &.clickable {
        cursor: pointer;

        &:hover {
            background: color-mix(in srgb, currentColor 6%, transparent);

            &::before,
            & + .program-item::before {
                display: none;
            }
        }

        &.current-program:hover {
            background: color-mix(
                in srgb,
                var(--app-selection-color) 10%,
                transparent
            );
        }
    }

    &.active {
        background: linear-gradient(
            135deg,
            var(--app-selection-surface-strong),
            var(--app-selection-surface)
        );
        border-color: var(--app-selection-border);
        box-shadow:
            inset 0 0 0 1px var(--app-selection-border),
            0 12px 20px -18px var(--app-selection-glow);

        .program-title {
            color: var(--app-selection-color);
        }

        &::before,
        & + .program-item::before {
            display: none;
        }
    }
}

.program-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.program-title {
    font-size: 0.94rem;
    line-height: 1.3;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-wrap: balance;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.epg-item__description {
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--app-body-color);
    text-wrap: pretty;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.program-progress {
    padding-top: 2px;
}

.epg-progress-track {
    position: relative;
    width: 100%;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background-color: rgba(127, 127, 127, 0.28);
    background-image: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.12),
        rgba(255, 255, 255, 0)
    );
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.12),
        inset 0 1px 1px rgba(0, 0, 0, 0.18);
}

.epg-progress-fill {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    border-radius: inherit;
    background-color: var(--app-selection-color);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.18),
        rgba(255, 255, 255, 0)
    );
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--app-selection-border) 82%, transparent),
        0 0 10px -2px var(--app-selection-glow);
    transition: width 0.35s ease;
}

.epg-empty-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);

    .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-bottom: 8px;
        text-wrap: balance;
    }

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