* {
  margin: 0;
  padding: 0;
  font-size: inherit;
  min-width: 0px;
  box-sizing: border-box;
}


html, body {
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.8rem;
  font-family: "Libre Franklin", sans-serif;
  background-color: #0F131A;
  box-sizing: border-box;
  color: #DEE4ED;
}

body
{
  display: flex;
  flex-direction: column;
}

main
{
  height: 100%;
  width: 100%;
  contain: content;
  display: flex;
  flex-direction: column;
  overflow-y: auto;  
  -webkit-overflow-scrolling: touch;
  transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
}

.error
{
  padding: 0rem;
  margin: 0rem;
  font-size: 1rem;
  grid-area: error;
  color: #ff4d4d;
}

footer
{
  display: grid;
  grid-template-rows: 0.5fr, 1fr 1fr;
  grid-auto-columns: 1fr;
  grid-template-areas: "error"
                       "top"
                       "bottom";
  position: fixed;
  transform: translateZ(0);
  bottom: 0;
  align-items: center;
  justify-items: center;
  gap: 1rem;
  left: 0;
  width: 100%;
  z-index: 1000;
}

ol {
  list-style-position: inside;
}

#topic-list {
  flex-grow:1;
  padding: 1rem 0rem 1rem 0rem;
}

@media screen and (max-width: 1000px) { 
  body 
  { 
    padding: 2% 5% 30vh 5%;
  }
  footer 
  {
    height: 25vh;
  }
}
@media screen and (min-width: 1000px)
{
  body
  {
    padding: 2% 25% 18vh 25%; 
  }
  footer 
  {
    height: 15vh;
  }
}

.survey-question {
  margin-top: 2rem;
}

.chat-row       
{ 
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  flex-shrink: 0;
}
.chat-row:last-of-type
{
  min-height: 100%;
}


button:hover {
  cursor: pointer;
}

button:disabled
{
  cursor: default;
}

#chat-msgs { display: flex; flex-direction: column; }


.msg { padding: 1rem; margin-top: 0.5rem; margin-bottom: 0.5rem; border-radius: 40px; max-width: 80%; }
.msg:nth-child(6n + 1),
.msg:nth-child(6n + 4) { align-self: center; background-color: #374962; }
.msg:nth-child(6n + 2),
.msg:nth-child(6n) { align-self: flex-start; background-color: #375962; }
.msg:nth-child(6n + 3),
.msg:nth-child(6n + 5) { align-self: flex-end; background-color: #373E62; }

.msg-content { margin: 0rem; padding: 0rem; }

#suggestion-form { grid-area: top; }

#suggestion-form > button
{
  background-color: #2B323B;
  color: #DEE4ED;
  border-radius: 10px;
  border: none;
  padding: 1rem;
  font-size: 0.8rem;
}

#suggestion-form > button:disabled
{
  opacity: 50%;
}
#suggestion-form > button:enabled
{
  opacity: 100%;
}

#submission-form 
{
  width: 100%;
  grid-area: bottom;
}


@media screen and (min-width: 1000px) {
  footer
  {
    padding: 0rem 25% 0rem 25%;
  }
}

@media screen and (max-width: 1000px) {
  footer
  {
    padding: 0rem 5% 0rem 5%;
  }
}

a:visited {
    color: inherit; /* Remove the default visited color change */
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 200ms;
}


.survey-button {
  padding: 1rem 3rem 1rem 3rem;
  margin-top: 4rem;
  border-radius: 80px;
  color: #DEE4ED;
  background-color: #253141;
}

.textbar
{
  display: flex;
  align-self: center;
  align-items: center;
  width: 100%;
  flex-direction: row;
  align-items: center;
  background-color: #253141;
  border-radius: 80px;
  padding: 0rem 1rem 0rem 2rem;
}

#intro-msgs
{
  display: flex;
  flex-direction: column;
  align-items: center;
}

.intro-msg
{
  text-align: center;
}

.textbar > textarea {
  flex-grow: 1;
}

.textbar > button {
  background-color: transparent;
  border: none;
}


.textbar:has(> textarea:disabled)
{
  opacity: 50%;
  cursor: default;
}
.textbar:has(> textarea:enabled)
{
  opacity: 100%;
  cursor: pointer;
}

textarea {
  width: 100%;
  border: none;
  outline: none;
  background-color: transparent;
  font-family: inherit;
  line-height: inherit;
  color: inherit;
  resize: none;
  margin: 0;
}


@media screen and (min-width: 1000px) {
  .textbar img {
    min-width: 3rem;
  }
}
@media screen and (max-width: 1000px) {
  .textbar img {
    min-width: 2rem;
  }
  textarea {
      font-size: 1.0rem;
      padding: 1rem 1rem 1rem 2rem;
  } 
}

.intro-msg {
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

.intro-msg.visible {
  opacity: 1;
  visibility: visible;
}


@media screen and (min-width: 1000px) {
  header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
}
@media screen and (max-width: 1000px) {
  header {
    font-size: 14px;
  }
}

#countdown-timer span {
    text-align: center;
    font-size: 1.5em; /* Slightly increased for better visibility */
}


/* New Chat Button Styling */
#new-chat-btn {
    background-color: #ff4d4d; /* Bright red color */
    color: #fff;
    border: none;
    border-radius: 25px; /* Reduced radius for a sleeker button */
    padding: 8px 16px; /* Adjusted padding for better proportion */
    font-size: 1em; /* Consistent with timer text size */
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#new-chat-button {
  text-align: center;
}

#new-chat-btn:hover {
    background-color: #e60000; /* Darker red on hover */
}


@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 1s ease-out forwards;
}