body, html {
  background: black;
  font-size: 100%;
  max-width: 100%;
  overflow-x: hidden;
  height: 100%;
  margin: 0;
  justify-content: center;
  align-items: center;
  font-family: sans-serif;
}

img {
  background-repeat: no-repeat;
}

/* Default values for grid layout 4 cols x 3 rows */
:root {
  --top-bar-height: auto;
  --ticker-height: 2em;
  --tiles-layout: auto auto auto auto;
  --tile-width: auto;
  --tile-height: calc((100vh - var(--top-bar-height) - var(--ticker-height)) / 3);
}

.button {
  text-decoration: none;
}

.error-block {
  background-color: darkred;
  border: 0.5em red;
  color: white;
}

.media {
  cursor: pointer;
  height: 100%;
  width: 100%;
}

.dashboard {
  border: 0em none;
  display: grid;
  grid-gap: 0em;
  grid-template-columns: var(--tiles-layout);
  margin-bottom: 0em;
  overflow: hidden;
  position: relative;
  width: 100%;
  height: calc(var(--dashboard-height) - 1vh);
  --webkit-height: var(--dashboard-height);
}

.default-frame {
  margin-top: 0em;
  margin-bottom: 0em;
  margin-left: 0em;
  left: 0em;
  top: 0em;
  border: 0em none;
  height: 100%;
  width: 100%;
  position: fixed;
  overflow: hidden;
  bottom: 0em;
}


/* Feeds */
.feed-ticker {
  background-color: #000000aa;
  bottom: 0em;
  box-sizing: border-box;
  font-size: 1em;
  font-weight: normal;
  overflow: hidden;
  padding: 0em;
  margin: 0em;
  position: relative;
  white-space: nowrap;
  width: 100%;
  height: var(--ticker-height);
}

.feeds-container {
  animation-play-state: running;
  animation: ticker var(--ticker-duration, 90s) linear infinite;
  display: inline-block;
  height: 2em;
  margin-left: 100%;
  --webkit-margin-top: 0.2em;
}

.feed-container {
  border-radius: 0.5em;
  padding-left: 0.5em;
}

.feed-item {
  color: goldenrod;
  margin-right: 0.5em;
  text-decoration: none;
}

.feed-title {
  color: lightgrey;
  margin-right: 0.5em;
  text-decoration: none;  
}

.feed-ticker-error {
  color: white;
}

@keyframes ticker {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-100%);
  }
}


/* Menus */
#menu-container {
  display: block;
  height: auto;
  position: absolute;
  right: 5em;
  top: 4.3em;
  transition: 0.3s;
  z-index: 20;
}

.user-menu, .menu {
  grid-gap: 0.2em;
  width: 3em;
}

.menu-item a, .tile-menu-item a, .focused-tile-menu-item a{
  opacity: 50%;
  background-color: #777777;
  border-radius: 0.7em;
  color: white;
  float: inline-start;
  font-family: sans-serif;
  font-optical-sizing: auto;
  font-size: 1em;
  font-style: normal;
  font-weight: bold;
  margin-top: 0.5em;
  padding-bottom: 0.4em;
  padding-left: 1.3em;
  padding-right: 1.3em;
  padding-top: 0.4em;
  position: relative;
  text-align: center;
  text-decoration: none;
  transition: 0.3s;
  width: 5em;
}

.menu-item a:hover, .tile-menu-item a:hover, .focused-tile-menu-item a:hover {
  opacity: 85%;
  background-color: #777777;
  border-radius: 0.7em;
}


/* Popups */
.popup {
  display: flex-root;
}

.popup-container {
  position: absolute;
  top: 4.3em;
  left: 30%;
  right: 30%;
  bottom: 30%;
  background-color: darkslategrey;
  color: white;
  border-radius: 1em;
  height: max-content;
  display: block;
} 

.popup-label {
  display: flex;
  align-content: center;
  justify-content: center;
  text-align: center;
  padding: 0.8em;
  font-size: x-large;
}

.popup-body {
  align-content: center;
  justify-content: center;
  text-indent: -2em;
  margin-bottom: 2em;
  margin-left: 2em;
  padding: 1em;
  padding-right: 2em;
  display: flow-root;
}

.popup-text {
  display: block;
}

.popup-text p {
  margin-top: 0.2em;
  margin-bottom: 0em;
  margin-left: 2em;
  padding: 0em;
}

.sources-js-code-container {
  overflow-y: auto;
  overflow-x: scroll;
  width: 100%;
  display: flow;
  text-indent: 0em;
}

.sources-js-code pre {
  overflow: auto;
}

.popup-button-container {
  align-content: center;
  display: flow;
  margin-bottom: 1em;
  margin-left: 42%;
  margin-top: 1em;
  width: fit-content;
  position: relative;
  text-align: center;
}

