/* Grundlegende Einstellungen für alle Geräte */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
    padding: 15px; /* Abstand zum Rand */
}

/* Container für den Inhalt */
.container {
    max-width: 600px; /* Begrenzt die Breite auf dem Desktop, volle Breite auf Handy */
    margin: 0 auto;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Formulareingaben für mobile Finger optimieren */
input {
    width: 100%;
    padding: 15px; /* Größer als auf Desktop, damit man es leicht tippen kann */
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px; /* Verhindert automatisches Zoomen auf iPhones */
}

button {
    width: 100%;
    padding: 15px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    cursor: pointer;
}

button:hover {
    background-color: #218838;
}

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

/* Tabelle responsive machen */
.table-container {
    overflow-x: auto; /* Erlaubt das seitliche Scrollen, falls die Tabelle zu breit ist */
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

/* Chart responsive machen */
canvas {
    width: 100% !important;
    height: auto !important;
}

/* Container für die Kacheln */
.tile-container {
    display: grid;
    /* Nutzt 1fr auf dem Handy und 2-spaltig/3-spaltig auf größeren Screens */
    grid-template-columns: repeat(2, 1fr); 
    gap: 15px;
    margin-top: 20px;
    width: 100%;
    margin-bottom: 20px;
}

/* Optional: Damit es auf iOS noch cleaner aussieht */
h2 {
    margin-bottom: 5px;
    margin-bottom: 10px;
    font-weight: 800;
}

/* Styling für die Gruppen-Überschriften */
.group-title {
    text-align: left;
    margin: 15px 0 30px 5px;
    font-size: 1.1em;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

/* Die Kachel selbst */
.tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 12px; /* Etwas runder für modernen Look */
    padding: 20px 10px;
    
    text-decoration: none;
    color: #333;
    
    /* WICHTIG für iOS: Verhindert das Kollabieren */
    min-height: 120px; 
    -webkit-appearance: none; /* Entfernt iOS Standard-Button-Styling */
    
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Hover-Effekt (wird auf Touch als Klick-Feedback wahrgenommen) */
.tile:active, .tile:hover {
    background-color: #f8f9fa;
    transform: scale(0.98);
    border-color: #007bff;
}

.tile-icon {
    font-size: 32px;
    margin-bottom: 8px;
    display: block;
}

.tile-title {
    font-weight: 700;
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}

.tile-subtitle {
    font-size: 11px;
    color: #6c757d;
    display: block;
}

/* Media Query für größere Bildschirme */
@media (min-width: 480px) {
    .tile-container {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* Fix für die Kachel-Anzeige bei Textinhalten */
.tile-content-wrapper {
    width: 100%;
    text-align: left;
}

/* Spezielles Styling für das Details-Element */
details {
    width: 100%;
    margin-top: 15px;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

/* Der klickbare Bereich (Summary) */
summary {
    cursor: pointer;
    color: #007bff;
    font-weight: bold;
    font-size: 0.9em;
    outline: none;
    /* Entfernt den Standard-Pfeil in manchen Browsern, um Platz zu sparen */
    list-style: none;
}

/* Eigener kleiner Pfeil für iOS Konsistenz */
summary::before {
    content: "▶ ";
    font-size: 0.8em;
    transition: transform 0.2s;
    display: inline-block;
}

details[open] summary::before {
    content: "▼ ";
}

/* Verhindert, dass die Liste unter iOS eingerückt oder abgeschnitten wird */
details ol {
    margin: 10px 0 0 0;
    padding-left: 20px;
    font-size: 0.9em;
    color: #444;
    width: 100%;
    /* Wichtig für iOS: Verhindert horizontales Scrollen innerhalb der Kachel */
    word-wrap: break-word;
}

details li {
    margin-bottom: 8px;
}
/* Container für die Buttons */
.discipline-selector {
    display: flex;
    gap: 10px;
    margin: 10px 0 20px 0;
    width: 100%;
}

/* Der Standard-Zustand der Buttons */
.type-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 5px;
    background: #ffffff; /* Weißer Hintergrund */
    border: 2px solid #eee; /* Hellgrauer Rand */
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

/* DER FEHLENDE STYLE: Wenn der Button aktiv/selektiert ist */
.type-btn.active {
    border-color: #007bff !important; /* Blauer Rand */
    background-color: #e7f1ff !important; /* Hellblauer Hintergrund */
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.2);
}

/* Textfarbe ändern, wenn aktiv */
.type-btn.active .label-text {
    color: #007bff !important;
}

/* Icon-Größe */
.type-btn .icon {
    font-size: 24px;
    margin-bottom: 5px;
    pointer-events: none;
}

/* Beschriftung */
.type-btn .label-text {
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    color: #666;
    pointer-events: none;
}