﻿/*
 *  Event-Kalender (SQLite) - style.css (utf-8)
 *  von Werner Zenk
 */

@charset "UTF-8";

/* Globale Styles */
:root {
  --font-family: system-ui, -apple-system, "Segoe UI", "Roboto", "Ubuntu",
    "Cantarell", "Noto Sans", "Verdana", "Arial", sans-serif;
  --bgcolor-even: rgba(250, 250, 250, 0.97);
  --bgcolor-odd: rgba(240, 240, 240, 0.97);
  --bgcolor-scheme: rgb(255, 255, 255);
  --color: rgb(55, 55, 55);
  --highlight-bgcolor: rgba(223, 238, 255, 0.97);
  --highlight-color: rgb(4, 122, 240);
  color-scheme: light dark;
}

/* Kalender */
div#kalender {
  min-height: 325px;
  width: 100%;
}

/* Tabelle */
table#tabelle {
  border-collapse: separate;
  border-spacing: 1px;
  cursor: default;
  font-family: var(--font-family);
  font-size: clamp(0.9rem, 1vw, 1.1rem);
  table-layout: auto;
  -webkit-user-select: none;
  user-select: none;
  width: 100%;
  z-index: 10;
}

/* Tabelle (Spalten) */
table#tabelle th:nth-child(even),
table#tabelle td:nth-child(even) {
  background-color: var(--bgcolor-even);
}

table#tabelle th:nth-child(odd),
table#tabelle td:nth-child(odd) {
  background-color: var(--bgcolor-odd);
}

/* Tabelle (Zeilen) */
table#tabelle tbody > tr:nth-child(even) {
  background-color: rgba(125, 125, 125, 0.97);
}

/* Wochentage */
table#tabelle th.spalten {
  box-shadow: inset 0px -0.5px rgb(190, 190, 190);
  font-weight: normal;
  position: sticky;
  text-align: center;
  top: 30px;
  width: 14.285714%;
  z-index: 50;
  &:hover {
    color: var(--highlight-color);
  }
}

/* Woche */
table#tabelle th.spalte {
  font-weight: normal;
  text-align: center;
  box-shadow: inset 0px -0.5px rgb(190, 190, 190);
  position: sticky;
  top: 30px;
  z-index: 50;
}

/* Ein Tag */
table#tabelle td.eintag {
  vertical-align: top;
  height: 65px;
  &:hover {
    color: var(--highlight-color);
  }
}

table#tabelle td.eintag:hover span#uhrzeit {
  color: rgb(0, 150, 0);
}

/* Kein Tag */
table#tabelle td.keintag {
  color: rgba(184, 184, 184, 0.5);
  vertical-align: top;
}

/* Heute */
table#tabelle td.heute {
  border-radius: 2px;
  box-shadow: inset 0px 0px 4px var(--highlight-color);
}

/* Woche */
table#tabelle th.woche {
  font-weight: normal;
  padding: 0px 5px 0px 5px;
  text-align: center;
  vertical-align: middle;
  &:hover {
    color: var(--highlight-color);
  }
}

/* Navigation */
table#tabelle th#navigation {
  background-image: linear-gradient(var(--bgcolor-scheme), var(--bgcolor-odd));
  font-size: clamp(1.2rem, 1.3vw, 1.5rem);
  font-weight: normal;
  position: sticky;
  text-align: center;
  top: 0px;
  white-space: nowrap;
  z-index: 100;
}

/* Menue */
table#tabelle td#menue {
  background-image: linear-gradient(var(--bgcolor-odd), var(--bgcolor-scheme));
  height: 28px;
  text-align: right;
  vertical-align: bottom;
}

/* Tabellenzeile hervorheben */
table#tabelle > tbody > tr {
  transition: background-color 0.3s;
}

/* Hyperlinks */
a:link.link,
a:visited.link {
  color: var(--highlight-color);
  word-break: break-all;
}

/* Funktionsaufrufe */
.navLink {
  border-radius: 2px;
  display: inline-block;
  padding: 1px 8px 1px 8px;
  transition: all 0.3s;
  &:hover {
    background-color: var(--highlight-bgcolor);
    color: var(--highlight-color);
    cursor: pointer;
    outline: solid 1px var(--highlight-color);
  }
}

.navLinkPlus {
  border-radius: 2px;
  padding: 1px;
  transition: all 0.3s;
  &:hover {
    background-color: var(--highlight-bgcolor);
    color: var(--highlight-color);
    cursor: pointer;
    outline: solid 1px var(--highlight-color);
  }
}

