/**
 * @fileOverview The primary stylesheet for the app
 * @notes This stylesheet is for the static look of the page
 */

/* ==== The footer expansion magic ==== */

.content-wrapper {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.header,
.footer {
  flex: none;
}

.main {
  flex: 1 0 auto;
  height: calc(100vh - 16rem);
}

/* ==== Header ==== */

.header-content {
  /*background-color: var(--clr-blue-dark); */
  background-color: #0301490d; /* Very light background */
  border-radius: 0 0 1rem 1rem;
  margin: 0 0.25rem;
  padding: 0.75rem 0 0.75rem 4rem;

  color: var(--clr-blue-dark);
  font-size: 1.125rem;
  font-weight: bold;
}

.header-links-divider {
  padding: 0 0.25rem 0 0.25rem;
}

.header-content a {
  color: var(--clr-blue-dark);
  text-decoration: none;
}

.header-content a:hover {
  text-decoration: underline;
}

/* ==== Main ==== */

.main {
  width: 100%;

  margin: 4rem auto;

  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
}

.main-left {
  max-width: 32rem;
}

.main-title {
  padding: 2rem 0;
}

.main-title h1 {
  font-size: 3.25rem;
  font-weight: bold;
  line-height: 1.2;
}

.main-description p {
  font-size: 1.25rem;
}

.main-start {
  margin: 4rem 0;

  display: flex;
  flex-direction: column;
  align-items: center;

  cursor: pointer;
}

.main-start-button {
  height: 4rem;
  width: 4rem;
  border-radius: 2rem;
  margin-bottom: 0.5rem;

  background-color: var(--clr-blue-dark);

  display: flex;
  justify-content: center;
  align-items: center;
}

.main-start-button img {
  margin-left: 0.25rem;
  height: 2.5rem;
  width: 2.5rem;
}

.main-start-text p {
  font-weight: bold;
  font-size: 1rem;
}

/* ==== Options ==== */

.main-divider {
  background-color: var(--clr-blue-dark);
  width: 0.25rem;
  height: 12rem;
  margin: 6rem 8rem 0 8rem;
}

.main-right {
  max-width: 32rem;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
}

.main-options {
  text-align: right;
  padding-top: 2rem;
}

.main-option h2 {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 2rem 0 1rem 0;
}

.main-option-button-group {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
}

.main-option-button {
  min-width: 6rem;
  height: 2rem;
  border: 1px solid var(--clr-blue-dark);
  border-radius: 1rem;
  margin-left: 2rem;

  font-size: 1rem;

  display: flex;
  justify-content: center;
  align-items: center;

  cursor: pointer;
}

.main-option-button.active {
  background-color: var(--clr-blue-dark);
  color: var(--clr-brown-light);
}

.main-option-input input {
  border: none;
  border-bottom: 1px solid var(--clr-blue-dark);
  background-color: var(--clr-brown-light);
  text-align: right;
  color: var(--clr-blue-dark);
}

.main-option-input input:focus {
  border: none;
  border-bottom: 1px solid var(--clr-blue-dark);
  box-shadow: 0 0.25rem 0.25rem -0.25rem var(--clr-blue-dark);
  outline: none;
}

.main-option-input p {
  padding-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--clr-red);
}

.main-confirm {
  margin-top: 8rem;

  display: flex;
  flex-direction: column;
  align-items: center;
}

.main-confirm-button {
  height: 4rem;
  width: 4rem;
  border-radius: 2rem;
  margin-bottom: 0.5rem;

  background-color: var(--clr-blue-dark);

  display: flex;
  justify-content: center;
  align-items: center;
}

.main-confirm-button img {
  margin-top: 0.5rem;
  height: 2.5rem;
  width: 2.5rem;
}

.main-confirm-text p {
  font-weight: bold;
  font-size: 1rem;
}

/* ==== Footer ==== */

.footer-content {
  margin: 0 1.5rem;
  padding-bottom: 0.5rem;

  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-end;
}

.footer-title h2 {
  font-size: 1.5rem;
  font-weight: bold;
}

.footer-links {
  position: fixed;  /* 让整个 footer 固定在页面某处 */
  top: 10px;  /* 距离页面顶部 10px */
  right: 10px;  /* 距离页面右边 10px */
  display: flex;
  justify-content: flex-end;
  align-items: center;
  z-index: 1000;  /* 确保它在所有元素上方显示 */
}

.footer-links {
  font-size: 1.125rem;
  font-weight: bold;
  margin: 0;
  height: min-content;
}

.footer-links-divider {
  padding: 0 0.25rem 0 0.25rem;
}
.footer-links a {
  color: inherit;
  text-decoration: none;
}

.footer-links a:hover {
  border-bottom: 1px solid currentColor; /* Changes to solid underline on hover */
}
/* ==== Custom Scrollbar ==== */
::-webkit-scrollbar {
  width: 0.5rem;
}

