/*
 *  Event-Kalender (SQLite) - style.css (utf-8)
 * von Werner Zenk
 * editiert von Tommy
 */

/* Globale Styles */
:root {
  --font-family: system-ui, -apple-system, "Segoe UI", "Roboto", "Ubuntu", "Cantarell", "Noto Sans", "Verdana", "Arial",
    sans-serif;
  --color: rgb(55, 55, 55);
  --bgcolor-even: rgba(250, 250, 250, 0.97);
  --bgcolor-odd: rgba(240, 240, 240, 0.97);
  --bgcolor-scheme: rgb(255, 255, 255);
  --highlight-color: rgb(4, 122, 240);
  --highlight-bgcolor: rgba(223, 238, 255, 0.97);
  color-scheme: light dark;
}

/* Kalender */
div#kalender {
  min-height: 325px;
}

/* Tabelle */
table#tabelle {
  font-family: var(--font-family);
  font-size: clamp(0.9rem, 1vw, 1.1rem);
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 1px;
  width: 100%;
  z-index: 10;
  cursor: default;
  -webkit-user-select: none;
  user-select: none;
}

/* Tabelle (nth-child even/odd) */
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);
}

/* th (Wochentage) */
table#tabelle th.spalten {
  font-weight: normal;
  text-align: center;
  width: 14.285714%;
  box-shadow: inset 0px -0.5px rgb(190, 190, 190);
  position: sticky;
  top: 30px;
  z-index: 50;
}

table#tabelle th.spalten: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;
}

table#tabelle td.eintag:hover {
  color: var(--highlight-color);
}

/* Kein Tag */
table#tabelle td.keintag {
  color: rgba(184, 184, 184, 0.5);
  vertical-align: top;
}

/* Heute */
table#tabelle td.heute {
  box-shadow: inset 0px 0px 4px var(--highlight-color);
  border-radius: 2px;
}

/* Woche */
table#tabelle th.woche {
  font-weight: normal;
  text-align: center;
  vertical-align: middle;
  padding: 0px 5px 0px 5px;
}

table#tabelle th.woche:hover {
  color: var(--highlight-color);
}

/* Navigation */
table#tabelle th#navigation {
  font-size: clamp(1.2rem, 1.3vw, 1.5rem);
  font-weight: normal;
  text-align: center;
  word-spacing: 4px;
  white-space: nowrap;
  background-image: linear-gradient(var(--bgcolor-scheme), var(--bgcolor-odd));
  position: sticky;
  top: 0px;
  z-index: 100;
}

/* Menue */
table#tabelle td#menue {
  text-align: right;
  background-image: linear-gradient(var(--bgcolor-odd), var(--bgcolor-scheme));
}

/* Tabellenzeile hervorheben */
table#tabelle > tbody > tr {
  transition: background-color 0.3s;
}

table#tabelle > tbody > tr:hover {
  background-color: var(--highlight-color);
}

/* Hyperlinks */
a:link.link,
a:visited.link {
  color: var(--highlight-color);
  word-break: break-all;
}

/* Funktionsaufrufe */
.navLink {
  display: inline-block;
  padding: 1px 8px 1px 8px;
  border-radius: 2px;
}

.navLink:hover {
  color: var(--highlight-color);
  background-color: var(--highlight-bgcolor);
  outline: solid 1px var(--highlight-color);
  cursor: pointer;
}

/* Fenster schließen */
div#titelleiste > .navLink {
  padding: 5px 8px 5px 8px;
}

div#titelleiste > .navLink:hover {
  color: rgb(255, 255, 255);
  background-color: rgb(232, 17, 35);
  border-top-right-radius: 5px;
  outline: 0px;
}

/* Tage außerhalb des aktuellen Monats */
div.keineAuswahl {
  padding: 1px 8px 1px 8px;
}

/* Abmelden Markierung */
span.abmelden {
  text-decoration: underline solid 0.5px currentColor;
  text-underline-offset: 2px;
}

/* Fenster */
form#form {
  font-family: var(--font-family);
  font-size: clamp(1rem, 1.1vw, 1.1rem);
  color: var(--color);
  background-color: var(--bgcolor-even);
  border-radius: 5px;
  outline: solid 1px rgb(153, 153, 153);
  box-shadow: 0px 0px 15px 9px rgb(190 190 190 / 55%);
  position: absolute;
  z-index: 1500;
  -webkit-user-select: none;
  user-select: none;
}

