/* Global Styles - Fröhliches Braun-Grün-Pastell-Design */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Mobile Optimierungen */
html, body {
    overflow-x: hidden;
    width: 100%;
}

/* Verbesserte Touch-Ziele */
button, input, select, textarea {
    -webkit-tap-highlight-color: rgba(139, 195, 74, 0.3);
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #5d4037;
    background-color: #f1f8e9;
}

header {
    background: linear-gradient(135deg, #8bc34a 0%, #6d4c41 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 2.5rem;
    font-weight: 300;
}

nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.tab-button {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
    padding: 0.8rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    font-weight: 500;
}

.tab-button:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.tab-button.active {
    background: #fff8e1;
    color: #6d4c41;
    border-color: #fff8e1;
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Form Styles */
.form-container {
    background: #fefefe;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(109, 76, 65, 0.1);
    max-width: 600px;
    margin: 0 auto;
    border: 1px solid #e8f5e8;
}

.form-container h2 {
    color: #6d4c41;
    margin-bottom: 1rem;
    font-size: 2rem;
    font-weight: 400;
}

.form-container p {
    color: #8d6e63;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #5d4037;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #c8e6c9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background-color: #f8fdf8;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #8bc34a;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(139, 195, 74, 0.1);
}

.submit-button {
    width: 100%;
    background: linear-gradient(135deg, #8bc34a 0%, #6d4c41 100%);
    color: white;
    border: none;
    padding: 1.2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(139, 195, 74, 0.3);
}

.submit-button:active {
    transform: translateY(0);
}

/* Map Styles */
.map-container {
    background: #fefefe;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(109, 76, 65, 0.1);
    border: 1px solid #e8f5e8;
}

.map-container h2 {
    color: #6d4c41;
    margin-bottom: 1rem;
    font-size: 2rem;
    font-weight: 400;
}

.map-container p {
    color: #8d6e63;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* Impressum Styles */
.impressum-container {
    background: #fefefe;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(109, 76, 65, 0.1);
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid #e8f5e8;
}

.impressum-container h2 {
    color: #6d4c41;
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 400;
    text-align: center;
}

.impressum-container h3 {
    color: #5d4037;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
    border-bottom: 2px solid #c8e6c9;
    padding-bottom: 0.5rem;
}

.impressum-container h4 {
    color: #6d4c41;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.impressum-container p {
    color: #8d6e63;
    margin-bottom: 1rem;
    line-height: 1.7;
    text-align: justify;
}

.impressum-container strong {
    color: #5d4037;
}

#map {
    height: 500px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(109, 76, 65, 0.1);
}

.legend {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f1f8e9;
    border-radius: 8px;
    border: 1px solid #c8e6c9;
}

.legend h3 {
    margin-bottom: 0.5rem;
    color: #5d4037;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.legend-marker {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.legend-marker.confirmed {
    background-color: #8bc34a;
}

/* Message Styles */
.message {
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    font-weight: 500;
    text-align: center;
    display: none;
}

.message.success {
    background-color: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
    display: block;
}

.message.error {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
    display: block;
}

.message.info {
    background-color: #fff8e1;
    color: #6d4c41;
    border: 1px solid #ffecb3;
    display: block;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #6d4c41 0%, #5d4037 100%);
    color: #fff8e1;
    text-align: center;
    padding: 1rem;
    margin-top: 3rem;
}

/* Responsive Design - Erweiterte Mobile-Optimierung */

/* Tablet - Portrait und kleine Laptops */
@media (max-width: 1024px) {
    main {
        max-width: 95%;
        margin: 1rem auto;
    }
    
    .form-container,
    .map-container,
    .impressum-container {
        padding: 1.5rem;
    }
}

/* Tablet - Portrait */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
        margin-bottom: 0.8rem;
    }
    
    nav {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
    }
    
    .tab-button {
        width: 85%;
        max-width: 280px;
        padding: 0.7rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .form-container,
    .map-container,
    .impressum-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .form-group {
        margin-bottom: 1.2rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.8rem;
        font-size: 16px; /* Verhindert Zoom auf iOS */
    }
    
    main {
        padding: 0;
    }
    
    #map {
        height: 450px; /* Vergrößert von 400px */
    }
    
    .legend {
        padding: 0.8rem;
    }
    
    .legend-item {
        margin-bottom: 0.5rem;
    }
}

/* Mobile - Large (iPhone Plus, etc.) */
@media (max-width: 480px) {
    header {
        padding: 0.8rem 0;
    }
    
    header h1 {
        font-size: 1.6rem;
        margin-bottom: 0.6rem;
        padding: 0 1rem;
        text-align: center;
    }
    
    nav {
        padding: 0 1rem;
        gap: 0.6rem;
    }
    
    .tab-button {
        width: 90%;
        max-width: none;
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
        margin-bottom: 0.3rem;
    }
    
    .form-container,
    .map-container,
    .impressum-container {
        margin: 0.3rem; /* Weniger Margin für größere Kartenansicht */
        padding: 1rem;
        border-radius: 10px;
    }
    
    /* Spezielle Optimierung für Map-Container auf Mobile */
    .map-container {
        margin: 0.2rem; /* Noch weniger Margin für die Karte */
        padding: 0.8rem 0.6rem; /* Weniger Horizontal-Padding für breitere Karte */
    }
    
    .map-container h2 {
        margin-bottom: 0.6rem; /* Weniger Abstand zum Titel */
    }
    
    .map-container p {
        margin-bottom: 1rem; /* Weniger Abstand zur Beschreibung */
    }
    
    .form-container h2,
    .map-container h2,
    .impressum-container h2 {
        font-size: 1.5rem;
        margin-bottom: 0.8rem;
        text-align: center;
    }
    
    .form-container p,
    .map-container p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
        text-align: center;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-group label {
        margin-bottom: 0.4rem;
        font-size: 0.95rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.9rem;
        font-size: 16px; /* Wichtig für iOS */
        border-radius: 6px;
    }
    
    .submit-button {
        padding: 1rem;
        font-size: 1rem;
        border-radius: 6px;
        margin-top: 1.5rem;
    }
    
    #map {
        height: 400px; /* Vergrößert von 280px für bessere mobile Sichtbarkeit */
        border-radius: 8px;
    }
    
    .legend {
        padding: 0.4rem; /* Weniger Padding für kompaktere Legende */
        margin-top: 0.5rem; /* Weniger Abstand zur Karte */
    }
    
    .legend h3 {
        font-size: 0.9rem; /* Kleinere Schrift */
        margin-bottom: 0.3rem; /* Weniger Abstand */
    }
    
    .legend-item {
        font-size: 0.8rem; /* Kleinere Schrift für Items */
        margin-bottom: 0.3rem; /* Weniger Abstand zwischen Items */
    }
    
    .legend-marker {
        width: 16px;
        height: 16px;
    }
    
    .impressum-container h3 {
        font-size: 1.2rem;
        margin-top: 1.5rem;
    }
    
    .impressum-container h4 {
        font-size: 1rem;
        margin-top: 1rem;
    }
    
    .impressum-container p {
        font-size: 0.9rem;
        text-align: left;
        line-height: 1.6;
    }
}

