html {
  direction: rtl;
}

@font-face {
  font-family: Estedad;
  src: url("/static/font/Estedad.woff2");
}

@font-face {
  font-family: CascadiaCode;
  src: url("/static/font/CascadiaCode.woff2");
}

body {
  margin: 0;
  padding: 0;
  font-family: Estedad;
  font-size: 16px;
  background-color: #fcfcfc;
  color: #333;
}
* {
  box-sizing: border-box;
}
button,
input {
  font-family: Estedad;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
}
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid #eee;
  border-top-color: green;
  border-bottom-color: green;
  border-radius: 50%;
  animation: spinning_animation 1s linear infinite;
}
@keyframes spinning_animation {
  from {
    transform: rotateZ(0deg);
  }
  to {
    transform: rotateZ(360deg);
  }
}
.separator {
  margin: 0 auto;
}

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  padding: 0 2vw;
  background-color: #fff;
  box-shadow: 0 0 3px #ddd;
}
.header__title {
  font-size: 1.4rem;
  display: block;
  text-decoration: none;
  color: #000;
}
.header__action {
  height: 32px;
  cursor: pointer;
}

/* SMS Form */
.sms-form {
  height: calc(100vh - 72px);
  padding: 2vh 2vw;
  display: flex;
  align-items: stretch;
  justify-content: start;
  overflow-x: auto;
}

/* Card */
.card {
  display: flex;
  align-items: stretch;
  justify-content: start;
  flex-flow: column;
  position: relative;
  width: 100%;
  height: 100%;
  background-color: #fff;
  box-shadow: 0 0 3px #ddd;
}
.card--margin {
  margin-left: 12px;
}
.card__title {
  position: absolute;
  top: 16px;
  right: 16px;
  font-weight: bold;
}
.card__editor {
  display: flex;
  align-items: stretch;
  justify-content: start;
  width: 100%;
  height: calc(100% - 64px);
  flex-grow: 1;
}
.card__editor .numbers {
  border: none;
  padding: 6px;
  font-family: CascadiaCode;
  text-align: left;
  line-height: 24px;
  direction: ltr !important;
  overflow: auto;
  flex-grow: 1;
  resize: none;
}
.card__editor .linenumbers {
  width: 48px;
  padding-top: 7px;
  padding-bottom: 7px;
  padding-right: 6px;
  overflow: hidden;
}
.card__editor .linenumbers div {
  height: 24px;
  line-height: 24px;
  color: #ccc;
  font-family: CascadiaCode;
}
.card__numbers {
  font-family: CascadiaCode;
  text-align: left;
  line-height: 24px;
  direction: ltr !important;
  list-style: none;
  margin: 0;
  padding: 0 12px;
}
.card__numbers .linenumber {
  display: inline-block;
  width: 30px;
  height: 24px;
  line-height: 24px;
  color: #ccc;
}
.card__bottombar {
  display: flex;
  align-items: center;
  justify-content: start;
  padding: 9px;
  gap: 9px;
}
.card__bottombar .button {
  padding: 9px;
  outline: 0;
  background-color: #fff;
  cursor: pointer;
  transition: 300ms;
  display: flex;
  align-items: center;
  justify-content: start;
  font-weight: bold;
}
.card__bottombar .button--delete {
  background-color: red;
  color: #fff;
  border-radius: 9px;
  border: none;
}
.card__bottombar .button--send {
  background-color: green;
  color: #fff;
  border-radius: 9px;
  border: none;
}
.card__bottombar .button__indicator {
  display: block;
  background-color: #999;
  width: 24px;
  line-height: 24px;
  text-align: center;
  color: #fff;
  margin-left: 9px;
  border-radius: 50%;
}
.card__bottombar .button__indicator--spinner {
  background-color: #fff;
  animation-play-state: paused;
}
.card__bottombar .button__indicator#wrong__indicator {
  background-color: red;
}
.card__bottombar .button__indicator#duplicated__indicator {
  background-color: sandybrown;
}
.card__bottombar .button__icon {
  height: 24px;
  margin-left: 9px;
}
.card__bottombar .input-group {
  display: flex;
}
.card__bottombar .input {
  border: 1px solid #ddd;
  outline: none;
  border-radius: 9px;
  padding: 8px;
  font-size: 1rem;
  flex-grow: 1;
}
.card__bottombar .input-group .input {
  flex-grow: 0;
  width: 50px;
  border-radius: 0;
  border-left: none;
  text-align: center;
}
.card__bottombar .input-group .input:first-child {
  border-radius: 0 9px 9px 0;
}
.card__bottombar .input-group .input:last-child {
  border-radius: 9px 0 0 9px;
  border-left: 1px solid #ddd;
}
.card__list {
  border: none;
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  line-height: 24px;
  list-style: none;
  overflow: auto;
  animation: message_animation 300ms running;
}
.card__list .item {
  padding: 9px;
  margin: 12px 9px;
  display: flex;
  flex-flow: column;
  align-items: stretch;
  justify-content: start;
  position: relative;
  border-radius: 9px;
  border: 1px solid #e5e5e5;
  box-shadow: 0 3px #eee;
}
.card__list .item .row {
  display: flex;
  align-items: center;
  justify-content: start;
}
.card__list .item .row--space {
  margin-top: 12px;
}
.card__list .item .template {
  padding: 3px;
  font-size: 0.9rem;
  background-color: #f5f5f5;
  border-radius: 6px;
  font-weight: bold;
  font-family: CascadiaCode;
}
.card__list .item.loading .template {
  width: 50%;
  transition: 300ms;
  animation: loading_animation 1s linear infinite alternate;
}
.card__list .item .status {
  margin-left: 6px;
}
.card__list .item.loading .status {
  color: #fff;
}
.card__list .item .status-icon {
  width: 24px;
  height: 24px;
}
.card__list .item .status-icon--space {
  margin-left: 15px;
}
.card__list .item .status-icon--clickable {
  cursor: pointer;
}
.card__list .item.loading .status-icon {
  background-color: #f5f5f5;
  color: #f5f5f5;
  border-radius: 50%;
  transition: 300ms;
  animation: loading_animation 1s linear infinite alternate;
}
.card__list .item .proggressbar {
  position: absolute;
  bottom: -3px;
  right: -5px;
  width: 0;
  margin: 0 5px;
  height: 86px;
  border-bottom: 3px solid green;
  border-radius: 0 9px 9px 0;
  transition: 500ms;
}
@keyframes loading_animation {
  0% {
    background-color: #f5f5f5;
    color: #f5f5f5;
  }
  100% {
    background-color: #ddd;
    color: #ddd;
  }
}
@keyframes message_animation {
  from {
    margin-top: 42px;
  }
  to {
    margin-top: 30;
  }
}

