/* ==================== Footer ==================== */
/* Standard-Footer-Styling, basierend auf Ihren früheren Snippets */
footer {
    background-color: white;
}

.main-footer {
    background-color: var(--body-color);
    border-top-left-radius: 100px;
    position: relative;
    width: 100%;
    color: var(--text-color);
    padding-top: 4rem;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

.main-footer .footer-container {
    padding-bottom: 3rem;
    display: grid;
    /* Angepasstes Grid für 4 Spalten, responsive */
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 3rem 2rem; /* Abstand zwischen den Spalten */
    align-items: flex-start; /* Standard: Oben ausgerichtet */
}

/* Footer-Spalten-Styling */
.footer-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Links ausgerichtet im Desktop-Modus */
    /* Kein text-align hier, damit Listen linksbündig bleiben */
}

/* Styling für Logo und Beschreibung im ersten Footer-Feld */
.footer-info .footer-logo img {
    max-height: 70px; /* Angepasste Logohöhe */
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.footer-info .footer-logo:hover img {
    transform: translateY(-5px); /* Leichter Hover-Effekt */
}

.footer-description {
    font-size: var(--normal-font-size);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: var(--text-color-light); /* Leichtere Textfarbe */
}

/* Footer Titel */
.footer-title {
    font-size: var(--h3-font-size);
    color: var(--title-color);
    margin-bottom: 1.5rem; /* Abstand vom Titel zum Inhalt darunter - inklusive Linie */
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative; /* Wichtig für die Positionierung des ::after Pseudo-Elements */
    padding-bottom: 0.5rem; /* Platz für die Unterstreichung */
}

.footer-title-icon {
    font-size: 1.25rem;
    color: var(--first-color); /* Icon Farbe */
}

/* Listen-Styling im Footer */
.footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-list li:not(:last-child) {
    margin-bottom: 0.75rem;
}

.footer-link {
    color: var(--text-color);
    font-size: var(--normal-font-size);
    transition: color 0.3s ease;
}

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

/* Kontaktliste spezifisches Styling */
.footer-contact-list p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color-light);
    font-size: var(--normal-font-size);
}

.footer-contact-list i {
    font-size: 1rem;
    color: var(--first-color);
}

/* Newsletter Formular */
.newsletter-description {
    font-size: var(--small-font-size);
    line-height: 1.5;
    margin-bottom: 1rem;
    color: var(--text-color-light);
}

.footer-newsletter-form {
    display: flex; /* Flexbox für Input und Button */
    align-items: center;
    background-color: var(--container-color);
    border-radius: var(--border-radius-md); /* Annahme, dass Sie solche Variablen haben */
    padding: 0.5rem;
    box-shadow: var(--shadow-small); /* Annahme, dass Sie solche Variablen haben */
    width: 100%;
    gap: 0.5rem; /* Kleiner Abstand zwischen Input und Button */
}

.footer-newsletter-input-wrapper {
    display: flex;
    align-items: center;
    flex-grow: 1; /* Nimmt den verbleibenden Platz ein */
    flex-shrink: 1; /* Erlaubt dem Input, kleiner zu werden */
}

.newsletter-input-icon {
    font-size: 1.25rem;
    color: var(--text-color);
    margin-right: 0.5rem;
}

.footer-newsletter-input {
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-color);
    width: 100%; /* Wichtig, damit der Input innerhalb des Wrappers wächst */
    padding: 0.5rem 0;
    font-size: var(--normal-font-size);
}

.footer-newsletter-input::placeholder {
    color: var(--text-color-light);
}

.footer-newsletter-btn {
    background-color: var(--first-color);
    color: var(--white-color);
    border: none;
    border-radius: var(--border-radius-sm); /* Annahme, dass Sie solche Variablen haben */
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem; /* Abstand zwischen Icon und Text im Button */
    font-weight: var(--font-semi-bold);
    white-space: nowrap; /* Verhindert Zeilenumbruch im Button-Text */
    flex-shrink: 0; /* Verhindert, dass der Button schrumpft */
}

.footer-newsletter-btn:hover {
    background-color: var(--first-color-hover); /* Annahme, dass Sie eine Hover-Farbe haben */
}

