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

body {
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.container {
    width: 100%;
    max-width: 900px;
}

.title {
    text-align: center;
    color: white;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.title i {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Comparison Container */
.comparison-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.comparison-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 1rem;
    cursor: ew-resize;
    user-select: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* Images */
.image-before,
.image-after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.image-content {
    width: 100%;
    height: 100%;
}

/* Gradient placeholders (simulating images) */
.gradient-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: white;
    font-size: 1.2rem;
}

.gradient-placeholder i {
    font-size: 4rem;
    opacity: 0.8;
}

.gradient-placeholder p {
    font-weight: 500;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.before-gradient {
    background: linear-gradient(135deg, #434343 0%, #000000 100%);
}

.after-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Image After - clipped by the slider */
.image-after {
    clip-path: inset(0 0 0 50%);
    transition: clip-path 0.1s ease-out;
}

/* Image Labels */
.image-label {
    position: absolute;
    top: 1.5rem;
    padding: 0.5rem 1.5rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 2rem;
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.label-before {
    left: 1.5rem;
}

.label-after {
    right: 1.5rem;
}

.comparison-slider:hover .image-label {
    opacity: 1;
    transform: translateY(0);
}

/* Slider Handle */
.slider-handle {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 10;
}

.handle-line {
    position: absolute;
    width: 2px;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(255, 255, 255, 0.8) 10%,
        rgba(255, 255, 255, 0.8) 90%,
        transparent 100%
    );
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5),
                0 0 40px rgba(102, 126, 234, 0.3);
}

.handle-circle {
    position: relative;
    width: 4rem;
    height: 4rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                0 0 0 4px rgba(255, 255, 255, 0.1),
                inset 0 0 20px rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    pointer-events: all;
    cursor: ew-resize;
}

.handle-circle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4),
                0 0 0 6px rgba(255, 255, 255, 0.15),
                0 0 40px rgba(102, 126, 234, 0.4),
                inset 0 0 30px rgba(255, 255, 255, 0.2);
}

.handle-circle:active {
    transform: scale(0.95);
}

.handle-circle i {
    color: white;
    font-size: 1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Instructions */
.instructions {
    text-align: center;
    margin-top: 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.instructions i {
    color: #667eea;
}

/* Examples */
.examples {
    margin-top: 3rem;
    text-align: center;
}

.examples h3 {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.example-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.example-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.example-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.example-card i {
    font-size: 2.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.example-card h4 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.example-card p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .title {
        font-size: 1.8rem;
    }

    .comparison-container {
        padding: 1rem;
    }

    .comparison-slider {
        aspect-ratio: 4 / 3;
    }

    .handle-circle {
        width: 3rem;
        height: 3rem;
    }

    .handle-circle i {
        font-size: 0.8rem;
    }

    .gradient-placeholder i {
        font-size: 2.5rem;
    }

    .gradient-placeholder p {
        font-size: 1rem;
    }
}

/* Active state when dragging */
.comparison-slider.dragging {
    cursor: grabbing;
}

.comparison-slider.dragging .handle-circle {
    transform: scale(0.95);
}

.comparison-slider.dragging .image-label {
    opacity: 1;
    transform: translateY(0);
}
