.custom-cropper-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.form-field {
    margin-bottom: 20px;
}

.form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.image-slot {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    border: 2px dashed #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: #f9f9f9;
}

.image-slot.featured {
    grid-column: 1 / -1;
}

.image-slot.additional {
    padding-bottom: 100%; /* 1:1 aspect ratio */
}

.image-slot-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.upload-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    color: #ddd;
    cursor: pointer;
    z-index: 2;
}

.image-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 3;
}

.image-slot.has-image .image-input {
    pointer-events: none;
    z-index: -1;
}

.image-preview {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f9f9f9;
}

.preview-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preview-container img {
    max-width: none;
    max-height: none;
}

/* Cropper.js core styles */
.cropper-container {
    direction: ltr;
    font-size: 0;
    line-height: 0;
    position: relative;
    touch-action: none;
    user-select: none;
}

.cropper-wrap-box,
.cropper-canvas,
.cropper-drag-box,
.cropper-crop-box,
.cropper-modal {
    bottom: 0;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.cropper-wrap-box {
    overflow: hidden;
}

.cropper-drag-box {
    background-color: #fff;
    opacity: 0;
}

.cropper-modal {
    background-color: #000;
    opacity: 0.5;
}

.cropper-view-box {
    display: block;
    height: 100%;
    outline: 1px solid #39f;
    outline-color: rgba(51, 153, 255, 0.75);
    overflow: hidden;
    width: 100%;
}

.cropper-dashed {
    border: 0 dashed #eee;
    display: block;
    opacity: 0.5;
    position: absolute;
}

.cropper-dashed.dashed-h {
    border-bottom-width: 1px;
    border-top-width: 1px;
    height: calc(100% / 3);
    left: 0;
    top: calc(100% / 3);
    width: 100%;
}

.cropper-dashed.dashed-v {
    border-left-width: 1px;
    border-right-width: 1px;
    height: 100%;
    left: calc(100% / 3);
    top: 0;
    width: calc(100% / 3);
}

.cropper-center {
    display: block;
    height: 0;
    left: 50%;
    opacity: 0.75;
    position: absolute;
    top: 50%;
    width: 0;
}

.cropper-center::before,
.cropper-center::after {
    background-color: #eee;
    content: ' ';
    display: block;
    position: absolute;
}

.cropper-center::before {
    height: 1px;
    left: -3px;
    top: 0;
    width: 7px;
}

.cropper-center::after {
    height: 7px;
    left: 0;
    top: -3px;
    width: 1px;
}

.cropper-face,
.cropper-line,
.cropper-point {
    display: block;
    height: 100%;
    opacity: 0.1;
    position: absolute;
    width: 100%;
}

.cropper-face {
    background-color: #fff;
    left: 0;
    top: 0;
}

.cropper-line {
    background-color: #39f;
}

.cropper-line.line-e {
    cursor: ew-resize;
    right: -3px;
    top: 0;
    width: 5px;
}

.cropper-line.line-n {
    cursor: ns-resize;
    height: 5px;
    left: 0;
    top: -3px;
}

.cropper-line.line-w {
    cursor: ew-resize;
    left: -3px;
    top: 0;
    width: 5px;
}

.cropper-line.line-s {
    bottom: -3px;
    cursor: ns-resize;
    height: 5px;
    left: 0;
}

.cropper-point {
    background-color: #39f;
    height: 5px;
    opacity: 0.75;
    width: 5px;
}

.cropper-point.point-e {
    cursor: ew-resize;
    margin-top: -3px;
    right: -3px;
    top: 50%;
}

.cropper-point.point-n {
    cursor: ns-resize;
    left: 50%;
    margin-left: -3px;
    top: -3px;
}

.cropper-point.point-w {
    cursor: ew-resize;
    left: -3px;
    margin-top: -3px;
    top: 50%;
}

.cropper-point.point-s {
    bottom: -3px;
    cursor: s-resize;
    left: 50%;
    margin-left: -3px;
}

.cropper-point.point-ne {
    cursor: nesw-resize;
    right: -3px;
    top: -3px;
}

.cropper-point.point-nw {
    cursor: nwse-resize;
    left: -3px;
    top: -3px;
}

.cropper-point.point-sw {
    bottom: -3px;
    cursor: nesw-resize;
    left: -3px;
}

.cropper-point.point-se {
    bottom: -3px;
    cursor: nwse-resize;
    height: 20px;
    opacity: 1;
    right: -3px;
    width: 20px;
}

.cropper-point.point-se::before {
    background-color: #39f;
    bottom: -50%;
    content: ' ';
    display: block;
    height: 200%;
    opacity: 0;
    position: absolute;
    right: -50%;
    width: 200%;
}

/* Cropper Controls */
.cropper-controls {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    gap: 5px;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.control-button {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    color: #333;
    margin: 0 2px;
}

.control-button:hover {
    background: #f5f5f5;
}

.control-button:active {
    background: #e5e5e5;
}

/* Show elements when image is loaded */
.image-slot.has-image .cropper-container,
.image-slot.has-image .cropper-wrap-box,
.image-slot.has-image .cropper-canvas,
.image-slot.has-image .cropper-drag-box,
.image-slot.has-image .cropper-crop-box,
.image-slot.has-image .cropper-modal {
    display: block;
}

.image-slot.has-image .cropper-controls {
    display: flex;
}

.image-slot.has-image .upload-icon {
    display: none;
}

/* RTL */
.cropper-container[dir="rtl"] .cropper-crop-box {
    direction: rtl;
}

/* Status messages */
.status-message {
    margin: 10px 0;
    padding: 10px;
    border-radius: 4px;
}

.status-message.error {
    background: #ffe6e6;
    color: #d63031;
}

.status-message.success {
    background: #e6ffe6;
    color: #27ae60;
}

/* Submit button */
.submit-field {
    text-align: center;
    margin-top: 30px;
}

.button-primary {
    background: #0073aa;
    border-color: #006799;
    color: #fff;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    transition: background-color 0.2s ease;
}

.button-primary:hover {
    background: #006799;
}

.button-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Instructions */
.cropper-instructions {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.cropper-instructions h4 {
    margin-top: 0;
    margin-bottom: 10px;
}

.cropper-instructions ul {
    margin: 0;
    padding-left: 20px;
}

.cropper-instructions li {
    margin-bottom: 5px;
}

/* Ensure drag box is clickable */
.cropper-drag-box {
    pointer-events: all;
}

/* Make crop box and handles interactive */
.cropper-crop-box {
    pointer-events: all;
}

.cropper-face {
    pointer-events: all;
    cursor: move;
}

/* Make view box visible but not interfering */
.cropper-view-box {
    pointer-events: none;
}