/* Cropper Modal Styles */
#cropper-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

#cropper-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.cropper-container-inner {
    background: #fff;
    width: 100%;
    max-width: 600px;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.25s ease;
}

#cropper-modal.active .cropper-container-inner {
    transform: scale(1);
}

.cropper-modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cropper-modal-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.cropper-modal-body {
    padding: 1.5rem;
    position: relative;
    max-height: 70vh;
    overflow: hidden;
}

.cropper-image-wrapper {
    width: 100%;
    background: #f8fafc;
    border-radius: 1rem;
    overflow: hidden;
    min-height: 300px;
    max-height: 60vh;
}

/* Ensure the cropper target image is visible and properly sized */
#cropper-target-image {
    display: block;
    max-width: 100%;
    width: 100%;
}

.cropper-modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    background: #f8fafc;
}

.cropper-btn {
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.cropper-btn-cancel {
    background: #fff;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.cropper-btn-cancel:hover {
    background: #f1f5f9;
    color: #334155;
}

.cropper-btn-save {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.cropper-btn-save:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.3);
    transform: translateY(-1px);
}

/* Override Cropper.js defaults to ensure proper rendering inside our modal */
.cropper-container {
    border-radius: 0.75rem;
}

@media (max-width: 640px) {
    .cropper-container-inner {
        max-width: 100%;
        border-radius: 1rem;
    }
    .cropper-modal-body {
        padding: 1rem;
    }
    .cropper-image-wrapper {
        min-height: 200px;
    }
}
