:root {
    --bg-main: #f4f7f6;
    --bg-card: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --border: #e2e8f0;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body.dark-mode {
    --bg-main: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

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

body { 
    background-color: var(--bg-main); 
    color: var(--text-main); 
    transition: 0.3s; 
    display: flex; 
    flex-direction: column;
    align-items: center; 
    min-height: 100vh; 
    padding: 20px 20px 0 20px; 
}

.app-container { 
    background: var(--bg-card); 
    width: 100%; 
    max-width: 600px; 
    border-radius: 20px; 
    box-shadow: var(--shadow); 
    padding: 25px; 
    display: flex; 
    flex-direction: column; 
    gap: 20px; 
    margin-top: 2vh;
}

header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

header h1 { 
    font-size: 1.5rem; 
    color: var(--primary); 
}

.icon-btn { 
    background: none; 
    border: none; 
    font-size: 1.5rem; 
    color: var(--text-main); 
    cursor: pointer; 
}

.upload-zone { 
    border: 2px dashed var(--border); 
    border-radius: 15px; 
    padding: 40px 20px; 
    text-align: center; 
    cursor: pointer; 
    transition: 0.2s; 
    background: rgba(99, 102, 241, 0.05); 
}

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

.upload-zone i { 
    font-size: 3rem; 
    color: var(--primary); 
    margin-bottom: 10px; 
}

.upload-zone span { 
    color: var(--primary); 
    font-weight: 600; 
}

.upload-zone small { 
    display: block; 
    margin-top: 8px; 
    color: var(--text-muted); 
    font-size: 0.8rem; 
}

.editor-zone .image-wrapper { 
    max-height: 400px; 
    width: 100%; 
    overflow: hidden; 
    border-radius: 10px; 
    background: #000; 
}

img { 
    display: block; 
    max-width: 100%; 
}

.progress-bar-container { 
    width: 100%; 
    height: 8px; 
    background: var(--border); 
    border-radius: 4px; 
    overflow: hidden; 
    margin-top: 10px; 
}

.progress-bar { 
    height: 100%; 
    background: var(--primary); 
    width: 0%; 
    transition: width 0.3s ease; 
}

#loading-text { 
    text-align: center; 
    font-weight: 600; 
    font-size: 0.9rem; 
}

.before-after-container { 
    position: relative; 
    width: 100%; 
    height: 350px; 
    border-radius: 10px; 
    overflow: hidden; 
    background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYGAQYcAP3uCTZhw1gGGYhAGBZIA/GPeBOTKEB/9D2XgMIEP8jB8xAAAcpwP/0E3m4AAAAABJRU5ErkJggg=='); 
}

.before-after-container img { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    object-fit: contain; 
}

#img-before { clip-path: inset(0 50% 0 0); }

.slider { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    opacity: 0; 
    cursor: ew-resize; 
    z-index: 10; 
}

.slider-button { 
    position: absolute; 
    top: 0; 
    left: 50%; 
    bottom: 0; 
    width: 4px; 
    background: white; 
    pointer-events: none; 
    z-index: 5; 
    transform: translateX(-50%); 
    box-shadow: 0 0 5px rgba(0,0,0,0.5); 
}

.slider-button::after { 
    content: '< >'; 
    position: absolute; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    background: white; 
    color: black; 
    border-radius: 50%; 
    width: 30px; 
    height: 30px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: bold; 
    font-size: 12px; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.3); 
}

.controls { 
    display: flex; 
    gap: 10px; 
    width: 100%; 
    margin-top: 15px; 
    flex-wrap: wrap; 
}

button, .primary-btn, .secondary-btn { 
    flex: 1; 
    padding: 12px; 
    border-radius: 10px; 
    font-weight: 600; 
    border: none; 
    cursor: pointer; 
    transition: 0.2s; 
    text-align: center; 
    text-decoration: none; 
    font-size: 1rem; 
}

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

.secondary-btn { 
    background: transparent; 
    border: 1px solid var(--border); 
    color: var(--text-main); 
}
.secondary-btn:hover { background: rgba(0,0,0,0.05); }

.hidden { display: none !important; }

footer {
    width: 100%;
    max-width: 600px; 
    margin: 20px auto 10px auto;
    padding: 15px;
    text-align: center;
    border-top: 1px solid var(--border); 
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 5px; 
}

.credits i {
    color: #ef4444; 
    margin: 0 2px;
}

.credits span {
    font-weight: 600;
    color: var(--primary);
}

@media (max-width: 480px) {
    footer {
        font-size: 0.75rem;
        padding: 10px;
    }
}