/* Image Editor Modal Styles */
.image-editor-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
}

.image-editor-content {
    background-color: #fff;
    margin: 2% auto;
    padding: 0;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.image-editor-loading {
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
}

.image-editor-loading-content {
    text-align: center;
    color: #fff;
    font-size: 1.2rem;
}

.image-editor-loading-dots {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.image-editor-loading-dots span {
    width: 0.75rem;
    height: 0.75rem;
    background: #fff;
    border-radius: 50%;
    display: inline-block;
    animation: image-editor-bounce 0.8s infinite;
}

.image-editor-loading-dots span:nth-child(2) {
    animation-delay: 0.1s;
}

.image-editor-loading-dots span:nth-child(3) {
    animation-delay: 0.2s;
}

@keyframes image-editor-bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.3;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.image-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid #eee;
}

.image-editor-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
}

.image-editor-close {
    color: #aaa;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.image-editor-close:hover,
.image-editor-close:focus {
    color: #000;
}

.image-editor-body {
    padding: 1.5rem;
    flex: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.image-editor-message {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-weight: 500;
    display: none;
}

.image-editor-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.image-editor-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.image-editor-preview {
    width: 100%;
    max-height: 60vh;
    overflow: hidden;
    background: #f5f5f5;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-editor-preview img {
    max-width: 100%;
    max-height: 60vh;
    display: block;
}

.image-editor-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-rotate,
.btn-crop,
.btn-reset,
.btn-reset-original {
    padding: 0.75rem 1.5rem;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.3s;
}

.btn-rotate:hover {
    background: #2980b9;
}

.btn-crop {
    background: #27ae60;
}

.btn-crop:hover {
    background: #229954;
}

.btn-reset {
    background: #95a5a6;
}

.btn-reset:hover {
    background: #7f8c8d;
}

.btn-reset-original {
    background: #e74c3c;
}

.btn-reset-original:hover {
    background: #c0392b;
}

.btn-reset:hover {
    background: #7f8c8d;
}

.image-editor-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 2px solid #eee;
}

.btn-close,
.btn-cancel,
.btn-apply {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-close {
    background: #95a5a6;
    color: white;
}

.btn-close:hover {
    background: #7f8c8d;
}

.btn-cancel {
    background: #95a5a6;
    color: white;
}

.btn-cancel:hover {
    background: #7f8c8d;
}

.btn-apply {
    background: #27ae60;
    color: white;
}

.btn-apply:hover {
    background: #229954;
}

/* Cropper.js overrides */
.cropper-container {
    direction: ltr;
}

.cropper-modal {
    background-color: rgba(0, 0, 0, 0.5);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .image-editor-content {
        max-width: 95%;
        margin: 5% auto;
        max-height: 95vh;
    }
    
    .image-editor-body {
        padding: 1rem;
    }
    
    .image-editor-preview {
        max-height: 50vh;
    }
    
    .image-editor-controls {
        flex-direction: column;
    }
    
    .btn-rotate,
    .btn-reset {
        width: 100%;
        justify-content: center;
    }
    
    .image-editor-footer {
        flex-direction: column;
    }
    
    .btn-close,
    .btn-cancel,
    .btn-apply {
        width: 100%;
    }
}

