﻿body {
  padding: 0;
  margin: 0;
  overflow-y: scroll;
  font-family: monospace;
}

body,
input,
textarea {
  font-family: "DejaVu Sans Mono", monospace;
  font-size: 12px;
  -o-tab-size: 4;
  -moz-tab-size: 4;
  tab-size: 4;
}

input[type="checkbox"] {
  margin: 0;
  margin-right: 1em;
}

label {
  vertical-align: 3px;
}

input,
textarea {
  background: none;
  border: none;
  outline: none;
  resize: none;
  max-height: 400px;
}

h4 {
  font-size: 12px;
  margin: 1em 0;
  font-weight: bold;
}

pre {
  tab-size: 2;
  white-space: pre-wrap;
  word-wrap: break-word;
  -o-tab-size: 4;
  -moz-tab-size: 4;
  tab-size: 4;
}

a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

a:hover {
  text-decoration: underline;
}

#sidebar-content ul {
  padding-inline-start: 20px;
}

#sidebar-content ul li {
  list-style: disc outside none;
}

ul,
ol {
  margin-top: 0;
  margin-bottom: 10px;
  display: block;
  list-style-type: disc;
  margin-block-start: 1em;
  margin-block-end: 1em;
  margin-inline-start: 0px;
  margin-inline-end: 0px;
  padding-inline-start: 40px;
}

ul li {
  list-style: inside;
}

.hidden {
  display: none;
}

.expand {
  height: 100%;
}

.container {
  max-width: 600px;
  margin: 0 auto;
}

#messages {
  padding-top: 2em;
}

.message,
.refmessage {
  padding-bottom: 1em;
}

.chat-nick {
  float: left;
  width: 16em;
  margin-left: -17em;
  margin-right: 1em;
  text-align: right;
  white-space: nowrap;
}

.trip {
  font-size: 10px;
}

.text {
  margin: 0;
  margin-left: 1em;
  overflow: hidden;
}

.text p {
  margin: 0;
}

p.folded {
  max-height: 10em;
  overflow: auto;
}

p.folded::before {
  content: "Folded, Click or scroll to See more...";
  color: grey;
}

.message .text {
  overflow-wrap: break-word;
  /*Note: In contrast to word-break, overflow-wrap (word-wrap is now an alias of overflow-wrap) will only create a break if an entire word cannot be placed on its own line without overflowing.
  https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap
  
  I think this is a proper solution of too long messages without any spaces which may overflow the paragraph, though i dont know how official hack.chat client does the same thing.*/
}

.katex-display,
.katex {
  overflow-x: hidden;
  overflow-y: hidden;
}

pre.captcha {
  line-height: 1;
  width: max-content;
  font-size: small;
}

.colorful {
  background: linear-gradient(to right,
      #6600cc,
      #9900ff,
      #9900cc,
      #660066,
      #9900cc,
      #9900ff,
      #6600cc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbow_animation 6s ease-in-out infinite;
  background-size: 400% 100%;
}

.jebbed {
  background: linear-gradient(to right,
      #6666ff,
      #0099ff,
      #00ff00,
      #ff3399,
      #6666ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rainbow_animation 6s ease-in-out infinite;
  background-size: 400% 100%;
}

@keyframes rainbow_animation {

  0%,
  100% {
    background-position: 0 0;
  }

  50% {
    background-position: 100% 0;
  }
}

button#send {
  width: max-content;
  height: 100%;
}

button#sent-pre,
button#sent-next {
  width: auto;
  margin: 0%;
}

button.char {
  float: left;
}

#footer {
  position: fixed;
  bottom: 0;
  width: 100%;
}

#chatform {
  width: 100%;
  border-top: 1px solid;
}

#chatinput {
  width: 100%;
  padding: 1em;
  box-sizing: border-box;
}

#sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  padding: 1em;
  border-left: solid 1px;
  overflow-y: auto;
}

#sidebar-content {
  width: 180px;
  padding-bottom: 10%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 3px;
  margin-top: 0px;
}

blockquote {
  padding: 3px 10px;
  margin: 3px;
  border-left: 5px solid #4e4e4e;
}

code {
  padding: 2px 4px;
  font-size: 90%;
  color: #000000;
  background-color: #4e4e4e;
  border-radius: 4px;
}

hr {
  margin-top: 20px;
  margin-bottom: 20px;
  border: 0;
  border-top: 1px solid #4e4e4e;
}

mark {
  background-color: #60ac39;
  color: black;
}

pre {
  display: block;
  padding: 9.5px;
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.42857143;
  color: #797979;
  word-break: break-all;
  word-wrap: break-word;
  background-color: #4e4e4e;
  border: 1px solid #000;
  border-radius: 4px;
}

