/* ======== BG REMOVER PRO - MODERN UI ======== */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-light: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --radius: 12px;
    --radius-lg: 16px;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* ======== HEADER ======== */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 30px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.header-content {
    position: relative;
    z-index: 1;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.logo-icon {
    font-size: 2.5rem;
}

.header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.tagline {
    color: rgba(255,255,255,0.85);
    font-size: 1rem;
}

/* ======== MAIN ======== */
.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ======== UPLOAD SECTION ======== */
.upload-section {
    margin-bottom: 40px;
}

.upload-card {
    background: var(--bg-card);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.upload-card:hover,
.upload-card.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.upload-card.dragover {
    border-style: solid;
    border-width: 3px;
}

.upload-icon-big {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

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

.upload-card h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.upload-sub {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.browse-link {
    color: var(--primary-light);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.supported-types {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.badge {
    background: var(--bg-light);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.upload-hint {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.hidden-input {
    display: none;
}

/* ======== MODEL LOADING ======== */
.model-loading {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 50px 40px;
    text-align: center;
    margin-bottom: 40px;
    border: 1px solid var(--border);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--bg-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.loading-sub {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.loading-bar {
    width: 100%;
    max-width: 400px;
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    margin: 0 auto 10px;
    overflow: hidden;
}

.loading-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 4px;
    transition: width 0.3s;
}

.loading-percent {
    color: var(--primary-light);
    font-weight: 700;
    font-size: 1.1rem;
}

/* ======== PROCESSING ======== */
.processing {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 50px 40px;
    text-align: center;
    margin-bottom: 40px;
    border: 1px solid var(--border);
}

.processing-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--bg-light);
    border-top-color: var(--secondary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

.processing-text {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.processing-bar {
    width: 100%;
    max-width: 400px;
    height: 6px;
    background: var(--bg-light);
    border-radius: 3px;
    margin: 0 auto 10px;
    overflow: hidden;
}

.processing-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--secondary), #34d399);
    border-radius: 3px;
    transition: width 0.3s;
}

.processing-count {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* ======== RESULTS SECTION ======== */
.results-section {
    margin-bottom: 40px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

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

.results-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 10px 24px;
    border-radius: 8px;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--border);
    color: var(--text-primary);
}

/* ======== RESULTS GRID ======== */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.result-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.result-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.result-images {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.result-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-original {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    overflow: hidden;
    border-right: 2px solid var(--primary);
}

.result-original img {
    width: 200%;
    height: 100%;
    object-fit: cover;
}

.result-label {
    position: absolute;
    bottom: 8px;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-label.original {
    left: 8px;
    background: rgba(0,0,0,0.7);
    color: white;
}

.result-label.removed {
    right: 8px;
    background: var(--secondary);
    color: white;
}

.result-info {
    padding: 15px;
}

.result-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-meta {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 12px;
}

.result-actions {
    display: flex;
    gap: 8px;
}

.result-actions .btn {
    flex: 1;
    justify-content: center;
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-download {
    background: var(--secondary);
    color: white;
}

.btn-download:hover {
    background: #059669;
}

.btn-remove {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.btn-remove:hover {
    background: var(--danger);
    color: white;
}

/* ======== EMPTY STATE / FEATURES ======== */
.empty-state {
    margin-top: 20px;
}

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.feature {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 30px 25px;
    text-align: center;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.feature:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.feature h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.feature p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ======== FOOTER ======== */
.footer {
    text-align: center;
    padding: 30px 20px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-note {
    margin-top: 5px;
    font-size: 0.8rem;
}

/* ======== RESPONSIVE ======== */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.6rem;
    }

    .upload-card {
        padding: 40px 20px;
    }

    .upload-card h2 {
        font-size: 1.4rem;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .features {
        grid-template-columns: 1fr;
    }
}

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

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

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

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