@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Inter:wght@400;500;700&display=swap');

:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.5);
    --secondary: #a855f7;
    --secondary-glow: rgba(168, 85, 247, 0.5);
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shimmer: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Background Gradients */
body::before {
    content: '';
    position: fixed;
    top: -20%;
    right: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    z-index: -1;
    filter: blur(80px);
}

body::after {
    content: '';
    position: fixed;
    bottom: -20%;
    left: -10%;
    width: 60%;
    height: 60%;
    background: radial-gradient(circle, var(--secondary-glow) 0%, transparent 70%);
    z-index: -1;
    filter: blur(80px);
}

header {
    width: 100%;
    padding: 2rem;
    text-align: center;
    position: relative;
}

.watermark {
    position: absolute;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary);
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(5px);
}

h1 {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 800;
    margin-top: 1rem;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

.counter-container {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--glass-shimmer);
    padding: 0.5rem 1.5rem;
    border-radius: 100px;
    border: 1px solid var(--glass-border);
}

.counter-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    box-shadow: 0 0 10px #22c55e;
    animation: pulse 2s infinite;
}

#removal-counter {
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

main {
    flex: 1;
    width: 100%;
    max-width: 1000px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.upload-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.upload-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.15);
    transform: translateY(-4px);
}

.drop-zone {
    border: 2px dashed var(--glass-border);
    border-radius: 16px;
    padding: 3rem 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-icon {
    width: 64px;
    height: 64px;
    color: var(--primary);
}

.btn-main {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: #fff;
    padding: 1rem 2.5rem;
    border-radius: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px -10px var(--primary-glow);
    font-size: 1rem;
}

.btn-main:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 30px -10px var(--primary-glow);
}

/* Processing & Results */
.hidden {
    display: none !important;
}

.loader-container {
    padding: 4rem;
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

.result-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.image-preview-box {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.preview-label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(0,0,0,0.6);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
}

.result-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
}

.action-btn {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-download {
    background: white;
    color: black;
    border: none;
}

.btn-download:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
}

.btn-again {
    background: transparent;
    color: white;
    border: 1px solid var(--glass-border);
}

.btn-again:hover {
    background: var(--glass-shimmer);
}

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

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

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .result-card {
        grid-template-columns: 1fr;
    }
    
    .upload-card {
        padding: 1.5rem;
    }
    
    .drop-zone {
        padding: 2rem 1rem;
    }
}