table {
  background-color: transparent;
  width: 100%;
  max-width: 100%;
  margin-bottom: 20px;
  border-spacing: 0;
  border-collapse: collapse;
}

table>caption+thead>tr:first-child>th,
table>colgroup+thead>tr:first-child>th,
table>thead:first-child>tr:first-child>th,
table>caption+thead>tr:first-child>td,
table>colgroup+thead>tr:first-child>td,
table>thead:first-child>tr:first-child>td {
  border-top: 0;
}

table>thead>tr>th {
  vertical-align: bottom;
  border-bottom: 2px solid #4e4e4e;
}

table>thead>tr>th,
table>tbody>tr>th,
table>tfoot>tr>th,
table>thead>tr>td,
table>tbody>tr>td,
table>tfoot>tr>td {
  padding: 8px;
  line-height: 1.42857143;
  vertical-align: top;
  border-top: 1px solid #4e4e4e;
}

th {
  text-align: left;
}

td,
th {
  padding: 0;
}

table>tbody>tr:nth-child(odd)>td,
table>tbody>tr:nth-child(odd)>th {
  background-color: #4e4e4e;
}

table>thead>tr>th,
table>tbody>tr>th,
table>tfoot>tr>th,
table>thead>tr>td,
table>tbody>tr>td,
table>tfoot>tr>td {
  padding: 8px;
  line-height: 1.42857143;
  vertical-align: top;
  border-top: 1px solid #4e4e4e;
}

td,
th {
  padding: 0;
}

img {
  max-width: 50%;
  max-height: 800px;
}

ul,
ol {
  padding: 0;
  margin: 0;
}

ul ul,
ol ol {
  padding-left: 2em;
}

.break {
  white-space: pre-line;
}

/* Mobile style */

@media only screen and (max-width: 600px) {

  #messages,
  #preview {
    border: none;
    padding: 0 0.5em 0 0.5em;
  }

  .message {
    padding-bottom: 0.5em;
  }

  .chat-nick {
    margin: 0;
    float: none;
    text-align: left;
    display: inline;
  }

  .text {
    display: inline;
  }

  .text * {
    overflow: hidden;
  }

  #sidebar {
    /* 
      https://github.com/ZhangChat-Dev-Group/ZhangChat/blob/main/client/style.css
      The Style above is under MIT License 
    */
    bottom: auto;
    border-bottom: solid 1px;
  }
}

#menu {
  position: relative;
  width: 200px;
  position: fixed;
  border-radius: 4px;
  background: #000000aa;
  line-height: 20px;
  max-height: 300px;
  overflow-y: scroll;
  -ms-overflow-style: none;
  /* IE 10+ */
  scrollbar-width: none;
  /* Firefox */
}

#menu>li {
  padding: 10px;
  display: block;
  cursor: pointer;
}

#menu>li:hover {
  background: #ffffff20;
}

dialog {
  border: 1px solid;
  padding: 5px 10px 5px 10px;
  border-radius: 2px;
  background: #333333ee;
  color: unset;
  max-width: 90%;
  max-height: 90vh;
  position: fixed;
}

#menu::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari �� Opera */
}

@keyframes shake {
  10%, 90% {
    transform: translate3d(-1px, 0, 0);
  }
  20%, 80% {
    transform: translate3d(2px, 0, 0);
  }
  30%, 50%, 70% {
    transform: translate3d(-4px, 0, 0);
  }
  40%, 60% {
    transform: translate3d(4px, 0, 0);
  } 
}
.shake {
  animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both; 
}
.login-error,.r {
  color: #ff2020;
  font-weight: bold;
}
#join-box {
  position: fixed;
  top: -120px;
  left: 0;
  right: 0;
  padding: 8px;
  background: #ffffff10;
  border-bottom: solid 2px #444;
  transition: all 0.5s;
}
#join-box>p {
  margin: 2px 5px 
}

#join-box>button {
  border: 0;
  background: #444;
  color: #fff;
  padding: 2px 10px;
  box-shadow: 2px 2px 0px 0px #333;
}
#join-box>button:hover {
  border: 0;
  background: #555;
  color: #fff;
  padding: 2px 10px;
  box-shadow: 3px 3px 0px 0px #444;
}
#join-box>p>input {
  background: #ffffff10;
  outline: 0;
  border: 0;
  color: #eee;
  width: calc(100% - 200px);
}
.login-error-message {
  display: none;
}
#join-box>label, #join-box>p>label, #join-box>b>label {
  vertical-align: 0;
}