/* styles/components/checkin.css */

/*----------------------------------------
  Design Tokens
----------------------------------------*/
:root {
  --color-navy:       #001F3F;
  --color-teal:       #00D0B0;
  --color-white:      #ffffff;
  --color-bg:         #f7fafc;
  --color-grey-50:    #edf2f7;
  --color-grey-100:   #e2e8f0;
  --color-grey-200:   #cbd5e0;
  --color-grey-400:   #718096;
  --radius-sm:        4px;
  --radius-md:        8px;
  --radius-lg:        12px;
  --shadow-sm:        0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md:        0 4px 6px rgba(0, 0, 0, 0.1);
  --font-stack:       'Poppins', sans-serif;
}

/*----------------------------------------
  Global Reset & Base
----------------------------------------*/
*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: var(--font-stack);
  background: var(--color-bg);
  color: var(--color-grey-400);
  line-height: 1.6;
}
h1, h2 {
  margin: 0 0 0.5rem;
  font-weight: 600;
  color: var(--color-navy);
}
p {
  margin: 0 0 1rem;
}
a {
  text-decoration: none;
  color: inherit;
}

/*----------------------------------------
  Buttons
----------------------------------------*/
.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-teal);
  color: var(--color-white);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn:hover {
  background: #00b399;
  transform: translateY(-1px);
}
.btn.logout {
  background: none;
  color: var(--color-white);
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
}
.btn.logout:hover {
  background: rgba(255, 255, 255, 0.2);
}

/*----------------------------------------
  Header
----------------------------------------*/
header {
  background: var(--color-navy);
  color: var(--color-white);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
}
header h1 {
  font-size: 1.5rem;
}
header p {
  font-size: 1rem;
}
@media (max-width: 600px) {
  header {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

/*----------------------------------------
  Main Grid
----------------------------------------*/
main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

/*----------------------------------------
  Section Cards
----------------------------------------*/
.section {
  background: var(--color-white);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.section h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

/*----------------------------------------
  Scanner Section
----------------------------------------*/
.scanner {
  display: flex;
  flex-direction: column;
}
.scanner button {
  width: 100%;
  margin-bottom: 0.5rem;
}
.scanner-text {
  font-style: italic;
  color: var(--color-grey-200);
  margin-bottom: 1rem;
}
.scanner-view {
  position: relative;
  width: 100%;
  padding-top: 75%; /* 4:3 aspect ratio */
  border: 2px solid var(--color-grey-100);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
}
.scanner-view video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/*----------------------------------------
  Guest Preview
----------------------------------------*/
.preview {
  display: flex;
  flex-direction: column;
  text-align: left;
}
.preview p {
  margin: 0.5rem 0;
}
.preview .btn {
  width: 100%;
  margin-top: 1rem;
}

/*----------------------------------------
  Manual Search
----------------------------------------*/
.manual {
  display: flex;
  flex-direction: column;
}
.manual input[type="text"] {
  padding: 0.6rem 1rem;
  border: 1px solid var(--color-grey-100);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: border-color 0.2s;
}
.manual input:focus {
  outline: none;
  border-color: var(--color-teal);
}
.guest-list {
  list-style: none;
  margin-top: 1rem;
  padding: 0;
  max-height: 240px;
  overflow-y: auto;
}
.guest-list li {
  padding: 0.6rem;
  border-bottom: 1px solid var(--color-grey-100);
  cursor: pointer;
  transition: background 0.2s;
}
.guest-list li:hover {
  background: var(--color-grey-50);
}

/*----------------------------------------
  Checked-In Guests Table
----------------------------------------*/
.checked-in {
  display: flex;
  flex-direction: column;
}
.checked-in table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.checked-in thead {
  background: var(--color-grey-100);
}
.checked-in th,
.checked-in td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-grey-100);
}
.checked-in tbody tr:nth-child(even) {
  background: var(--color-grey-50);
}
.checked-in {
  overflow-x: auto;
}

/*----------------------------------------
  Responsive Tweaks
----------------------------------------*/
@media (max-width: 500px) {
  main {
    grid-template-columns: 1fr;
  }
  .btn {
    width: 100%;
  }
}


main {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;

  /* prevent columns from stretching to equal height */
  align-items: start;
}
