/* RESET & CORE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #050505;
    color: #e0e0e0;
    font-family: 'Courier New', Courier, monospace;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* HEADER */
header {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    margin-bottom: 20px;
}

h1 {
    font-size: 1.5rem;
    text-transform: uppercase;
}

.back-link {
    color: #888;
    text-decoration: none;
    font-size: 0.9rem;
}

.back-link:hover {
    color: #fff;
    text-decoration: line-through;
}

/* CONTROLS */
.controls {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.btn {
    border: 1px solid #333;
    color: #fff;
    background-color: #111;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
}

.btn:hover {
    background-color: #fff;
    color: #000;
}

.file-input-wrapper input[type=file] {
    font-size: 100px;
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    cursor: pointer;
}

/* COMPARISON CONTAINER */
.compare-container {
    position: relative;
    width: 90vw;
    max-width: 1000px;
    /* Height will be determined by image aspect ratio via JS or max-height */
    min-height: 400px;
    background: #111;
    border: 1px solid #333;
    overflow: hidden;
    user-select: none;
}

.img-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.img-wrapper img {
    display: block;
    width: 100%;
    height: auto;
    /* Ensure images scale similarly */
    object-fit: contain;
    max-height: 80vh;
    pointer-events: none;
}

/* The top image (Left Image - Top Layer) */
#left-image-wrapper {
    width: 50%;
    /* Initial split */
    border-right: 2px solid #fff;
    z-index: 2;
}

#right-image-wrapper {
    width: 100%;
    z-index: 1;
}

/* SLIDER HANDLE */
.slider-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    cursor: ew-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    /* Centered vertically via JS or top: 50% */
    top: 50%;
}

.slider-handle::after {
    content: '↔';
    color: #000;
    font-weight: bold;
}

.slider-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: #fff;
    z-index: 9;
    pointer-events: none;
}

/* Placeholder Text */
.placeholder-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #555;
    text-align: center;
    pointer-events: none;
}