/* WhatsApp-like Image Cropper Styles */
.image-cropper-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    flex-direction: column;
}

.image-cropper-modal.active {
    display: flex;
}

.cropper-header {
    background: linear-gradient(135deg, #075e54, #128c7e);
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.cropper-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.cropper-actions {
    display: flex;
    gap: 15px;
}

.cropper-btn {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.2s;
}

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

.cropper-btn.primary {
    background: #25d366;
    font-weight: 600;
}

.cropper-btn.primary:hover {
    background: #128c7e;
}

.cropper-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: #000;
}

.cropper-canvas {
    position: relative;
    max-width: 90%;
    max-height: 70vh;
}

.cropper-image {
    max-width: 100%;
    max-height: 100%;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

.cropper-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.cropper-crop-area {
    position: absolute;
    border: 2px solid white;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    cursor: move;
    touch-action: none;
}

.cropper-crop-area::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -20px;
    right: -20px;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
}

.cropper-crop-area::after {
    content: '';
    position: absolute;
    top: -20px;
    bottom: -20px;
    left: 50%;
    width: 1px;
    background: rgba(255, 255, 255, 0.3);
}

.cropper-handle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: white;
    border: 2px solid #25d366;
    border-radius: 50%;
}

.cropper-handle.nw { top: -6px; left: -6px; cursor: nw-resize; }
.cropper-handle.ne { top: -6px; right: -6px; cursor: ne-resize; }
.cropper-handle.sw { bottom: -6px; left: -6px; cursor: sw-resize; }
.cropper-handle.se { bottom: -6px; right: -6px; cursor: se-resize; }

.cropper-controls {
    background: rgba(0, 0, 0, 0.8);
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cropper-control-group {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.cropper-control-group label {
    font-size: 14px;
    opacity: 0.8;
}

.cropper-slider {
    width: 120px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
}

.cropper-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #25d366;
    border-radius: 50%;
    cursor: pointer;
}

.cropper-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #25d366;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.cropper-rotate-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.cropper-rotate-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Aspect ratio presets */
.cropper-presets {
    display: flex;
    gap: 8px;
}

.cropper-preset-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.cropper-preset-btn:hover,
.cropper-preset-btn.active {
    background: #25d366;
    border-color: #25d366;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .cropper-header {
        padding: 10px 15px;
    }
    
    .cropper-header h3 {
        font-size: 16px;
    }
    
    .cropper-controls {
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px;
    }
    
    .cropper-control-group {
        flex: 1;
        min-width: 150px;
    }
    
    .cropper-slider {
        width: 80px;
    }
    
    .cropper-presets {
        order: -1;
        width: 100%;
        justify-content: center;
    }
}

/* Loading spinner */
.cropper-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    z-index: 10;
}

.cropper-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: cropper-spin 1s linear infinite;
}

@keyframes cropper-spin {
    to { transform: rotate(360deg); }
}
