:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-color: #f8fafc;
    --text-color: #1e293b;
    --border-color: #e2e8f0;
    --card-bg: #ffffff;
}

[data-theme="dark"] {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --bg-color: #1e293b;
    --text-color: #f8fafc;
    --border-color: #475569;
    --card-bg: #334155;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', -apple-system, sans-serif;
    line-height: 1.5;
    transition: all 0.3s ease;
}

.theme-switch-wrapper {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    padding-top: 10px;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.header p {
    color: var(--text-color);
    opacity: 0.8;
    font-size: 1.1rem;
}

.upload-container {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.drop-zone.dragover {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
}

.image-editor {
    position: relative;
    margin-top: 2rem;
}

.image-preview {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
}

.image-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

.close-button {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.close-button:hover {
    background: var(--primary-hover);
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    border-radius: 0.5rem;
}

.loading-overlay.show {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.comparison-slider {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 400px;
    margin: 0 auto;
    border-radius: 0.5rem;
    overflow: hidden;
}

.comparison-slider img {
    position: absolute;
    max-width: 100%;
    height: auto;
    display: block;
}

#processedImage {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    object-fit: contain;
    background-color: white;
}

.slider-handle {
    position: absolute;
    width: 2px;
    height: 100%;
    background: white;
    left: 50%;
    cursor: ew-resize;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.slider-handle::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.slider-handle::before {
    content: '↔';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--primary-color);
    font-size: 20px;
    z-index: 1;
}

.actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: center;
}

.button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.button:hover {
    background: var(--primary-hover);
}

.download-button {
    background: #059669;
}

.download-button:hover {
    background: #047857;
}

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






.comparison-slider {
    position: relative;
    width: 100%;
    max-width: none;
    height: auto;
    margin: 0 auto;
    border-radius: 0.5rem;
    overflow: hidden;
}

.comparison-slider img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
    top: 0;
    left: 0;
}

#originalImage {
    width: 100%;
    height: auto;
    display: block;
}

#processedImage {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: white;
}

.comparison-slider.active {
    height: auto;
    /* min-height: 400px; */
}










#originalImage {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    display: block;
}






#outputContainer {
    position: relative;
    display: inline-block;
}

#outputImage {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}