/* Form */
.form {
  border-radius: 6px;
  padding: 66px 18px 18px 18px;
  width: 100%;
}
.form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.form__field {
  display: flex;
  justify-content: start;
  align-items: stretch;
}
.form__field--margin {
  margin-bottom: 18px;
}
.form__field label {
  padding: 12px;
  border-radius: 0 3px 3px 0;
  border: 1px solid #ddd;
  border-left: none;
  min-width: 42px;
  text-align: center;
}
.form__field input {
  border: 1px solid #ddd;
  border-radius: 3px 0 0 3px;
  padding: 12px;
  width: 50%;
  font-size: 1rem;
  flex-grow: 1;
}
.form__input--code {
  font-family: CascadiaCode;
}

/* Modal */
#modal_container {
  position: fixed;
  top: 0;
  right: 0;
  width: 100vw;
  height: 100vh;
  display: none;
  opacity: 0;
  justify-content: center;
  align-items: center;
  transition: 300ms;
}
#modal_shadow {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99;
  background-color: #fff;
  opacity: 0.7;
}
.card--modal {
  display: none;
  max-width: 512px;
  height: 80vh;
  z-index: 100;
}
.card--modal .card__title {
  position: static;
  text-align: center;
  line-height: 32px;
  padding: 12px 0;
  font-size: 1.2rem;
  border-bottom: 1px solid #eee;
}
.card--modal .card__editor {
  height: calc(100% - 64px - 57px);
}
/* for functionality */
.card__close,
.card__back {
  position: absolute;
  top: 12px;
  right: 12px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  width: 32px;
}

/* Toast message */
#toast_message {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  animation: toast_message_animation 6s linear forwards paused;
  border-radius: 6px;
  padding: 12px 18px;
  font-weight: bold;
  background-color: green;
  color: #fff;
  z-index: 120;
}
@keyframes toast_message_animation {
  0% {
    opacity: 0;
  }
  5% {
    opacity: 1;
  }
  95% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* Login page */
#login_page {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 110;
  display: flex;
  flex-flow: column;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  background-color: #fff;
}
.login__button {
  padding: 9px;
  border: none;
  display: block;
  border-radius: 6px;
  background-color: steelblue;
  color: #fff;
  font-weight: bold;
  text-align: center;
  cursor: pointer;
  font-size: 1rem;
  width: 100%;
}

/* Responsive */
@media screen and (max-width: 1024px) {
  .sms-form {
    display: block;
  }
  .card {
    height: 100%;
  }
  .card--no-scroll {
    height: auto;
  }
  .card--margin {
    margin-left: 0;
    margin-bottom: 2vh;
  }
  .card__editor {
    height: calc(96vh - 72px);
  }
  .card__bottombar--dynamic {
    position: absolute;
    bottom: 0;
    right: 0;
    flex-flow: column;
    align-items: stretch;
  }
}
