/* Custom styles for AI Photo Enhancer */

/* Upload Area */
.upload-area {
    border: 2px dashed var(--bs-border-color);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    background: var(--bs-light-bg-subtle);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.upload-area:hover {
    border-color: var(--bs-primary);
    background: var(--bs-primary-bg-subtle);
}

.upload-area.dragover {
    border-color: var(--bs-primary);
    background: var(--bs-primary-bg-subtle);
    transform: scale(1.02);
}

.upload-content {
    position: relative;
    z-index: 2;
}

.upload-icon {
    font-size: 3rem;
    color: var(--bs-primary);
    margin-bottom: 1rem;
}

/* Style the file input to be invisible but functional */
.upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

/* Gallery Cards */
.gallery-card {
    height: 100%;
    transition: transform 0.2s ease;
}

.gallery-card:hover {
    transform: translateY(-5px);
}

.card-img-wrapper {
    position: relative;
    overflow: hidden;
}

.card-img-top {
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-card:hover .card-img-top {
    transform: scale(1.05);
}

.enhanced-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--bs-success);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 50px;
    font-size: 0.75rem;
}

/* Image Comparison */
.comparison-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 8px;
}

.comparison-image {
    width: 100%;
    height: 100%;
    display: block;
}

.comparison-image.enhanced {
    position: absolute;
    top: 0;
    left: 0;
    clip-path: inset(0 50% 0 0);
}

.comparison-slider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background: var(--bs-primary);
    cursor: col-resize;
    z-index: 10;
    transform: translateX(-50%);
}

.slider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    background: var(--bs-primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Preview Image */
.preview-image {
    max-height: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Enhancement Controls */
.form-range {
    margin-bottom: 0.5rem;
}

/* AI Prompt styling */
#enhancementPrompt {
    color: black;
    border: 2px solid var(--bs-primary);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--bs-primary-bg-subtle);
}

#enhancementPrompt:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

#enhancementPrompt::placeholder {
    color: var(--bs-secondary);
    opacity: 0.8;
}

/* Loading States */
.loading-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--bs-primary);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .upload-icon {
        font-size: 2rem;
    }
    
    .comparison-container {
        max-width: 100%;
    }
    
    .preview-image {
        max-height: 300px;
    }
}

/* Alert improvements */
.alert {
    border-radius: 8px;
}

/* Card improvements */
.card {
    border: none;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

/* Button improvements */
.btn {
    border-radius: 8px;
    font-weight: 500;
}

/* Navbar improvements */
.navbar-brand {
    font-weight: 600;
}

/* Text improvements */
.display-4 {
    font-weight: 700;
}

.lead {
    font-size: 1.1rem;
}

/* Enhancement sections styling */
.enhancement-section {
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 15px;
    background-color: rgba(0,0,0,0.02);
}

.enhancement-section h6 {
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid currentColor;
}

/* Compact form styling */
.form-label.small {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.form-select-sm {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
}

/* Custom range slider styling */
.form-range::-webkit-slider-thumb {
    background: var(--bs-primary);
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.form-range::-moz-range-thumb {
    background: var(--bs-primary);
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Section color coding */
.text-primary { color: #007bff !important; }
.text-success { color: #28a745 !important; }
.text-warning { color: #ffc107 !important; }
.text-info { color: #17a2b8 !important; }
.text-secondary { color: #6c757d !important; }

/* Card body scroll for enhancement controls */
.card-body {
    max-height: 80vh;
    overflow-y: auto;
}

.card-body::-webkit-scrollbar {
    width: 6px;
}

.card-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.card-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.card-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}
