/* =========================================================
 * COMMON APPS CSS
 * ========================================================= */

 /* =========================================================
 * FAQS ANFANG
 * ========================================================= */

.faq-container {
    max-width: 800px;
    margin: 2em auto;
    padding: 0 1em;
}

.faq-item {
    margin-bottom: 1em;
    border-bottom: 1px solid #ccc;
}

.faq-question {
    position: relative;
    display: block;
    margin: 1em auto;
    width: 90%;
    max-width: 700px;
    padding: 1em 3em 1em 1em;
    background: linear-gradient(
        90deg,
        rgba(75, 0, 130, 0.5),
        rgba(0, 180, 100, 0.5)
    );
    color: #dfd;
    cursor: pointer;
    font-weight: bold;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    border-radius: 0.75em;
    transition:
        background 0.4s ease,
        transform 0.2s ease;
    text-align: left;
    border: none;
    outline: none;
    background-clip: padding-box;
    height: auto;
    border: 3px solid black;
    /* border: 3px solid red; // zum test*/
}

.faq-question:hover {
    background: linear-gradient(
        90deg,
        rgba(75, 0, 130, 0.7),
        rgba(0, 180, 100, 0.7)
    );
    transform: scale(1.01);
}

.faq-label {
    display: inline-block;
    padding-right: 2em;
}

.faq-icon {
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;
    transition: transform 0.3s ease;
}

.faq-item.open .faq-icon {
    transform: translateY(-50%) rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    padding: 0;
    opacity: 0;
    transition:
        max-height 0.4s ease,
        opacity 0.3s ease,
        padding 0.3s ease;
    font-size: clamp(1rem, 2vw, 1.2rem);
}

.faq-item.open .faq-answer {
    max-height: 500px;
    opacity: 1;
    padding: 1em;
}

/* =========================================================
 * FAQS ENDE
 * ========================================================= */



/* =========================================================
 * ANLEITUNG SCROLL BUTTON ANFANG
 * ========================================================= */

.scroll-zur-anleitung {
    text-align: center;
    margin: 1.5em 0;
}

.scroll-zur-anleitung a {
    text-decoration: none;
    font-weight: 600;
    font-size: 1.2em; /* kleiner gemacht */
    color: #bff3ff;
    padding: 0.3em 0.9em;
    border: 2px solid #bff3ff; 
    /*border: 2px solid black;  testen */

    border-radius: 12px;
    background: rgba(0, 20, 30, 0.6);
    transition: all 0.4s ease;
    display: inline-block;

    animation: farbschimmer 5s infinite alternate ease-in-out;
}

/* Hover-Effekt bleibt bestehen */
.scroll-zur-anleitung a:hover {
    background: #bff3ff;
    color: #001920;
    box-shadow: 0 0 12px #bff3ff;
    cursor: pointer;
}

/*  Farbverlauf-Animation */
@keyframes farbschimmer {
    0% {
        color: #11ff11;
        border-color: #11ffaa;
    }
    50% {
        color: #9aeaff;
        border-color: #9aeaff;
    }
    100% {
        color: #ff1122;
        border-color: #cfffff;
    }
}

/* =========================================================
 * ANLEITUNG SCROLL BUTTON ENDE
 * ========================================================= */

/* =========================================================
   COMMON APPS – GEMEINSAME BASIS FUER ALLE 3 TOOLS
   Grundlage Buttons: kartenlegen-style.css
========================================================= */

/* =============================
   Allgemeine Textformatierung
============================= */

h2,
h3,
h4 {
    font-weight: bold;
    padding: 10px 10px 10px 0;
    background-color: transparent;
    max-width: 90%;
}

h2 {
    font-size: 4vh;
    color: rgba(0, 255, 255, 0.8);
    text-shadow:
        0 0 10px rgba(0, 255, 255, 0.6),
        0 0 20px rgba(0, 255, 255, 0.4);
    margin-top: 1vh;
}

h3 {
    font-size: 3vh;
    color: rgba(0, 255, 255, 1);
    text-shadow:
        0 0 10px rgba(0, 255, 255, 0.6),
        0 0 20px rgba(0, 255, 255, 0.4);
    margin-top: 0.5vh;
}

h4 {
    font-size: 2vh;
    color: rgba(90, 100, 255, 1);
    text-shadow:
        0 0 10px rgba(255, 100, 255, 0.6),
        0 0 20px rgba(255, 200, 255, 0.4);
    margin-top: 1vh;
}

/* =============================
   App-Header
============================= */

#app-header {
    width: 100%;
    color: white;
    text-align: center;
    padding: 1vh;
    font-size: 1.2em;
    background: rgba(0, 0, 0, 0.7);
    position: relative;
}

/* =============================
   Placeholder
============================= */

input::placeholder,
textarea::placeholder {
    color: gray;
    text-shadow: none;
}

/* =============================
   Button-Container
============================= */

#buttonContainer {
    display: flex;
    align-items: stretch;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    position: relative;
    left: 0;
    padding: 10px;
    gap: 10px;
    overflow: visible;
    height: auto;
    box-sizing: border-box;
}

