/* ===== BODY ===== */

body {
  display: flex;
  flex-direction: column;

  min-height: 100vh;
  min-height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;

  margin: 0;
}

/* ===== HEADER ===== */

header {
  display: flex;
  flex-direction: column;

  flex-shrink: 0;

  position: relative;
  z-index: 100;

  /*padding: env(safe-area-inset-top) max(1rem, env(safe-area-inset-right)) 0
    max(1rem, env(safe-area-inset-left));*/
  padding-top: 3px;
  padding-bottom: 3px;
}

header:not(.invisible) {
  background-color: color-mix(
    in srgb,
    var(--background-primary) 80%,
    transparent
  );

  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);

  box-shadow:
    0 1px 2px rgb(0 0 0 / 20%),
    inset 0 -1px 1px rgb(0 0 0 / 10%);
}

.header-row {
  display: flex;
  flex-direction: row;
  flex: 1 1 auto;

  align-items: center;
  justify-content: space-between;
}

#header-left,
#header-right {
  display: flex;
  align-items: center;
}

#header-left {
  gap: 0.5rem;
}

/* ===== MAIN ===== */

main {
  flex: 1 1 auto;
  min-width: 0;
}

/* ===== FOOTER ===== */

footer {
  flex-shrink: 0;

  position: relative;
  z-index: 100;

  background-color: color-mix(
    in srgb,
    var(--background-primary) 80%,
    transparent
  );

  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);

  padding: 0 max(1rem, env(safe-area-inset-right)) env(safe-area-inset-bottom)
    max(1rem, env(safe-area-inset-left));
}

footer a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

footer p {
  margin: 0.15cm 0.1cm;
  color: var(--text-secondary);
}

/* ===== KEYBOARD FOCUS ===== */

header a:focus-visible,
footer a:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 3px;
  border-radius: 0.25rem;
}

/* ===== DARK MODE ===== */

@media (prefers-color-scheme: dark) {
  header:not(.invisible),
  footer {
    background-color: color-mix(
      in srgb,
      var(--background-primary) 80%,
      transparent
    );
  }

  header:not(.invisible) {
    box-shadow:
      0 1px 2px rgb(255 255 255 / 12%),
      inset 0 -1px 1px rgb(255 255 255 / 6%);
  }
}

#strawberry-title {
  margin-left: 10px;
  font-weight: 400;
  color: #ffd700;

  background-clip: text;
  -webkit-background-clip: text;

  text-shadow:
    0 1px 1px #d4af37,
    0 -1px 1px #fff9c4;

  letter-spacing: 0;
  line-height: 1;

  margin: 0 !important;
}

.main-padding {
  padding: 10px;
}

#startpage-box-container-before {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  flex: 1;
  box-sizing: border-box;
}

#startpage-box-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
  box-sizing: border-box;
  max-width: 95%;
}

@media (min-height: 800px) {
  #startpage-box-container {
    margin-top: 20px;
  }
}

@media (min-height: 900px) {
  #startpage-box-container {
    margin-top: 135px;
  }
}

@media (min-height: 1000px) {
  #startpage-box-container {
    margin-top: 190px;
  }
}

@media (min-width: 768px) {
  #startpage-box-container {
    max-width: min(80%, 1000px);
  }
}

#startpage-box-logo {
  margin-bottom: 20px;
}

#startpage-box-logo-img {
  max-width: 160px;
  height: auto;
}

#startpage-box-title {
  font-size: 2.6rem;
  margin: 0 0 10px 0;
  font-weight: 400;
  color: #ffd700;
  text-shadow:
    0 1px 0 #d4af37,
    0 -1px 0 #fff9c4,
    0 0 12px rgba(255, 215, 0, 0.9);
  letter-spacing: 1px;
  line-height: 1;
}

#startpage-box-description {
  font-size: 1.1rem;
  color: #555;
}

@media (prefers-color-scheme: dark) {
  #startpage-box-description {
    color: #cccccc;
  }
}

/* Responsive Anpassungen */
@media (min-width: 768px) {
  #startpage-box-container {
    flex-direction: row;
    justify-content: center;
    align-items: center;
  }

  #startpage-box-logo {
    margin-bottom: 0;
    margin-right: 30px;
  }

  #startpage-box-content {
    text-align: left;
  }
}

header {
  width: 100%;
  box-sizing: border-box;
  z-index: 100;
}

#open-login-button {
  padding: 7px;
  font-size: 15px;
}

#strawberry-title {
  font-size: 0.8cm;
  margin-top: 0.4cm;
}

