/* Background Remover Specific Styles */

:root {
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --secondary-gradient: linear-gradient(135deg, #3b82f6 0%, #2dd4bf 100%);
    --success-gradient: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-muted: #94a3b8;
}

/* Base Layout Modifications */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.tool-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

.tool-header h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

/* Upload Section */
.upload-section {
    background: var(--glass-bg);
    border: 2px dashed var(--glass-border);
    border-radius: 24px;
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(12px);
    max-width: 800px;
    margin: 0 auto;
}

.upload-section:hover,
.upload-section.dragover {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.upload-icon {
    font-size: 4rem;
    color: #6366f1;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 15px rgba(99, 102, 241, 0.4));
}

.upload-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.upload-card p span {
    color: #6366f1;
    font-weight: 600;
    text-decoration: underline;
}

.features-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 3rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.feature-item i {
    color: #10b981;
}

/* Tool Container & Layout */
.tool-container {
    animation: fadeInUp 0.8s ease-out;
}

.editor-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
    background: var(--glass-bg);
    padding: 2rem;
    border-radius: 32px;
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
}

/* Preview Panel */
.preview-panel {
    background: #0f172a;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.comparison-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.image-box {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-box.result {
    width: 50%;
    /* Initial split */
    border-right: 2px solid #fff;
    z-index: 2;
}

.image-box.original {
    z-index: 1;
}

.badge {
    position: absolute;
    bottom: 20px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.original .badge {
    left: 20px;
}

.result .badge {
    right: 20px;
}

/* Comparison Slider */
.comparison-slider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: #fff;
    z-index: 3;
    pointer-events: none;
    transform: translateX(-50%);
}

.slider-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: #fff;
    color: #4f46e5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    cursor: ew-resize;
    pointer-events: all;
    transition: transform 0.2s;
}

.slider-button:hover {
    transform: translate(-50%, -50%) scale(1.1);
}

/* Checkerboard Background for Transparency */
.checkerboard-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(45deg, #2a2a2a 25%, transparent 25%),
        linear-gradient(-45deg, #2a2a2a 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #2a2a2a 75%),
        linear-gradient(-45deg, transparent 75%, #2a2a2a 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: #1a1a1a;
    z-index: -1;
}

/* Controls Panel */
.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.status-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    text-align: center;
}

.status-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.status-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Progress Bar */
.progress-container {
    margin-top: 1.5rem;
}

.progress-bar-wrapper {
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--primary-gradient);
    border-radius: 10px;
    transition: width 0.3s ease;
}

#progress-percent {
    font-size: 0.8rem;
    font-weight: 600;
}

/* Loader */
.loader-circle {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #6366f1;
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

/* Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.primary-btn,
.success-btn,
.secondary-btn {
    padding: 1rem 1.5rem;
    border-radius: 16px;
    border: none;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.primary-btn {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.4);
}

.success-btn {
    background: var(--success-gradient);
    color: #fff;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

.success-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(16, 185, 129, 0.4);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid var(--glass-border);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.tip-box {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    gap: 12px;
    font-size: 0.85rem;
    color: #93c5fd;
    line-height: 1.5;
}

.tip-box i {
    color: #fbbf24;
    font-size: 1.1rem;
}

/* Animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 968px) {
    .editor-layout {
        grid-template-columns: 1fr;
    }

    .tool-header h1 {
        font-size: 2.25rem;
    }
}

@media (max-width: 640px) {
    .features-grid {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .main-content {
        padding: 1rem;
    }
}