/* background_remove.css - Custom styles for Background Remove tool */

/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #e6f0fa 0%, #f0f9ff 100%);
    color: #1e293b;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Tool Container */
.tool-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.1);
    animation: fadeIn 0.5s ease-in;
}

.tool-container h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Drag and Drop Area */
.drag-drop-area {
    border: 3px dashed #2dd4bf;
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.3s ease;
}

.drag-drop-area:hover, .drag-drop-area.drag-active {
    border-color: #f43f5e;
    background: #fef2f2;
}

.drag-drop-area p {
    font-size: 1.2rem;
    color: #475569;
}

/* Loader Animation */
.loader {
    border: 10px solid #e2e8f0;
    border-top: 10px solid #2dd4bf;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    animation: spin 1.2s linear infinite;
    margin: 2rem auto;
    box-shadow: 0 0 15px rgba(45, 212, 191, 0.3);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Slider and Image Containers */
.slider-container {
    position: relative;
    width: 100%;
    height: 450px;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin: 2rem 0;
    background: #f8fafc;
}

.image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

#before-image {
    z-index: 1; /* Original image behind after-image */
}

#after-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2; /* Above before-image */
}

#after-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#after-image .overlay {
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    z-index: 3; /* Above all */
}

.slider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 6px;
    height: 100%;
    background: linear-gradient(180deg, #2dd4bf, #f43f5e);
    z-index: 4; /* Above images */
    cursor: ew-resize;
}

.slider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -20px;
    width: 40px;
    height: 40px;
    background: #ffffff;
    border: 2px solid #2dd4bf;
    border-radius: 50%;
    transform: translateY(-50%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #2dd4bf;
}

/* Options Section */
.options {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem;
}

.options h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

input[type="color"] {
    width: 60px;
    height: 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.predefined-bgs {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.bg-option {
    width: 80px;
    height: 80px;
    background-size: cover;
    border-radius: 8px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.bg-option:hover, .bg-option.selected {
    border-color: #f43f5e;
    transform: scale(1.05);
}

input[type="file"] {
    padding: 0.5rem;
    color: #475569;
}

/* Buttons */
button {
    background: #2dd4bf;
    color: #ffffff;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 1rem;
}

button:hover {
    background: #f43f5e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Hidden Class */
.hidden {
    display: none;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    background: #f0f9ff;
}

::-webkit-scrollbar-thumb {
    background: #2dd4bf;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #f43f5e;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .tool-container {
        margin: 1rem;
        padding: 1rem;
    }
    .slider-container {
        height: 300px;
    }
    .drag-drop-area {
        padding: 2rem;
    }
    .drag-drop-area p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .slider-container {
        height: 200px;
    }
    button {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    .bg-option {
        width: 60px;
        height: 60px;
    }
}