/* =====================================================================
   Mobintutors – Stylesheet
   Funktioniert auf Smartphones (iOS/Android), Tablets und Computern.
   Farben und Bilder kannst du zentral hier oben ändern.
   ===================================================================== */
:root {
    --blue: #3498db;
    --blue-dark: #2980b9;
    --navy: #2c3e50;
    --text: #333;
    --text-soft: #555;
    --yellow: #fff703;
    --radius: 10px;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --header-h: 64px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after {
    box-sizing: border-box; /* Padding sprengt keine Breiten mehr */
}

html {
    -webkit-text-size-adjust: 100%; /* iPhone vergrössert Text im Querformat nicht */
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 12px); /* Anker landen nicht unter dem Header */
}

body {
    font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    background-color: #eef2f7; /* falls das Bild nicht lädt */
}

/* Hintergrundbild fest hinter der Seite.
   (background-attachment: fixed funktioniert auf iPhones nicht, darum so.) */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: url('hintergrundbild.png');
    background-size: cover;
    background-position: center;
}

img {
    max-width: 100%;
    height: auto;
}

h1, h2, h3 {
    color: var(--navy);
    line-height: 1.2;
    overflow-wrap: break-word;
    -webkit-hyphens: auto; /* lange deutsche Wörter auf kleinen Handys trennen */
    hyphens: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px clamp(16px, 4vw, 20px);
}

a:focus-visible, button:focus-visible, select:focus-visible,
input:focus-visible, textarea:focus-visible, [role="button"]:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
}

/* ---------- Header und Navigation ---------- */
header {
    background-color: var(--navy); /* falls das Banner nicht lädt */
    background-image: url('banner .png');
    background-size: cover;
    background-position: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px clamp(16px, 4vw, 20px);
    min-height: var(--header-h);
}

.logo {
    font-weight: 700;
    font-size: clamp(1.2rem, 1rem + 1vw, 1.5rem);
    color: var(--yellow);
    text-decoration: none;
    transition: color 0.3s ease;
    margin-right: auto;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-soft);
    font-weight: 600;
    padding: 4px 0;
    transition: color 0.3s ease;
}

/* Sprachumschalter */
.language-switcher-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 5px;
    border-radius: 5px;
    padding: 5px;
    transition: background-color 0.3s ease;
}

#language-switcher {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: transparent;
    border: none;
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-soft);
    cursor: pointer;
    padding: 4px 18px 4px 4px;
    /* Grössere Klickfläche, Globus liegt rechts */
}

.language-switcher-container .fa-globe {
    color: var(--text-soft);
    font-size: 1rem;
    position: absolute;
    right: 5px;
    pointer-events: none;
    transition: color 0.3s ease;
}

/* ---------- Hero ---------- */
.hero {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 30px;
    min-height: 80vh;
    min-height: 80svh; /* berücksichtigt Browserleisten auf Handys */
    padding: clamp(24px, 6vw, 50px) clamp(16px, 4vw, 50px);
    text-align: center;
}

