/* ========================================
   Image Cropper Component Styles
   ======================================== */

.image-cropper-editor {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

/* Upload area when no image is loaded */
.cropper-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 220px;
    height: 220px;
    border: 2px dashed #b0b8c4;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8f9fb 0%, #eef1f5 100%);
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.cropper-upload-area:hover {
    border-color: #5b7fdb;
    background: linear-gradient(135deg, #f0f3ff 0%, #e6eaff 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(91, 127, 219, 0.15);
}

.cropper-upload-area.has-image {
    border-style: solid;
    border-color: #d0d6de;
    cursor: default;
    background: #f5f6f8;
}

.cropper-upload-area.has-image:hover {
    transform: none;
    box-shadow: none;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    color: #8c96a6;
    pointer-events: none;
}

.upload-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: transform 0.2s ease;
}

.cropper-upload-area:hover .upload-icon {
    transform: scale(1.08);
}

.upload-text {
    font-size: 13px;
    color: #6b7a8d;
    text-align: center;
    line-height: 1.4;
}

.upload-text strong {
    display: block;
    color: #4a5568;
}

.upload-text small {
    display: block;
    margin-top: 3px;
    font-size: 11px;
    color: #a0aab6;
}

/* File inputs */
.cropper-file-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 5;
}

.cropper-file-hidden {
    display: none !important;
}

/* Preview thumbnail */
.cropper-preview-container {
    position: relative;
    width: 200px;
    height: 200px;
}

.cropper-preview-img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.cropper-preview-actions {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    gap: 5px;
    z-index: 2;
}

.btn-cropper-action {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: rgba(30, 35, 45, 0.85);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.btn-cropper-action:hover {
    background: rgba(15, 20, 30, 0.95);
    transform: scale(1.08);
}

.btn-cropper-action.danger:hover {
    background: rgba(220, 53, 69, 0.95);
}

/* ---- Modal Overlay ---- */
.cropper-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: cropperFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cropperFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cropper-modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    width: 500px;
    max-width: 95vw;
    display: flex;
    flex-direction: column;
    animation: cropperSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cropperSlideUp {
    from {
        transform: translateY(20px) scale(0.97);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.cropper-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eef0f4;
}

.modal-title-group h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-subtitle {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-top: 3px;
}

.btn-close-modal {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.btn-close-modal:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Canvas area */
.cropper-canvas-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    background: #0f172a;
    user-select: none;
}

.cropper-canvas {
    cursor: grab;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.cropper-canvas:active {
    cursor: grabbing;
}

/* Controls */
.cropper-controls {
    padding: 14px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-label {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    min-width: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.zoom-controls {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 8px;
}

.btn-step {
    width: 26px;
    height: 26px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #334155;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    line-height: 1;
}

.btn-step:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.control-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: linear-gradient(to right, #cbd5e1, #6366f1);
    border-radius: 3px;
    outline: none;
}

.control-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
    transition: transform 0.15s ease;
}

.control-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.control-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
}

.control-value {
    font-size: 12px;
    font-weight: 600;
    color: #6366f1;
    min-width: 40px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.control-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.btn-control-sm {
    padding: 5px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #475569;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-control-sm:hover {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
}

.btn-control-sm.active {
    background: #e0e7ff;
    color: #4338ca;
    border-color: #818cf8;
}

/* Footer */
.cropper-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
}

.btn-cropper {
    padding: 8px 20px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.btn-cropper-cancel:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.btn-cropper-save {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.3);
}

.btn-cropper-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

.btn-cropper:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.cropper-error-banner {
    padding: 10px 20px;
    background: #fef2f2;
    border-top: 1px solid #fee2e2;
    border-bottom: 1px solid #fee2e2;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 500;
}
