/**
 * SLOT Timetable-App Stylesheet
 * defines page layout and ui-element styles
 *
 * @extends style.css
 * @author Simon Bayer <simon.bayer@fau.de>
 */

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

body > #nav-wrapper {
  flex-grow: 0;
  flex-shrink: 0;
}

body > #main {
  flex-grow: 1;
  flex-shrink: 1;
  min-height: 0;
}

#nav-wrapper {
  font-size: var(--responsive-font-size);
}

#main {
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  z-index: 10;
  box-sizing: border-box;
  font-size: var(--responsive-font-size);
}

/* OWNEDIT, drag n drop */
.markzone {
  background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
}

@media only screen {
  #main {
    max-width: var(--max-width);
    max-height: calc(var(--max-width) / (16 / 9));
  }
}

#main > #leftbar {
  width: 20%;
  height: auto;
  z-index: 30;
}

#main > #timetable {
  width: 80%;
  height: auto;
  z-index: 20;
  flex-grow: 1;
}

@media only screen and (orientation: portrait) {
  body {
    height: initial;
  }

  #main {
    flex-direction: column;
    max-height: initial;
  }

  #main > #leftbar {
    width: auto;
    height: 25vh;
  }

  #main > #timetable {
    width: auto;
    height: 76vh;
  }
}

#main { padding: .5%; }
#timetable, #leftbar { margin: .5%; }

@media only screen and (max-width: 750px) {
  #timetable, #leftbar { margin: .4em; }
}

#leftbar {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
}

@media print {
  #main { padding: 0; }
  #leftbar { display: none; }
}

#timetable, #clipboard {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  cursor: default;
}

#clipboard {
  height: 100%;
  overflow-y: scroll;
  background-color: #f4f4f4;
  z-index: 31;
  font-size: 80%;
  padding: 2.5%;
  position: relative;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  /* OWNEDIT */
  border-radius: 5px;
}

#clipboard:empty::before {
  content: attr(data-empty);
  position: absolute;
  left: 0;
  right: 0;
  top: 35%;
  padding-left: 1.5em;
  padding-right: 1.5em;
  text-align: center;
  font-size: 115%;
  opacity: 0.8;
}

.clipboard-element {
  padding: 1.2em;
  margin: 0.5em;
  text-align: center;
  font-weight: bold;
  color: #424242;
  word-wrap: break-word;
  cursor: pointer;
  z-index: 32;
  position: relative;
  box-sizing: border-box;
}

@media only screen and (orientation: portrait) {
  #clipboard {
    padding: 1%;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .clipboard-element {
    width: calc(50% - 1em); /* half width - (2 * margin) */
  }
}

.element-name {
  min-height: 2.5em;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.clipboard-element::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background-color: transparent;
  transition:
    background-color .1s linear,
    height .1s step-end;
}

.clipboard-element:not(.options-open):not(.selecting):hover::after {
  height: 100%;
  background-color: rgba(0, 0, 0, 0.07);
  transition: none;
}

.clipboard-element:not(.options-open):not(.selecting):active::after {
  height: 100%;
  background-color: rgba(0, 0, 0, 0.2);
  transition: none;
}

.cb-options, .selecting-hint {
  visibility: hidden;
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: transparent;
  top: 0;
  bottom: 0;
  right: 0;
  left: 0;
  transform: scaleX(0);
  transform-origin: 100% 50%;
  opacity: 0;
  transition: all .25s;
  transition-timing-function: cubic-bezier(0.05, 0.04, 0.06, 0.99);
}

.add, .del {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 50%;
  height: 100%;
  font-weight: bolder;
  font-size: 1.7em;
  color: white;
}

.add {
  background-color: rgba(0, 190, 0, 0.85);
  transition: background-color .3s;
  /* OWNEDIT */
  border-radius: 0px 5px 5px 0px;
}

.add:active {
  background-color: rgba(0, 110, 0, 0.94);
  transition: none;
}

.del {
  background-color: rgba(200, 0, 0, 0.85);
  transition: background-color .3s;
  /* OWNEDIT */
  border-radius: 5px 0px 0px 5px;
}

.del:active {
  background-color: rgba(120, 0, 0, 0.94);
  transition: none;
}

.selecting-hint {
  background-color: rgba(0, 190, 0, 0.85);
  font-weight: bolder;
  font-size: 120%;
  color: white;
  text-shadow: 1px 1px 7px rgba(0, 0, 0, 0.4);
  cursor: default;
}

.clipboard-element.options-open > .cb-options,
.clipboard-element.selecting > .selecting-hint {
  visibility: visible;
  opacity: 1;
  transform: none;
  /* transform-origin: none; OWNEDIT throws error in firefox*/
  transition: all .25s;
  transition-timing-function: cubic-bezier(0.05, 0.04, 0.06, 0.99);
}

.selecting-hint .icon-arrow-right {
  animation: slot-arrow 1.4s ease-in-out infinite;
}

@media only screen and (orientation: portrait) {
  .selecting-hint .icon-arrow-right {
    animation: none;
    transform: rotate(90deg);
  }
}

