/* ===== IMAGE EDITOR STYLES ===== */
/* Dark theme matching editor.html */

/* Large modal (not fullscreen) - centered and responsive */
#imageEditorModal .modal-dialog {
    max-width: 800px;
    width: 85vw;
    max-height: 90vh;
    margin: auto;
    display: flex;
    align-items: center;
}

#imageEditorModal .modal-content {
    max-height: 90vh;
    height: auto;
    min-height: 400px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    background: #2B2E32;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
}

#imageEditorModal .modal-header {
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5em 0.75em;
    font-weight: 500;
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 0.5em;
    flex-shrink: 0;
}

#imageEditorModal .modal-title {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    font-size: 0.8em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

#imageEditorModal .modal-title i {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8em;
}

#imageEditorModal .modal-body {
    padding: 0;
    overflow: hidden;
    background: #2B2E32;
    color: rgba(255, 255, 255, 0.9);
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#imageEditorModal .modal-footer {
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5em 0.75em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

/* Main container */
.image-editor-container {
    display: flex;
    height: 100%;
    width: 100%;
}

/* Main editing area */
.image-editor-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #2B2E32;
    position: relative;
}

.image-editor-canvas {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: 
        linear-gradient(45deg, #1a1a1a 25%, transparent 25%),
        linear-gradient(-45deg, #1a1a1a 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #1a1a1a 75%),
        linear-gradient(-45deg, transparent 75%, #1a1a1a 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    position: relative;
    overflow: hidden;
    padding: 0.75em;
    box-sizing: border-box;
    min-height: 300px; /* Ensure minimum usable space */
    max-height: calc(90vh - 150px); /* Account for header and footer */
}

.editor-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Removed sidebar and toolbar styles - no longer needed */

/* Footer buttons - matching editor.html style */
.footer-left,
.footer-right {
    display: flex;
    gap: 0.5rem;
}

.footer-left .btn,
.footer-right .btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
    border-radius: 3px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8em;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 0;
    margin-right: 0.25rem;
}

.footer-left .btn:hover,
.footer-right .btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
}

.footer-right .btn {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.footer-right .btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Preview modal - dark theme, centered and responsive */
#previewModal .modal-dialog {
    max-width: 700px;
    width: 85vw;
    max-height: 90vh;
    margin: auto;
    display: flex;
    align-items: center;
}

#previewModal .modal-content {
    max-height: 90vh;
    height: auto;
    background: #2B2E32;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
}

#previewModal .modal-header {
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
}

#previewModal .modal-body {
    background: #2B2E32;
    color: rgba(255, 255, 255, 0.9);
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

#previewModal .modal-footer {
    flex-shrink: 0;
}

.preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 0.75rem 0;
}

.preview-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    padding: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.preview-item h6 {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    margin-bottom: 0.75rem;
    font-size: 0.8em;
}

.preview-image {
    max-width: 100%;
    height: auto;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Cropper.js customizations */
.cropper-container {
    background: transparent !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

.cropper-wrap-box {
    background: transparent !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

.cropper-view-box {
    outline: 2px solid #3498db !important;
    outline-color: rgba(52, 152, 219, 0.8) !important;
}

.cropper-face {
    background-color: rgba(52, 152, 219, 0.1) !important;
}

.cropper-line,
.cropper-point {
    background-color: #3498db !important;
}

.cropper-bg {
    background: transparent !important;
}

/* Remove cropper modal overlay */
.cropper-modal {
    background: transparent !important;
}

/* Ensure cropper doesn't extend beyond container */
.cropper-container,
.cropper-wrap-box,
.cropper-canvas,
.cropper-crop-box {
    max-width: 100% !important;
    max-height: 100% !important;
}

/* Responsive design */
@media (max-width: 768px) {
    #imageEditorModal .modal-dialog {
        width: 95vw;
        max-width: 95vw;
        max-height: 95vh;
        margin: auto;
    }
    
    #imageEditorModal .modal-content {
        max-height: 95vh;
        min-height: 300px;
    }
    
    .image-editor-canvas {
        max-height: calc(95vh - 150px);
        min-height: 250px;
    }
    
    .footer-left,
    .footer-right {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    #previewModal .modal-dialog {
        width: 95vw;
        max-width: 95vw;
        max-height: 95vh;
        margin: auto;
    }
    
    #previewModal .modal-content {
        max-height: 95vh;
    }
    
    .preview-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}
