
.chat-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#interactionTimer {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.95;
}

.rounded-btn {
  background-color: #007BFF;
  color: white;
  border: none;
  border-radius: 30px;
  padding: 12px 28px;
  font-size: 16px;
  font-family: 'Lato', 'Roboto', sans-serif;
  font-weight: 500;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.rounded-btn:hover {
  background-color: #0056b3;
  transform: translateY(-1px);
}

#floating-ui {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;

  width: min(320px, calc(50vw - 40px));
}

.control-panel {
  width: 100%;
  box-sizing: border-box;

  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  padding: 12px;
  border-radius: 10px;

  box-shadow: 0 4px 15px rgba(0,0,0,0.25);

  display: flex;
  flex-direction: column;
  gap: 10px;
}

.top-buttons {
  display: flex;
  gap: 10px;
}

.top-buttons .rounded-btn {
  flex: 1;
  min-width: 0;
}

.bottom-button {
  display: flex;
}

.bottom-button .rounded-btn {
  width: 100%;
}

df-messenger {
  --df-messenger-button-titlebar-color: #1e88e5;
}

html,
body {
  margin: 1px;
  max-width: 100%;
  overflow-x: hidden;
}

/* PATIENT INFORMATION PANEL */

#prog {
  position: fixed;
  top: 80px;
  bottom: 410px;
  left: 20px;

  width: min(420px, calc(50vw - 40px));
  max-width: calc(100vw - 40px);

  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
}

#prog .messageList {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

/* DISCOVERIES PANEL */

#discoveries {
  position: fixed;
  bottom: 20px;
  left: 20px;

  width: min(420px, calc(50vw - 40px));
  max-width: calc(100vw - 40px);

  height: min(420px, 40vh);

  display: flex;
  flex-direction: column;
  z-index: 10;
}

.discoveryList {
  background-color: white;
  flex: 1;
  overflow-y: auto;
  border-radius: 0px 0px 5px 5px;
  box-shadow: 0px 3px 6px 0px #00000029;
  padding: 10px;
}

/* VIDEO */
html, body {
  width: 100%;
  height: 100%;
  background: #000;
}

body {
  position: relative;
}

#idleVideo,
#myVideo {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  object-fit: cover;
  object-position: center center;
  pointer-events: none;
  background: #000;

  transition: opacity 0.18s ease-in-out;   
  will-change: opacity;
}

#idleVideo {
  z-index: 1;
  opacity: 1;
}

#myVideo {
  z-index: 2;
  opacity: 0;
}

#infoContainer,
#prog,
#discoveries,
#potentialquestions,
.chat-container,
.popup-overlay {
  z-index: 100;
}

/* DISCOVERY BUTTONS */

.disc_category {
  background-color: #42a5f5;
  color: white;
  padding: 10px;
  width: 100%;
  border: none;
  text-align: center;
  outline: none;
  font-size: 15px;
}

.content {
  font-size: 15px;
  padding: 0 18px;
  overflow: auto;
  transition: max-height 0.2s ease-out;
  background-color: #f1f1f1;
}

/* POPUPS */

.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.popup-window {
  background-color: white;
  padding: 30px;
  border-radius: 12px;
  width: min(400px, calc(100vw - 40px));
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  position: relative;
  text-align: center;
  font-family: 'Roboto', sans-serif;
}

.close-button {
  position: absolute;
  top: 12px;
  right: 16px;
  height: 3vh;
  width: 3vh;
  min-width: 32px;
  min-height: 32px;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  font-weight: bold;
  background-color: #42a5f5;
  color: white;
  cursor: pointer;
}

/* CHAT */

.chat-container {
  position: fixed;
  top: 80px;              /* aligns with Patient Information */
  right: 20px;
  bottom: 170px;          /* stays above control panel */

  width: min(320px, calc(50vw - 40px));
  min-width: 260px;
  max-width: calc(100vw - 40px);

  background-color: #ffffff;
  border-radius: 5px;

  box-shadow: rgba(0, 0, 0, 0.24) 1px 4px 15px 0px;

  display: flex;
  flex-direction: column;
  overflow: hidden;

  z-index: 100;
}

