@use '@angular/material' as mat;

:host {
    display: flex;
    flex-direction: row;
    overflow: hidden;
    height: 100%;
    width: 100%;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; // Important for proper flex behavior
}

.content-header {
    text-transform: capitalize;
    padding: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);

    h2 {
        margin: 0;
        font-size: 1.2rem;
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: 10px;
    }
}

.scrollable-content {
    flex: 1;
    overflow-y: auto;
}

.favorites-container {
    padding: 20px;
}

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

.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    padding: 16px;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
}

.item-card {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;

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

.item-image {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.favorite-button {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1;
}

mat-card-content {
    padding: 12px;
    flex-grow: 1;

    h3 {
        margin: 0;
        font-weight: normal;
        font-size: 14px;
        line-height: 1.2;
        max-height: 2.4em;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        white-space: normal;
    }
}

.added-date {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin: 4px 0 0 0;
}

.no-items {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;

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

    p {
        font-size: 1.1rem;
        margin: 0;
    }
}

.sidebar-header {
    display: flex;
    flex-direction: row;
    align-items: center;

    button {
        @include mat.form-field-density(-5);
    }
}
