/* ============================================
   GENZFLOW — IMAGE CROPPER MODAL
   ============================================ */

.crop-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.crop-modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.crop-modal {
    background: var(--card-bg, #1a1a24);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 90vw;
    max-width: 680px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: cropModalIn 0.25s ease;
}

@keyframes cropModalIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header */
.crop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.crop-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #f0f0f5);
}

.crop-close {
    background: none;
    border: none;
    color: var(--text-muted, #55556a);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.15s;
}

.crop-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary, #f0f0f5);
}

/* Body — cropper canvas */
.crop-body {
    flex: 1;
    overflow: hidden;
    background: #0e0e14;
    min-height: 300px;
    max-height: 55vh;
}

.crop-canvas-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crop-canvas-wrapper img {
    max-width: 100%;
    max-height: 55vh;
}

/* Cropper.js overrides for dark theme */
.cropper-modal {
    background: rgba(0, 0, 0, 0.4) !important;
}

.cropper-view-box {
    outline: 2px solid hsl(245, 70%, 62%) !important;
    outline-color: hsl(245, 70%, 62%) !important;
}

.cropper-line {
    background-color: hsl(245, 70%, 62%) !important;
}

.cropper-point {
    background-color: hsl(245, 70%, 62%) !important;
    width: 10px !important;
    height: 10px !important;
    border-radius: 50% !important;
}

.cropper-dashed {
    border-color: rgba(255, 255, 255, 0.3) !important;
}

/* Preset buttons */
.crop-presets {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-wrap: wrap;
}

.crop-preset-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary, #8a8a9a);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.crop-preset-btn:hover {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary, #f0f0f5);
    background: rgba(255, 255, 255, 0.05);
}

.crop-preset-btn.active {
    border-color: hsl(245, 70%, 62%);
    color: hsl(245, 70%, 62%);
    background: hsla(245, 70%, 62%, 0.1);
}

/* Actions footer */
.crop-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.crop-action-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Light mode */
[data-theme="light"] .crop-modal {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .crop-body {
    background: #f5f5f7;
}

[data-theme="light"] .crop-preset-btn {
    border-color: rgba(0, 0, 0, 0.12);
    color: #666;
}

[data-theme="light"] .crop-preset-btn:hover {
    border-color: rgba(0, 0, 0, 0.2);
    color: #111;
}

[data-theme="light"] .crop-preset-btn.active {
    border-color: hsl(245, 70%, 55%);
    color: hsl(245, 70%, 55%);
    background: hsla(245, 70%, 55%, 0.08);
}