.popup-button {
  color: white;
  text-decoration: none;
  align-content: center;
  background-color: #00000099;
  padding-left: 1em;
  padding-right: 1em;
  padding-top: 0.2em;
  padding-bottom: 0.2em;
  border-radius: 1em;
  text-align: center;
}


/* Tiles */
.tile-container {
  position: relative;
  display: grid;
  height: var(--tile-height);
  width: var(--tile-width);
}

.tile-error {
  position: absolute;
  text-align: center;
  color: goldenrod;
  top: 30%;
  left: 10%;
  right: 10%;
}

.tile-error-text {
  font-size: large;
  font-weight: bold;
  margin-bottom: 1em;
}

.tile-error-detail {
  font-family: monospace;
  font-size: small;
  padding: 1em;
  text-align: left;
  text-indent: -2em;
  margin-left: 2em;
}

.tile-error-detail-container {
  background-color: #222222;
  padding: 0.1em;
  border-radius: 1em;
}

.tile-menu-container, .focused-tile-menu-container {
  display: grid;
  height: auto;
  position: absolute;
  transition: 0.3s;
  width: 1em;
  z-index: 20;
}

.tile-menu, .focused-tile-menu {
  display: grid;
  height: auto;
  position: relative;
  top: 1em;
  transition: 0.3s;
}

.tile-menu-icon, .focused-tile-menu-icon {
  background-color: #00000044;
  border-radius: 0.3em;
  color: #cccccc;
  font-size: 1em;
  font-weight: bold;
  position: absolute;
  text-decoration: none;
}

.tile-menu-icon:hover, .focused-tile-menu-icon:hover {
  background-color: #333333;
  color: white;
}

.tile-image, .tile-iframe, .tile-video, .focused-tile-image, .focused-tile-iframe, .focused-tile-video {
  align-items: center; /* Vertical centering */
  height: var(--tile-height);
  width: var(--tile-width);
  border-radius: 0.2em; /* Rounded corners */
  border: 0em none;
  display: flex;
  float: inline-start;
  justify-content: center; /* Horizontal centering */
  margin: 0;
  overflow: hidden;
  position: absolute; /* it must be absolute */
}

.focused-tile-image, .focused-tile-iframe, .focused-tile-video {
  height: 100%;
  width: 100%;
}

.tile-title {
  display: block; /* Just to be explicit since it's set in the js */
  background-color: #00000099;
  border-radius: 0.7em;
  color: white;
  font-optical-sizing: auto;
  font-size: 1em;
  font-style: normal;
  font-weight: 300;
  left: 50%;
  padding-top: 0.1em;
  padding-bottom: 0.1em;
  padding-left: 0.5em;
  padding-right: 0.5em;
  position: absolute;
  top: 0em;
  transform: translateX(-50%);
  z-index: 2;
}

.focused-container {
  display: block;
  height: 100%;
  margin-left: auto;
  margin-right: auto;
  max-height: 100%;
  max-width: 100%;
  position: relative;
  width: 100%;
  z-index: -2;
}

#focused-iframe {
  background-color: black;
  border: 0em none;
  height: 100%;
  width: 100%;
  margin: 0em;
  justify-content: center;
  align-items: center;
  display: flex;
  float: inline-start;
  position: relative;
  -ms-zoom: 1;
  -moz-transform: scale(1);
  -moz-transform-origin: 0 0;
  -o-transform: scale(1);
  -o-transform-origin: 0 0;
  -webkit-transform: scale(1);
  -webkit-transform-origin: 0 0;
}

.focused-tile-parent {
  position: relative;
  display: block;
  height: 100%;
  width: 100%;
}


/* Top Bar */
.top-bar-button {
  background: #333333;
  border-radius: 0.7em;
  border: 0.3em solid slategrey;
  display: grid;
  overflow: hidden;
  position: relative;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.top-bar-button a {
  color: slategrey;
  font-family: sans-serif;
  font-size: 2em;
  text-decoration: none;
  width: auto;
}

#top-bar-left {
  color: blanchedalmond;
  padding-left: 0.7em;
  text-align: left;
}

#top-bar-center {
  color: lightgrey;
  text-align: center;
}

#top-bar-right {
  color: aquamarine;
  padding-right: 0.7em;
  text-align: right;
}

.top-bar {
  display: grid;
  grid-template-columns: 4em 2fr 1fr 2fr 4em;
  background-color: #333333;
  color: white;
  padding: 1vh;
  border: 0em none;
  overflow: hidden;
  position: relative;
  width: auto;
  height: var(--top-bar-height);
}

.top-bar-item {
  background: #333333;
  border-radius: 1em;
  border: 0.2em solid slategrey;
  color: white;
  display: grid;
  font-family: sans-serif;
  font-size: 1.5em;
  padding: 0.5vh;
  position: relative;
}

.hidden {
  display: none;
}