#title_icon {
  width: 1cm;
  height: 1cm;
  margin-top: 0.12cm;
}

main {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  flex: 1;
}

footer {
  font-size: 0.24cm;
  padding-bottom: 0;
}

header {
  padding-left: 4px;
  padding-right: 4px;
}

@media only screen and (min-width: 769px) {
  header {
    width: 100%;
    box-sizing: border-box;
    z-index: 100;
  }

  #open-login-button {
    padding: 10px;
  }

  #strawberry-title {
    font-size: 40px;
    margin-top: 20px;
  }

  #title_icon {
    width: 50px;
    height: 50px;
    margin-top: 4px;
  }

  main {
    overflow: auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    flex: 1;
  }

  footer {
    height: 0.7cm;
    font-size: 0.35cm;
  }
}






/* ===== HEADER APP ICON ===== */

.header-app-icon-wrapper {
    position: relative;
    isolation: isolate;

    width: 1cm;
    height: 1cm;
    flex-shrink: 0;

    border-radius: 14px;
    overflow: hidden;
}

.header-app-icon {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-app-icon-wrapper::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	pointer-events: none;
	z-index: 2;
	background: linear-gradient( to bottom, rgba(255, 255, 255, 0.30) 0%, rgba(255, 255, 255, 0.15) 20%, rgba(255, 255, 255, 0) 45%, rgba(0, 0, 0, 0.01) 65%, rgba(0, 0, 0, 0.08) 100% );
	box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08), inset 0 -1px 2px rgba(0, 0, 0, 0.12);
}

@media only screen and (min-width: 769px) {
    .header-app-icon-wrapper {
        width: 45px;
        height: 45px;
    }
}






/* ===== HEADER APP TITLE ===== */

#header-app-title {
    margin: 6px 5px !important;
    font-weight: 400;
    color: #ffd700;

    background-clip: text;
    -webkit-background-clip: text;

    text-shadow:
        0 1px 1px #d4af37,
        0 -1px 1px #fff9c4;

    letter-spacing: 0;
    line-height: 1;
    font-size: 0.8cm;
}

@media only screen and (min-width: 769px) {
    #header-app-title {
        font-size: 40px;
    }
}








a.user-avatar,
div.user-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px !important;
  font-weight: bold !important;
  font-family: var(--font-family) !important;
  padding: 8px;
  box-shadow:
    inset 0 1px 1px rgba(255 255 255 / 69%),
    inset 0 -1px 1px rgba(25 25 25 / 30%) !important;
  text-shadow:
    0 0.5px 0.5px rgba(255, 255, 255, 0.7),
    0 -0.5px 0.5px rgba(25, 25, 25, 0.3);
  border: none;
}

@media (prefers-color-scheme: dark) {
  a.user-avatar,
  div.user-avatar {

    box-shadow:
      inset 0 1px 1px rgba(255 255 255 / 10%),
      inset 0 -1px 1px rgba(0 0 0 / 35%);
  }
}

.popup {
  display: none;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(2px);
  z-index: 100000;
  justify-content: center;
  align-items: center;
}

@media (prefers-color-scheme: dark) {
  .popup {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(2px);
  }
}

.popup > div {
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;

  background: rgba(255, 255, 255, 0.96);
  border-radius: 20px;

  box-shadow:
    inset 0 1px 3px rgba(255, 255, 255, 0.9),
    inset 0 -1px 3px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: dark) {
  .popup > div {
    background: #1c1c1d;
    border-radius: 20px;

    box-shadow:
      inset 0 1px 3px rgba(255, 255, 255, 0.12),
      inset 0 -1px 3px rgba(0, 0, 0, 0.35);
  }
}

@media (max-width: 500px) {
  .popup > div {
    width: 100%;
    border-radius: 0;
  }
}

.popup {
  transition: backdrop-filter 0.3s ease;
}

.popup > div > div.header {
  margin: 0px;
  border-bottom: 1px solid #cccccc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-direction: row;
}

.popup > div > div.header > p {
  font-size: 22px;
}

.popup > div > div.content p:last-child {
  display: flex;
  gap: 40px;
  justify-content: center;
}

.popup > div > div.content p:last-child > button:only-child,
.popup > div > div.content p:last-child > input[type="submit"]:only-child {
  margin-left: auto;
  margin-right: 0;
}

.content-box {
  min-width: 901px;
  max-width: 901px;
  margin: 0 auto;
  background-color: var(--background-primary);
  border-radius: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

.content-box-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 8px 0;
  flex: 1;
  overflow-y: auto;
}

