:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --secondary: #06b6d4;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --gradient: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

.glow-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 20% 30%, rgba(139, 92, 246, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 80% 70%, rgba(6, 182, 212, 0.15) 0%, transparent 40%);
}

.btn-primary {
    background: var(--gradient);
    color: white;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-primary.pulse {
    animation: buttonPulse 2s infinite;
}

@keyframes buttonPulse {
    0% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(139, 92, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid var(--glass-border);
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
    padding: 0.6rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

main {
    max-width: 1100px;
    margin: 4rem auto 3rem;
    padding: 0 1.5rem;
}

.hero {
    text-align: center;
    margin-bottom: 3.5rem;
}

h1 {
    font-family: var(--font-heading);
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
}

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

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

.upload-container {
    background: var(--card-bg);
    border: 2px dashed var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem 1.5rem;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    max-width: 800px;
    margin: 0 auto;
    backdrop-filter: blur(12px);
}

.upload-container:hover, .upload-container.drag-over {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.05);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    min-height: 250px;
    justify-content: center;
}

.icon-circle {
    width: 60px;
    height: 60px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary);
}

.upload-content h2 {
    font-size: 1.5rem;
}

.file-info {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.bg-removed-hidden {
    display: none !important;
}

/* Comparison & Preview Layout */
.comparison-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.preview-box {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 600px;
    backdrop-filter: blur(12px);
}

.badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.35rem 0.75rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid var(--glass-border);
    z-index: 10;
}

.preview-box img {
    max-width: 100%;
    max-height: 550px;
    object-fit: contain;
    border-radius: 12px;
}

.processing-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    z-index: 20;
    border-radius: 24px;
    padding: 2rem;
    text-align: center;
}

.status-log {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

#log-text {
    color: var(--secondary);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(139, 92, 246, 0.1);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.progress-bar {
    width: 100%;
    max-width: 250px;
    height: 5px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: var(--gradient);
}

/* Result Section */
.result-section {
    margin-top: 3rem;
    animation: fadeIn 0.4s ease;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    max-width: 950px;
    margin-left: auto;
    margin-right: auto;
}

.section-header h2 {
    font-size: 1.5rem;
}

.options-bar {
    display: flex;
    gap: 1.5rem;
    margin: 0.5rem 0;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.6rem 1.25rem;
    border-radius: 100px;
    border: 1px solid var(--glass-border);
}

.option-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.option-item input {
    accent-color: var(--primary);
    width: 14px;
    height: 14px;
}

/* Result Container Styles */
.result-container {
    width: 100%;
    max-width: 950px;
    height: 650px;
    margin: 0 auto;
    border-radius: 24px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: 
        linear-gradient(45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(-45deg, #f0f0f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f0f0f0 75%),
        linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.result-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.result-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Features Section */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 6rem;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 20px;
}

.feature-card i {
    font-size: 1.5rem;
    color: var(--secondary);
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

footer {
    text-align: center;
    padding: 3rem 1.5rem;
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 0.85rem;
}

@media (max-width: 992px) {
    .comparison-container {
        grid-template-columns: 1fr;
    }
    h1 { font-size: 3rem; }
    .preview-box { min-height: 300px; }
}

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