/*
  sillygoose-poofchat: a proof of concept of a peer-to-peer chat using WebRTC
  Copyright (c) 2026 Ariane Geneviève

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU Affero General Public License as
  published by the Free Software Foundation, either version 3 of the
  License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  GNU Affero General Public License for more details.

  You should have received a copy of the GNU Affero General Public License
  along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

@import url('/stylesheet/fonts.css');

:root {
  --white: #eee;
  --black: #111;
  --bg: #ddd;
}

.nospacing {
  padding: 0;
  margin: 0;
}

html, body, #wrapper {
  overflow-x: hidden;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
}

#wrapper {
  display: flex;
  flex-direction: column;

  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  font-size: 1em;

  background:
    url('/assets/images/pattern.png') repeat,
    linear-gradient(135deg, #0984e3, #ea00ff);
}

h1 {
  padding: 0 !important;
  margin: 0;
}


/* Header */
header {
  display: flex;
  z-index: 1;

  align-items: center;
  padding: 0 1vw 0 1vw;

  background: linear-gradient(to left, #ecf0f1, white, white, white);
  box-shadow: #111 0 2px 6px;
}

header div {
  flex: auto;
  color: white;
  cursor: default;
  text-align: center;
}

header div p {
  display: inline-block;
}

header h1 {
  background: linear-gradient(to right, #ef5350, #f48fb1, #7e57c2, #2196f3, #26c6da);
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

header ul {
  display: flex;
  flex-direction: row;
  align-items: center;
  list-style: none;
}

header li a{
  margin-left: 1vw;
  text-transform: uppercase;
  text-decoration: none;
  color: #0984e3;
}

header li a:hover {
  text-decoration: underline;
}

#main {
  flex: auto;
  display: flex;
  flex-direction: column;
  justify-items: center;
}

#images {
  width: 100vw;
  position: absolute;
  top: calc(2vh + 32px);

  display: flex;
  justify-content: space-between;
}

#images img {
  height: 100px;
  width: auto;
}

#chatbox {
  max-height: 90vh;
  flex: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#chatbox div {
  width: 66vw;
}

#chatbox #messagebox {
  flex: auto;
  margin: 1vh 0 1vh;
  background: rgba(0,0,0,0.1);
  border-radius: 6px;

  overflow-y: scroll;
  word-break: break-all;
  max-height: 98vh;
}

#chatbox #messagebox p {
  font-size: 1em;
  color: var(--white);
}

#chatbox #form {
  display: flex;
  justify-content: center;
}

#chatbox #form input {
  flex: auto;
}

#status {
  display: flex;
  padding: 0 1vw 0 1vw;
}

#status #construction {
  flex: 2 !important;
  text-align: center !important;
}

#status p {
  flex: 1;
  color: var(--white);
}

#status #peer_status {
  text-align: right;
}

@media screen and (width <= 80rem) {
  #chatbox div { width: 80vw; }
}

@media screen and (width <= 60rem) {
  #chatbox div {
    width: 100%;
  }
  #chatbox #form { margin-bottom: 1vh; }
  #images, #status { display: none; }
}
