/* Garagenflohmarkt FarbenDesign */
* {
    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-color:  #077553;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

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

.tab-button {
    background-color: #555555;
    color: #d3d3d3;
    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-color: #white;
    transform: translateY(-2px);
}

.tab-button.active {
    background: #baa58b;
    color: black;
    border-color: white;
}

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: #077553;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(139, 195, 74, 0.1);
}

/* Categories Checkbox Styling */
.categories-main-container {
    padding: 1rem;
    background-color: #f8fdf8;
    border: 2px solid #c8e6c9;
    border-radius: 8px;
    margin-top: 0.5rem;
}

.category-group {
    margin-bottom: 1rem;
    padding: 0.8rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.category-group:hover {
    border-color: #077553;
    box-shadow: 0 2px 8px rgba(7, 117, 83, 0.1);
}

.category-main {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
}

.main-category-checkbox {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: #077553;
}

.main-category-label {
    cursor: pointer;
    font-weight: 600;
    margin: 0;
    color: #077553;
    font-size: 1.05rem;
}

.subcategories-container {
    margin-left: 2rem;
    margin-top: 0.8rem;
    padding: 0.8rem;
    background-color: #f8fdf8;
    border-left: 3px solid #077553;
    border-radius: 4px;
}

.subcategory-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.6rem;
    margin-bottom: 0.8rem;
}

.subcategory-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.subcategory-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #077553;
}

.subcategory-item label {
    cursor: pointer;
    font-weight: 400;
    margin: 0;
    color: #5d4037;
    font-size: 0.95rem;
}

.freetext-container {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px dashed #c8e6c9;
}

.freetext-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #5d4037;
    margin-bottom: 0.4rem;
}

.freetext-input {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid #c8e6c9;
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: white;
    transition: border-color 0.3s ease;
}

.freetext-input:focus {
    outline: none;
    border-color: #077553;
    box-shadow: 0 0 0 2px rgba(7, 117, 83, 0.1);
}

/* Legacy category styles for backward compatibility */
.categories-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.8rem;
    padding: 1rem;
    background-color: #f8fdf8;
    border: 2px solid #c8e6c9;
    border-radius: 8px;
    margin-top: 0.5rem;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #077553;
}

.category-item label {
    cursor: pointer;
    font-weight: 400;
    margin: 0;
    color: #5d4037;
}

.form-hint {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #8d6e63;
    font-style: italic;
}

.submit-button {
    width: 100%;
    background: #077553;
    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 {
    background: #055d42;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(7, 117, 83, 0.3);
}

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

/* 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;
}

/* Category Filter Styles */
.category-filter {
    background: #f1f8e9;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    border: 2px solid #c8e6c9;
}

.category-filter h3 {
    color: #5d4037;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.filter-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.filter-category-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    border: 1px solid #dcedc8;
}

.filter-category-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #077553;
}

.filter-category-item label {
    cursor: pointer;
    font-weight: 500;
    margin: 0;
    color: #5d4037;
    font-size: 0.95rem;
}

.filter-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.filter-button {
    background: white;
    color: #5d4037;
    border: 2px solid #c8e6c9;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
}

.filter-button:hover {
    background: #e8f5e9;
    transform: translateY(-1px);
}

.filter-button.primary {
    background: #077553;
    color: white;
    border-color: #077553;
}

.filter-button.primary:hover {
    background: #066644;
    border-color: #066644;
}

/* 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: #555555;
    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: #555555;
    margin-top: 1.5rem;
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    font-weight: 600;
}

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

.impressum-container strong {
    color: #555555;
}

#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 #077553;
}

.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: #59aa44c;
}

/* 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: #077553;
    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-color: #555555;
    color: white;
    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 */
    }
    
    .filter-categories {
        grid-template-columns: 1fr;
    }
    
    .filter-actions {
        flex-direction: column;
    }
    
    .filter-button {
        width: 100%;
    }
    
    .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;
    }
}