.content-box-content.padding {
  padding: 15px 30px;
  box-sizing: border-box;
}

.content-box-footer {
  display: flex;
  justify-content: right;
  gap: 8px;
  padding: 8px 16px;
  border-top: 1px solid #f0f0f0;
  margin-top: auto;
  flex-shrink: 0;
  align-items: center;
}

.content-box-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid #f0f0f0;
  margin-top: auto;
  flex-shrink: 0;
  align-items: center;
}

.content-box-header h2 {
  margin-top: 7px;
  margin-bottom: 7px;
}

@media (prefers-color-scheme: dark) {
  .content-box {
    box-shadow: 0 1px 5px rgba(255, 255, 255, 0.4);
  }
}

@media (max-width: 900px) {
  .content-box {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .content-box-footer {
    padding: 6px 12px;
    border-top: 1px solid #f0f0f0;
  }
  .content-box-header {
    padding: 6px 12px;
    border-bottom: 1px solid #f0f0f0;
  }
}

p.submit-button {
  display: flex;
  justify-content: right;
}

.content-box-header-left,
.content-box-header-right {
  display: flex;
  flex-direction: row;
  gap: 15px;
  align-items: center;
}

.content-box-header h2 {
  font-size: 25px;
}

.content-box-content h3 {
  font-size: 22px;
}

section {
  margin-bottom: 10px;
}







/* ==================================================
   Content Panel – global wiederverwendbare Komponente
   ================================================== */

/* ---------- Hauptbereich ---------- */

.content-panel-main {
    display: flex;
    flex: 1 1 0;
    align-items: stretch;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 0;
    padding: 24px;
    overflow: hidden;
    background: #f5f5f7;
}

/* ---------- Panel ---------- */

.content-panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-width: 860px;
    min-width: 0;
    min-height: 0;
    margin: 0 auto;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #dedee3;
    border-radius: 16px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.045);
}

/* ---------- Kopfbereich ---------- */

.content-panel-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-sizing: border-box;
    width: 100%;
    padding: 11px 16px;
    background: #fafafa;
    border-bottom: 1px solid #e5e5ea;
}

/* ---------- Scrollbarer Inhaltsbereich ---------- */

.content-panel-content {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #c7c7cc transparent;
}

.content-panel-content::-webkit-scrollbar {
    width: 8px;
}

.content-panel-content::-webkit-scrollbar-track {
    background: transparent;
}

.content-panel-content::-webkit-scrollbar-thumb {
    background: #c7c7cc;
    border: 2px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

.content-panel-content::-webkit-scrollbar-thumb:hover {
    background-color: #a8a8ae;
    background-clip: padding-box;
}

/* ---------- Fußbereich ---------- */

.content-panel-footer {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    padding: 11px 16px;
    background: #fafafa;
    border-top: 1px solid #e5e5ea;
    border-radius: 0 0 15px 15px;
}

/* ==================================================
   Responsive Layout
   ================================================== */

@media (max-width: 600px) {
    .content-panel-main {
        padding: 10px;
    }

    .content-panel {
        max-width: none;
        border-radius: 14px;
    }

    .content-panel-header {
        padding: 10px 12px;
    }

    .content-panel-footer {
        padding: 10px 12px;
        border-radius: 0 0 13px 13px;
    }
}

/* Kleine Displays mit geringer Höhe */

@media (max-height: 500px) {
    .content-panel-main {
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .content-panel-footer {
        padding-top: 7px;
        padding-bottom: 7px;
    }
}

/* ==================================================
   Dark Mode
   ================================================== */

@media (prefers-color-scheme: dark) {
    .content-panel-main {
        background: #1c1c1e;
    }

    .content-panel {
        background: #2c2c2e;
        border-color: #48484a;
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
    }

    .content-panel-header,
    .content-panel-footer {
        background: #262628;
        border-color: #48484a;
    }

    .content-panel-content::-webkit-scrollbar-thumb {
        background: #636366;
        background-clip: padding-box;
    }

    .content-panel-content {
        scrollbar-color: #636366 transparent;
    }
}


body.panel-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    margin: 0;
    overflow: hidden;
}

body.panel-layout > header {
    flex: 0 0 auto;
}


@media (max-width: 850px) {
    .content-panel-main {
        padding: 0;
        background: transparent;
    }

    .content-panel {
        max-width: none;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    .content-panel-footer {
        border-radius: 0;
    }
}