.hidden {
  display: none;
}

.container {
  display: flex;
  flex-direction: column;
  min-height: var(--tg-viewport-height, 100vh);
}

#video-container {
  height: calc(var(--tg-viewport-height, 100vh) - 4rem);
  min-height: calc(var(--tg-viewport-height, 100vh) - 4rem);
  max-height: calc(var(--tg-viewport-height, 100vh) - 4rem);
  overflow: hidden;
}

header {
  padding: 0.5rem;
  background-color: var(--secondary-bg-color);
  position: sticky;
  top: 0;
  left: 0;
}

.logo {
  display: block;
  font-size: 1.25rem;
  font-weight: 200;
  color: var(--text-color);
  padding: 0.25rem;
  border-radius: var(--border-radius);
}

.edges {
  max-width: 768px;
  margin: 0 auto;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

nav {
  padding: 0 .25rem;
  display: flex;
  gap: 1rem;
}

nav a.active {
  color: var(--text-color);
}

.marged {
  margin-top: 3rem;
  margin-bottom: 3rem;
}

.va-middle {
  vertical-align: middle;
}

.va-bottom {
  vertical-align: bottom;
}

.content {
  flex: 1;
  padding: 1rem;
  width: 100%;
  margin: 0 auto;
}

.row {
  display: flex;
  gap: .5rem;
}

.fixed-button {
  flex: 0;
}

.mainpage-bottom-block {
  margin: 0 auto;
}

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

footer {
  padding: 0.5rem;
  font-size: .75rem;
  font-weight: 200;
  width: 100%;
}

.badge {
  background-color: var(--error-color);
  color: var(--text-color);
  padding: 0.25rem;
  border-radius: var(--border-radius);
  position: absolute;
  top: -1rem;
  font-size: .55rem;
}

.buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 4rem;
  vertical-align: middle;
  gap: 1rem;
}

.buttons button, .buttons label {
  width: auto;
  padding: 0.25rem;
  background-color: var(--bg-color);
  color: var(--text-color);
  position: relative;
}

.hidden-select {
  position: relative;
}

.hidden-select select {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  z-index: 2;
  cursor: pointer;
}

.buttons button.disabled {
  color: var(--hint-color);
}

.buttons button.disabled::before {
  content: "";
  position: absolute;
  top: 45%;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--hint-color);
  z-index: 1;
  transform: rotate(45deg);
  animation: cross-line .1s forwards;
}

.call-container {
  display: flex;
}

@keyframes cross-line {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

.buttons svg {
  width: 1.5rem;
}

#main {
  display: flex;
  align-items: stretch;
  justify-content: center;
  height: 100%;
  overflow: hidden;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  position: relative;
}

#main.hidden-callers {
  flex-direction: row;
  align-items: flex-end;
  justify-content: center;
  flex-wrap: nowrap;
}

.caller {
  flex: 1;
  border: 0;
  flex-basis: 10%;
  position: relative;
}

.hidden-callers .caller {
  min-width: 4rem;
  flex: 0;
  height: 3rem;
  pointer-events: none;
}

.hidden-callers .caller.pinned {
  width: calc(100% - 2rem);
  position: absolute;
  left: 1rem;
  top: 1rem;
  height: calc(100% - 5rem);
  order: -1;
  flex: 15;
  pointer-events: all;
}

.caller#my-video {
  border-color: var(--secondary-bg-color);
}

.caller video {
  background-color: var(--bg-color);
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  margin: auto;
  height: 100%;
  width: 100%;
}

.video-name {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--text-color);
  background-color: var(--bg-color);
  padding: 0.5rem;
  z-index: 1;
  border-radius: var(--border-radius);
  font-size: .75rem;
}

@media (orientation: landscape) {
  #main {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .caller {
    flex-basis: 30%;
  }

  #main.hidden-callers {
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    flex-wrap: nowrap;
  }
  
  .hidden-callers .caller {
    width: 10%;
    flex: 0;
    min-height: 5rem;
    pointer-events: none;
  }
  
  .hidden-callers .caller.pinned {
    width: 85%;
    position: absolute;
    left: 1rem;
    top: 1rem;
    height: calc(100% - 2rem);
    order: -1;
    flex: 15;
    pointer-events: all;
  }
}

.buttons button.exitcall {
  color: var(--error-color);
}

.buttons-group {
  display: flex;
  align-items: center;
}

.call-footer {
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}

.call-control {
  flex: 1;
}

.notification {
  position: fixed;
  right: .5rem;
  top: .5rem;
  z-index: 10;
  padding: 0.5rem;
  background-color: var(--secondary-bg-color);
  color: var(--success-color);
  border-radius: var(--border-radius);
  text-align: center;
  animation: notification-animation 5s forwards;
}

.notification.user-disconnected {
  color: var(--warning-color);
}

@keyframes notification-animation {
  0% {
    opacity: 0;
  }

  5% {
    opacity: 1;
  }

  95% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }

}

.callers-count {
  color: var(--hint-color);
  position: fixed;
  right: 1rem;
  bottom: 0;
  line-height: 4.5rem;
  z-index: 3;
  display: flex;
  align-items: center;
  font-size: .5rem;
}

.callers-count svg {
  width: 1rem;
}

.chat-modal {
  display: flex;
  position: fixed;
  z-index: 2;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  top: 1rem;
  flex-direction: column;
  background-color: var(--secondary-bg-color);
  overflow: hidden;
  padding: 1rem;
  border-radius: var(--border-radius);
}

.chat-modal-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.chat-modal-title button {
  width: 2rem;
  padding: 0;
  background-color: transparent;
}

.chat-modal-title-text {
  font-size: 1.5rem;
  font-weight: 700;
}

.chat-modal-title-text em {
  font-style: normal;
  font-weight: 200;
  font-size: .75rem;
  color: var(--warning-color);
  vertical-align: middle;
}

.chat-model-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-right: 2rem;
}

.chat-model-footer button {
  width: 5rem;
  padding: 0.5rem;
  background-color: transparent;
}

.chat-model-footer button,
.chat-model-footer input {
  margin: 0;
}

.chat-modal-body {
  overflow: auto;
  overflow-y: auto;
  height: 400px;
  text-align: left;
  color: var(--text-color);
  flex: 1;
}

.chat-message-sender {
  color: var(--hint-color);
}

@media (orientation: landscape) {
  .chat-modal {
    width: 30%;
    height: var(--tg-viewport-height, 100vh);
    position: relative;
    left: 0;
    top: 0;
  } 
}
