/* Error Message */
.sj-error-message-sj12 {
    position: relative;
    z-index: 10;
}

.sj-error-container-sj12 {
    margin: 1rem;
}

.sj-error-container-sj12 .error-message {
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 1rem;
    color: #dc2626;
    font-size: 0.9rem;
}

.sj-error-container-sj12 .success-message {
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    padding: 1rem;
    color: #065f46;
    font-size: 0.9rem;
}

.sj-upload-help-sj12 {
    margin-top: 0.5rem;
    opacity: 0.7;
}

.sj-upload-help-sj12 small {
    color: #64748b;
    font-size: 0.8rem;
}

.sj-download-info-sj12 {
    margin-top: 0.5rem;
    text-align: center;
}

.sj-download-info-sj12 small {
    color: #64748b;
    font-size: 0.8rem;
}

/* Canvas focus styles for accessibility */
#sjCropCanvas:focus,
#sjCropPreview:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* SJ Image Crop Tool Styles */
.sj-crop-container-sj12 {
    max-width: 600px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.sj-crop-header-sj12 {
    text-align: center;
    padding: 2rem 2rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.sj-crop-header-sj12 h3 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.sj-crop-header-sj12 p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

/* Upload Zone */
.sj-crop-upload-zone-sj12 {
    padding: 3rem 2rem;
    text-align: center;
    border: 2px dashed #e2e8f0;
    margin: 2rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: #f8fafc;
    cursor: pointer;
    position: relative;
}

.sj-crop-upload-zone-sj12:hover,
.sj-crop-upload-zone-sj12.sj-drag-over-sj12 {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateY(-2px);
}

.sj-upload-content-sj12 {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.sj-upload-icon-sj12 {
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.sj-crop-upload-zone-sj12:hover .sj-upload-icon-sj12 {
    opacity: 0.8;
}

.sj-upload-content-sj12 h4 {
    margin: 0;
    color: #1e293b;
    font-size: 1.1rem;
    font-weight: 500;
}

.sj-upload-content-sj12 p {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
}

.sj-btn-upload-sj12 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease;
    font-size: 0.9rem;
}

.sj-btn-upload-sj12:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Crop Editor */
.sj-crop-editor-sj12 {
    padding: 2rem;
}

.sj-crop-tools-sj12 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.sj-tools-group-sj12 {
    display: flex;
    gap: 0.5rem;
}

.sj-btn-tool-sj12 {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.2rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sj-btn-tool-sj12:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

.sj-btn-primary-sj12 {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease;
    font-size: 0.9rem;
}

.sj-btn-primary-sj12:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.sj-btn-secondary-sj12 {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.sj-btn-secondary-sj12:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
}

/* Crop Editor Layout */
.sj-crop-main-area-sj12 {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
}

.sj-crop-preview-panel-sj12 {
    text-align: center;
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    min-width: 160px;
}

.sj-crop-preview-panel-sj12 h4 {
    margin: 0 0 1rem;
    color: #1e293b;
    font-size: 0.9rem;
    font-weight: 600;
}

.sj-crop-preview-panel-sj12 canvas {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: #ffffff;
}

.sj-crop-preview-panel-sj12 p {
    margin: 0.5rem 0 0;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Canvas Container */
.sj-crop-canvas-container-sj12 {
    position: relative;
    width: 400px;
    height: 400px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.sj-crop-canvas-container-sj12 canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
}

.sj-crop-overlay-sj12 {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.sj-crop-frame-sj12 {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 8px;
}

.sj-crop-instructions-sj12 {
    text-align: center;
    margin-top: 1rem;
    color: #64748b;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Result Section */
.sj-crop-result-sj12 {
    padding: 2rem;
    text-align: center;
}

.sj-result-content-sj12 h4 {
    color: #059669;
    margin: 0 0 1.5rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.sj-result-preview-sj12 {
    width: 200px;
    height: 200px;
    margin: 0 auto 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.sj-result-preview-sj12 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sj-result-actions-sj12 {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Loading */
.sj-crop-loading-sj12 {
    padding: 3rem;
    text-align: center;
}

.sj-loading-spinner-sj12 {
    width: 40px;
    height: 40px;
    margin: 0 auto 1rem;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: sj-spin-sj12 1s linear infinite;
}

@keyframes sj-spin-sj12 {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.sj-crop-loading-sj12 p {
    color: #64748b;
    margin: 0;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 640px) {
    .sj-crop-container-sj12 {
        margin: 0 1rem;
        border-radius: 12px;
    }
    
    .sj-crop-header-sj12 {
        padding: 1.5rem 1rem 0.5rem;
    }
    
    .sj-crop-upload-zone-sj12 {
        margin: 1rem;
        padding: 2rem 1rem;
    }
    
    .sj-crop-editor-sj12 {
        padding: 1rem;
    }
    
    .sj-crop-tools-sj12 {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sj-tools-group-sj12 {
        justify-content: center;
    }
    
    .sj-crop-main-area-sj12 {
        flex-direction: column;
        align-items: center;
    }
    
    .sj-crop-preview-panel-sj12 {
        order: -1;
        margin-bottom: 1rem;
    }
    
    .sj-crop-canvas-container-sj12 {
        width: 300px;
        height: 300px;
    }
    
    .sj-result-actions-sj12 {
        flex-direction: column;
        align-items: center;
    }
    
    .sj-btn-primary-sj12,
    .sj-btn-secondary-sj12 {
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .sj-crop-canvas-container-sj12 {
        width: 250px;
        height: 250px;
    }
    
    .sj-crop-header-sj12 h3 {
        font-size: 1.2rem;
    }
    
    .sj-upload-content-sj12 h4 {
        font-size: 1rem;
    }
    
    .sj-result-preview-sj12 {
        width: 150px;
        height: 150px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .sj-crop-upload-zone-sj12 {
        border-color: #000;
        background: #fff;
    }
    
    .sj-btn-primary-sj12,
    .sj-btn-upload-sj12 {
        background: #000;
        color: #fff;
    }
    
    .sj-btn-secondary-sj12 {
        background: #fff;
        color: #000;
        border-color: #000;
    }
}

/* Focus styles for accessibility */
.sj-btn-upload-sj12:focus,
.sj-btn-primary-sj12:focus,
.sj-btn-secondary-sj12:focus,
.sj-btn-tool-sj12:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.sj-crop-upload-zone-sj12:focus-within {
    border-color: #667eea;
    background: #f0f4ff;
}