/* Footer Bottom Sektion: Copyright und Rechtliches */
.footer-bottom {
    display: flex;
    justify-content: space-between; /* Elemente verteilen sich am Rand */
    align-items: center;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color); /* Eine Trennlinie */
    font-size: var(--small-font-size);
    color: var(--text-color-light);
    flex-wrap: wrap; /* Ermöglicht Umbruch auf kleineren Bildschirmen */
    gap: 0.5rem 1.5rem; /* Abstand für Flex-Wrap */
}

.footer-copyright {
    text-align: left; /* Für Desktop: Links ausgerichtet */
    flex-grow: 0; /* Nimmt keinen extra Platz ein */
    flex-shrink: 0; /* Schrumpft nicht, wenn genug Platz ist */
    white-space: nowrap; /* Verhindert Umbruch auf Desktop */
}

.footer-legal-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-grow: 1; /* Nimmt verfügbaren Platz ein */
    justify-content: center; /* Zentriert die Links auf Desktop */
    white-space: nowrap; /* Verhindert Umbruch auf Desktop */
}

.footer-legal-link {
    color: var(--text-color-light);
    transition: color 0.3s ease;
}

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

.footer-legal-separator {
    color: var(--text-color-light);
}

.footer-dev-info {
    text-align: right; /* Für Desktop: Rechtsbündig */
    flex-grow: 0; /* Nimmt keinen extra Platz ein */
    flex-shrink: 0; /* Schrumpft nicht, wenn genug Platz ist */
    white-space: nowrap; /* Verhindert Umbruch auf Desktop */
}

.footer-dev-info a {
    color: var(--first-color);
    font-weight: var(--font-semi-bold);
}

.newsletter-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Dunkles, halbtransparentes Overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Stellt sicher, dass das Popup über allem liegt */
    visibility: hidden; /* Standardmäßig versteckt */
    opacity: 0; /* Für den Fade-Effekt */
    transition: visibility 0.3s, opacity 0.3s;
}

.newsletter-popup.is-active {
    visibility: visible;
    opacity: 1;
}

.newsletter-popup .popup-content {
    background-color: var(--container-color); /* Oder eine andere Hintergrundfarbe */
    padding: 2.5rem;
    border-radius: var(--border-radius-lg); /* Großer Radius, falls definiert */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    text-align: center;
    position: relative;
    max-width: 450px; /* Maximale Breite des Popups */
    width: 90%; /* Responsive Breite */
    transform: translateY(-20px); /* Startposition für Animation */
    opacity: 0;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.newsletter-popup.is-active .popup-content {
    transform: translateY(0);
    opacity: 1;
}

.newsletter-popup .close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
    transition: color 0.3s ease;
}

.newsletter-popup .close-btn:hover {
    color: var(--first-color);
}

/* Styling für den Titel (Icon + Text nebeneinander) */
.newsletter-popup .popup-title {
    font-size: var(--h2-font-size);
    color: var(--title-color);
    margin-bottom: 0.75rem;
    display: flex; /* Macht den Titel zu einem Flex-Container */
    align-items: center; /* Zentriert Icons und Text vertikal */
    justify-content: center; /* Zentriert Icons und Text horizontal */
    gap: 0.5rem; /* Abstand zwischen Icon und Text */
}

/* Styling für die Icons im Titel */
.newsletter-popup .popup-icon {
    font-size: 2.5rem; /* Größe der Icons, anpassen nach Bedarf */
    display: none; /* Standardmäßig beide Icons versteckt */
    flex-shrink: 0; /* Verhindert, dass das Icon schrumpft */
}

.newsletter-popup .popup-icon.success-icon {
    color: var(--first-color); /* Deine Akzentfarbe für Erfolg */
}

.newsletter-popup .popup-icon.error-icon {
    color: var(--error-color); /* Deine Fehlerfarbe (rot) */
}

