/**
 * ===============================================
 *     Styles Multi Image Uploader
 * ===============================================
 */

.multi-image-uploader {
    width: 100%;
}

.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 0.75rem;
    min-height: 180px;
    padding: 1rem;
    border: 2px dashed #e5e7eb;
    border-radius: 0.5rem;
    background: #f9fafb;
    transition: all 0.3s ease;
}

.image-preview-grid.drag-over {
    border-color: #3b82f6;
    background: #eff6ff;
}

.image-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    background: white;
    transition: all 0.3s ease;
}

.image-preview-item.primary {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-preview-item:hover .image-overlay {
    opacity: 1;
}

.primary-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: #f59e0b;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.btn-remove {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: #ef4444;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    line-height: 1;
    transition: all 0.2s ease;
}

.btn-remove:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.btn-move-left,
.btn-move-right {
    background: #3b82f6;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 1rem;
    margin: 0.25rem;
    transition: all 0.2s ease;
}

.btn-move-left:hover,
.btn-move-right:hover {
    background: #2563eb;
    transform: scale(1.1);
}

.uploading-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(59, 130, 246, 0.9);
    color: white;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.image-add-button {
    aspect-ratio: 1;
    border: 2px dashed #9ca3af;
    border-radius: 0.5rem;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6b7280;
}

.image-add-button:hover {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #3b82f6;
    transform: scale(1.02);
}

.image-add-button svg {
    margin-bottom: 0.5rem;
}

.image-add-button span {
    font-weight: 600;
    font-size: 0.875rem;
}

.image-add-button small {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.25rem;
}

.upload-info {
    text-align: center;
    color: #6b7280;
}

.upload-info small {
    font-size: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
    .image-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .btn-remove {
        width: 26px;
        height: 26px;
        font-size: 1rem;
    }

    .btn-move-left,
    .btn-move-right {
        width: 28px;
        height: 28px;
        font-size: 0.875rem;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.image-preview-item {
    animation: fadeIn 0.3s ease;
}