.hero-content {
    flex: 1 1 340px;
    max-width: 640px;
    animation: fadeInDown 1s ease-in-out;
    background-color: rgba(255, 255, 255, 0.85);
    padding: clamp(24px, 5vw, 40px);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-content h1 {
    font-size: clamp(1.6rem, 0.6rem + 5.6vw, 3.5rem);
    margin: 0 0 10px;
    -webkit-hyphens: manual; /* keine automatischen Trennstriche im Titel */
    hyphens: manual;
}

.hero-content p {
    font-size: clamp(1rem, 0.9rem + 0.5vw, 1.2rem);
    color: var(--text-soft);
    margin: 0;
}

.hero-image {
    flex: 1 1 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Schriftzug "Online Tutoring" im Hero */
.handwriting-effect {
    margin: 0;
    font-family: 'Caveat', 'Segoe Script', 'Bradley Hand', cursive;
    font-weight: 600;
    font-size: clamp(2.6rem, 1.5rem + 5vw, 5rem);
    color: var(--yellow);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    white-space: nowrap;
}

.handwriting-effect::before {
    content: attr(data-text);
    display: inline-block;
    animation: writeIn 2.2s steps(30, end) 0.4s both;
}

/* ---------- Buttons ---------- */
.cta-button {
    display: inline-block;
    background-color: var(--blue);
    color: #fff;
    padding: 12px 25px;
    min-height: 44px; /* gut antippbar */
    border-radius: 5px;
    text-decoration: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 20px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none;
    cursor: pointer;
}

.cta-button, nav a {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

/* ---------- Abschnitte ---------- */
.page-section {
    padding: clamp(48px, 8vw, 80px) 0;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.9);
}

/* Einblenden nur, wenn script.js läuft – sonst bleibt alles sichtbar */
.js-ready .page-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.js-ready .page-section.visible {
    opacity: 1;
    transform: none;
}

.page-section h2 {
    font-size: clamp(1.6rem, 1.2rem + 2vw, 2.5rem);
    margin: 0 0 20px;
    display: inline-block;
    max-width: 100%;
}

.page-section h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--blue);
    margin: 10px auto 0;
}

/* Über mich */
.about-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 40px;
    margin-top: 30px;
    text-align: left;
}

.about-text {
    flex: 2 1 320px;
    min-width: 0;
}

.about-image {
    flex: 1 1 220px;
    display: flex;
    justify-content: center;
}

.about-image img {
    width: 100%;
    max-width: 320px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: var(--shadow);
    transition: transform 0.5s ease;
}

/* Kontakt */
.contact-section {
    background-color: rgba(232, 234, 246, 0.9);
}

.contact-grid {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(20px, 4vw, 40px);
    margin-top: 30px;
    text-align: left;
}

.contact-info, .contact-form-container {
    flex: 1 1 320px;
    min-width: 0;
    background-color: #fff;
    padding: clamp(20px, 4vw, 30px);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.contact-info h3, .contact-form-container h3 {
    margin-top: 0;
}

.contact-info p {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 15px;
    overflow-wrap: anywhere; /* lange E-Mail-Adressen brechen um */
}

.contact-info .icon {
    width: 1.2em;
    flex-shrink: 0;
    text-align: center;
    color: var(--blue);
}

.contact-info a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.3s ease;
}

.clickable-phone-number {
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.contact-form input, .contact-form textarea {
    display: block;
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: inherit;
    font-size: 16px; /* verhindert automatisches Hineinzoomen auf iPhones */
    background-color: #fff;
    color: var(--text);
    -webkit-appearance: none;
    appearance: none;
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-form button {
    width: 100%;
    margin-top: 5px;
}

/* Impressum */
.imprint-section {
    background-color: transparent;
    text-align: left;
}

.imprint-section .container {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius);
}

/* Footer */
footer {
    background-color: var(--navy);
    color: #fff;
    text-align: center;
    padding: 20px 16px calc(20px + var(--safe-bottom));
}

footer p {
    margin: 0;
}

/* ---------- Hero: Kurzinfos ---------- */
.hero-facts {
    list-style: none;
    padding: 0;
    margin: 18px 0 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.hero-facts li {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    border-radius: 999px;
    background-color: #e8f2fb;
    color: var(--navy);
    font-weight: 600;
    font-size: 0.92rem;
}

.hero-facts i {
    color: var(--blue);
}

/* ---------- Preise ---------- */
.prices-section {
    background-color: rgba(255, 255, 255, 0.92);
}

.price-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(20px, 4vw, 32px);
    margin-top: 30px;
}

.price-card {
    flex: 1 1 280px;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #fff;
    border: 2px solid #e3e8ef;
    border-radius: var(--radius);
    padding: clamp(22px, 4vw, 32px);
    text-align: center;
}

.price-card--main {
    border-color: var(--blue);
}

.price-card h3 {
    margin: 0;
    font-size: 1.25rem;
}

.price-amount {
    margin: 8px 0 12px;
    font-size: clamp(2.2rem, 1.8rem + 2vw, 3rem);
    font-weight: 700;
    line-height: 1.1;
    color: var(--blue);
}

.price-card p:not(.price-amount) {
    margin: 0 0 22px;
    color: var(--text-soft);
}

.price-card .cta-button {
    margin-top: auto; /* Buttons beider Karten auf gleicher Höhe */
}

.price-note {
    max-width: 640px;
    margin: 26px auto 0;
    color: var(--text-soft);
}

/* ---------- Erfahrungsberichte ---------- */
.testimonials-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    margin-top: 30px;
}