#vorzurueckbuttoncontainer {
    display: flex;
    align-items: stretch;
    justify-content: center;
    flex-wrap: nowrap;
    width: auto;
    position: relative;
    height: auto;
    overflow: visible;
    gap: 4px;
}

/* =============================
   Buttons – gemeinsame Basis
   Grundlage: kartenlegen-style.css
============================= */

button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: linear-gradient(
        to right,
        rgba(0, 0, 255, 0.5),
        rgba(4, 170, 109, 0.5)
    );
    color: white;
    border: 2px solid black;
    border-radius: 10px;
    font-size: 1.2vw;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow:
        inset 0 0 4px rgba(0, 0, 0, 0.6),
        2px 6px 10px rgba(3, 255, 200, 0.7);
    font-weight: bold;
    text-align: center;
    white-space: normal;
    word-wrap: break-word;
    min-width: 10%;
    max-width: 96%;
}

#buttonContainer button,
.button-container button,
#vorzurueckbuttoncontainer button {
    color: white;
}

#buttonContainer button:is(:hover, :focus, :active),
.button-container button:is(:hover, :focus, :active),
#vorzurueckbuttoncontainer button:is(:hover, :focus, :active) {
    color: white;
}

button:hover {
    background: linear-gradient(
        to left,
        rgba(0, 255, 255, 0.5),
        rgba(255, 255, 255, 0.8)
    );
    box-shadow: 2px 6px 10px rgba(60, 200, 90, 0.5);
    color: yellow;
}

#undoBtn,
#redoBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
    font-size: 2.7vh !important;
    min-width: 32px;
    box-sizing: border-box;
    line-height: 1;
}

/* =============================
   Klassische Modals
   (wird aktuell vor allem von Kartenlegen genutzt,
    ist aber als gemeinsames System sinnvoll)
============================= */

.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(9, 0, 30, 0.9);
    backdrop-filter: blur(10px);
}

.modal-wrapper {
    display: flex;
    justify-content: center;
    padding-top: 5vh;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: rgba(7, 0, 60, 0.72);
    width: 90%;
    max-width: 80vw;
    max-height: 80vh;
    border-radius: 18px;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: scroll;
    overflow-x: hidden;
    text-align: center;
    box-shadow:
        0 0 20px rgba(106, 94, 255, 0.7),
        0 0 40px rgba(80, 0, 255, 0.5),
        0 0 80px rgba(0, 4, 255, 0.73);
    -webkit-overflow-scrolling: touch;
}

.inputField {
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    font-size: 1em;
    border: 2px solid rgba(0, 255, 0, 0.8);
    border-radius: 8px;
    background-color: rgba(0, 0, 139, 0.6);
    color: rgba(0, 255, 0, 0.8);
    text-shadow:
        0 0 10px rgba(0, 255, 0, 0.6),
        0 0 20px rgba(0, 255, 0, 0.4);
    box-shadow:
        0 0 10px rgba(0, 255, 0, 0.6),
        0 0 20px rgba(0, 255, 0, 0.4);
    margin: 20px 0;
    resize: vertical;
    line-height: 1.4;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    text-align: left;
    vertical-align: top;
    height: auto;
    min-height: 3em;
}

.button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-top: 30px;
    flex-wrap: wrap;
}


/* --- Manuelle Kartenwahl Modal --- */

#manualLegungOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10002;
}

#manualLegungModal {
  position: fixed;
  top: 10vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 520px);

  max-height: 80vh;        /* 👈 wichtig */
  overflow-y: auto;        /* 👈 wichtig */

  background: rgba(45, 0, 60, 0.85);
  color: #f3eaff;
  border: 1px solid rgba(150, 100, 220, 0.3);
  border-radius: 14px;
  padding: 18px 20px;
  z-index: 10003;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  font-family: inherit;
  backdrop-filter: blur(8px);
    -webkit-overflow-scrolling: touch;
      animation: modalFadeIn 0.3s ease;
}

#manualLegungModal h3 {
  margin: 0 0 10px 0;
}

#manualLegungModal p {
  margin: 0 0 12px 0;
  font-size: 0.95rem;
}

#manualInputs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

#manualInputs input {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ccc;
  text-align: center;
  font-size: 1rem;
}

.manualLegungButtons {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.manualLegungButtons button {
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

/* Abbrechen */
/* --- Abbrechen-Button im Manuell-Modal --- */
#manualCancel {
  background: rgba(180, 180, 180, 0.25);   /* halbtransparentes Grau */
  color: #f0f0f0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  font-size: 0.95rem;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

#manualCancel:hover {
  background: #ccc;
}

/* Übernehmen */
#manualApply {
  background: linear-gradient(135deg, #4b0082, #7b2cbf);
  color: white;
  font-weight: 500;
}

#manualApply:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, #6400a0, #9550e0);
}

/* =============================
   Thank You Overlay
============================= */

#thankYouOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(12, 0, 40, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1001;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
}

