/* =========================
   Base
========================= */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f0f2f5;
  color: #1c1e21;
  margin: 0;
  padding: 20px;
  min-height: 100vh;

  display: flex;
  align-items: center;
  justify-content: center;
}

/* =========================
   Card / Box
========================= */
.container,
.box,
.card {
  background: #ffffff;
  padding: 24px;
  border-radius: 12px;
  width: 100%;
  max-width: 500px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

/* =========================
   Headings & text
========================= */
h1 {
  color: #0b2f5b;
  margin-bottom: 16px;
}

.subtitle {
  color: #65676b;
  margin-bottom: 24px;
  font-size: 0.95em;
}

/* =========================
   Forms
========================= */
.form-group {
  margin-bottom: 20px;
  text-align: left;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

input {
  width: 100%;
  padding: 12px;
  font-size: 1em;
  border: 1px solid #ddd;
  border-radius: 8px;
}

input:focus {
  outline: none;
  border-color: #0b2f5b;
}

input:disabled {
  background: #f0f2f5;
  cursor: not-allowed;
}

/* =========================
   Buttons
========================= */
button {
  padding: 14px 20px;
  font-size: 1em;
  font-weight: bold;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

button:disabled {
  background: #aaa;
  cursor: not-allowed;
}

.btn-primary {
  background: #007bff;
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: #0056b3;
}

.btn-dark {
  background: #0b2f5b;
  color: #fff;
}

.btn-dark:hover:not(:disabled) {
  background: #083050;
}

.btn-block {
  width: 100%;
}

#new-checkin-button{
  display: none;
}

/* =========================
   QR Scanner
========================= */
#qr-reader {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  transition: opacity 0.3s ease;
}

#qr-reader.hidden {
  opacity: 0;
  height: 0;
  overflow: hidden;
  border: none;
}

/* =========================
   Results / Status
========================= */
#results-container {
  margin: 20px 0px;
  padding: 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
  min-height: 50px;

  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

#results-container.show {
  display: flex;
}

#scan-result,
#result-message {
  font-weight: bold;
  font-size: 1.1em;
  word-wrap: break-word;
}

#result-details {
  font-size: 0.95em;
  color: #65676b;
}

/* =========================
   States
========================= */
.success,
.ok {
  color: #28a745;
  border-color: #28a745;
  background: #f0fdf4;
}

.error {
  color: #dc3545;
  border-color: #dc3545;
  background: #fef2f2;
}

/* =========================
   Spinner
========================= */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation: spin 0.6s linear infinite;
  margin-left: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
