/* --- Variables de Estilo (Tema App Móvil Relabel.pro) --- */
:root {
    /* Basado en los colores de la imagen 1 y 2 */
    --color-fondo-app: #fbf6f1; /* Este era el color crema anterior, lo mantenemos por si la imagen de fondo falla */
    --color-tarjeta-claro: #fefcfb; /* Color de las tarjetas, más blanco crema */
    --color-texto-oscuro: #212121; /* Texto casi negro */
    --color-texto-claro: #757575; /* Gris para textos secundarios o iconos */
    --color-accion-principal: #ff3b30; /* Rojo vibrante para el botón de acción principal */
    --sombra-suave: 0 2px 8px rgba(0, 0, 0, 0.08); /* Sombra muy sutil */
    --borde-radio-redondeado: 18px; /* Esquinas muy redondeadas */
}

/* --- Reseteo Básico y Estilos Globales --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    /* --- INTEGRACIÓN DEL FONDO (IMAGEN 1) --- */
    /* background-image: url('texture.png');  Asume que tienes esta imagen de fondo */
    background-size: cover; /* Cubre toda la página */
    background-repeat: no-repeat;
    background-attachment: fixed; /* Mantiene el fondo fijo al hacer scroll */
    background-color: var(--color-fondo-app); /* Fallback si la imagen no carga */
    /* ----------------------------------------- */
    color: var(--color-texto-oscuro);
    line-height: 1.6;
}

/* --- Layout Principal --- */
.container { 
    max-width: 800px; 
    margin: 20px auto; 
    padding: 0 15px; 
}

header {
    background-color: transparent; /* Fondo transparente para dejar ver el fondo principal */
    color: var(--color-texto-oscuro);
    padding: 20px;
    text-align: center;
    box-shadow: none;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* --- NUEVO ESTILO PARA EL LOGO EN EL HEADER --- */
.header-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px; /* Espacio entre el logo y el resto del contenido del header */
}

.header-logo img {
    height: 50px; /* Ajusta el tamaño del logo según sea necesario */
    margin-right: 15px; /* Espacio entre el logo y el texto */
}

header h1 { 
    font-weight: 600; 
    font-size: 1.8em;
    margin: 0; /* Asegura que no haya margen extra en el h1 */
}
/* --------------------------------------------- */

footer {
    text-align: center;
    margin-top: 30px;
    padding: 15px;
    font-size: 0.9em;
    color: var(--color-texto-claro);
}

/* --- Estilo de Tarjetas (Cards) --- */
.card {
    background-color: var(--color-tarjeta-claro);
    border-radius: var(--borde-radio-redondeado);
    box-shadow: var(--sombra-suave);
    margin-bottom: 15px;
    padding: 20px;
}

.card h2 {
    color: var(--color-texto-oscuro);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 1.4em;
}

/* --- Formulario --- */
#tracker-form { display: flex; flex-wrap: wrap; gap: 10px; }
#tracker-form label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

.input-wrapper {
    position: relative;
    flex-grow: 1;
    display: flex;
}

#tracker-form input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    padding-right: 50px;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 10px;
    font-size: 1em;
    background-color: #fff;
    color: var(--color-texto-oscuro);
}

/* --- Estilo del botón de pegar --- */
#paste-button {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.4em;
    color: var(--color-texto-claro);
    padding: 0 5px;
    opacity: 0.8;
    transition: opacity 0.2s;
    display: none; 
}
#paste-button:hover {
    opacity: 1;
}

/* Botón principal de submit */
#tracker-form button[type="submit"] {
    padding: 12px 20px;
    background-color: var(--color-accion-principal);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
#tracker-form button[type="submit"]:hover {
    background-color: #d1322a;
}

/* --- Contenedor del Código de Barras --- */
#barcode-container { 
    text-align: center; 
    padding: 15px 0 0; 
    min-height: 100px; 
}

/* Ajuste para el SVG del código de barras */
#barcode {
    max-width: 90%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* --- Lista del Historial --- */
#history-list { 
    list-style: none; 
    max-height: 300px; 
    overflow-y: auto; 
    padding: 0; 
    background-color: transparent; 
    border-radius: var(--borde-radio-redondeado); 
}

#history-list li {
    background-color: var(--color-tarjeta-claro);
    border-radius: var(--borde-radio-redondeado);
    box-shadow: var(--sombra-suave);
    margin-bottom: 10px;
    padding: 12px 15px;
    border-bottom: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-weight: 500;
    color: var(--color-texto-oscuro);
    letter-spacing: 0.5px;
    text-align: center;
}

#history-list li:hover {
    background-color: #f7e9df;
}

#history-list li:last-child {
    margin-bottom: 0;
}

/* Ocultar el scrollbar pero permitir el scroll */
#history-list::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}
#history-list {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}


/* --- Diseño Responsive --- */
@media (max-width: 600px) {
    #tracker-form {
        flex-direction: column;
    }
    #tracker-form button[type="submit"] {
        width: 100%;
    }
    .card { padding: 15px; }
    header h1 { font-size: 1.5em; }
    .card h2 { font-size: 1.2em; }
    .header-logo img {
        height: 40px; /* Un poco más pequeño en móviles */
    }
}