body {
  font-family: sans-serif;
  margin: 0;
  padding: 2rem;
  background: #f0f0f0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
}

.card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  padding: 2rem;
  max-width: 400px;
  width: 100%;
  text-align: center;
  transition: background 0.3s, color 0.3s;
}

input[type="text"],
input[type="file"] {
  width: 100%;
  padding: 0.6rem;
  margin-bottom: 1rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

canvas {
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(30,144,255,0.4);
  margin-top: 1rem;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.5s ease, transform 0.3s ease;
}

canvas.show {
  opacity: 1;
  transform: scale(1);
}

.wide-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 1rem;
  padding: 0.6rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #eee;
  transition: background 0.3s, color 0.3s;
}

.wide-button:hover {
  background: #1e90ff;
  color: white;
}

.btn-icon {
  width: 1rem;
  height: 1rem;
}

.tab-buttons {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.tab-buttons button {
  flex: 1;
  margin: 0 0.5rem;
  padding: 0.5rem;
  border-radius: 20px;
  border: 1px solid #ccc;
  background: #ddd;
  transition: 0.3s;
}

.tab-buttons button:hover {
  background: #1e90ff;
  color: white;
}

.tab-content {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.tab-content.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.icon-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.icon-button {
  background: #1e90ff;
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  font-size: 24px;
  color: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s ease;
}

.icon-button:hover {
  background: #1c86ee;
  transform: scale(1.1);
}

.scan-method {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1rem 0;
}

.scan-option.fade {
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.4s ease, transform 0.4s ease;
  display: block;
}

.scan-option.fade.hidden {
  display: none;
}

.scan-option.fade:not(.hidden) {
  opacity: 1;
  transform: scale(1);
}

#reader {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  border: 1px solid #ccc;
  border-radius: 6px;
  overflow: hidden;
}

#scanResult {
  font-weight: bold;
  margin-top: 0.5rem;
}

#scanTable {
  width: 100%;
  margin-top: 1rem;
  border-collapse: collapse;
}

#scanTable th, #scanTable td {
  border: 1px solid #ccc;
  padding: 0.4rem;
  text-align: left;
  font-size: 0.9rem;
}

.dark #scanTable th,
.dark #scanTable td {
  border-color: #555;
}

/* Dark mode extras */
.dark {
  background: #121212;
  color: white;
}
.dark .card {
  background: #222;
  color: white;
  box-shadow: 0 6px 20px rgba(255,255,255,0.08);
}
.dark input,
.dark .wide-button,
.dark .tab-buttons button {
  background: #333;
  color: white;
  border-color: #555;
}
.dark .wide-button:hover,
.dark .tab-buttons button:hover {
  background: #1e90ff;
  color: white;
}
