
/* Modal */
.admin-media-modal {
    width: 90vw;
    max-width: 1100px;
    max-height: 90vh;
}

.admin-media-modal .modal-card-body {
    overflow-y: auto;
    min-height: 0;
}

/* Media grid */
.admin-media-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin-top: 15px;
}

/* Media item */
.admin-media-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    padding: 8px;
    border: 1px solid #dbdbdb;
    border-radius: 5px;
    background-color: #fff;
    cursor: pointer;
}

.admin-media-item:hover {
    border-color: #f14668;
    background-color: #fff5f7;
}

.admin-media-item.is-selected {
    border-color: #f14668;
    background-color: #fff5f7;
}

/* Image preview */
.admin-media-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100px;
    overflow: hidden;
}

.admin-media-preview img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Filename */
.admin-media-name {
    width: 100%;
    margin-top: 6px;
    font-size: 11px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Easytable image column */
.admin-media-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    cursor: pointer;
}

.admin-media-thumbnail,
.admin-media-cell > .icon {
    width: 48px;
    height: 40px;
    flex-shrink: 0;
    margin: 0 auto;
    border-radius: 3px;
}

.admin-media-thumbnail {
    display: block;
    object-fit: contain;
}

.admin-media-cell > .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    font-size: 20px;
}

.admin-media-cell:hover {
    background-color: #fff5f7;
}

/* Tablet */
@media screen and (max-width: 1023px) {
    .admin-media-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Mobile */
@media screen and (max-width: 767px) {
    .admin-media-modal {
        width: calc(100vw - 20px);
        max-height: calc(100dvh - 20px);
        margin: 0 auto;
    }

    .admin-media-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .admin-media-preview {
        height: 90px;
    }

    .admin-media-modal .modal-card-foot {
        flex-wrap: wrap;
        gap: 8px;
    }
}
