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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #ffffff;
  color: #1c1e21;
  margin: 0;

  min-height: 100vh;

  display: flex;
  
  justify-content: center;
}

/* =========================
   Card / Box
========================= */
.container,
.box,
.card {
  background: #ffffff;
  padding: 24px;
  border-radius: 12px;
  width: 100%;

  text-align: center;

}

/* =========================
   Navigation
========================= */
.top-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  height: 44px;
  width: auto;
}

.nav-toggle {
  background: #1b3363;
  color: #ffffff;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 1.1em;
}

.nav-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-link {
  text-decoration: none;
  color: #1b3363;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  background: #eef2f7;
}

.nav-link.is-active {
  background: #1b3363;
  color: #ffffff;
}

#install-btn.hidden {
  display: none;
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
  }

  .top-nav.is-open .nav-links {
    display: flex;
  }
}

@media (min-width: 721px) {
  .nav-toggle {
    display: none;
  }
}

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

h2 {
  color: #1b3363;
  font-size: 1.1em;
  margin: 0 0 12px;
  text-align: left;
}

.subtitle {
  color: #65676b;
  font-size: 0.95em;
}

/* =========================
   Warning for unsynced data
========================= */

.unsynced-warning {
  display: flex;
  align-items: center;
  gap: 0.5rem;

  margin: 0.75rem 0;
  padding: 0.75rem 1rem;

  background-color: #fff3e0;
  color: #c62828;

  border: 1px solid #f5c6cb;
  border-left: 4px solid #c62828;
  border-radius: 6px;

  font-size: 0.9rem;
  font-weight: 600;
}

.unsynced-warning.hidden {
  display: none;
}


/* =========================
   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: #1b3363;
}

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;
}

.btn-small {
  padding: 10px 14px;
  font-size: 0.9em;
}

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

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

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

.btn-dark {
  background: #1b3363;
  color: #fff;
}

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

.btn-outline {
  background: transparent;
  border: 2px solid #1b3363;
  color: #1b3363;
}

.btn-outline:hover:not(:disabled) {
  background: #1b3363;
  color: #ffffff;
}

.btn-block {
  width: 100%;
}

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

.secondary-button {
    margin-top: 10px;
    margin-bottom: 24px;
    background: transparent;
    border: 2px solid #1c3463;
    color: #1c3463;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

.secondary-button:hover {
    background: #1c3463;
    color: white;
}

/* === MODAL === */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.modal-content {
    background: white;
    max-width: 420px;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    position: relative;
    text-align: center;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 22px;
    cursor: pointer;
}

.help-image {
    width: 100%;
    margin-top: 15px;
    border-radius: 6px;
}


/* =========================
   Buscador manual
========================= */
.search-panel {
  margin-bottom: 24px;
  text-align: left;
}

.hint {
  color: #65676b;
  font-size: 0.9em;
  margin-bottom: 12px;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e2e6ea;
  border-radius: 10px;
  background: #f8f9fb;
}

.result-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result-name {
  font-weight: 700;
}

.result-meta {
  color: #65676b;
  font-size: 0.9em;
}

.meta-tags {
  display: flex;
  flex-direction: column;
}

.result-item.checked {
  border-color: #28a745;
  background: #f0fdf4;
}

.results-scroll {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 4px;
}

/* =========================
   Status banner
========================= */
.status-banner {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 600;
  display: none;
}

.status-banner.show {
  display: block;
}

/* =========================
   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); }
}
