/* Styles for the AI Photo Enhancer UI */

.ai-enhance-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ai-enhance-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(99, 102, 241, 0.3);
}

.ai-enhance-btn i {
    font-size: 14px;
}

/* Modal Styles */
.ai-enhancer-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.ai-enhancer-modal.active {
    display: flex;
    animation: aiModalFadeIn 0.3s ease;
}

@keyframes aiModalFadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.ai-enhancer-content {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.ai-enhancer-header {
    background: linear-gradient(to right, #1e1e2f, #2a2a40);
    color: white;
    padding: 15px 20px;
    font-weight: 600;
    font-size: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-enhancer-close {
    background: none;
    border: none;
    color: #a0a0b0;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}

.ai-enhancer-close:hover {
    color: white;
}

.ai-enhancer-body {
    padding: 20px;
}

/* Image Comparison Slider */
.ai-compare-container {
    position: relative;
    width: 100%;
    height: 350px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
}

.ai-compare-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ai-compare-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
    border-right: 2px solid white;
}

.ai-compare-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: ew-resize;
    z-index: 10;
}

.ai-slider-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    color: #6366f1;
}

.ai-badge-before, .ai-badge-after {
    position: absolute;
    top: 10px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    z-index: 5;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}

.ai-badge-before { left: 10px; }
.ai-badge-after { right: 10px; }

/* Actions */
.ai-enhancer-actions {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.ai-price-info {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 5px;
}

.ai-price-info strong {
    color: #1e293b;
}

.ai-apply-btn {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ai-apply-btn:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.ai-apply-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: #cbd5e1;
}

/* Loading State */
.ai-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 20;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.ai-loading-overlay.active {
    display: flex;
}

.ai-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: ai-spin 1s linear infinite;
}

@keyframes ai-spin {
    to { transform: rotate(360deg); }
}

.ai-loading-text {
    color: #475569;
    font-weight: 500;
}

/* Error Alert */
.ai-error-alert {
    display: none;
    background: #fee2e2;
    color: #ef4444;
    padding: 12px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 14px;
    text-align: left;
    border: 1px solid #fca5a5;
}

.ai-error-alert.active {
    display: block;
}