@keyframes slot-arrow {
  0% {
    transform: translateX(8px);
  }
  50% {
    transform: translateX(2px);
  }
  100% {
    transform: translateX(8px);
  }
}

/* ==== change color popup ==== */

.change-color-colors {
  align-items: center;
  display: flex;
  flex-direction: row;
}

.change-color-colors > .color {
  cursor: pointer;
  display: flex;
  width: 64px;
  height: 64px;
}

.change-color-colors > .color:hover {
  transform: scale(1.1);
}

.change-color-colors > .color:active {
  transform: none;
}

/* ==== custom entry popup ==== */

.ce-time-inputs {
  display: flex;
  width: 100%;
}

.ce-time-inputs > .ce-time-input {
  margin-left: 1.5em;
  flex: 1 1 0;
}

.ce-time-inputs > .ce-time-input:first-child {
  margin-left: 0;
}

#ce-color-buttons {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  overflow: hidden;
  margin-bottom: 1.5em;
}

.ce-color-button, #ce-own-color-button {
  height: 3em;
  width: 3em;
  margin: .35em;
  line-height: 3em;
  cursor: pointer;
}

.ce-color-button.selected {
  box-sizing: border-box;
  border: 2px solid #424242;
}

.ce-color-button:hover {
  transform: scale(1.2);
}

#ce-own-color-button {
  background-color: #f2f2f2;
  text-align: center;
}

#ce-color-buttons.hex-input > .ce-color-button {
  display: none;
}

#ce-color-buttons:not(.hex-input) > #ce-color-input {
  display: none;
}

#ce-color-buttons.hex-input > #ce-own-color-button::before {
  content: '...';
}

#ce-color-buttons:not(.hex-input) > #ce-own-color-button::before {
  content: '#';
}

/* ==== export popup ==== */

.export-options {
  display: flex;
  justify-content: center;
}

.export-options > form, .export-options > div {
  width: 35%;
  margin: .5em;
  margin-bottom: 1em;
}

.export-options button {
  height: 100%;
}

#export p {
  text-align: center;
}

#export > p > code {
  -webkit-user-select: all;
  -moz-user-select: all;
  -ms-user-select: all;
  user-select: all;
  font-size: 110%;
}

/* ==== search ==== */

#search {
  width: 100%;
  z-index: 35;
  padding: .4em 0 .3em .6em;
  margin-bottom: 0;
  border: 1px solid #dcdcdc;
  background: #f6f6f6;
  font-size: 100%;
  box-sizing: border-box;
  outline: 0;
  /* OWNEDIT */
  border-radius: 5px;
}

#search-wrapper {
  position: static;
  z-index: 33;
  margin-bottom: 5%;
}

@media only screen and (orientation: portrait) {
  #search-wrapper { margin-bottom: 1.5%; }
}

#search-bg {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 33;
}

#search_results, #search_results ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

#search_results ul li {
  padding: .4em;
  cursor: pointer;
}

#search_results li.disabled {
  color: #D0D0D0;
  cursor: default;
}

#search_results li[data-module] {
  font-weight: bold;
}

#search_results li[data-lecture] {
  padding-left: 15px;
  font-weight: initial;
}

#search_results li[data-module].selected:not(.disabled) {
  background-color:rgb(90, 90, 90);
  color: white;
}

#search_results li[data-lecture].selected,
#search_results li[data-lecture].highlight:not(.disabled) {
  background: rgb(104, 104, 104);
  color: white;
}

#search_results li[data-lecture].selected.disabled {
  background: rgb(133, 133, 133);
  color: white;
}

/* OWNEDIT */
#search_options_row {
  display: flex;
  gap: 15px;
  align-items: center;
  padding-bottom: 8px;
  margin-bottom: 3px;
  border-bottom: 2px solid #bbb;
  border-radius: 1px;
}
/* Alignt Checkbox + Label */
#cb_label_div {
  display: flex;
  align-items: center;
}
.prevent-select {
  -webkit-user-select: none; /* Safari */
  -ms-user-select: none; /* IE 10 and IE 11 */
  user-select: none; /* Standard syntax */
}

/* ==== search results ==== */

#color-select {
  padding: 16px;
  align-items: center;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  /* OWNEDIT */
  border-radius: 5px;
}

#color-select > .color {
  cursor: pointer;
  display: flex;
  width: 64px;
  height: 64px;
}

#color-select > .color.selected {
  transform: scale(1.25);
}

#search_box {
  max-width: calc(100vw - 45px);
  max-height: calc(100vh - 10em);
  min-width: calc(25% - 40px);
  display: none;
  background-color: rgba(243, 243, 243, 0.85);
  box-shadow: 0px 5px 15px 0px rgba(0, 0, 0, 0.2);
  position: absolute;
  padding: 20px;
  z-index: 34;
  overflow: scroll;
  /* OWNEDIT */
  border-radius: 5px;
}

@media only screen and (orientation: portrait) {
  #search_box {
    max-height: calc(100vh - 12em); /* maybe higher navbar */
    padding: 10px;
  }
}

#btn_close_search{
  cursor: pointer;
  float: right;
  font-size: 100%;
  margin-left:7px;
}