/* Track */
::-webkit-scrollbar-track {
  border-radius: 0.5rem;
}

/* Handle */
::-webkit-scrollbar-thumb {
  background: var(--clr-unity-grey);
  border-radius: 0.5rem;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
  background: var(--clr-unity-grey-dark);
}

/* ==== App ==== */

.app {
  flex-grow: 1;
  height: 100vh;

  display: flex;
  flex-direction: column;
}

.app-content {
  width: 100%;
  flex-grow: 1;
  padding: 0 1rem 1rem 1rem;
  position: relative;
}

.main-unity {
  position: absolute;
  top: 0;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;

  background-color: var(--clr-unity-grey);
  border-radius: 1rem;

  color: var(--clr-unity-grey-dark);

  display: flex;
  align-items: center;
  justify-content: center;
}

.main-unity p {
  font-size: 4rem;
  font-weight: bold;
}

.main-overlay {
  border-radius: 0 1rem 1rem 0;
  position: absolute;
  top: 0;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;

  pointer-events: none;
  overflow: hidden;

  display: flex;
  flex-direction: row;
}

/* ==== Chatbot ==== */

.main-chatbot {
  width: 1.5rem;
  background-color: var(--clr-brown-light);
  border-radius: 0 1rem 1rem 0;
  border: 0.25rem solid var(--clr-brown-dark);
  border-left: none;

  min-height: 0;
  display: flex;
  flex-direction: row;
  pointer-events: auto;

  z-index: 20;
}

.main-chatbot-toggle {
  background-color: var(--clr-brown-light);
  height: 100%;
  width: 1.5rem;
  border-radius: 0 0.5rem 0.5rem 0;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;

  cursor: pointer;
}

.main-chatbot-toggle:hover {
  box-shadow: inset -0.125rem 0 0.125rem 0 var(--clr-brown-dark);
}

.main-chatbot-toggle p {
  font-size: 0.875rem;
  writing-mode: vertical-rl;
}

.chatbot-content {
  display: flex;
  width: 100%;
  height: 100%;
  border-radius: 0 1rem 1rem 0;
  min-height: 0;
  flex-direction: column;
}

.chatbot-dialogue-area {
  background-color: var(--clr-brown-lighter);
  border-radius: 0 1rem 1rem 0;
  flex-grow: 1;

  margin: 0.25rem;
  display: flex;
  flex-direction: column;

  min-height: 0;
  overflow-y: scroll;

  font-size: 1rem;
}

.chatbot-dialogue-placeholder {
  margin-top: auto;
}

.chatbot-dialogue {
  margin-bottom: 3rem;
}

.chatbot-dialogue-name {
  padding: 0 2rem;
}

.chatbot-dialogue-content {
  padding: 0.5rem 2rem;
}

.chatbot-dialogue.there {
  text-align: left;
}

.chatbot-dialogue.there > .chatbot-dialogue-name {
  color: var(--clr-brown-dark);
}

