/* === Global Reset === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* === Body & Background === */
body {
  font-family: 'Poppins', sans-serif;
  background:
    linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.55)),
    url('lib.jpg') no-repeat center center / cover;
  color: #fff;
  text-align: center;
  padding: 40px 20px;
  min-height: 100vh;
  background-attachment: fixed;
}

/* Avoid jank on mobile for fixed backgrounds */
@media (max-width: 768px) {
  body {
    background-attachment: scroll;
    padding: 24px 12px;
  }
}

/* Respect reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* === Headings === */
h1, h2 {
  color: #fff;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.25);
  margin-bottom: 16px;
}

#t1 {
  color: #fff;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.25);
  margin-bottom: 20px;
  font-size: clamp(32px, 5vw, 54px);
}

/* === Rooms Grid === */
#rooms {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 45px;
  margin-top: 36px;
}

/* === Room Card === */
.room {
  width: 280px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 20px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  backdrop-filter: blur(5px);
  text-align: left;
}

.room:hover {
  transform: translateY(-6px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.available {
  border-left: 6px solid #28a745;
}

.occupied {
  border-left: 6px solid #dc3545;
}

/* === Card Text === */
.room h3 {
  font-size: 1.2em;
  color: #333;
  margin-bottom: 10px;
}

.room p {
  font-size: 0.95em;
  margin: 6px 0;
  color: #555;
  line-height: 1.45;
}

b {
  color: #111;
}

/* === QR Image === */
.room img {
  margin: 12px auto;
  border-radius: 10px;
  border: 2px solid #eee;
  transition: transform 0.25s ease;
}

.room img:hover {
  transform: scale(1.08);
}

/* === Buttons & Links === */
a, button {
  display: inline-block;
  background: linear-gradient(90deg, #007bff, #0056b3);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  text-decoration: none;
  cursor: pointer;
  margin-top: 16px;
  transition: transform 0.2s ease, filter 0.2s ease, background 0.2s ease;
  font-weight: 500;
}

a:hover, button:hover {
  background: linear-gradient(90deg, #0056b3, #00408d);
  transform: translateY(-1px) scale(1.03);
  filter: brightness(1.02);
}

a:focus-visible, button:focus-visible {
  outline: 3px solid rgba(0, 123, 255, 0.5);
  outline-offset: 2px;
}

/* Optional: a slightly different look for destructive actions */
.btn-danger {
  background: linear-gradient(90deg, #dc3545, #a71d2a);
}
.btn-danger:hover {
  background: linear-gradient(90deg, #b02a37, #7e1621);
}

/* === Timer === */
[id^="timer-"], #timer {
  font-weight: 700;
  color: #ff4500;
  letter-spacing: 0.3px;
}

/* === Forms === */
form {
  background: rgba(255, 255, 255, 0.95);
  max-width: 420px;
  margin: 32px auto;
  padding: 24px;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  text-align: left;
}

label {
  display: block;
  font-weight: 600;
  margin-top: 14px;
  color: #444;
}

input, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  margin-top: 6px;
  font-size: 1em;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus-visible, select:focus-visible {
  border-color: #80bdff;
  box-shadow: 0 0 0 3px rgba(0,123,255,0.25);
  outline: none;
}

/* === Result/Message === */
#result {
  margin-top: 16px;
  font-weight: 600;
  color: #16e413;
  text-align: center;
}

code {
  background: #f3f3f3;
  color: #333;
  padding: 2px 6px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* === Small screens tweaks === */
@media (max-width: 480px) {
  #rooms { gap: 20px; }
  .room { width: 100%; max-width: 360px; margin: 0 auto; }
}