/**
 * Background Image Element Styles
 * Template System - Background Image Component
 */

/* Background Image Element Specific Styles */
.background-image-element {
    position: relative;
    z-index: -1000;
}

/* Background Image Placeholder Styles */
.background-placeholder {
    border: 2px dashed #ccc;
    background: rgba(240, 240, 240, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.background-placeholder:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.background-placeholder i {
    font-size: 48px;
    color: #999;
    margin-bottom: 10px;
}

.background-placeholder span {
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

/* Background Image Properties Panel */
.background-properties {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
}

.background-properties .property-group {
    margin-bottom: 15px;
}

.background-properties .property-label {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.background-domain-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.background-domain-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Background Image Upload Progress */
.background-upload-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.background-upload-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
}

.background-upload-icon {
    font-size: 24px;
    margin-bottom: 15px;
    color: #667eea;
}

.background-upload-title {
    font-size: 16px;
    color: #333;
    font-weight: 500;
    margin-bottom: 10px;
}

.background-upload-subtitle {
    font-size: 14px;
    color: #666;
}

/* Background Image Selection Styles */
.background-selection-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(102, 126, 234, 0.2);
    border: 2px solid #667eea;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.background-image-element.selected .background-selection-overlay {
    opacity: 1;
}

/* Background Image Controls */
.background-controls {
    position: absolute;
    top: -40px;
    right: 0;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.background-image-element:hover .background-controls,
.background-image-element.selected .background-controls {
    opacity: 1;
}

.background-control-btn {
    width: 32px;
    height: 32px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.background-control-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.background-control-btn.danger {
    background: #dc3545;
}

.background-control-btn.danger:hover {
    background: #c82333;
}

/* Background Image Layer Indicator */
.background-layer-indicator {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.background-image-element:hover .background-layer-indicator,
.background-image-element.selected .background-layer-indicator {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .background-placeholder {
        min-height: 150px;
    }
    
    .background-placeholder i {
        font-size: 36px;
    }
    
    .background-placeholder span {
        font-size: 14px;
    }
    
    .background-controls {
        top: -35px;
    }
    
    .background-control-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

/* Animation for background image loading */
@keyframes backgroundImageFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.background-image-element.loaded {
    animation: backgroundImageFadeIn 0.5s ease-out;
}

/* Background image resize handles (when selected) */
.background-image-element.selected {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Background image domain badge */
.background-domain-badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.background-image-element:hover .background-domain-badge,
.background-image-element.selected .background-domain-badge {
    opacity: 1;
}