.aum-gallery-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin: 15px 0;
    padding: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-height: 120px;
}

.aum-gallery-item {
    position: relative;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.aum-gallery-item:hover {
    border-color: #007cba;
}

.gallery-item-inner {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    height: 0;
    overflow: hidden;
}

.gallery-item-inner img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item-actions {
    position: absolute;
    top: 5px;
    right: 5px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.aum-gallery-item:hover .gallery-item-actions {
    opacity: 1;
}

.gallery-view,
.gallery-remove {
    width: 24px;
    height: 24px;
    border-radius: 3px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 2px;
    text-decoration: none;
}

.gallery-view {
    background: #007cba;
    color: white;
}

.gallery-remove {
    background: #dc3232;
    color: white;
}

.gallery-view:hover {
    background: #005a87;
    color: white;
}

.gallery-remove:hover {
    background: #b32d2d;
    color: white;
}

.gallery-item-order {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.aum-video-preview {
    margin: 15px 0;
    max-width: 400px;
}

.aum-video-preview-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.video-preview-inner {
    display: flex;
    padding: 10px;
    align-items: center;
}

.video-thumbnail {
    width: 100px;
    height: 60px;
    object-fit: cover;
    border-radius: 3px;
    margin-right: 15px;
}

.video-info {
    flex: 1;
}

.video-title {
    font-weight: 500;
    margin-bottom: 8px;
    word-break: break-word;
}

.video-actions {
    display: flex;
    gap: 5px;
}

.aum-gallery-preview.ui-sortable {
    min-height: 120px;
}

.aum-gallery-preview.ui-sortable .aum-gallery-item {
    cursor: move;
}

.aum-gallery-preview.ui-sortable .aum-gallery-item.ui-sortable-helper {
    transform: rotate(3deg);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.aum-gallery-preview:empty::after {
    content: "No images selected";
    color: #999;
    font-style: italic;
    display: block;
    text-align: center;
    padding: 20px;
}

.aum-video-preview:empty::after {
    content: "No video selected";
    color: #999;
    font-style: italic;
    display: block;
    text-align: center;
    padding: 20px;
}

.button.button-small {
    padding: 2px 8px;
    font-size: 12px;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .aum-gallery-preview {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }
    
    .aum-template-options {
        flex-direction: column;
        gap: 10px;
    }
}