#chat-box {
  flex: 1 1 auto;
  min-height: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.chat-input {
  flex: 0 0 auto;
  display: flex;
  align-items: start;
  padding: 4px 15px 4px 10px;
}

.chat-input input {
  flex: 1;
  min-width: 0;
  padding: 0px;
  font-size: 14px;
  outline: none;
  border: none;
  color: rgba(0,0,0,0.87);
}

.chat-input input::placeholder {
  padding-left: 4px;
  color: #757575;
}

.chat-input button {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: #1e88e5;
  font-size: 18px;
  cursor: pointer;
  padding: 6px 0px;
}

#mic-button {
  padding-left: 8px;
  padding-right: 30px;
}

.chat-input button:hover {
  color: #0b57d0;
}

/* MESSAGE BUBBLES */

.chat-list {
  display: flex;
  flex-direction: column;
}

.df-message-bubble {
  border-radius: 12px;
  color: #001d35;
  text-align: start;
  flex: 0 0 auto;
  font-family: "Google Sans","Helvetica Neue",sans-serif;
  font-size: 14px;
  margin-top: 10px;
  width: fit-content;
  max-width: min(220px, 80%);
  padding: 7px 16px;
  box-shadow: 0px 1px 2px rgba(0,0,0,0.1);
  word-wrap: break-word;
}

.df-message-bubble.user {
  background-color: #e1e3e1;
  align-self: flex-end;
}

.df-message-bubble.bot {
  background-color: #ecf3fe;
  align-self: flex-start;
}

/* TITLES */

.title-wrapper {
  align-items: center;
  background-color: #42A5F5;
  border-radius: 5px 5px 0 0;
  box-shadow: 0px 3px 6px 0px #00000029;
  color: white;
  display: flex;
  font-family: 'Roboto', sans-serif;
  font-size: 18px;
  height: 50px;
  justify-content: space-between;
  padding-left: 15px;
  padding-right: 15px;
}

@media (max-height: 760px) and (min-width: 981px) {
  #prog {
    top: 20px;
    bottom: 230px;
  }

  #discoveries {
    height: 190px;
    bottom: 20px;
  }

.chat-container {
  right: 20px;
  bottom: 110px;
  height: min(420px, calc(100vh - 150px));
}

  #floating-ui {
    bottom: 20px;
  }

  .title-wrapper {
    height: 44px;
    font-size: 16px;
  }

  .rounded-btn {
    padding: 10px 20px;
    font-size: 15px;
  }
}

@media (max-width: 980px) {
  html,
  body {
    overflow: hidden;
  }

  body {
    padding: 0;
    box-sizing: border-box;
  }

  #idleVideo,
  #myVideo {
    width: 100vw;
    height: 100dvh;
    object-fit: cover;
  }

  /* Patient info: top-left */
#prog {
  position: fixed;
  top: 8px;
  left: 8px;

  width: 42vw;
  max-width: 185px;
  min-width: 135px;

  bottom: calc(24vh + 18px); 

  display: flex;
  flex-direction: column;
  overflow: hidden;

  z-index: 100;
}

  #prog .messageList {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    font-size: 11px;
  }

  /* Discoveries: bottom-left */
#discoveries {
  position: fixed;
  left: 8px;
  bottom: 8px;

  width: 42vw;
  max-width: 185px;
  min-width: 135px;

  height: 24vh; /* fixed bottom box */

  display: flex;
  flex-direction: column;
  overflow: hidden;

  z-index: 100;
}

  .discoveryList {
    font-size: 9px;
  }

  /* Chat: compact panel on right-middle */
.chat-container {
  position: fixed;

  top: 8px;
  right: 8px;

  width: 44vw;
  max-width: 210px;
  min-width: 150px;

  bottom: calc(120px + 18px); 

  display: flex;
  flex-direction: column;
  overflow: hidden;

  z-index: 100;
}