/* Mobile - Small (iPhone SE, kleine Android) */
@media (max-width: 375px) {
    header h1 {
        font-size: 1.4rem;
        line-height: 1.3;
    }
    
    .tab-button {
        padding: 0.7rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .form-container,
    .map-container,
    .impressum-container {
        margin: 0.2rem; /* Weniger Margin für kleinere Bildschirme */
        padding: 0.8rem;
    }
    
    /* Spezielle Optimierung für Map-Container auf kleinen Bildschirmen */
    .map-container {
        margin: 0.1rem; /* Minimaler Margin für maximale Kartenfläche */
        padding: 0.6rem; /* Weniger Padding für mehr Kartenfläche */
    }
    
    .form-container h2,
    .map-container h2,
    .impressum-container h2 {
        font-size: 1.3rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.8rem;
        font-size: 16px;
    }
    
    .submit-button {
        padding: 0.9rem;
        font-size: 0.95rem;
    }
    
    #map {
        height: 350px; /* Vergrößert von 250px */
    }
}

/* Mobile - Extra Small (sehr kleine Geräte) */
@media (max-width: 320px) {
    header h1 {
        font-size: 1.2rem;
        padding: 0 0.5rem;
    }
    
    .form-container,
    .map-container,
    .impressum-container {
        margin: 0.1rem; /* Minimaler Margin für sehr kleine Bildschirme */
        padding: 0.6rem;
    }
    
    /* Maximale Kartenfläche für sehr kleine Bildschirme */
    .map-container {
        margin: 0.05rem; /* Fast kein Margin */
        padding: 0.5rem; /* Minimales Padding */
    }
    
    .tab-button {
        padding: 0.6rem;
        font-size: 0.8rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.7rem;
    }
    
    #map {
        height: 300px; /* Vergrößert von 220px */
    }
}

/* Touch-Optimierungen für alle mobilen Geräte */
@media (max-width: 768px) and (pointer: coarse) {
    .tab-button {
        min-height: 44px; /* Apple's empfohlene Touch-Größe */
        touch-action: manipulation;
    }
    
    .submit-button {
        min-height: 48px;
        touch-action: manipulation;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    /* Verhindert Zoom bei Input-Focus auf iOS */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px !important;
    }
}

/* Landscape-Optimierungen für Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    header h1 {
        font-size: 1.4rem;
        margin-bottom: 0.5rem;
    }
    
    header {
        padding: 0.5rem 0;
    }
    
    nav {
        flex-direction: row;
        gap: 0.5rem;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .tab-button {
        width: auto;
        min-width: 120px;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    #map {
        height: 350px; /* Vergrößert von 300px für bessere Landscape-Sichtbarkeit */
    }
    
    .form-container,
    .map-container,
    .impressum-container {
        margin: 0.5rem;
        padding: 1rem;
    }
}