/* Fenster schließen */
div#titelleiste > .navLink {
  padding: 5px 8px 5px 8px;
}

/* Tage außerhalb des aktuellen Monats */
div.keineAuswahl {
  display: inline-block;
  padding: 1px 8px 1px 8px;
}

/* Liste */
div.liste {
  margin-top: 5px;
  padding: 3px;
  box-shadow: 0px 0px 1.5px rgb(90, 90, 90);
  &:hover {
    color: var(--highlight-color);
    cursor: pointer;
  }
}

/* Abmelden Markierung */
span.abmelden {
  text-decoration: underline solid 0.5px var(--highlight-color);
  text-underline-offset: 2px;
}

/* Fenster */
form#form {
  background-color: var(--bgcolor-even);
  border-radius: 5px;
  box-shadow: 0px 0px 15px 9px rgba(190, 190, 190, 55%);
  color: var(--color);
  font-family: var(--font-family);
  font-size: clamp(1rem, 1.1vw, 1.1rem);
  outline: solid 1px rgb(153, 153, 153);
  position: absolute;
  scroll-margin-top: 35px;
  -webkit-user-select: none;
  user-select: none;
  z-index: 1500;
}

/* Titelleiste */
div#titelleiste {
  background-color: var(--highlight-bgcolor);
  border-bottom: Solid 1px rgba(155, 155, 155, 0.5);
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  color: rgb(0, 0, 0);
  cursor: move;
  display: grid;
  font-family: var(--font-family);
  font-size: 0.9em;
  grid-template-columns: 1.9fr 0.27fr;
  height: 20px;
  letter-spacing: 0.5px;
  padding: 5px 0px 5px 10px;
  position: sticky;
  top: 0px;
}

/* Kalender-Icon */
div#titel::before {
  content: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAR0lEQVR42mNggIGqM//BGB3gEideA0yAWGy/8PZ/UjDD7asP/xMLQGrhGpbP3QjHMIDsFMo1UMVJ6GKUaSDaSTAA4uDDMHUA2DOWmpNPH+AAAAAASUVORK5CYII=");
  padding-right: 5px;
}

/* Schließen Kreuz */
button#schliessen {
  background-color: transparent;
  border-top-right-radius: 5px;
  border: 0px;
  box-shadow: none;
  font-size: 0.9rem;
  height: 30px;
  margin-top: -5px;
  outline: 0px;
  text-align: center;
  &:hover {
    color: rgb(255, 255, 255);
    background-color: rgb(232, 17, 35);
  }
}

/* Ueberschrift */
div#ueberschrift {
  color: var(--highlight-color);
  font-family: var(--font-family);
  font-size: clamp(1.2rem, 1.3vw, 1.4rem);
  font-variant: small-caps;
  letter-spacing: 2px;
  text-align: center;
  -webkit-user-select: none;
  user-select: none;
}

div#ueberschrift > q {
  font-variant: normal;
}

/* Beschreibung */
div#beschreibung {
  cursor: text;
  margin-bottom: 5px;
  -webkit-user-select: text;
  user-select: text;
  -ms-hyphens: auto;
  -webkit-hyphens: auto;
  hyphens: auto;
}

/* Formblock */
div#formblock {
  margin: 2px;
  min-width: 330px;
  max-width: 650px;
  min-height: 80px;
  max-height: calc(100vh - 15em);
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 8px;
  resize: both;
}

/* Zentrierter Absatz */
p.absatz {
  text-align: center;
}

/* Event */
.event {
  border-radius: 2px;
  border: none !important;
  box-shadow: 1px 1px 1px 0.5px rgb(130, 130, 130);
  cursor: pointer;
  display: block;
  font-size: clamp(0.8rem, 1vw, 1.1rem) !important;
  margin-bottom: 4px;
  padding: 0px 0px 0px 2px;
  text-align: left;
  width: 100%;
  word-break: break-all;
}

button.event:hover {
  box-shadow: 0px 0px 1px 0.5px var(--highlight-color);
}

form div.event {
  cursor: default;
  font-family: var(--font-family);
  font-size: clamp(1rem, 1.1vw, 1.1rem) !important;
  line-height: 22px;
  padding-left: 5px;
  width: 97%;
}

/* Bild, Video */
figure :is(img, video) {
  border-radius: 5px;
  border: Solid 1px rgb(32, 32, 32);
  box-shadow: 5px 5px 5px rgb(153, 153, 153);
  cursor: default;
  display: block;
  height: auto;
  margin-block-end: 0.5em;
  margin-block-start: 0.5em;
  max-width: 100%;
}

