body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #f5f5f5;
}

header {
  display: flex;
  background: #3f51b5;
  color: white;
  padding: 15px;
  text-align: center;
  align-items: center;
}
header img {
  width: 50px;
  height: 50px;
  padding-right: 15px;
}

nav {
  display: flex;
  margin: 15px 0;
  text-align: center;
  align-items: center;
  justify-content: flex-end;
}

nav button {
  width: fit-content;
  margin: 0 5px;
  padding: 8px 15px;
  background: #3f51b5;
  border: none;
  color: white;
  border-radius: 5px;
  cursor: pointer;
}

nav button:hover {
  background: #2c387e;
}

.view {
  max-width: 800px;
  margin: 20px auto;
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  font-family: Arial, sans-serif;
}

input {
  width: 100%;
  margin: 8px 0;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

button {
  margin-top: 10px;
  width: 100%;
}

#loginMsg, #regMsg {
  margin-top: 10px;
  font-size: 14px;
  color: #e53935;
}

/* Pantalla modal */
.modal {
  display: none; /* oculto por defecto */
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  justify-content: center;
  align-items: center;
}

/* Contenido dentro del modal */
.modal-content {
  background: white;
  padding: 30px;
  border-radius: 10px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  animation: fadeIn 0.3s ease;
}

/* Animación */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Botón cerrar */
.close-btn {
  margin-top: 15px;
  padding: 8px 15px;
  background: #e53935;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.close-btn:hover {
  background: #c62828;
}


nav {
  display: flex;
  justify-content: space-between; /* links a la izquierda, auth a la derecha */
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #ddd;
  padding: 10px 16px;
  flex-wrap: wrap;
}

.navbar a {
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 6px;
  background: #3f51b5;
  color: #fff;
  margin-right: 8px;
}

.navbar a:hover {
  background: #2c387e;
}

.auth-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-controls button {
  background: #3f51b5;
  border: none;
  padding: 8px 12px;
  color: white;
  border-radius: 5px;
  cursor: pointer;
}

.auth-controls button:hover {
  background: #2c387e;
}

#userStatus {
  font-weight: bold;
  margin: 0 8px;
}


/* Contenedor principal */
#qrDinamico {
  max-width: 800px;
  margin: 20px auto;
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  font-family: Arial, sans-serif;
}

/* Inputs y botón */
#qrDinamico input[type="text"] {
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
}

#qrDinamico button {
  background: #007bff;
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 10px;
  font-size: 14px;
  transition: background 0.3s ease;
}

#qrLibre button {
  background: #007bff;
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 10px;
  font-size: 14px;
  transition: background 0.3s ease;
}

#qrDinamico button:hover {
  background: #0056b3;
}

/* Preview del último QR generado */
.qr-preview {
  margin: 20px 0;
  text-align: center;
}

.qr-preview img {
  border: 2px solid #eee;
  border-radius: 8px;
  padding: 10px;
  background: #fafafa;
  max-width: 200px;
}

/* Listado de QR */
.qr-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.qr-item {
  background: #f9f9f9;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: transform 0.2s ease;
}

.qr-item:hover {
  transform: scale(1.03);
}

.qr-item p {
  margin: 6px 0;
  font-size: 13px;
  color: #333;
}

.qr-item a {
  display: inline-block;
  margin-top: 6px;
  color: #007bff;
  font-weight: bold;
  text-decoration: none;
}

.qr-item a:hover {
  text-decoration: underline;
}

.qr-item img {
  display: block;
  margin: 10px auto 0;
  max-width: 150px;
  border-radius: 6px;
}

#btnDescargarQR {
  background-color: #0078d7;
  color: white;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  margin-top: 10px;
  cursor: pointer;
  transition: background 0.2s;
  width: auto;
}

#btnDescargarQR:hover {
  background-color: #005ea6;
}
