@font-face {
  font-family: 'NeueEinstellung';
  src: 
    url('../assets/fonts/neueeinstellung-regular.eot'),
    url('../assets/fonts/neueeinstellung-regular.woff') format('woff'),
    url('../assets/fonts/neueeinstellung-regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'NeueEinstellung';
  src: 
    url('../assets/fonts/neueeinstellung-bold.eot'),
    url('../assets/fonts/neueeinstellung-bold.woff') format('woff'),
    url('../assets/fonts/neueeinstellung-bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

html, body, button, input, select, textarea {
  font-family: 'NeueEinstellung', Arial, sans-serif;
}

html {
    background: var(--background-color);
}

body {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--background-color);
    min-height: 100vh; /* Stellt sicher, dass der Body mindestens die HÃ¶he des Viewports hat */
    color: var(--font-color);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--font-color);
}

a:link, a:visited, a:active, a:hover {
    color: var(--font-color);
}

.bold, strong, b {
    font-weight: 700;
}

div {
    box-sizing: border-box;
}

#header, #upload-container, #taskContainer {
    flex: 0 0 auto; /* LÃ¤sst diese Elemente ihre natÃ¼rliche GrÃ¶ÃŸe beibehalten */
}

#header {
    display: flex;
    flex-wrap: wrap;           /* ermÃ¶glicht Umbruch */
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 10px 0 0 0;
    background: var(--secondary-background-color);
    box-shadow: 0 2px 4px var(--shadow-color);
    width: 100%;
    column-gap: 5px;
    margin-bottom: 20px;
}

/* Erstes und zweites Kind bleiben in Zeile 1 */
/* (optional â€“ nur wenn du sicherstellen willst, daÃŸ sie nicht zu schmal werden) */
#header > *:nth-child(1),
#header > *:nth-child(2) {
    flex: 0 0 auto;            /* GrÃ¶ÃŸe nach Inhalt */
}

/* Drittes Kind auf 100% Breite, neue Zeile */
#header > *:nth-child(3) {
    flex: 0 0 100%;            /* nimmt die gesamte Zeilenbreite */
}

#logo {
    display: inline-block;
    width: 35px;
    height: 35px;
    background-color: var(--font-color);
    -webkit-mask: var(--logo-image) no-repeat center/contain;
    mask: var(--logo-image) no-repeat center/contain;
}

#title {
    font-size: 22px;
    margin: 0;
    color: var(--font-color);
}

#content {
    max-width: 800px;
    padding: 25px;
}

#wrapper {
    width: 100%;
    max-width: 400px;
    padding: 0 10px;
}

#taskContainer {
    margin: 0 0 15px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: auto; /* Adjust as needed */
    min-height: 150px;
}

.task-card {
    background: var(--font-color);
    padding: 10px;
    border-radius: var(--card-border-radius);
    text-align: center;
    width: 100%;
    max-width: 400px;
    color: var(--bold-font-color);
    will-change: transform; /* This helps the browser optimize the animation */
    background: linear-gradient(145deg, var(--task-card-bg-light), var(--task-card-bg-dark));
    box-shadow: 0 4px 8px var(--shadow-color),
                3px 3px 20px var(--box-shadow-dark),
                -3px -3px 20px var(--box-shadow-light),
                3px 3px 20px var(--task-card-bg-dark) inset,
                -3px -3px 20px var(--task-card-bg-light) inset;
}

@keyframes floating {
    0%, 100% {
        transform: translateY(0);
        box-shadow: 2px 4px 4px rgba(0, 0, 0, 0.3), 
                    3px 3px 20px var(--box-shadow-dark), 
                    -3px -3px 20px var(--box-shadow-light), 
                    3px 3px 20px var(--task-card-bg-dark) inset, 
                    -3px -3px 20px var(--task-card-bg-light) inset;
    }
    50% {
        transform: translateY(-6px);
        box-shadow: 4px 6px 12px rgba(0, 0, 0, 0.15), 
                    3px 3px 20px var(--box-shadow-dark), 
                    -3px -3px 20px var(--box-shadow-light), 
                    3px 3px 20px var(--task-card-bg-dark) inset, 
                    -3px -3px 20px var(--task-card-bg-light) inset;
    }
}