.chatbot-dialogue.there > .chatbot-dialogue-content {
  background-image: url("../img/shade-brown.png");
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.chatbot-dialogue.here {
  text-align: right;
}

.chatbot-dialogue.here > .chatbot-dialogue-name {
  color: var(--clr-blue-light);
}

.chatbot-dialogue.here > .chatbot-dialogue-content {
  background-image: url("../img/shade-blue.png");
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.chatbot-input {
  height: 6rem;
  flex: none;

  padding: 1rem 0;

  display: flex;
  flex-direction: row;
}

.chatbot-input-button {
  height: 4rem;
  width: 4rem;
  border-radius: 2rem;
  margin: 0 1rem;

  background-color: var(--clr-green);

  display: flex;
  justify-content: center;
  align-items: center;

  cursor: pointer;
}

.chatbot-input-button:hover {
  background-color: var(--clr-green-light);
}

.chatbot-input-button img {
  width: 2rem;
  height: 2rem;
  margin-left: 0.25rem;
}

.chatbot-input-textarea {
  flex-grow: 1;
  margin-left: 0.25rem;
}

.chatbot-input-textarea textarea {
  width: 100%;
  height: 100%;
  resize: none;
  border: none;
  padding: 0.25rem;
  background-color: var(--clr-brown-lighter);
  color: var(--clr-blue-dark);
}

/* == Chatbot Customisation == */

.chatbot-customise {
  padding: 0.25rem;
  display: flex;
  flex-direction: row;
  border-bottom: 1px solid var(--clr-blue-dark);
  margin: 0.25rem 0.5rem;

  justify-content: flex-end;
}

.chatbot-theme-toggle {
  border: 1px solid var(--clr-blue-dark);
  border-radius: 0.5rem;
  padding: 0 0.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: 1.5rem;

  cursor: pointer;
}

.chatbot-customise p {
  font-size: 1.125rem;
  font-weight: bold;
  margin-right: 1rem;
}

.chatbot-customise-font {
  cursor: pointer;
  margin-right: 0.75rem;
  display: flex;
}

.chatbot-customise-font img {
  width: 1rem;
  height: 1rem;
  align-self: center;
}

/* ==== Protocol ==== */

.main-protocol {
  width: 3rem;
  background-color: var(--clr-brown-light);
  border-radius: 0 1rem 1rem 0;
  border: 0.25rem solid var(--clr-brown-dark);
  border-left: none;

  margin-left: -1.5rem;
  padding-left: 1.5rem;

  min-height: 0;
  display: flex;
  flex-direction: row;
  pointer-events: auto;

  z-index: 10;
}

.protocol-content {
  width: 100%;
  height: 100%;
  border-radius: 0 1rem 1rem 0;
  min-height: 0;

  display: flex;
  flex-direction: column;

  padding: 1rem;
}
/* ==== Protocol Landing and Description Styling ==== */


/* Consolidate styles for protocol-landing, protocol-desc, and protocol-exercise */
.protocol-landing,
.protocol-desc,
.protocol-exercise {
  background-color: var(--clr-brown-lighter); /* Beige color */
  padding: 1rem; /* Consistent padding */
  margin-bottom: 20px; /* Spacing between sections */
  border: none;
  border-left: none;
  border-radius: 5px; /* Rounded corners */
  color: var(--clr-brown-dark); /* Consistent text color */
}


/* Ensure protocol-desc uses Flexbox to stack children vertically */
.protocol-desc {
  flex-grow: 1;
  overflow-y: auto;
  display: flex; /* Enable Flexbox */
  flex-direction: column; /* Stack children vertically */
}

/* Allow protocol-exercise to grow and become scrollable */
.protocol-exercise {
  flex: 1 1 auto; /* Allow to grow and shrink as needed */
  overflow-y: auto; /* Enable vertical scrolling when content overflows */
}
/* ==== Typography ==== */

.protocol-landing h2,
.protocol-exercise h2,
.protocol-desc h2 {
  font-size: 1.8rem; /* Consistent heading size */
  margin: 1rem 0 1.5rem 0;
  margin-bottom: 1rem; /* Uniform spacing */
  color: var(--clr-brown-dark); /* Consistent heading color */
}

.protocol-landing p,
.protocol-exercise p,
.protocol-desc p {
  font-size: 1rem; /* Uniform paragraph size */
  line-height: 1.6;
  color: var(--clr-brown-dark);
  margin-bottom: 1rem;
}

/* ==== Buttons ==== */

.protocol-buttons,
.protocol-exercise .protocol-back-button {
  display: flex;
  flex-direction: column;
  align-items: center;    /* Center buttons horizontally */
  gap: 15px;

}

.protocol-week-button,
.protocol-back-button {
  padding: 10px 20px;
  background-color: #80b4ab; /* Primary button color */
  color: #ffffff; /* Button text color */
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s ease;
  max-width: 250px; /* Set a maximum width */

}

.protocol-week-button:hover {
  background-color: #424d51; /* Darker shade on hover */
  transform: translateY(-2px);              /* Slight lift on hover */
}

/* Specific styling for Back button */
.protocol-back-button {
  background-color: #e0e0e0; /* Neutral color for back action */
  color: #333333;
}

.protocol-back-button:hover {
  background-color: #c0c0c0;
}

/* ==== Responsive Design ==== */

@media (max-width: 768px) {
  .protocol-buttons {
    flex-direction: column;
    gap: 10px;
  }

  .protocol-week-button,
  .protocol-back-button {
    width: 100%; /* Full width on smaller screens */
    max-width: none; /* Remove max-width to allow full width */
  }
}


/*==== Unity ====*/

.main-unity canvas {
  width: 100%;
  height: 100%;
}

.avatar-creation {
  position: absolute;
  width: 90%;
  height: 90%;
  background-color: var(--clr-brown-lighter);
  display: flex;
  flex-direction: column;
  border-radius: 0.5rem;
  box-shadow: 0.125rem 0.5rem 1rem var(--clr-black);
}

.avatar-creation-title {
  height: 2rem;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
}

.avatar-creation-title h2 {
  width: fit-content;
  font-size: 1.25rem;
}

.avatar-creation-title label {
  font-size: 0.875rem;
}

.avatar-creation-title button {
  border-radius: 0.5rem;
  background-color: var(--clr-brown-lighter);
  width: 4rem;
  border: 1px solid var(--clr-brown-dark);
}

.avatar-creation iframe {
  width: 100%;
  height: calc(100% - 2rem);
}