.thank-you-modal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4vh 4vw;
    max-width: 600px;
    width: 90vw;
    background: rgba(5, 0, 25, 0.95);
    border-radius: 16px;
    box-shadow: 0 0 25px #00ffaa;
    color: limegreen;
    font-family: sans-serif;
    text-align: center;
}

.thank-you-modal h2 {
    font-size: 2rem;
    text-shadow: 0 0 8px #0077aa;
    margin-bottom: 2vh;
}

.thank-you-modal p {
    font-size: 1.2rem;
    text-shadow:
        0 0 5px #0077aa,
        0 0 10px #0077aa;
    line-height: 1.5;
}

.thank-you-modal button {
    background-color: #00ffaa;
    color: darkblue;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    margin-top: 3vh;
    box-shadow: 0 0 12px #00ffaa;
    cursor: pointer;
}

/* =============================
   Donation / Spenden-Modale
============================= */

body.modal-open {
    overflow: hidden !important;
}

.donation-modal-inner {
    width: 100%;
    max-width: 100%;
    max-height: 93vh;
    padding: 30px;
    overflow-y: auto;
    overflow-x: hidden;
    font-size: 18px;
    background: rgba(5, 0, 25, 0.85);
    color: #11ff99;
    border-radius: 16px;
    font-family: sans-serif;
    text-align: center;
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.5),
        0 0 12px rgba(0, 174, 255, 0.8),
        0 0 30px rgba(0, 174, 255, 0.6);
    backdrop-filter: blur(6px);
}


.donation-modal-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

#donationModalContent,
#donationModalContentDOWNLOAD {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
    width: min(93vw, 900px);
    max-height: 93vh;
    display: none;
}

#donationModalContent.visible,
#donationModalContentDOWNLOAD.visible {
    display: block;
}

#blurBackground,
#blurBackgroundDownload {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
}

#blurBackground.visible,
#blurBackgroundDownload.visible {
    display: block;
}

/* Allgemeine Button-Styles im Donation-Modal */
#enterCodeBtn,
#modalCloseBtn {
    padding: 10px 20px;
    font-size: 13px;
    border-radius: 8px;
    cursor: pointer;
    font-family: sans-serif;
    min-height: 2.5em;
    line-height: 1.4;
}

#enterCodeBtn {
    background-color: darkblue;
    color: limegreen;
    border: none;
}

#modalCloseBtn {
    background: transparent;
    border: 2px solid #a66bbe;
    color: #a66bbe;
}

/* =============================
   Blur-Overlay
============================= */

#blurBackground,
#blurBackgroundDownload {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

#blurBackground.visible,
#blurBackgroundDownload.visible {
    opacity: 1;
    pointer-events: auto;
}

/* =============================
   Spenden-Code Modal
============================= */

#spendenModal,
#spendenModalDownload {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    max-width: 500px;
    height: 500px;
    max-height: 80vh;
    background-color: rgba(12, 0, 64, 0.85);
    color: limegreen;
    padding: 20px;
    border-radius: 12px;
    z-index: 1001;
    font-family: Arial, sans-serif;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.7);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4vh;
    align-items: center;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

#spendenModal.visible,
#spendenModalDownload.visible {
    opacity: 1;
    pointer-events: auto;
}

#spendenModal h3,
#spendenModalDownload h3 {
    margin-bottom: 1vh;
}

#zugangscodeInput,
#zugangscodeInputDownload {
    font-size: 3vh;
    padding: 10px;
    width: 100%;
    background-color: #10001a;
    color: #00ffff;
    border: 2px solid limegreen;
    border-radius: 5px;
    font-family: inherit;
    text-align: left;
    text-shadow:
        0 0 2px blue,
        0 0 10px blue,
        0 0 20px blue,
        0 0 40px green;
}

/* =============================
   Buttons im Spenden-Code Modal
============================= */

.button-row {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 6vh;
    gap: 12px;
}

.button-row button {
    flex: 1;
    min-height: 48px;
    background-color: limegreen;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: normal;
    line-height: 1.4;
    font-size: clamp(1.4rem, 4vw, 3.6rem);
}

#closeSpendenButton,
#closeSpendenButtonDownload {
    background-color: #110000;
}

/* =============================
   Responsive
============================= */

@media (max-width: 600px) {
    #buttonContainer {
        flex-direction: column;
        align-items: center;
        top: 1vh;
        gap: 1vh;
        justify-content: flex-start;
        max-width: 100%;
        height: auto;
    }

    #vorzurueckbuttoncontainer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 96% !important;
        height: 4vh !important;
        padding-top: 0.5vh;
        padding-bottom: 0.5vh;
    }

    button {
        width: 100%;
        font-size: 2.7vh;
        min-height: 4vh;
        height: auto;
    }

    #buttonContainer button,
    #shareButton,
    #deleteCurrentLegungBtn,
    #clearStorageBtn {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 1vh 1.5vh;
        font-size: 2vh;
        line-height: 1.2;
        box-sizing: border-box;
        width: 100%;
    }
}

/* =============================
   Querformat
============================= */

@media screen and (orientation: landscape) {
    .inputField {
        font-size: 1.4em;
        min-height: 4.5em;
    }
}