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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

h1 {
    text-align: center;
    padding: 30px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    font-size: 2.5em;
    margin: 0;
}

.camera-section {
    display: flex;
    justify-content: center;
    padding: 30px;
    background: #f8f9fa;
}

#video {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    transform: scaleX(-1); /* Efecto espejo */
}

.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 30px;
}

.photo-options {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.separator {
    font-size: 18px;
    font-weight: bold;
    color: #666;
    margin: 0 10px;
}

.background-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 0 15px;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    background: #f9f9f9;
}

.background-type-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.background-type-selector > label {
    font-weight: bold;
    color: #333;
    font-size: 16px;
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    transition: color 0.3s ease;
}

.radio-option:hover {
    color: #667eea;
}

.radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.background-options {
    width: 100%;
    display: flex;
    justify-content: center;
}

.background-option-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.background-option-group label {
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.background-select {
    padding: 10px 15px;
    border: 2px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 250px;
}

.background-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
}

.btn-success {
    background: linear-gradient(45deg, #28a745, #1e7e34);
    color: white;
}

.btn-warning {
    background: linear-gradient(45deg, #ffc107, #e0a800);
    color: #212529;
}

.btn-info {
    background: linear-gradient(45deg, #17a2b8, #138496);
    color: white;
}

.btn-secondary {
    background: linear-gradient(45deg, #6c757d, #545b62);
    color: white;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.result-section {
    padding: 30px;
    background: #f8f9fa;
}

.image-comparison {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    height: 500px;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.image-labels {
    position: absolute;
    width: 100%;
    top: 15px;
    z-index: 3;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    box-sizing: border-box;
    pointer-events: none;
}

.image-label {
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.image-container.original {
    z-index: 1;
    clip-path: polygon(0 0, var(--position, 50%) 0, var(--position, 50%) 100%, 0 100%);
}

.image-container.processed {
    z-index: 0;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
    background: #fff;
}

.slider-comparison {
    position: absolute;
    width: 4px;
    height: 100%;
    background: #667eea;
    left: var(--position, 50%);
    transform: translateX(-50%);
    z-index: 2;
    cursor: ew-resize;
    transition: background 0.3s ease;
}

.slider-comparison:hover {
    background: #764ba2;
}

.slider-comparison::before {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    background: #667eea;
    border: 3px solid white;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.slider-comparison:hover::before {
    background: #764ba2;
    transform: translate(-50%, -50%) scale(1.1);
}

.slider-comparison::after {
    content: '⇄';
    position: absolute;
    color: white;
    font-size: 16px;
    font-weight: bold;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading p {
    color: white;
    font-size: 18px;
    font-weight: bold;
}

@media (max-width: 768px) {
    .result-section {
        grid-template-columns: 1fr;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 200px;
    }
    
    h1 {
        font-size: 2em;
        padding: 20px;
    }
}