/* Aplicar box-sizing globalmente para un mejor control del layout responsive */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f4f7f9;
    color: #333;
    margin: 0;
    padding: 10px; /* Reducido para móviles */
    text-align: center;
}

h1 {
    color: #007bff;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    padding: 20px; /* Reducido para móviles */
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* --- Mensajes --- */
.mensaje {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-weight: bold;
    text-align: left;
    border: 1px solid;
}

.mensaje-error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.mensaje-exito {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

/* --- Formularios y Campos --- */
form {
    text-align: left;
    margin-bottom: 20px;
}

label {
    display: block;
    margin-top: 15px;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

input[type="text"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

/* --- Botones --- */
button[type="submit"], .nav-button {
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s, opacity 0.3s;
    text-decoration: none; /* Para usar .nav-button en <a> */
    display: block; /* Para que tomen todo el ancho en móviles */
    text-align: center;
}

button[type="submit"] {
    background-color: #007bff;
    color: white;
}

button[type="submit"]:hover {
    background-color: #0056b3;
}

button[type="submit"]:disabled {
    background-color: #adb5bd;
    cursor: not-allowed;
}

/* --- Navegación Superior (Responsive) --- */
.nav-bar {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 20px;
}

.nav-bar .nav-button {
    width: 33%;
    text-align: center;
    text-decoration: none;
    padding: 10px;
    font-size: 0.9em;
    white-space: nowrap;
}

.btn-menu { background-color: #6c757d; color: white; }
.btn-entrada { background-color: #28a745; color: white; }
.btn-salida { background-color: #007bff; color: white; }

.btn-menu:hover { background-color: #5a6268; }
.btn-entrada:hover { background-color: #1e7e34; }
.btn-salida:hover { background-color: #0056b3; }

/* --- Resultado de Cobro --- */
.resultado-cobro {
    background-color: #e9ecef;
    padding: 20px;
    border-radius: 8px;
    text-align: left;
    margin-top: 20px;
}

.resultado-cobro h2 { color: #333; border-bottom: 2px solid #ccc; padding-bottom: 10px; margin-top: 0; }
.resultado-cobro h3 { color: #dc3545; font-size: 1.8em; text-align: center; margin-top: 15px;}
.resultado-cobro strong { display: inline-block; width: 120px; }

/* --- PANTALLA COMPLETA DE FEEDBACK (ENTRADA) --- */
.feedback-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: white;
    text-align: center;
    transition: opacity 0.3s;
}

.success-overlay {
    background-color: #28a745; /* Verde */
}

.error-overlay {
    background-color: #dc3545; /* Rojo */
}

.feedback-icon {
    font-size: 8em;
    margin-bottom: 20px;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* --- Responsive (Ajustes para móviles) --- */
@media (max-width: 480px) {
    .nav-bar {
        flex-direction: row; /* Mantenemos en fila, pero permitimos wrap */
        flex-wrap: wrap;
        gap: 5px;
    }
    .nav-bar .nav-button {
        width: 48%; /* Dos botones por fila en lugar de tres */
        margin-bottom: 5px;
    }
    .btn-menu { width: 100%; } /* Menú principal toma todo el ancho */
}