/* Titelleiste */
div#titelleiste {
  font-family: var(--font-family);
  font-size: 0.92rem;
  color: rgb(0, 0, 0);
  letter-spacing: 0.5px;
  background-color: var(--highlight-bgcolor);
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  border-bottom: Solid 1px rgba(155, 155, 155, 0.5);
  display: grid;
  grid-template-columns: 1.9fr 0.27fr;
  height: 20px;
  padding: 5px 0px 5px 10px;
  position: sticky;
  top: 0px;
  cursor: move;
}

/* Kalender-Icon */
div#titel::before {
  content: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAR0lEQVR42mNggIGqM//BGB3gEideA0yAWGy/8PZ/UjDD7asP/xMLQGrhGpbP3QjHMIDsFMo1UMVJ6GKUaSDaSTAA4uDDMHUA2DOWmpNPH+AAAAAASUVORK5CYII=");
  padding-right: 5px;
}

/* Schließen Kreuz */
div#schliessen {
  font-size: 0.9rem;
  text-align: center;
  height: 20px;
  margin-top: -5px;
}

/* Ueberschrift */
div#ueberschrift {
  font-family: var(--font-family);
  font-size: clamp(1.2rem, 1.3vw, 1.4rem);
  font-variant: small-caps;
  color: var(--highlight-color);
  letter-spacing: 2px;
  text-align: center;
  -webkit-user-select: text;
  user-select: text;
  cursor: text;
}

/* Beschreibung */
div#beschreibung {
  margin-bottom: 5px;
  -webkit-user-select: text;
  user-select: text;
  cursor: text;
  -ms-hyphens: auto;
  -webkit-hyphens: auto;
  hyphens: auto;
}

/* Formblock */
div#formblock {
  padding: 10px;
  min-width: 330px;
  max-width: 650px;
  min-height: 80px;
  resize: both;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

/* Zentrierter Absatz */
p.absatz {
  text-align: center;
}

/* Event */
.event {
  font-family: var(--font-family);
  font-size: clamp(0.8rem, 1vw, 1.1rem) !important;
  text-align: left;
  word-break: break-all;
  padding: 0px 0px 0px 2px;
  border-radius: 2px;
  border: none !important;
  box-shadow: 1px 1px 2px 0.5px rgb(130, 130, 130);
  display: block;
  width: 100%;
  margin-bottom: 4px;
  cursor: pointer;
}

form div.event {
  font-family: var(--font-family);
  font-size: clamp(1rem, 1.1vw, 1.1rem) !important;
  line-height: 22px;
  padding-left: 5px;
  width: 97%;
  cursor: text;
}

/* Bild, Video */
figure :is(img, video) {
  display: block;
  max-width: 100%;
  height: auto;
  border: Solid 1px rgb(32, 32, 32);
  border-radius: 5px;
  box-shadow: 5px 5px 5px rgb(153, 153, 153);
  margin-block-start: 0.5em;
  margin-block-end: 0.5em;
  cursor: default;
}

/* Kein JavaScript! */
noscript {
  color: rgb(255, 0, 0);
}

/* Mit JavaScript gesetzte CSS-Klassen */
.aktivevent {
  box-shadow: 0px 0px 0px 3px var(--highlight-color);
  outline: solid 0.5px rgb(255 255 255);
  position: relative;
}

.zeigeWoche {
  display: none;
}

/* Tooltip */
span.tool {
  display: inline-table;
  color: currentColor;
  cursor: help;
}

span.tip {
  display: none;
}

span.tool:hover span.tip {
  font-family: var(--font-family);
  font-size: 12px;
  color: currentColor;
  -webkit-user-select: text;
  user-select: text;
  cursor: text;
  display: table-caption;
  position: absolute;
  z-index: 2000;
  width: 250px;
  padding: 5px 0 5px 10px;
  background-color: var(--bgcolor-scheme);
  line-height: 20px;
  outline: solid 1px currentColor;
}

