/* ============================================
   IMAGE CROPPER MODAL — Circular Crop
   ============================================ */

/* Overlay */
.cropper-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.cropper-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal */
.cropper-modal {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2rem;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.cropper-overlay.active .cropper-modal {
    transform: scale(1) translateY(0);
}

/* Header */
.cropper-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.cropper-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cropper-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.cropper-close:hover {
    background: rgba(245, 87, 108, 0.2);
    border-color: rgba(245, 87, 108, 0.4);
    color: #f5576c;
}

/* Canvas Area */
.cropper-canvas-wrapper {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(102, 126, 234, 0.5);
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.15);
    cursor: grab;
    background: rgba(0, 0, 0, 0.3);
    touch-action: none;
}

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

.cropper-canvas-wrapper canvas {
    display: block;
}

/* Guide overlay - shows the circle border */
.cropper-guide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    pointer-events: none;
    box-shadow: inset 0 0 0 2px rgba(102, 126, 234, 0.6);
}

/* Controls */
.cropper-controls {
    margin-bottom: 1.5rem;
}

.cropper-zoom-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cropper-zoom-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    min-width: 60px;
}

.cropper-zoom-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

.cropper-zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.cropper-zoom-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.cropper-zoom-value {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    min-width: 35px;
    text-align: right;
}

/* Buttons */
.cropper-buttons {
    display: flex;
    gap: 0.75rem;
}

.cropper-btn {
    flex: 1;
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.cropper-btn-cancel {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
}

.cropper-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.12);
}

.cropper-btn-apply {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.cropper-btn-apply:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Tip Text */
.cropper-tip {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Preview Badge (shown after cropping near the file input) */
.cropper-preview-badge {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
}

.cropper-preview-img-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid #667eea;
    padding: 2px;
    background: #fff;
    flex-shrink: 0;
}

.cropper-preview-badge img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.cropper-preview-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.cropper-preview-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cropper-preview-status {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
}

.cropper-preview-badge .cropper-preview-remove {
    color: #f5576c;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem;
    transition: opacity 0.2s;
}

.cropper-preview-badge .cropper-preview-remove:hover {
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 520px) {
    .cropper-modal {
        padding: 1.25rem;
        border-radius: 16px;
    }

    .cropper-canvas-wrapper {
        width: 240px;
        height: 240px;
    }

    .cropper-title {
        font-size: 1rem;
    }

    .cropper-btn {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
}
