:root {
  background-image: linear-gradient(to bottom, #7AD7F0, #002E5D);
}

body {
  margin: 0;
  font-family: sans-serif;
}

/* ----------------- Guess Box ----------------- */
.guessbox {
  width: 600px;
  height: 650px;
  background-color: #0771B8;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);

  overflow-y: auto;          /* ← enables scrolling INSIDE */
  padding: 20px;
}

/* Container holding all guess rows */
.guesses-container {
  display: flex;
  flex-direction: column;
  padding-top: 100px;   /* pushes the first guess downward */
  box-sizing: border-box;
  gap: 20px;
}

/* Each guess is now a block */
.guess-row {
  width: 100%;
  background: #0771B8;      /* ← match the guessbox color */
  border-radius: 10px;
  padding: 10px;
}
/* Book title for each guess */
.guess-title {
  text-align: center;
  font-size: 20px;
  font-weight: bold;
  color: white;
  margin-bottom: 10px;
}

/* Row of 5 boxes */
.rect-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

/* Individual attribute boxes */
.rect {
  flex: 1;
  height: 60px;
  margin: 0 5px;
  background: rgba(255,255,255,0.1);
  border: 3px solid black;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: white;
  font-weight: 600;
  text-align: center;       /* ensures multi-line text is centered */
  flex-direction: column;   /* centers text vertically even with line breaks */
  word-break: break-word;   /* prevents overflow */

}

/* Softer colors applied in JS:
   Green: #4CAF50
   Yellow: #FFD54F
   Gray: #808080 */


/* ----------------- Guess Counter ----------------- */
.guess-label {
  position: fixed;
  top: 40px;
  right: 35%;
  font-size: 20px;
  font-weight: bold;
  color: white;
}

/* ----------------- Search Bar ----------------- */
.search-container {
  position: fixed;
  top: 60px;
  left: 0;
  width: 100%;
  padding: 15px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

#searchInput {
  width: 300px;
  padding: 10px;
  font-size: 16px;
  border-radius: 6px;
  border: none;
  color: black;
}

#searchInput::placeholder {
  color: #555;
}

.search-container button {
  padding: 10px 20px;
  font-size: 16px;
  border: none;
  border-radius: 6px;
  background: #5b9dc9;
  color: #F9F6EE;
  cursor: pointer;
}

.search-container button:hover {
  background: #1874d1;
}

.search-wrapper {
  position: relative;
}

/* ----------------- Dropdown ----------------- */
#dropdown {
  position: absolute;
  top: 45px;
  width: 300px;
  background: white;
  border: 1px solid #aaa;
  border-radius: 6px;
  display: none;
  max-height: 200px;
  overflow-y: auto;
  z-index: 999;
}

.dropdown-item {
  padding: 10px;
  cursor: pointer;
}

.dropdown-item:hover {
  background: #ddd;
}

/* ----------------- Messages ----------------- */
#searchResult {
  margin-top: 60px;
  text-align: center;
  color: white;
}

.bookDetails {
  background: rgba(0,0,0,0.35);
  border-radius: 10px;
  padding: 20px;
  display: inline-block;
}

/* ----------------- Start Message ----------------- */
.search-message {
  position: absolute;
  top: 100px; /* higher than the guessbox */
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  z-index: 9999;  /* ensures it is above guessbox */
  margin-bottom: 40px;
}

/* ----------------- Overlay ----------------- */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  color: white;
  font-size: 28px;
  z-index: 10000;
}

.overlay.hidden {
  display: none;
}

.overlay button {
  margin-top: 20px;
  padding: 10px 20px;
  font-size: 18px;
  border: none;
  border-radius: 6px;
  background: #5b9dc9;
  color: #F9F6EE;
  cursor: pointer;
}

.overlay button:hover {
  background: #1874d1;
}
