:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --info-gradient: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

.hero-section {
    background: var(--primary-gradient);
    color: white;
    min-height: 70vh;
    display: flex;
    align-items: center;
}

.hero-image {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.feature-icon {
    transition: transform 0.3s ease;
}

.card:hover .feature-icon {
    transform: scale(1.1);
}

.step-number {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bs-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto;
}

.upload-area {
    border: 2px dashed var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bs-body-bg);
}

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

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

.upload-content {
    pointer-events: none;
}

.file-preview-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    background: var(--bs-secondary-bg);
}

.file-preview-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 0.25rem;
    margin-right: 1rem;
}

.file-preview-item .file-info {
    flex: 1;
}

.file-preview-item .file-actions {
    margin-left: auto;
}

.file-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.file-item,
.background-select {
    background: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 200px;
}

.file-item img,
.background-select-image {
    width: 100%;
    height: 120px;
    object-fit: contain;
    background: var(--bs-body-bg);
    border-radius: 0.5rem;
}

.background-select-image {
    object-fit: cover;
}

.file-name,
.background-select-caption {
    font-size: 0.85rem;
    text-align: center;
    min-height: 2.4em;
    word-break: break-word;
}

.background-select-actions {
    margin-top: auto;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.background-select-overlay {
    position: absolute;
    inset: 0;
    pointer-events: auto;
}

.background-select {
    position: relative;
}

.processing-card {
    border-left: 4px solid var(--bs-primary);
}

.result-image {
    max-width: 100%;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.result-image:hover {
    transform: scale(1.05);
}

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

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

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

.card-img-overlay {
    opacity: 0;
    transition: opacity 0.3s ease;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-img-container:hover .card-img-overlay {
    opacity: 1;
}

.image-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-floating {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.progress-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: conic-gradient(var(--bs-primary) 0deg, var(--bs-secondary-bg) 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.progress-circle::before {
    content: '';
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bs-body-bg);
    position: absolute;
}

.progress-text {
    position: relative;
    z-index: 1;
    font-weight: bold;
    font-size: 0.875rem;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-brand i {
    color: var(--bs-primary);
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-divider {
    height: 2px;
    background: var(--primary-gradient);
    border: none;
    margin: 3rem 0;
}

.user-info {
    font-size: 0.875rem;
}

/* Dark theme adjustments */
[data-bs-theme="dark"] .upload-area {
    border-color: var(--bs-secondary);
}

[data-bs-theme="dark"] .upload-area:hover {
    border-color: var(--bs-primary);
}

[data-bs-theme="dark"] .file-preview-item {
    background: var(--bs-dark);
    border-color: var(--bs-secondary);
}

/* Animation for loading states */
.loading-spinner {
    animation: spin 1s linear infinite;
}

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

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-section {
        min-height: 50vh;
        text-align: center;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .btn-floating {
        bottom: 1rem;
        right: 1rem;
        width: 50px;
        height: 50px;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .card-img-top {
        height: 200px;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bs-secondary-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--bs-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bs-primary);
}
