html {
  overscroll-behavior: none;
}

body {
  height: 100vh;
  margin: 0;
  cursor: default;
}

body,
textarea,
input {
  font-family: helvetica, arial, sans-serif;
  font-size: 16px;
}

.buttonbar {
  text-align: right;
  margin-top: 16px;
}

button {
  background: none;
  cursor: pointer;
  min-width: 20px;
  padding: 5px 12px;
  font-size: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
}

button.primary {
  background-color: #00a8fb;
  border: 1px solid #00a8fb;
  color: #fff;
}

.hidden {
  display: none !important;
}

.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.title {
  font-size: 23px;
  font-weight: bold;
}

/* calendar view */

#monthScreen {
  width: 100%;
  height: 100vh;
  border-spacing: 0;
  border-collapse: collapse;
  table-layout: fixed;
  white-space: nowrap;
}

#monthScreen thead td {
  height: 2vh;
  vertical-align: top;
  padding: 10px;
}

#mainmenu {
  font-size: 23px;
  cursor: pointer;
  position: relative;
  top: 5px;
}

#daysGrid tr.weekdays td {
  height: 2vh;
  text-align: right;
  vertical-align: bottom;
  border: 0 !important;
  border-bottom: 1px solid #999 !important;
  color: #333;
  padding-right: 8px;
  cursor: default !important;
}

#daysGrid td {
  width: 14%;
  border: 1px solid #ddd;
  vertical-align: top;
  overflow: hidden;
  cursor: pointer;
}

#daysGrid td.blank {
  border: 0;
  cursor: default !important;
}

#daysGrid td.weekend {
  background-color: #f5f5f5;
}

#daysGrid td .dayInfoLine {
  margin: 2px 0 4px 0;
  text-align: right;
  width: 100%;
}

#daysGrid td .dayInfoLine .dayNumber {
  padding: 0 6px;
}

#daysGrid td.today .dayInfoLine .dayNumber {
  color: white;
  background-color: #ff111a;
  font-size: 16px;
  font-weight: bold;
  border-radius: 18px;
  padding: 2px 4px;
}

.evtSmall {
  margin: 2px;
  line-height: 1.2em; /* without line-height, emojis make the line bigger */
  color: white;
  border-radius: 3px;
  padding-left: 5px;
}

.evtMore {
  padding-left: 3px;
  font-weight: bold;
}

/* dialogs */

.dialog {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2;
  background: rgba(0, 0, 0, 0.4);
}

.dialog > div {
  background-color: #fff;
  box-sizing: border-box;
  padding: 16px;
}

#drawer > div {
  margin: 0;
  width: 300px;
  height: 100vh;
}

#drawer button {
  width: 268px;
}

#drawerCloseButton,
#dayScreenCloseButton {
  cursor: pointer;
}

select {
  font-size: 1.5em;
  border: 0;
}

#dayScreen > div {
  margin: 5vh 5vw;
  width: 90vw;
}

#eventBoxes {
  height: 60vh;
  overflow: scroll;
  margin-top: 1em;
}

#eventBoxes > div {
  border-radius: 8px;
  padding: 8px;
  color: #fff;
  margin-bottom: 8px;
  white-space: pre-line;
}

#eventBoxes .eventMeta {
  font-size: 14px;
  margin-bottom: 8px;
}

#eventBoxes .eventAction {
  cursor: pointer;
  float: right;
  margin: 0 6px;
}

.noEvents {
  margin-top: 1em;
  color: #aaa;
}

#editEventDetailsDiv textarea {
  margin-top: 1em;
  width: 95%;
  height: 20vh;
}

.colorBtns {
  font-size: 16px;
}

input[type="checkbox"].uncheckHides:not(:checked) ~ .hideIfUnchecked {
  opacity: 0.25;
  pointer-events: none;
}

#editEventDeleteButton {
  float: left;
}

#alert > div {
  margin: 10vh 10vw;
  width: 80vw;
}

/* dark mode */

:root {
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: #1f1d1e;
    color: #eee;
  }

  button,
  textarea {
    border: 1px solid #404040;
  }

  #daysGrid tr.weekdays td {
    border: 0 !important;
    border-bottom: 1px solid #404040 !important;
    color: #ddd;
  }

  #daysGrid td {
    border: 1px solid #404040;
  }

  #daysGrid td.weekend {
    background-color: #282627;
  }

  .dialog > div {
    background-color: #1f1d1e;
  }
}
