/* Allgemeine Header-Stile */
header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 10px 0;
    position: fixed; /* Statt absolute */
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
}

/* Container für Inhalt im Header */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

/* Logo */
.logo {
    height: 50px;
}

/* Navigation */
nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
}

nav ul li {
    margin-right: 30px;
}

nav ul li:last-child {
    margin-right: 0;
}

nav ul li a {
    text-decoration: none;
    font-size: 18px;
    color: #333;
    font-weight: 600;
    transition: color 0.3s ease, transform 0.3s ease;
}

nav ul li a:hover {
    color: #e74c3c;
    transform: scale(1.05);
}

/* Hamburger Menu Button */
.menu-toggle {
    display: none;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 30px;
    height: 3px;
    background-color: #333;
    margin: 6px 0;
    transition: transform 0.3s ease;
}

/* Mobile Navigation */
@media screen and (max-width: 768px) {
    nav ul {
        display: none !important; /* Menü ist immer zu, außer .active */
        flex-direction: column;
        width: 100%;
        background-color: #fff;
        padding: 10px 0;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }
    nav ul.active {
        display: flex !important; /* Nur wenn .active gesetzt ist */
    }
    .logo-text {
        font-size: 1.1em;
        line-height: 1.1;
        word-break: break-word;
        white-space: normal;
        padding: 0 4px;
    }
}

/* Kontakt Container */
.contact-container {
    padding: 40px 20px;
    background-color: #f9f9f9;
    margin-top: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.contact-container h2 {
    font-size: 2.5em;
    color: #333;
    text-align: center;
    margin-bottom: 30px;
}

/* Formular */
.contact-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    max-width: 800px;
    margin: 0 auto;
}

.contact-form label {
    font-size: 1.1em;
    color: #333;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 12px;
    font-size: 1em;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
    margin-bottom: 15px;
}

.contact-form textarea {
    resize: vertical;
    min-height: 150px;
}

.contact-form button {
    background-color: #e74c3c;
    color: white;
    padding: 15px;
    font-size: 1.2em;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.contact-form button:hover {
    background-color: #c0392b;
}

/* Kontaktinfos */
.contact-info {
    margin-top: 40px;
    text-align: center;
}

.contact-info h3 {
    font-size: 2em;
    color: #333;
    margin-bottom: 15px;
}

.contact-info p {
    font-size: 1.1em;
    color: #555;
}

.contact-info a {
    color: #28a745;
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

/* Popup */
.popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 300px;
    max-width: 90%;
    text-align: center;
}

.popup.success {
    border-left: 4px solid #16a34a;
}

.popup.error {
    border-left: 4px solid #dc2626;
}

.popup.info {
    border-left: 4px solid #1e3a8a;
}

.popup-content {
    position: relative;
}

.popup .close {
    position: absolute;
    top: -1rem;
    right: -1rem;
    width: 2rem;
    height: 2rem;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    color: #4b5563;
    transition: all 0.2s ease;
}

.popup .close:hover {
    background: #e5e7eb;
    color: #1f2937;
}

/* Formular-Status */
.form-field.error input,
.form-field.error textarea,
.form-field.error select {
    border-color: #dc2626;
}

.error-message {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.form-field.error .error-message {
    display: block;
}

/* Button-Status */
.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Verbesserte Formular-Validierung */
input:invalid,
textarea:invalid,
select:invalid {
    border-color: #dc2626;
}

input:focus:invalid,
textarea:focus:invalid,
select:focus:invalid {
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

/* Responsives Design */
@media screen and (max-width: 768px) {
    .contact-form {
        grid-template-columns: 1fr; /* Alle Felder untereinander anzeigen */
    }

    .container {
        padding: 0 15px;
    }

    .contact-container {
        padding: 20px;
    }

    .contact-info h3 {
        font-size: 1.8em; /* Kleinere Schriftgröße für bessere Lesbarkeit */
    }
}

/* Mobile Header Anpassung */
@media screen and (max-width: 768px) {
    header {
        padding: 5px 0; /* Reduziert das Padding oben und unten */
    }
    
    .logo {
        height: 40px; /* Reduziert die Größe des Logos für mobile Geräte */
    }
    
    nav ul li {
        margin-right: 15px; /* Verringert den Abstand zwischen den Navigationselementen */
    }
}

/* Container Anpassung für kleinere Bildschirme */
@media screen and (max-width: 768px) {
    .container {
        padding: 0 10px; /* Weniger Padding auf kleineren Bildschirmen */
    }

    .contact-container {
        padding: 20px;
    }
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    width: 1.5rem;
    height: 1.5rem;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1e3a8a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 0.5rem;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