.testimonial {
    flex: 1 1 280px;
    max-width: 380px;
    margin: 0;
    padding: 24px;
    background-color: #fff;
    border-left: 4px solid var(--blue);
    border-radius: 0 var(--radius) var(--radius) 0;
    text-align: left;
}

.testimonial blockquote {
    margin: 0 0 12px;
    font-size: 1.05rem;
}

.testimonial blockquote::before { content: '«'; }
.testimonial blockquote::after { content: '»'; }

.testimonial figcaption {
    font-weight: 600;
    color: var(--navy);
    font-size: 0.92rem;
}

/* ---------- FAQ ---------- */
.faq-section {
    background-color: rgba(232, 234, 246, 0.9);
}

.faq-list {
    max-width: 780px;
    margin: 30px auto 0;
    text-align: left;
}

.faq-list details {
    background-color: #fff;
    border-radius: var(--radius);
    margin-bottom: 10px;
    border: 1px solid #e3e8ef;
}

.faq-list summary {
    cursor: pointer;
    list-style: none;
    padding: 16px 48px 16px 20px;
    font-weight: 600;
    color: var(--navy);
    position: relative;
    min-height: 44px;
}

.faq-list summary::-webkit-details-marker { display: none; }

.faq-list summary::after {
    content: '+';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.4rem;
    line-height: 1;
    color: var(--blue);
}

.faq-list details[open] summary::after {
    content: '−';
}

.faq-list details p {
    margin: 0;
    padding: 0 20px 18px;
    color: var(--text-soft);
}

/* ---------- Datenschutz ---------- */
.privacy-section h3 {
    font-size: 1.05rem;
    margin: 22px 0 4px;
}

.privacy-section p {
    margin: 0 0 8px;
}

.form-privacy {
    font-size: 0.85rem;
    color: var(--text-soft);
    margin: -4px 0 10px;
}

.form-privacy a {
    color: var(--blue);
}

/* ---------- Footer-Links ---------- */
.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 24px;
    margin-bottom: 10px;
}

.footer-links a {
    color: #fff;
    text-decoration: none;
    opacity: 0.85;
    padding: 6px 0;
}

.footer-links a:hover,
.footer-links a:focus-visible {
    opacity: 1;
    text-decoration: underline;
}

/* ---------- Chatbot ---------- */
#chatbot-container {
    position: fixed;
    bottom: calc(20px + var(--safe-bottom));
    right: calc(20px + var(--safe-right));
    z-index: 1100;
}

#chatbot-icon {
    width: 72px;
    height: 72px;
    background-color: var(--blue);
    color: #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    font-size: 2.5rem;
    transition: transform 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

#chatbot-icon .bot-face {
    width: 1.1em;
    height: 1.1em;
    display: block;
}

#chatbot-window {
    width: min(350px, calc(100vw - 40px));
    height: min(450px, calc(100vh - 150px));
    height: min(450px, calc(100dvh - 150px)); /* passt sich der Handy-Tastatur an */
    background-color: #fff;
    border-radius: var(--radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    bottom: 86px;
    right: 0;
    transform-origin: bottom right;
}

#chatbot-window.visible {
    display: flex;
    animation: fadeInScale 0.25s ease-out;
}

#chatbot-header {
    background-color: var(--blue);
    color: #fff;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

#chatbot-header h3 {
    margin: 0;
    color: #fff;
    font-size: 1.05rem;
}