.newsletter-popup .popup-message {
    font-size: var(--normal-font-size);
    color: var(--text-color-light);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Stil für das Eingabefeld, wenn ein Fehler vorliegt */
.footer-newsletter-input.input-error {
    border: 1px solid var(--error-color); /* Roter Rahmen */
    box-shadow: 0 0 5px rgba(255, 0, 0, 0.3); /* Leichter roter Schatten */
}

/* ==================== Footer Responsive Anpassungen ==================== */

/* State 3: Alle Elemente untereinander (kleine Bildschirme, bis 767px) */
@media screen and (max-width: 897px) {
    .main-footer .footer-container {
        grid-template-columns: 1fr; /* Alle Spalten stapeln */
        gap: 1.5rem; /* Kleinerer Abstand für gestapelte Elemente */
        align-items: center; /* Inhalt zentrieren */
        text-align: center; /* Text zentrieren */
    }

    /* Alle Footer-Spalten erhalten einen border-top und Padding, wenn sie gestapelt sind */
    .footer-col {
        align-items: center;
        text-align: center;
        border-top: 1px solid hsla(var(--hue), 4%, 16%, 0.3);
        padding-top: 1.5rem; /* Fügt Padding oberhalb des border-top hinzu */
    }

    /* Das erste Footer-Element (footer-info) erhält keinen border-top */
    .footer-info {
        grid-column: auto;
        margin-inline: auto;
        width: 100%;
        border-top: none;
        padding-top: 0;
    }

    .footer-info .footer-logo,
    .footer-info .footer-description,
    .footer-info .footer-socials {
        align-self: center;
        text-align: center;
    }

    .footer-col .underline {
        left: 50%;
        transform: translateX(-50%);
    }

    /* Anpassungen für die unterste Footer-Zeile (footer-bottom) zum Stapeln und Zentrieren */
    .footer-bottom {
        flex-direction: column; /* Stapelt die Kinder vertikal */
        gap: 0.5rem; /* Abstand zwischen den gestapelten Elementen */
        align-items: center; /* Zentriert die gestapelten Elemente horizontal im Flex-Container */
        text-align: center; /* Zentriert den Text innerhalb der Elemente */
        width: 100%; /* Stellt sicher, dass der Flex-Container die volle Breite einnimmt */
        flex-wrap: wrap; /* Erlaubt Umbruch, falls Text zu lang */
    }

    /* Stellt sicher, dass die direkten Kinder von footer-bottom korrekt stapeln und zentriert sind */
    .footer-bottom > * {
        width: auto; /* Erlaubt dem Inhalt, die Breite zu bestimmen */
        margin-inline: auto; /* Zentriert die Block-Elemente explizit */
        flex-grow: 0; /* Verhindert unnötiges Wachstum */
        flex-shrink: 1; /* Erlaubt Schrumpfen */
        flex-basis: 100%; /* Jedes Element nimmt volle Breite ein */
        white-space: normal; /* Textumbruch erlauben */
    }

    /* Sicherstellen, dass die Legal-Links sich bei Bedarf umbrechen und zentriert bleiben */
    .footer-legal-links {
        justify-content: center; /* Zentriert die Links, wenn sie umbrechen */
    }

    .footer-description,
    .footer-newsletter-form,
    .newsletter-description {
        max-width: 400px;
    }
}

/* State 2: 'Info' alleine mittig darüber, die anderen 3 nebeneinander (mittlere Bildschirme, 768px bis 1199px) */
@media screen and (min-width: 898px) and (max-width: 1199px) {
    .main-footer .footer-container {
        grid-template-columns: repeat(3, minmax(220px, 1fr));
        gap: 3rem 2rem;
        align-items: flex-start;
        text-align: left;
    }

    /* Das 'info'-Element soll alle 3 Spalten überspannen und zentriert sein */
    .footer-info {
        grid-column: 1 / -1; /* Überspannt alle verfügbaren Spalten */
        text-align: center; /* Zentriert den Text innerhalb der Info-Spalte */
        justify-self: center; /* Zentriert die Info-Spalte selbst in ihrem Grid-Bereich */
        margin-bottom: 2rem; /* Fügt etwas Platz unterhalb der Info-Spalte hinzu */
        border-top: none;
        padding-top: 0;
    }

    /* Stellt sicher, dass der Inhalt des 'info'-Elements zentriert bleibt, wenn es spannt */
    .footer-info .footer-logo,
    .footer-info .footer-description,
    .footer-info .footer-socials {
        align-self: center;
        text-align: center;
    }

    /* Die anderen drei Spalten linksbündig ausrichten und border-top entfernen */
    .footer-col:not(.footer-info) {
        align-items: flex-start;
        text-align: left;
        border-top: none;
        padding-top: 0;
    }

    /* Unterstreichung der Titel für die drei Spalten linksbündig */
    .footer-col .underline {
        left: 0;
        transform: translateX(0);
    }

    /* --- WICHTIGE ANPASSUNGEN HIER FÜR `footer-bottom` --- */
    .footer-bottom {
        flex-direction: row; /* Elemente nebeneinander */
        justify-content: space-between; /* Elemente an den Rändern und dazwischen verteilen */
        align-items: center; /* Vertikal zentrieren */
        flex-wrap: nowrap; /* Verhindert Umbruch in dieser Ansicht, wenn genügend Platz ist */
        padding-inline: 1rem; /* Leicht reduzieren, falls es zu eng wird, oder behalten Sie 2rem */
        gap: 0.5rem 1rem; /* Angepasster Gap für Flex-Elemente, damit sie nicht zu dicht sind */
    }

    .footer-copyright {
        text-align: left;
        flex-grow: 1; /* Erlaubt dem Copyright, sich auszudehnen */
        flex-shrink: 1; /* Erlaubt Schrumpfen, falls es eng wird */
        flex-basis: auto; /* Basisbreite vom Inhalt */
        white-space: nowrap; /* Versucht, den Umbruch zu verhindern */
        min-width: 0; /* Erlaubt dem Element, kleiner als sein Inhalt zu werden, wenn flex-shrink aktiv ist */
    }

    .footer-legal-links {
        justify-content: center; /* Links zentrieren */
        flex-grow: 0; /* Wächst nicht unnötig */
        flex-shrink: 0; /* Schrumpft nicht */
        white-space: nowrap; /* Versucht, den Umbruch zu verhindern */
        min-width: fit-content; /* Passt sich dem Inhalt an, verhindert zu starkes Schrumpfen */
    }

    .footer-dev-info {
        text-align: right;
        flex-grow: 1; /* Erlaubt dem Dev-Info, sich auszudehnen */
        flex-shrink: 1; /* Erlaubt Schrumpfen, falls es eng wird */
        flex-basis: auto; /* Basisbreite vom Inhalt */
        white-space: nowrap; /* Versucht, den Umbruch zu verhindern */
        min-width: 0; /* Erlaubt dem Element, kleiner als sein Inhalt zu werden, wenn flex-shrink aktiv ist */
    }
}

/* State 1: Alle 4 Elemente nebeneinander (sehr große Bildschirme, ab 1200px) */
@media screen and (min-width: 1200px) {
    .main-footer .footer-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 3rem 2rem;
        align-items: flex-start;
        text-align: left;
    }

    /* Alle Footer-Spalten wieder linksbündig ausrichten */
    .footer-col {
        align-items: flex-start;
        text-align: left;
        border-top: none;
        padding-top: 0;
    }

    /* Keine spezielle Spannen- oder Zentrierungslogik für das "info"-Element hier, es ist eine normale Spalte */
    .footer-info {
        grid-column: auto;
        text-align: left;
        justify-self: auto;
        margin-bottom: 0;
    }

    /* Inhalte des "info"-Elements auch linksbündig */
    .footer-info .footer-logo,
    .footer-info .footer-description,
    .footer-info .footer-socials {
        align-self: flex-start;
        text-align: left;
    }

    /* Unterstreichungen der Titel wieder linksbündig */
    .footer-col .underline {
        left: 0;
        transform: translateX(0);
    }

    /* Footer Bottom in diesem State: Nebeneinander, wie ursprünglich */
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: unset;
        flex-wrap: nowrap; /* Wichtig, um Umbruch hier zu verhindern */
        padding-inline: 2rem; /* Standard Padding, wenn viel Platz ist */
        gap: 1.5rem; /* Standard Gap */
    }

    .footer-copyright {
        text-align: left;
        flex-grow: 0;
        flex-shrink: 0;
        flex-basis: auto;
        white-space: nowrap;
    }

    .footer-legal-links {
        justify-content: center;
        flex-grow: 0;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .footer-dev-info {
        text-align: right;
        flex-grow: 0;
        flex-shrink: 0;
        white-space: nowrap;
    }
}