.task-card.floating {
    animation: floating 4s ease-in-out infinite;
}

.task-card h2 {
    font-size: 22px;
    margin-bottom: 10px;
    color: var(--head-color);
}

.task-card p {
    font-size: 18px;
    line-height: 1.8rem;
}

#upload-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#drop-area {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    position: relative;
}

.round-button {
    background: var(--highlight-color);
    border: none;
    border-radius: 50%;
    position: relative;
    width: 70px;
    height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s;
    color: var(--font-color);
    font-size: 16px;
}

/* Disable transitions during initial load */
.no-transition {
    transition: none !important;
}

.round-button svg {
    height: auto;
    display: block;
    fill: currentColor;
    width: 65%;
}

#postponeButton {
    width: 50px;
    height: 50px;
    position: absolute;
    left: 0%;
    top: 50%;
    transform: translate(-150%, -50%);
    color: var(--icon-color);
}

#selectButton {
    color: var(--icon-color);
}

.round-button:disabled {
    background: var(--disabled-background);
    cursor: not-allowed;
    opacity: 0.65;
}

.round-button:disabled svg {
    opacity: 0.65;
}

#previewContainer {
    position: relative; /* Erforderlich fÃ¼r das Platzieren des Pseudoelements */
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 400px;
    height: 110px; /* Set a fixed height for the placeholder */
    margin-bottom: 15px;
    background: var(--secondary-background-color);
    border: var(--preview-border);
    border-radius: var(--preview-border-radius);
    overflow: hidden; /* Stellen Sie sicher, dass das Pseudoelement nicht auÃŸerhalb des Containers angezeigt wird */
}

#previewContainer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--box-shadow-light);
    -webkit-mask: url('img/picture.svg') no-repeat center/80px;
    mask: url(
    'img/picture.svg') no-repeat center/80px;
    opacity: 0.6; /* Einstellen der gewÃ¼nschten Transparenz */
    z-index: 1; /* Platzieren Sie das Pseudoelement hinter den Inhalten im Container */
}

#previewContainer > * {
    position: relative; /* Stellen Sie sicher, dass der Inhalt vor dem Pseudoelement angezeigt wird */
    z-index: 2; /* Inhalt vor dem Pseudoelement */
}



.preview {
    position: relative;
    width: 90px; /* Adjust size as needed */
    height: 90px; /* Adjust size as needed */
}

.preview img {
    width: 100%;
    height: 100%;
    max-width: 90px;
    max-height: 90px;
    border-radius: var(--preview-border-radius);
    object-fit: cover;
}

.preview .remove {
    position: absolute;
    top: -5px;
    right: -10px;
    width: 20px;
    height: 20px;
    background-color: var(--icon-color);
    -webkit-mask: url('img/remove.svg') no-repeat center/contain;
    mask: url('img/remove.svg') no-repeat center/contain;
    border: none;
    cursor: pointer;
}

#uploadButton {
    background: var(--highlight-color);
    border: none;
    border-radius: var(--button-border-radius);
    width: 120px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s;
    color: var(--font-color);
    font-size: 18px;
}

#uploadButton:disabled {
    background: var(--upload-button-disabled-bg);
    color: var(--upload-button-disabled-color);
    cursor: not-allowed;
}

#restartButton {
    background: var(--highlight-color);
    border: none;
    border-radius: var(--button-border-radius);
    width: 160px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s;
    color: var(--font-color);
    font-size: 18px;
    margin-top: 20px;
}

.notice {font-size: small;text-align: center;max-width: 400px;}

.progress-bar-container {
    width: 100%;
    background: var(--font-color);
    height: 4px;
    margin-bottom: 0;
    margin-top: 10px;
}

.progress-bar {
    width: 0;
    height: 100%;
    background: repeating-linear-gradient(to right, var(--highlight-color) 0%, var(--highlight-color) 25%, var(--highlight-color) 50%, var(--highlight-color) 75%, var(--highlight-color) 100%);
    transition: width 1.0s;
    animation: gradient 3s infinite;
    animation-fill-mode: forwards;
    animation-timing-function: linear;
    background-position: 0 100%;
    background-size: 200% auto;
}

#wallet {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translate(100%, -50%);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.4s ease;
    z-index: 100;
}