#close-btn {
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    margin: -4px -8px -4px 0;
}

#chatbot-messages {
    flex: 1 1 auto;
    min-height: 0;
    padding: 15px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain; /* Seite scrollt nicht mit */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    padding: 10px 12px;
    border-radius: var(--radius);
    max-width: 85%;
    overflow-wrap: anywhere;
    font-size: 0.95rem;
    line-height: 1.45;
}

.user-message {
    background-color: #e6f0ff;
    align-self: flex-end;
}

.bot-message {
    background-color: #f0f0f0;
    align-self: flex-start;
}

#chatbot-input {
    display: flex;
    border-top: 1px solid #ccc;
    flex-shrink: 0;
}

#user-input {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    padding: 12px;
    font-family: inherit;
    font-size: 16px; /* kein Auto-Zoom auf iPhones */
    outline: none;
    border-radius: 0;
    -webkit-appearance: none;
    appearance: none;
}

#send-btn {
    background-color: var(--blue);
    color: #fff;
    border: none;
    padding: 0 18px;
    min-width: 48px;
    cursor: pointer;
    font-size: 1rem;
}

/* ---------- Hover-Effekte nur auf Geräten mit Maus ---------- */
@media (hover: hover) and (pointer: fine) {
    .logo:hover { color: var(--blue-dark); }
    .nav-links a:hover { color: var(--blue); }
    .language-switcher-container:hover { background-color: rgba(255, 255, 255, 0.5); }
    .language-switcher-container:hover .fa-globe,
    #language-switcher:hover { color: var(--blue); }
    .cta-button:hover { background-color: var(--blue-dark); transform: translateY(-2px); }
    .about-image img:hover { transform: rotate(5deg) scale(1.05); }
    .contact-info a:hover, .clickable-phone-number:hover { color: var(--blue); }
    #chatbot-icon:hover { transform: scale(1.1); }
}

/* ---------- Tablets und Handys ---------- */
@media (max-width: 768px) {
    :root { --header-h: 96px; }

    /* Navigation: Logo und Sprache oben, Links darunter in einer Zeile */
    .nav-links {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 4px 18px;
        font-size: 0.95rem;
    }

    .hero {
        flex-direction: column-reverse;
        min-height: auto;
    }

    .hero-content,
    .hero-image {
        flex-basis: auto;
        width: 100%;
    }

    .about-content {
        flex-direction: column-reverse; /* Bild über dem Text */
        text-align: left;
        gap: 24px;
    }

    .about-text, .about-image {
        flex-basis: auto;
        width: 100%;
    }

    .about-image img {
        max-width: 220px;
    }
}

/* ---------- Kleine Handys ---------- */
@media (max-width: 420px) {
    .nav-links {
        justify-content: space-between;
        gap: 4px 10px;
        font-size: 0.9rem;
    }

    .hero-content {
        padding: 22px 18px;
    }

    #chatbot-container {
        bottom: calc(14px + var(--safe-bottom));
        right: calc(14px + var(--safe-right));
    }

    #chatbot-icon {
        width: 60px;
        height: 60px;
        font-size: 2.1rem;
    }

    #chatbot-window {
        width: calc(100vw - 28px);
        bottom: 72px;
    }
}

/* ---------- Querformat auf Handys (wenig Höhe) ---------- */
@media (max-height: 500px) and (orientation: landscape) {
    header { position: relative; } /* Header nimmt keinen Platz weg */
    html { scroll-padding-top: 12px; }
    .hero { min-height: auto; }
    #chatbot-window { height: calc(100dvh - 110px); }
}

/* ---------- Weniger Bewegung, falls im System eingestellt ---------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .js-ready .page-section { transform: none; }
}

/* ---------- Animationen ---------- */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes ripple {
    to { transform: scale(4); opacity: 0; }
}

/* Schriftzug erscheint wie von Hand geschrieben, von links nach rechts */
@keyframes writeIn {
    from { clip-path: inset(0 100% 0 0); }
    to   { clip-path: inset(0 0 0 0); }
}
