html{
  height: 100%;
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f4f4f9 url('/static/img/IMG_7140.JPEG') center/cover no-repeat;
  display: flex;
  justify-content: center;
  align-items: center;
}
body {
  height: 100%;
  margin: 0;
  font-family: Arial, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
}


.container {
  text-align: center;
}
.hidden { display: none; }

#slide-container {
  position: relative;
  width: calc(100% - 40px);
  max-width: 70vw;
  height: 70vh;
  margin: 0 auto;
  background: url('/static/img/IMG_7136.JPEG') center/cover;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: visible;
}

.slide {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  min-width: 50vw;
  min-height: 50vh;
}

.slide.active {
  display: flex;
}

.slide textarea,
.slide input {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  box-sizing: border-box;
  padding: 10px;
  border-radius: 8px;
  font-size: 1em;
  margin: 0;
  resize: none;
}

/* ----- Chat Bubble ----- */
.chat-bubble {
  position: relative;
  max-width: 50vw;
  max-height: 50vh;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 10;
  overflow: auto;
  margin-top: 1em;
}

/* ----- Spinner Inside Chat Bubble ----- */
.chat-bubble .spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #00796b;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
  margin: 8px auto;  /* center in bubble with some spacing */
  display: block;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ----- Navigation Arrows ----- */
.slide-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: transparent;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.5em;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}
.slide-arrow.left { left: 30px; }
.slide-arrow.right { right: 30px; }

/* ----- Tree View Layout ----- */
.container_tree_entries {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}
.left, .right {
  flex: 1;
  padding: 20px;
  border-radius: 8px;
}
#detail {
  position: absolute;
  top: 50%;
  left: calc(100% + 20px); /* pushes it 20px to the right of the tree container */
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.95);
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  width: 250px;
  display: none;
  color: #333;
  z-index: 999;
  max-height: 90vh;
  overflow-y: auto; /* allows scrolling if content exceeds max height */

}

#tree, .container_tree_entries {
  position: relative;
}
.node circle { cursor: pointer; stroke: #444; stroke-width: 1px; }
.link { fill: none; stroke: #ccc; stroke-width: 2px; }

/* ----- Donate Button ----- */
#donate-button-container button {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 9999;
  padding: 10px 20px;
  font-size: 16px;
  background-color: #00796b;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}
#donate-button-container button:hover {
  background-color: #004d40;
}
#new-thought-container button {
  position: fixed;
  top: 20px;
  left: 160px; /* move it a bit to the right of the donate button */
  z-index: 9999;
  padding: 10px 20px;
  font-size: 16px;
  background-color: #00796b;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: background-color 0.3s ease;
}
#new-thought-container button:hover {
  background-color: #004d40;
}



/* ----- jQuery UI Menu Styling ----- */
#menu {
  display: none;
  width: auto;
  min-width:100px;
  white-space:nowrap;
  position: absolute;
  z-index: 2000;
  background: white;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  overflow-y: auto;
  max-height: 200px;
  padding: 0;
  margin: 0;
}

.ui-menu {
  width: 220px;
  background: white;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.ui-menu .ui-menu {
  position: absolute;
  top: 0;
  left: 100%;
  margin-top: -3px;
  z-index: 2100;
}

.ui-menu-item-wrapper {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
}
.ui-menu-item-wrapper:hover {
  background: #e3f2fd;
}

/* ----- Responsive Adjustments ----- */
@media (max-width: 768px) {
  #slide-container {
    width: calc(100% - 40px);
    height: auto;
    flex-direction: column;
  }
  .slide {
    max-width: 90%;
    max-height: 70vh;
    overflow: visible;
  }
  .chat-bubble {
    max-width: 90vw;
    max-height: 50vh;
  }
  #menu {
    width: 80vw;
  }
}

#searching-emotion-wrapper {
    display: none; /* hidden until submit */
    position: fixed; /* so it floats */
    top: 80px; /* adjust as needed */
    left: 20px;
    z-index: 9999;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}
#searching-emotion-wrapper ul ul { display: none; } /* hide submenus by default */
#searching-emotion-wrapper li { cursor: pointer; list-style: none; padding: 2px 5px; }
#searching-emotion-wrapper li div:hover { background: #eee; }
