/* Modal Background */
.gv-image-editor-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.gv-image-editor-modal.is-open {
    opacity: 1;
    visibility: visible;
}

/* Modal Content */
.gv-image-editor-content {
    background: #1a1a1a;
    color: #fff;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.gv-image-editor-modal.is-open .gv-image-editor-content {
    transform: scale(1);
}

/* Header */
.gv-image-editor-header {
    padding: 20px 30px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gv-image-editor-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gv-image-editor-close {
    cursor: pointer;
    font-size: 1.5rem;
    color: #666;
    transition: color 0.2s;
}

.gv-image-editor-close:hover {
    color: #fff;
}

/* Canvas Area */
.gv-image-editor-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #111;
    position: relative;
    padding: 20px;
    min-height: 400px;
}

.gv-image-editor-body img {
    max-width: 100%;
    display: block;
}

/* Footer / Controls */
.gv-image-editor-footer {
    padding: 20px 30px;
    border-top: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #222;
}

.gv-image-editor-controls {
    display: flex;
    gap: 15px;
}

.gv-image-editor-btn {
    background: #333;
    border: none;
    color: #eee;
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.gv-image-editor-btn:hover {
    background: #444;
    color: #fff;
    transform: translateY(-2px);
}

.gv-image-editor-btn.active {
    background: #4a90e2;
    color: #fff;
}

.gv-image-editor-btn-save {
    background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
    color: white;
    padding: 12px 25px;
    font-weight: 600;
}

.gv-image-editor-btn-save:hover {
    background: linear-gradient(135deg, #5ba4f5 0%, #4a90e2 100%);
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
}

/* Cropper Overrides for Circular */
.cropper-view-box,
.cropper-face {
    border-radius: 0;
}

.is-circular .cropper-view-box,
.is-circular .cropper-face {
    border-radius: 50%;
}

.is-circular .cropper-face {
    background-color: transparent;
}

/* Icons */
.gv-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Cache Busting / Visibility Control */
/* The wrapper is output with style="display:none" by PHP. */
/* This CSS forces it to show ONLY when the plugin is active and CSS is loaded. */
.gf-image-edit-wrapper {
    display: block !important;
}