/* Kein JavaScript! */
noscript {
  color: rgb(255, 0, 0);
}

/* Anzahl der Events */
div#anzahlEvents {
  font-weight: lighter;
  font-size: 0.75rem;
  text-align: right;
}

/* Uhrzeit */
span#uhrzeit {
  float: right;
  font-size: small;
  font-weight: lighter;
  padding: 2px 5px 0px 0px;
}

/* Aktiver Event (mit JavaScript gesetzte Klasse) */
.aktivevent {
  box-shadow: 0px 0px 0px 3px var(--highlight-color) !important;
  outline: solid 0.5px rgb(255, 255, 255);
  position: relative;
}

/* Tastatur-Box (mit JavaScript gesetzte Klasse) */
.tastaturBox {
  backdrop-filter: blur(25px);
  border-radius: 5px;
  box-shadow: 0px 0px 15px 9px rgba(190, 190, 190, 55%);
  color: var(--color);
  cursor: Default;
  display: block;
  font-family: var(--font-family);
  font-size: 1rem;
  left: 50%;
  outline: solid 1px rgb(150, 150, 150);
  padding: 10px 8px 10px 12px;
  position: Absolute;
  top: 20%;
  transform: translate(-50%, -50%);
  z-index: 1500;
}

/* Tooltip */
span.tool {
  color: currentColor;
  cursor: help;
  display: inline-table;
}

span.tip {
  display: none;
}

span.tool:hover span.tip {
  background-color: var(--bgcolor-scheme);
  color: currentColor;
  cursor: text;
  display: table-caption;
  font-family: var(--font-family);
  font-size: 12px;
  line-height: 20px;
  outline: solid 1px currentColor;
  padding: 5px 0 5px 10px;
  position: absolute;
  -webkit-user-select: text;
  user-select: text;
  width: 250px;
  z-index: 2000;
}

/* Monatsbilder */
div#monatsbild {
  animation: bewegeMonatsbild 35s 2s ease-in-out infinite alternate;
  background-position: center center;
  background-size: cover !important;
  border-radius: 12px 12px 0 0;
  box-shadow: inset 0px 0px 20px 0px rgba(170, 170, 170, 0.9);
  height: 175px;
}

@keyframes bewegeMonatsbild {
  from {
    background-position: top center;
  }
  to {
    background-position: bottom center;
  }
}

/* Fokusindikator (all) */
:focus-visible {
  outline: solid 1.5px var(--highlight-color);
}

/* Textbereich */
textarea {
  height: 120px;
  margin-top: 3px;
  max-height: 550px;
  max-width: 98%;
  min-height: 120px;
  min-width: 320px;
  width: 100%;
}

/* Eingabefelder und Buttons */
input[type="text"],
input[type="date"],
input[type="password"],
input[type="time"],
input[type="search"],
input[type="checkbox"],
button[type="button"],
textarea,
select {
  border-radius: 2px;
  border: solid 1px rgb(118, 118, 118);
  box-shadow: 0px 0px 1.5px rgb(90, 90, 90);
  caret-color: rgb(255, 0, 0);
  font-family: var(--font-family);
  font-size: 1rem;
}

input[type="date"],
input[type="time"] {
  max-width: -moz-fit-content;
  max-width: fit-content;
}

input[type="search"] {
  width: 220px;
}

button[type="button"]:hover {
  background-color: var(--highlight-bgcolor);
  border: solid 1px var(--highlight-color);
  color: var(--highlight-color);
}

button[type="button"].event:focus {
  box-shadow: 0px 0px 0px 3px var(--highlight-color);
  outline: solid 0.5px rgb(255, 255, 255);
}

/* Akzentfarbe für Checkboxen */
input[type="checkbox"] {
  accent-color: var(--highlight-color);
}

/* Normale Checkboxen (checked) */
input[type="checkbox"]:checked + label {
  color: var(--highlight-color);
}

/* Checkbox zum kopieren (checked) */
input[type="checkbox"]:checked + label#copy {
  color: rgb(0, 172, 0);
}

/* Checkbox zum löschen (checked) */
input[type="checkbox"]:checked + label.delete {
  color: rgb(238, 0, 0);
}

/* Eingabefeld Event */
input[type="text"].eventfeld {
  width: 83%;
}

/* Pflichtfelder */
input:invalid {
  background-color: rgb(255, 255, 240);
}

input::placeholder {
  color: rgb(55, 55, 55);
  opacity: 0.5;
}

input::placeholder-shown {
  text-overflow: ellipsis;
}