#wallet.peek {
    transform: translate(calc(100% - 40px), -50%);
    opacity: 0.9;
}

#wallet.visible {
    transform: translate(0, -50%);
    opacity: 1;
    pointer-events: auto;
}

.wallet-item {
    width: 80px;
    height: 64px;
    margin: 4px 0;
    border-radius: var(--card-border-radius);
    background: linear-gradient(145deg, var(--task-card-bg-light), var(--task-card-bg-dark));
    box-shadow: 0 4px 8px var(--shadow-color),
                3px 3px 20px var(--box-shadow-dark),
                -3px -3px 20px var(--box-shadow-light),
                3px 3px 20px var(--task-card-bg-dark) inset,
                -3px -3px 20px var(--task-card-bg-light) inset;
    transform: translateX(60%);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.3s ease, height 0.3s ease;
    will-change: transform, height;
    cursor: pointer;
}

.wallet-item.open {
    transform: translateX(0) scale(1.2);
    width: 180px;
    padding: 8px;
    min-height: 64px;
}

.wallet-item-text {
    display: none;
    font-size: 14px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wallet-item.open .wallet-item-text {
    display: block;
    color: var(--bold-font-color);
}

/* Simple animations used when postponing or retrieving tasks */
.task-card.slide-out {
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.wallet-item.fade-out {
    transform: translateX(100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.wallet-item.new-item {
    transform: translateX(100%);
    opacity: 0;
}

.task-card.fade-in {
    animation: taskFadeIn 0.3s ease forwards;
}

@keyframes taskFadeIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes gradient { 
  0%   { background-position: 0 0; }
  100% { background-position: -200% 0; }
}

#footer {
    margin-top: auto; /* Schiebt den Footer an den unteren Rand */
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 10px;
    background: var(--secondary-background-color);
    /* box-shadow: 0 -2px 4px var(--shadow-color); */
    gap: 10px;
}

.footer-link {
    color: var(--footer-link-color);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-link:not(:first-child)::before {
    content: "|";
    margin-right: 10px;
}

.footer-link:hover {
    color: var(--highlight-color);
}

.footer-link:visited {
    color: var(--footer-link-color);
}

.hidden {
    display: none !important;
}

html.no-scroll,
body.no-scroll {
    overflow: hidden;
    overscroll-behavior: none;
}

body.no-scroll {
    position: fixed;
    width: 100%;
}

#loadingOverlay, #completedOverlay, #eventOverOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--completed-overlay-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--font-color);
    font-size: 24px;
    flex-direction: column;
    z-index: 2;
}

#completedOverlay p {
    margin: 10px 0;
    text-align: center;
}

#completedOverlay img {
    width: 150px; /* GrÃ¶ÃŸe des QR-Codes anpassen */
    height: 150px; /* GrÃ¶ÃŸe des QR-Codes anpassen */
    border-radius: var(--qr-border-radius); /* Abgerundete Ecken */
    box-shadow: 0 4px 8px var(--shadow-color), 
                3px 3px 20px var(--box-shadow-dark), 
                -3px -3px 20px var(--box-shadow-light), 
                3px 3px 20px var(--task-card-bg-dark) inset, 
                -3px -3px 20px var(--task-card-bg-light) inset;
    margin-top: 20px;
}

#eventOverOverlay p {
    margin: 10px 0;
    text-align: center;
}

#inAppBrowserOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--completed-overlay-bg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: var(--font-color);
    font-size: 18px;
    text-align: center;
    padding: 20px;
    z-index: 4;
}

#openInBrowser {
    background: var(--highlight-color);
    border: none;
    border-radius: var(--button-border-radius);
    width: 160px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: background 0.3s;
    color: var(--font-color);
    font-size: 18px;
    margin-top: 20px;
}

.spinner {
    border: 8px solid var(--spinner-border-color);
    border-radius: 50%;
    border-top: 8px solid var(--highlight-color);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
    border-right: 8px solid var(--highlight-color);
}

