/* Inline Image Editor Styles */

.image-edit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
    border-radius: 8px;
    overflow: visible;
    z-index: 100;
    pointer-events: none;
}

.carousel-slide.editable-container:hover .image-edit-overlay {
    opacity: 1;
    pointer-events: auto;
}

.carousel-slide.editable-container:hover .image-edit-overlay {
    opacity: 1;
    pointer-events: auto;
}

.image-edit-button {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 101;
    position: relative;
}

.image-edit-button:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.carousel-slide.editable-container {
    position: relative;
    cursor: pointer;
}

/* Modal Editor */
.inline-editor-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.inline-editor-modal.active {
    display: flex;
}

.inline-editor-container {
    background: #1a1a1a;
    border-radius: 12px;
    max-width: 1200px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.editor-title {
    font-size: 18px;
    font-weight: 600;
    color: white;
}

.editor-close-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.editor-close-btn:hover {
    color: white;
}

.editor-content {
    display: flex;
    gap: 20px;
    padding: 20px;
    flex: 1;
}

.editor-canvas-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#inline-editor-canvas {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: #0a0a0a;
    max-width: 100%;
    max-height: 500px;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.editor-btn {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.editor-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.editor-btn.primary {
    background: var(--accent, #ff6b6b);
    border-color: var(--accent, #ff6b6b);
}

.editor-btn.primary:hover {
    background: var(--accent2, #ff5252);
    border-color: var(--accent2, #ff5252);
}

.editor-btn.danger {
    background: rgba(255, 0, 0, 0.3);
    border-color: rgba(255, 0, 0, 0.5);
    color: #ff6b6b;
}

.editor-btn.danger:hover {
    background: rgba(255, 0, 0, 0.5);
}

.editor-sidebar {
    width: 250px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.editor-panel {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
}

.panel-title {
    font-size: 13px;
    font-weight: 600;
    color: #ccc;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: block;
}

.control-group {
    margin-bottom: 12px;
}

.control-group:last-child {
    margin-bottom: 0;
}

label {
    display: block;
    font-size: 12px;
    color: #aaa;
    margin-bottom: 6px;
}

input[type="range"],
input[type="file"],
select {
    width: 100%;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    color: white;
    font-size: 12px;
}

input[type="range"] {
    padding: 0;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent, #ff6b6b);
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent, #ff6b6b);
    cursor: pointer;
    border: none;
}

input[type="file"] {
    padding: 6px;
}

select {
    cursor: pointer;
}

select option {
    background: #1a1a1a;
    color: white;
}

.value-display {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    text-align: right;
}

.editor-actions {
    display: flex;
    gap: 8px;
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.editor-actions .editor-btn {
    flex: 1;
}

/* Responsive */
@media (max-width: 900px) {
    .editor-content {
        flex-direction: column;
    }

    .editor-sidebar {
        width: 100%;
    }

    .inline-editor-container {
        width: 95%;
        max-height: 85vh;
    }
}

@media (max-width: 600px) {
    .editor-toolbar {
        gap: 6px;
    }

    .editor-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    #inline-editor-canvas {
        max-height: 300px;
    }

    .editor-content {
        gap: 10px;
    }

    .editor-header,
    .editor-content,
    .editor-actions {
        padding: 10px;
    }

    .editor-panel {
        padding: 10px;
    }
}

/* Loading State */
.editor-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.editor-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent, #ff6b6b);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