/* Tastaturnummer */
input[type="text"]#tastaturnummer {
  background-color: transparent;
  border: 0;
  box-shadow: none;
  color: var(--highlight-color);
  width: 35px;
}

/* Label (Transition-Effekt) */
label {
  transition: color 0.3s;
  &:hover {
    color: var(--highlight-color);
  }
}

/* Accesskey hervorheben */
label > u,
summary > u,
button > u {
  text-decoration-skip-ink: none;
  text-decoration: underline 1px var(--highlight-color);
  text-underline-offset: 1px;
}

/* Auswahlliste, abwechselnde Hintergrundfarbe */
option:nth-child(even) {
  background-color: var(--highlight-bgcolor);
}

/* Summary */
summary {
  transition: color 300ms;
  &:hover {
    color: var(--highlight-color);
  }
}

/* Summary Pfeil-Symbol */
summary::marker {
  color: var(--highlight-color);
}

/* Media Screen */
@media screen and (max-width: 48rem) {
  table#tabelle td.eintag {
    height: 45px;
  }

  table#tabelle,
  div#aktiv form {
    font-size: 0.8rem;
  }

  /* Name des Wochentages kürzen */
  span.abbrWochentag {
    display: none;
  }

  .event {
    font-size: 0.6rem !important;
    line-height: 12px;
  }

  /* Accesskey nicht hervorheben */
  label > u,
  summary > u,
  button > u {
    text-decoration: none;
  }
}

@media screen and (min-width: 90rem) {
  table#tabelle td.eintag {
    height: 85px;
  }

  .event {
    line-height: 20px;
  }
}

@media screen and (min-width: 134rem) {
  table#tabelle td.eintag {
    height: 115px;
  }
}

/* Media Print
   Hier Elemente eintragen die beim ausdrucken (nicht) angezeigt werden sollen.
 */
@media print {
  p {
    display: none;
  }

  div#kalender,
  table#tabelle td {
    outline: solid 1px rgb(215, 215, 215);
  }
}

/* Media Color-Scheme (dark) */
@media (prefers-color-scheme: dark) {
  :root {
    --bgcolor-even: rgba(0, 0, 0, 0.9);
    --bgcolor-odd: rgba(61, 61, 61, 0.9);
    --bgcolor-scheme: rgb(18, 18, 18);
    --color: rgb(245, 245, 245);
  }

  div.event {
    box-shadow: 1px 1px 2px 0.5px rgb(255, 255, 255);
  }

  /* Heute */
  table#tabelle td.heute {
    box-shadow: inset 0px 0px 12px var(--highlight-color);
    border-radius: 2px;
  }

  /* Auswahlliste, abwechselnde Hintergrundfarbe */
  option:nth-child(even) {
    background-color: rgba(100, 100, 100, 0.9);
  }

  /* Pflichtfelder */
  input:invalid {
    background-color: rgb(103, 103, 68);
  }

  input::placeholder {
    color: rgb(230, 230, 230);
    opacity: 0.6;
  }

  div#titelleiste > .navLink {
    color: rgb(50, 50, 50);
  }
}

/* Bereiche im Kalender hervorheben */

/* Tag hervorheben 
td[data-tag="05.02.2023"],
td[data-tag="27.02.2023"] {
  background-color: #c6e3fd !important;
}
*/

/* Tag mit einem Bild hervorheben 
td[data-tag="09.02.2023"] {
  background-image: url("img/event.png");
  background-size: cover;
}
*/

/* Button mit einem Bild hervorheben 
td[data-tag="22.07.2023"] > button[type="button"] {
  background-image: url("img/event.png") !important;
  background-size: cover;
}
*/

/* Jeden zweiten Tag hervorheben 
td:nth-child(2n+1) {
  background-color: #dbf5fd !important;
  color: #000000;
}
*/

/* Tag mit einem Farbverlauf (Querstreifen) hervorheben 
td[data-tag="05.02.2023"] {
  background-image: repeating-linear-gradient(45deg, Lightsteelblue, Lightsteelblue 5px, White 5px, White 10px);
  color: #000000;
}
*/

/* Wochentag hervorheben 
td[data-wochentag="Samstag"],
td[data-wochentag="Sonntag"] {
  background-color: #ffcece !important;
  color: #000000;
}
*/

/* Name des Wochentags hervorheben 
th.Dienstag,
th.Donnerstag,
th.Samstag {
  background-color: #85ddf8 !important;
  color: #000000;
}
*/

/* Woche hervorheben 
tr[data-woche="6"],
tr[data-woche="29"] {
  outline: Solid 2px #11d100;
}
*/