.loading-overlay__progress {
    --progress: 0%;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: conic-gradient(var(--highlight-color) var(--progress), var(--spinner-border-color) 0);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.loading-overlay__progress::before {
    content: '';
    position: absolute;
    inset: 6px;
    background: var(--completed-overlay-bg);
    border-radius: 50%;
}

.loading-overlay__progress-text {
    position: relative;
    font-size: 14px;
    color: var(--font-color);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Fade-In bleibt unverÃ¤ndert */
@keyframes tutorialFadeIn {
  from { opacity: 0; transform: translateX(4px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Bounce-Keyframes */
@keyframes bounceTop {
  0%, 28%, 32%, 36%, 100% { transform: translateY(0); }
  30%                    { transform: translateY(-4px); }
  34%                    { transform: translateY(-3px); }
}

@keyframes bounceBottom {
  0%, 28%, 32%, 36%, 100% { transform: translateY(0); }
  30%                    { transform: translateY(4px); }
  34%                    { transform: translateY(3px); }
}

@keyframes bounceRight {
  0%, 28%, 32%, 36%, 100% { transform: translateX(0); }
  30%                    { transform: translateX(4px); }
  34%                    { transform: translateX(3px); }
}

@keyframes bounceLeft {
  0%, 28%, 32%, 36%, 100% { transform: translateX(0); }
  30%                    { transform: translateX(-4px); }
  34%                    { transform: translateX(-3px); }
}

/* Tooltip-Basis */
.tutorial-tip {
  position: absolute;
  background: #efefef;
  color: #121212;
  padding: 8px 12px;
  border-radius: var(--tooltip-border-radius);
  font-size: 14px;
  pointer-events: none;
  opacity: 0;
  z-index: 3;
  min-width: 100px;
  font-weight: 700;
}

/* Fade-In (wird per JavaScript o. Ã„. auf die tutorial-tip-Box gesetzt) */
.tutorial-tip.fade-in {
  /* hier werden FadeIn und Bounce â€œparallelâ€ gestartet
     - tutorialFadeIn lÃ¤uft 0.5s und bleibt dann stehen (forwards)
     - bounceXYZ beginnt erst nach 0.5s (delay) und lÃ¤uft endlos */
  animation:
    tutorialFadeIn 0.5s forwards,
    bounceTop 8s ease-in-out 0.5s infinite; /* default: top-Position */
}

/* Wenn Tooltip unten angezeigt wird, Ã¤ndere nur die Bounce-Animation */
.tutorial-tip.bottom.fade-in {
  animation:
    tutorialFadeIn 0.5s forwards,
    bounceBottom 8s ease-in-out 0.5s infinite;
}

/* Wenn Tooltip rechts angezeigt wird, Ã¤ndere ebenfalls */
.tutorial-tip.right.fade-in {
  animation:
    tutorialFadeIn 0.5s forwards,
    bounceRight 8s ease-in-out 0.5s infinite;
}

.tutorial-tip.left.fade-in {
  animation:
    tutorialFadeIn 0.5s forwards,
    bounceLeft 8s ease-in-out 0.5s infinite;
}

/* Fade-Out, falls benÃ¶tigt */
.tutorial-tip.fade-out {
  animation: tutorialFadeOut 0.5s forwards;
}

/* Pseudoelemente fÃ¼r Pfeil bleiben unverÃ¤ndert */
.tutorial-tip.top::after,
.tutorial-tip.bottom::after,
.tutorial-tip.right::after,
.tutorial-tip.left::after {
  content: '';
  position: absolute;
  border-style: solid;
}

.tutorial-tip.top::after {
  left: 50%;
  transform: translateX(-50%);
  bottom: -8px;
  border-width: 10px 10px 0 10px;
  border-color: var(--secondary-background-color) transparent transparent transparent;
}

.tutorial-tip.bottom::after {
  left: 50%;
  transform: translateX(-50%);
  top: -8px;
  border-width: 0 10px 10px 10px;
  border-color: transparent transparent #efefef transparent;
}

.tutorial-tip.right::after {
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 10px 10px 10px 0;
  border-color: transparent var(--secondary-background-color) transparent transparent;
}

.tutorial-tip.left::after {
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 10px 0 10px 10px;
  border-color: transparent transparent transparent var(--secondary-background-color);
}

#infoOverlay {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--background-color);
  color: var(--font-color);
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  will-change: transform;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 5;
  padding: 20px;
}

#infoOverlay.open {
  transform: translateY(0);
}

#infoOverlay .close-button {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  color: var(--font-color);
  font-size: 24px;
  cursor: pointer;
}
