/* Estilos generales actualizados */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f0f2f5;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 28px;
}

/* Estilos para el área del escáner */
.scanner-container {
    margin: 20px 0;
    border: 2px dashed #ddd;
    padding: 15px;
    border-radius: 8px;
    background-color: #fafafa;
}

#scanner {
    display: none; /* Oculto por defecto */
    width: 100%;
    max-height: 300px;
    background: #000;
}

.scanner-active {
    display: block !important;
}

/* Controles mejorados */
.controls {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

button {
    padding: 12px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

button:hover:not(:disabled) {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    opacity: 0.7;
}

#start-barcode {
    background-color: #2ecc71;
}

#start-barcode:hover:not(:disabled) {
    background-color: #27ae60;
}

#start-qr {
    background-color: #007425;
}

#start-qr:hover:not(:disabled) {
    background-color: #7AD20F;
}

/* Área de resultados */
.result {
    margin: 25px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

#result {
    font-weight: bold;
    font-size: 18px;
    color: #2c3e50;
    margin-top: 10px;
}

/* Formulario mejorado */
#register-form {
    margin-top: 25px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    display: none;
}

/* Nuevos campos de texto */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border 0.3s ease;
}

.form-group input[type="text"]:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* Lista de QR mejorada */
#qr-list {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

#qr-list h4 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

#qr-list ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

#qr-list li {
    padding: 10px 15px;
    background-color: white;
    margin-bottom: 8px;
    border-radius: 4px;
    border-left: 3px solid #3498db;
    display: flex;
    justify-content: space-between;
}

/* Botones del formulario */
.form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

#add-another {
    background-color: #f39c12;
}

#add-another:hover {
    background-color: #d35400;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 15px;
    }
    
    .controls {
        flex-direction: column;
    }
    
    button {
        width: 100%;
    }
    
    .form-buttons {
        flex-direction: column;
    }
}

/* Estilos para mensajes */
#message-container {
    margin: 20px 0;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    font-weight: bold;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.alert-error {
    background-color: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

/* Animación para desaparecer */
.fade-out {
    animation: fadeOut 0.5s;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}