/* ---------- Reset ---------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  height: 100vh;
  font-family: sans-serif;
}

/* ---------- Grid Layout ---------- */
.grid-container {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* 5 equal columns */
  grid-template-rows: 4fr 1fr;           /* row1 = video+empty, row2 = rooms */
  height: 100vh;
  gap: 5px;
}

/* ---------- First Row ---------- */

/* Video (spans 4 columns) */
.video-section {
  grid-column: 1 / 5;  /* columns 1-4 */
  grid-row: 1 / 2;
  border: 2px solid #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.video-section video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Right column split into 2 card-like panels */
.empty-section {
  grid-column: 5 / 6;
  grid-row: 1 / 2;
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 5px;
}

/* ---------- Shared Card Design ---------- */
.room-card,
.card-like {
  display: grid;
  border: 2px solid #000;
}

/* ---------- Room Cards Responsive Layout ---------- */
.room-card {
  grid-template-rows: 40% 60%; /* smaller top, bigger bottom */
  min-height: 150px;           /* keeps it readable on small screens */
}

/* Top part of room-card */
.room-card .top {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(5px, 2vw, 15px);
  gap: clamp(5px, 1.5vw, 12px);
  background-color: #003366;
  color: #fff;
  text-align: center;
}

.room-card .room-title {
  font-size: clamp(1rem, 2.5vw, 2rem);
  font-weight: bold;
  line-height: 1.2;
}

.room-card .specialty,
.room-card .doctor-name {
  font-size: clamp(0.8rem, 2vw, 1.4rem);
  font-weight: 600;
}

/* Bottom part of room-card */
.room-card .bottom {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: clamp(5px, 2vw, 15px);
  font-size: clamp(1rem, 2.5vw, 1.8rem);
  font-weight: bold;
  background-color: #76b9fd;
  text-align: center;
  overflow-y: auto;
}

/* ---------- Card-Like (Empty Section) ---------- */
.card-like {
  grid-template-rows: 70% 30%; /* default split */
}

.card-like .top {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px;
  gap: 10px;
  background-color: #003366;
  color: #fff;
  text-align: center;
}

.card-like .bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1rem, 2vw, 2rem);
  font-weight: bold;
  background-color: #76b9fd;
  text-align: center;
}

/* ---------- Empty Top Panel ---------- */
.empty-section .card-like:first-child .top {
  background: url("uploads/bg.jpg") center/cover no-repeat;
}

/* ---------- Queue Carousel (Empty Bottom Panel) ---------- */
#queue-carousel {
  width: 100%;
  height: 100%;
  display: flex;
}

#queue-carousel .room-card {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 30% 70%; /* smaller top, bigger bottom */
  border: 2px solid #000;
}

#queue-carousel .top {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px;
  gap: 5px;
  background-color: #003366;
  color: #fff;
  text-align: center;
}

#queue-carousel .room-title {
  font-size: clamp(1.2rem, 2.5vw, 2rem);
  font-weight: bold;
  line-height: 1.1;
}

#queue-carousel .doctor-name {
  font-size: clamp(0.9rem, 1.5vw, 1.2rem);
  font-weight: 600;
}

#queue-carousel .bottom {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 10px;
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: bold;
  background-color: #76b9fd;
  text-align: left;
  overflow-y: auto;
}

/* ---------- Alerts ---------- */
.room-card.alert-active .top,
.room-card.alert-active .bottom {
  animation: flash-bg 1s infinite;
}

@keyframes flash-bg {
  0%, 100% {
    background-color: inherit;
  }
  50% {
    background-color: #ffeb3b;
  }
}

/* Animate patient name during alert */
@keyframes pulseText {
  0%, 100% {
    font-size: 1.2rem;
    color: inherit;
  }
  50% {
    font-size: 3rem;
    color: #d9534f;
  }
}

.room-card.alert-active .patient-name {
  animation: pulseText 1s infinite ease-in-out;
}

/* ---------- Buttons ---------- */
#enable-notifications {
  display: none;
}

#enable-sound {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 10px 15px;
  background: #003366;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  z-index: 9999;
}
/* If no doctor */
.room-card.no-doctor .top {
  background: darkgrey;
}
.room-card.no-doctor .bottom {
  background: grey;
}