#chat-box {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 6px;
  gap: 4px;
}

  .df-message-bubble {
    font-size: 11px;
    max-width: 88%;
    padding: 5px 10px;
    margin-top: 6px;
  }

.chat-input {
  flex: 0 0 auto;
  padding: 2px 6px 4px 6px;
}

.chat-input input {
  font-size: 12px;
}

.chat-input button {
  font-size: 14px;
  padding: 4px 0;
}

  #mic-button {
    padding-right: 10px;
  }

  /* Control panel: bottom-right */
#floating-ui {
  position: fixed;
  right: 8px;
  bottom: 8px;

  width: 44vw;
  max-width: 210px;
  min-width: 150px;

  z-index: 1000;
}

.control-panel {
  padding: 6px;
  gap: 5px;
}

  .top-buttons {
    flex-direction: row;
    gap: 6px;
  }

.rounded-btn {
  min-height: 30px;
  padding: 4px 6px;
  font-size: 10px;
  border-radius: 18px;
}
  .title-wrapper {
    height: 34px;
    font-size: 13px;
    padding-left: 8px;
    padding-right: 8px;
  }

    .popup-window {
    width: min(320px, calc(100vw - 24px));
    max-height: 55vh;
    padding: 18px 16px 16px 16px;
    overflow-y: auto;
  }

  .notes-textarea {
    height: 22vh;
    min-height: 120px;
    max-height: 180px;
    font-size: 14px;
    padding: 10px;
  }

  #teethPopup iframe,
  #teethPopup img,
  #teethPopup video,
  #teethPopup object,
  #teethPopup embed {
    max-height: 22vh;
    width: 100%;
    object-fit: contain;
  }

  body::before,
  body::after {
    display: none;
  }
}

/* alignment grid */

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 460px;
  width: 1px;
  height: 100vh;
  background: rgba(0,0,0,0.06);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  top: 0;
  right: 340px;
  width: 1px;
  height: 100vh;
  background: rgba(0,0,0,0.06);
  pointer-events: none;
  z-index: 0;
}

.notes-textarea {
  height: 18vh !important;
  min-height: 100px !important;
  max-height: 150px !important;
  
  width: 100%;
    
  resize: vertical;

  box-sizing: border-box;
  padding: 14px;

  border: 1px solid #cfd8dc;
  border-radius: 8px;

  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  line-height: 1.5;
}


/* DISCOVERY HIGHLIGHTING */

.disc_category.active {
  background-color: #1e88e5;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.35);
}

.discoveryList.discovery-flash,
#discoveries .title-wrapper.discovery-flash,
.disc_category.discovery-flash,
.content.discovery-flash {
  animation: discoveryPulse 1.2s ease;
}

.discovery-item {
  padding: 8px 10px;
  margin-bottom: 8px;
  border-left: 4px solid #42a5f5;
  background: #f5fbff;
  border-radius: 4px;
  line-height: 1.35;
}

.discovery-item.new-discovery {
  animation: newDiscoveryGlow 2s ease;
}

@keyframes discoveryPulse {
  0% { box-shadow: 0 0 0 0 rgba(66,165,245,0.00); }
  25% { box-shadow: 0 0 0 6px rgba(66,165,245,0.20); }
  100% { box-shadow: 0 0 0 0 rgba(66,165,245,0.00); }
}

@keyframes newDiscoveryGlow {
  0% {
    background: #fff6bf;
    transform: translateY(-4px);
  }
  40% {
    background: #fff1a3;
  }
  100% {
    background: #f5fbff;
    transform: translateY(0);
  }
  } 

  
#discoveries {
  font-size: 11px;
}

#discoveries .title-wrapper {
  font-size: 13px;
}

.discovery-item {
  font-size: 11px;
  line-height: 1.2;
  margin-bottom: 4px;
}

.discoveryList {
  font-size: 11px;
}



