/* //home new interactive text */

html.atl header {
  position: fixed;
  z-index: 1000;
  width: 100%;
  top: 0;
  left: 0;
  padding: 1.5vw;
}
html.atl {
  background-color: rgb(0, 26, 53);
}
html.atl #chat-container {
  border: 0;
  border-radius: 0;
  padding-top: 0;  
}

#atl_container.disabled {
  pointer-events: none;  
}

#atl_container.disabled .input-container {
  bottom: -40px; 
  text-align: center;
  display: block;
}

#atl_container {
  width: 512px;
  height: 512px;
  background-color: rgb(0, 26, 53);
  z-index: 200;
  pointer-events: none;
  aspect-ratio: 1/1;
  position: relative;
  margin-top: 100px;
  transition: width 0.3s ease, height 0.3s ease, margin 0.3s ease;
  margin: 100px auto;
  /* Base font-size: 16px for 512px container = 3.125% of container height */
  font-size: 16px;
}

#atl_container.fullscreen {
  width: auto;
  height: calc(100vh - 130px);
  margin-top: 30px;
  margin-left: auto;
  margin-right: auto;
  /* Scale font proportionally: (height / 512) * 16px */
  font-size: calc((100vh - 130px) * 0.03125);
}

.blob-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 200;
  pointer-events: none;
  opacity: 0.5;
}

.chat-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  z-index: 2;
  pointer-events: none;
}

.conversation {
  flex: 1;
  overflow-y: auto;
  pointer-events: auto;
  /* padding-top: 3vw; */
}

.input-container {
  /* padding: 20px; */
  /* background: rgba(0, 0, 0, 0.5); */
  /* backdrop-filter: blur(10px); */
  display: flex;
  gap: 10px;
  pointer-events: auto;
  position: absolute;
  bottom: -70px;  
  width: 100%;
  transition: bottom 0.3s ease;
  z-index: 2000;
}

#atl_container.fullscreen .input-container {
  bottom: -70px;
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 0;
  border: 5px solid #000;
  border-radius: 8px;
  border-style: double;
  background: rgba(216, 225, 229, 1);
  transition: background 0.2s ease;
  width: 100%;
}

.input-wrapper:focus-within {
  background: rgba(255, 255, 255, 1);
}

#chat-input {
  flex: 1;
  padding: 12px;
  padding-right: 8px;
  border: none;
  background: transparent;
  color: #000;
  font-family: "routed-gothic";
  font-size: 16px;
  resize: none;
  overflow-y: auto;
  max-height: calc(1.4em * 3 + 24px); /* 3 lines max + padding */
  line-height: 1.4;
  min-height: calc(1.4em + 24px); /* 1 line + padding */
}

#chat-input:focus {
  outline: none;
}

/* #chat-input::placeholder {
  color: #7e7e7e;
  font-family: "routed-gothic";
  font-size: 12px;
  position: absolute;
  top: -10px;
  left: 0;
  padding: 12px;
  box-sizing: border-box;
} */

.fullscreen-chat {
  position: absolute;
  right: -30px;
  top: 0;
  cursor: pointer;
  transition: transform 0.3s ease;
  pointer-events: auto;
}

.fullscreen-chat:hover {
  transform: scale(1.1);
}

.fullscreen-chat.active {
  transform: rotate(45deg);
}

.fullscreen-chat.active:hover {
  transform: rotate(45deg) scale(1.1);
}


#send-button {
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #000;
  font-weight: bold;
  background: none;
  padding: 12px;
  padding-left: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#send-button img {
  width: 20px;
  height: 20px;
  display: block;
}

#send-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Scrollbar styling for textarea */
#chat-input::-webkit-scrollbar {
  width: 4px;
}

#chat-input::-webkit-scrollbar-track {
  background: transparent;
}

#chat-input::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 2px;
}

#chat-input::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.5);
}

.message {
  /* margin: 10px 0; */
  margin:0;
  padding: 0;
  max-width: 95%;
  width: fit-content;
  font-family: 'twoup', monospace;
  line-height: 1.4;
  word-wrap: break-word;
  white-space: pre-wrap;
  font-size: 1em;
  border-radius: 0;
  transition: font-size 0.3s ease;
}

.message-user {
  margin-left: auto;
  /* margin-right: 1.5vw */
  text-align: right;
}

.message-assistant {
  margin-right: auto;
  /* margin-left: 1.5vw */
}

.message-error {
  margin: 10px auto;
  background: rgba(255, 0, 0, 0.2);
  color: #fff;
  text-align: center;
}

.message-content {
  display: inline-block;
  width: 100%;
}

.message-text {
  margin: 0;
  padding: 0;
}

.error-icon {
  margin-right: 8px;
}

/* Mobile styles for interactive text */
@media screen and (max-width: 768px) {
  html.atl header {
    padding: 3vw;
  }
  
  html.atl .hamburger-menu span {
    background-color: #fff;
  }
  
  html.atl nav {
    background-color: rgba(0, 26, 53, 0.98);
  }
  
  html.atl nav ul li a,
  html.atl nav div.user a {
    color: #fff;
  }

  #atl_container {
    margin-top: 50px;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1/1 !important;
  }
  
  .conversation {
    padding-top: 0;
  }
  
  .input-container {
    padding: 15px;
    gap: 8px;
  }
  
  #chat-input {
    font-size: 18px;
    padding: 10px;
    padding-right: 8px;
    max-height: calc(1.4em * 3 + 20px);
    min-height: calc(1.4em + 20px);
  }
  
  #send-button {
    padding: 10px;
    font-size: 18px;
  }

  #send-button img {
    width: 18px;
    height: 18px;
  }

  .input-container {
    bottom: -100px;
  }
  #atl_container.disabled .input-container {
    bottom: -100px;
  }

  
  .message {
    /* margin: 8px 0; */
    padding: 0;
    max-width: 95%;
    font-size: 18px;
  }
  
  .message-user {
    margin-right: 0;
  }
  
  .message-assistant {
    margin-left: 0;
  }
}

/* iPhone SE and smaller phones */
@media screen and (max-width: 375px) {
  html.atl header {
    padding: 4vw;
  }
  
  .input-container {
    padding: 10px;
  }
  
  #chat-input {
    padding: 8px;
    padding-right: 6px;
    max-height: calc(1.4em * 3 + 16px);
    min-height: calc(1.4em + 16px);
  }
  
  #send-button {
    padding: 8px;
  }

  #send-button img {
    width: 16px;
    height: 16px;
  }
  
  .message {
    font-size: 14px;
    padding: 0;
  }
}
