:root{
  --accent: #666;
  --white: #fff;
  --bg: #fff;
  --main-text-color: #000;
  --bot-msg-bg: #1c1c20;
  --bot-msg-color: #ffffff;
  --user-msg-bg: #2b2b33;
  --user-msg-color: #ffffff;
}

*{ box-sizing: border-box; }
html, body { height: 100%; }
body{
  margin:0;
  font-family: var(--font-family), system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
}

.app{
  width: 100vw;
  height: 100vh;
  padding-top: 50px;
  padding-bottom: 100px;
  top: 0;
  left: 0;
  display: flex;
  align-items: flex-start;
  overflow-y: auto;
  scroll-behavior: smooth;
  scroll-padding-bottom: 120px;
}

#chat {
  width: 100vw;
  max-width: 1500px;
  margin: 0 auto;
  padding: 30px 30px 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
}

.icon-btn{
  border: 1px solid var(--accent);
  background: var(--bg);
  color: var(--accent);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}
.icon-btn:disabled{
  opacity: 0.5;
  cursor: default;
}

.msg{
  max-width: 78%;
  padding: 10px 12px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg.bot{
  align-self:flex-start;
  background: var(--bot-msg-bg);
  color: var(--bot-msg-color);
  border-radius: 10px 10px 10px 0;
  animation: fly-in 0.5s ease-in-out;
}

.msg.user{
  align-self:flex-end;
  background: var(--user-msg-bg);
  color: var(--user-msg-color);
  border-radius: 10px 10px 0 10px;
  animation: fly-in 0.5s ease-in-out;
}

.msg.user.uploaded-image{
  padding: 5px;
}

.msg img{
  display:block;
  max-width: 100%;
  border-radius: 12px;
}

.loadingWrap{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 15px;
  margin-right: auto;
  border-radius: 10px;
  background: var(--bg);
}

.loading-dot{
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--main-text-color);
}
.loading-dot:first-of-type {
  animation: 1.7s 0s infinite forwards ease-in-out load;
}
.loading-dot:nth-of-type(2) {
  animation: 1.7s 0.2s infinite forwards ease-in-out load;
}
.loading-dot:nth-of-type(3) {
  animation: 1.7s 0.4s infinite forwards ease-in-out load;
}

@keyframes load {
  0% {
      transform: translateY(0);
  }

  25% {
      transform: translateY(-10px);
  }

  50% {
      transform: translateY(0);
  }

  100% {
      transform: translateY(0);
  }
}

.loadingText{
  padding: 15px;  
  margin-right: auto;
  border-radius: 10px;
  background: var(--bg);
}

.extra-buttons{
  margin-left: 5px;
}

.input-bar{
  width: 90%;
  max-width: 1000px;
  height: 60px;
  background: var(--white);
  border: 1px solid var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
}

#textInput{
  flex:1;
  padding: 12px 12px;
  background: none;
  color: var(--main-text-color);
  outline: none;
  border: none;
}

.button{
  padding: 12px 14px;
  margin-right: 10px;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: var(--white);
  cursor: pointer;
  min-width: 90px;
}
#sendBtn:disabled, #textInput:disabled{
  opacity: 0.6;
  cursor: default;
}

.image-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  margin-right: auto;
  border-radius: 10px;
  padding: 0;
}

.image-container .image-overlay {
  position: relative;
  width: 100%;
}

.image-container p.image-info {
  padding-left: 15px;
  background: var(--bot-msg-bg);
  color: var(--bot-msg-color);
}

.image-container .image-overlay p.image-caption {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--main-text-color);
  background: var(--white);
  padding: 5px 15px;
  border-radius: 10px;
  font-size: min(2vw, 20px);
  font-weight: bold;
  text-align: center;
}

#chat img {
  width: 100%;
  border-radius: 10px;
}


.contact {
  padding: 20px;
  border-radius: 10px;
  border: 2px solid var(--accent);
  background: var(--white);
  margin-right: auto;
}

.contact-card a {
  color: var(--accent);
  text-decoration-color: var(--accent);
  text-decoration-thickness: bold;
}

.contact-card h4 {
  margin: 0;
}

.contact-card .print-btn {
  appearance: none;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  border: none;
  background: none;
  text-align: left;
  font-size: 1em;
}

.last-element {
  overflow: visible;
  height: 30px;
  display: block;
}


 
@media only screen and (max-width: 768px) {
  .app {
    padding-bottom: 160px;
  }

  .chat {
    padding: 10px;
    word-wrap: break-word;
    hyphens: auto;
  }

  .msg, .loadingText {
    max-width: 90%;
  }

  .icon-btn {
    background: var(--white);
    border: none;
  }
  .input-bar .extra-buttons {
    position: absolute;
    top: -46px;
    left: 10px;
    border-radius: 10px 10px 0 0;
    border: 1px solid var(--accent);
    background: var(--white);
  }
}

@media only print {
  body {
    overflow: initial;
  }

  .app {
    overflow: initial;
  }

  .chat {
    overflow: visible;
  }

  .input-bar {
    display: none;
  }
}
