:host {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: 100%;
    width: 100%;
}

.recent-container {
    padding: 20px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;

    .header-actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }
}

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.item-card {
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;

    &:hover {
        transform: scale(1.02);
    }

    .remove-button {
        position: absolute;
        top: 5px;
        right: 5px;
        z-index: 1;
        background: rgba(0, 0, 0, 0.5);
        
        &:hover {
            background: rgba(0, 0, 0, 0.7);
        }

        mat-icon {
            color: white;
        }
    }
}

.poster {
    width: 100%;
    height: 280px;
    object-fit: cover;
}

.item-info {
    padding: 16px;

    h3 {
        margin: 0;
        font-size: 16px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    p {
        margin: 8px 0;
    }

    .viewed-at {
        font-size: 12px;
    }
}

.no-items {
    text-align: center;
    padding: 40px;

    mat-icon {
        font-size: 48px;
        width: 48px;
        height: 48px;
        margin-bottom: 16px;
    }
}

.type-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    text-transform: uppercase;
    &.live {
        background: #e53935;
        color: white;
    }
    &.movie {
        background: #1e88e5;
        color: white;
    }
    &.series {
        background: #43a047;
        color: white;
    }
}

.playlist-section {
    .section-title {
        margin: 0 0 1.5rem;
        font-size: 1.2rem;
        font-weight: normal;
        color: var(--text-color-secondary);
        padding: 0 8px;
    }
}

.playlist-group {
    margin-bottom: 2rem;

    .playlist-title {
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 0 0 1rem 0;
        padding: 8px;
        background: rgba(0, 0, 0, 0.05);
        border-radius: 4px;
        font-size: 1.1rem;
        font-weight: 500;

        mat-icon {
            opacity: 0.7;
        }

        .item-count {
            margin-left: auto;
            font-size: 0.9rem;
            opacity: 0.7;
        }
    }
}

:host-context(.global-search-overlay) {
    .recent-container {
        background: var(--background);
        height: 100vh;
    }

    .playlist-group {
        .playlist-title {
            background: var(--surface);
        }
    }
}