/* Monatsbilder */
div#monatsbild {
  height: 175px;
  background-size: cover !important;
  background-position: center center;
  box-shadow: inset 0px 0px 20px 0px rgba(170, 170, 170, 0.9);
  border-radius: 12px 12px 0 0;
  /* EDIT Tommy - Animation der Monatsbilder unten, könnte hier entfernt werden */
  animation: bewegeMonatsbild 25s 2s ease-in-out infinite alternate;
}

@keyframes bewegeMonatsbild {
  from {
    background-position: top center;
  }
  to {
    background-position: bottom center;
  }
}

/* Fokusindikator */
:focus-visible {
  outline: solid 1.5px var(--highlight-color);
}

/* Textbereich */
textarea {
  margin-top: 3px;
  width: 100%;
  max-width: 98%;
  min-width: 320px;
  height: 120px;
  min-height: 120px;
  max-height: 450px;
}

/* Eingabefelder und Buttons */
input[type="text"],
input[type="date"],
input[type="password"],
input[type="time"],
input[type="checkbox"],
button[type="button"],
textarea,
select {
  font-family: var(--font-family);
  font-size: 1rem;
  caret-color: rgb(255, 0, 0);
  border: solid 1px rgb(118, 118, 118);
  border-radius: 2px;
}

button[type="button"]:hover {
  color: var(--highlight-color);
  background-color: var(--highlight-bgcolor);
  border: solid 1px var(--highlight-color);
}

/* Akzentfarbe für Checkboxen */
input[type="checkbox"] {
  accent-color: var(--highlight-color);
}

/* Normale Checkboxen */
input[type="checkbox"]:checked + label {
  color: var(--highlight-color);
}

/* Checkbox zum kopieren */
input[type="checkbox"]:checked + label#copy {
  color: rgb(0, 172, 0);
}

/* Checkbox zum löschen */
input[type="checkbox"]:checked + label#delete {
  color: rgb(238, 0, 0);
}

/* Eingabefeld Event */
input[type="text"].eventfeld {
  width: 83%;
}

/* Label (Transition-Effekt) */
label {
  transition: color 0.3s;
}

label:hover {
  color: var(--highlight-color);
}

/* Accesskey hervorheben */
label > u,
summary > u,
button > u {
  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 0.3s;
}

summary: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;
  }
  
  /* EDIT Tommy word-spacing auf 0 und font-size kleiner für Smartphone */
  table#tabelle th#navigation {
    word-spacing: 0px;
    font-size: 1.0rem;
  }

  /* Name des Wochentages kürzen */
  span.abbrWochentag {
    display: none;
  }

  .event {
    font-size: 0.6rem !important;
    line-height: 12px;
  }
}

@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 */
@media print {
  p {
    display: none;
  }

  div#kalender,
  table#tabelle td {
    outline: solid 1px rgb(215, 215, 215);
  }
}

/* Media Color-Scheme */
@media (prefers-color-scheme: dark) {
  :root {
    --color: rgb(245, 245, 245);
    --bgcolor-even: rgba(0, 0, 0, 0.9);
    --bgcolor-odd: rgba(61, 61, 61, 0.9);
    --bgcolor-scheme: rgb(18, 18, 18);
  }

  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);
  }
}

/* Tag hervorheben 
td[data-tag="05.07.2022"],
td[data-tag="25.07.2022"] {
  background-color: #c6e3fd !important;
}
*/

/* Tag mit einem Bild hervorheben 
td[data-tag="07.07.2022"] {
  background-image: url("img/event.png");
  background-size: cover;
}
*/

/* Jeden zweiten Tag hervorheben
td:nth-child(2n+1) {
  background-color: #dbf5fd !important;
}
*/

/* Tag mit einem Farbverlauf (Querstreifen) hervorheben 
td[data-tag="04.07.2022"] {
  background-image: repeating-linear-gradient(45deg, Lightsteelblue, Lightsteelblue 5px, White 5px, White 10px);
}
*/

/* Wochentag hervorheben 
td[data-wochentag="Samstag"],
td[data-wochentag="Sonntag"] {
  background-color: #ffcece !important;
}
*/

/* Name des Wochentags hervorheben 
th.Dienstag,
th.Donnerstag,
th.Samstag {
  background-color: #85ddf8 !important;
}
*/

/* Woche hervorheben 
tr[data-woche="1"],
tr[data-woche="29"] {
  outline: Solid 2px #11d100;
}
*/
