/* Grundlegendes responsives Design */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 15px;
    background-color: #f9f9f9;
    color: #333;
}

/* Header & Tabellen-Resets */
header table, 
form table {
    width: 100% !important;
    max-width: 600px;
    margin: 0 auto;
    border-collapse: collapse;
}

/* Header-Zentrierung erzwingen */
header, header table, header td {
    text-align: center !important;
}

/* Bilder im Header flexibel machen & Abstand erzwingen */
header img {
    max-width: 100%;
    height: auto !important;
    max-height: 60px; /* Begrenzt die Höhe, damit sie auf Handys nicht riesig werden */
    display: inline-block;
    margin: 10px; /* Gibt den Logos Atemraum nach oben und unten */
}

/* Formular-Elemente responsiv machen */
input[type="text"],
input[type="number"],
select,
textarea {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    padding: 10px;
    margin-top: 5px;
    font-size: 16px; /* Verhindert automatisches Zoomen auf iPhones */
    border: 1px solid #ccc;
    border-radius: 4px;
}

fieldset {
    width: 100% !important;
    box-sizing: border-box;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 4px;
}

/* Buttons stylen */
input[type="submit"],
input[type="reset"] {
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    margin-bottom: 10px;
}

/* --- Media Query für Smartphones & Tablets --- */
@media screen and (max-width: 600px) {
    /* Formular-Tabellen-Struktur aufbrechen */
    form tr {
        display: flex;
        flex-direction: column;
        margin-bottom: 15px;
    }

    form td {
        display: block;
        width: 100% !important;
        text-align: left !important;
        padding: 5px 0 !important;
    }
    
    /* Header-Bilder auf Handys untereinander statt nebeneinander */
    header img {
        float: none !important;
        display: block;
        margin: 15px auto !important; /* Zentriert die Blöcke sauber untereinander */
    }
}

/* ==========================================================================
   METHODE 1: Optimierter Code für die scrollbare Teilnehmerliste
   ========================================================================== */

/* 1. Der umschließende Container für die mobile Ansicht */
.table-responsive {
    width: 100%;
    overflow-x: auto; /* Aktiviert das horizontale Scrollen bei Bedarf */
    -webkit-overflow-scrolling: touch; /* Macht das Scrollen auf iPhones geschmeidig */
    margin: 20px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

/* 2. Styling für die Tabelle selbst */
#liste {
    width: 100%;
    border-collapse: collapse;
    background-color: #ffffff;
    font-size: 14px;
    min-width: 800px; /* Zwingt die Tabelle auf Smartphones, breit genug zu bleiben, statt zu quetschen */
}

/* 3. Schickere Kopfzeile */
#liste th {
    background-color: #333333;
    color: #ffffff;
    font-weight: bold;
    padding: 12px 10px;
    text-align: left;
    border: 1px solid #444444;
}

/* 4. Zellen-Styling für bessere Lesbarkeit */
#liste td {
    padding: 10px;
    border: 1px solid #dddddd;
    color: #333333;
    vertical-align: middle;
}

/* 5. Zeilen-Wechsel-Farbe (Zebra-Effekt) für bessere Übersicht */
#liste tr:nth-child(even) {
    background-color: #f2f2f2;
}

/* 6. Inline-Styles aus PHP überschreiben/unterstützen (Bezahlt/Offen-Status) */
#liste td[style*="background-color"] {
    font-weight: bold;
    text-align: center;
    border-radius: 4px;
}