/* ------------------------------------------------------------- */
/* GRUNDSTYLING (BASE STYLES) - Gilt für alle Geräte             */
/* ------------------------------------------------------------- */

body {
    /* Setzt die Basis für das Flexbox-Layout und entfernt das fehlerhafte Grid */
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Mindesthöhe des Viewports */
    margin: 0;
    padding: 0;
    color: black; /* Setze Textfarbe standardmäßig auf Schwarz */
    background-color: white;
}

/* Setzt die Haupt-Sektion auf Flexbox für die Desktop-Spalten */
section {
    display: flex;
    flex-wrap: wrap; 
    flex-grow: 1; /* Nimmt den verbleibenden vertikalen Platz ein */
    width: 100%;
    /* Beseitigt die alten float-Probleme */
    clear: both;
}

/* ------------------------------------------------------------- */
/* HEADER-LAYOUT */
/* ------------------------------------------------------------- */
header {
    display: flex; /* Nutze Flexbox für die inneren Boxen */
    flex-wrap: wrap; /* Wichtig für den Umbruch auf Mobilgeräten */
    width: 100%;
    padding: 10px 0;
    background-color: white;
    font-size: 20px;
    align-items: center; 
    border-bottom: 5px solid rgb(4, 4, 90); /* Visuelle Trennlinie */
}

/* Header Boxen (Logo, Titel, Dropdown) */
header .box1, header .box2, header .box3 {
    /* Standardmäßig gleiche Breite */
    flex-grow: 1;
    width: 33.33%; 
    text-align: center;
    padding: 10px;
    box-sizing: border-box;
}

header .box2 { 
    text-align: center; 
    text-decoration: underline; 
    color: rgb(4, 4, 90);
}
header h1 {
    margin: 0;
    font-size: 1.8em;
}
header p1 {
    font-size: 0.9em;
}


/* Logo-Bildanpassung für Responsivität */
header .box1 img {
    max-width: 100%;
    height: auto;
    width: 150px; /* Kleinere Standardgröße */
}


/* ------------------------------------------------------------- */
/* NAV & ASIDE & ARTICLE (Desktop Default)                       */
/* 3-Spalten-Layout: Nav(15%) | Article(70%) | Aside(15%)        */
/* ------------------------------------------------------------- */

/* Navigation (Links) */
.navbar {
    width: 15%;
    min-width: 150px; /* Mindestbreite, damit die Links lesbar bleiben */
    background-color: rgb(4, 4, 90);
}

.navbar ul {
    list-style-type: none;
    padding: 10px;
    margin: 0;
}

.navbar li a {
    font-size: 20px;
    display: block;
    color: white;
    text-decoration: none;
    padding: 10px 10px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.navbar li a:hover {
    background-color: lightsteelblue;
    color: black;
}

/* Inhalt (Mitte) */
article { 
    width: 70%;
    padding: 20px;
    box-sizing: border-box;
    background-color: white;
}

/* Rechte Seitenleiste (Aside) */
aside {
    width: 15%;
    min-width: 100px; 
    background-color: rgb(4, 4, 90); 
    padding: 20px 0;
}


/* ------------------------------------------------------------- */
/* FUSSBereich (FOOTER) */
/* ------------------------------------------------------------- */

footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    width: 100%;
    padding: 20px 0;
    background-color: rgb(4, 4, 90);
    color: white;
    text-align: center;
}

footer .box1, footer .box2, footer .box3 {
    flex-grow: 1;
    width: 33.33%;
    padding: 5px;
}
footer .box2 { font-size: 0.9em; }

/* ------------------------------------------------------------- */
/* TAGESKARTEN-STYLING (DAY CARD STYLES) - NEU                  */
/* ------------------------------------------------------------- */

.day-card-container {
    display: grid;
    /* 3 Spalten auf Desktop */
    grid-template-columns: repeat(3, 1fr); 
    gap: 20px;
    margin: 20px 0;
}

.day-card {
    background-color: lightgray;
    border: 1px solid rgb(4, 4, 90);
    border-radius: 8px;
    padding: 0;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    min-height: 200px; /* Standardhöhe für Konsistenz */
}

.day-card h2 {
    /* Überschrift für den Wochentag */
    margin: 0;
    padding: 15px 10px;
    text-align: center;
    background-color: rgb(4, 4, 90);
    color: white;
    font-size: 1.4em;
    border-radius: 7px 7px 0 0; /* Abgerundete Ecken oben */
}

.trainings-zeit {
    /* Ein einzelner Trainingseintrag */
    padding: 10px;
    text-align: center;
    color: black;
    font-weight: bold;
    border-top: 1px solid #ccc;
    flex-grow: 1; /* Nimmt den verfügbaren Platz im Flex-Container ein */
    display: flex;
    align-items: center; /* Zentriert vertikal */
    justify-content: center; /* Zentriert horizontal */
    line-height: 1.4;
}

.day-card:nth-child(even) {
    background-color: #e0e0e0; /* Abwechselnde Kartenfarbe */
}
.day-card:nth-child(even) h2 {
     background-color: rgb(4, 4, 90); /* Dunkelblau für Überschrift */
}

.no-training {
    font-style: italic;
    color: #666;
    background-color: white;
}

/* Entfernung der alten Tabellenstile */
/* table, thead, h2, th, td, p, tr:nth-child(even) td sind entfernt */


/* ------------------------------------------------------------- */
/* DROP-DOWN / BUTTONS STYLING */
/* ------------------------------------------------------------- */

.dropbtn {
    width: 200px;
    background-color: rgb(4, 4, 90);
    color: white;
    padding: 12px;
    font-size: 16px;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    transition: background-color 0.3s;
}
.dropbtn:hover, .dropbtn:focus {
    background-color: lightsteelblue;
    color: black;
}

/* Dropdown Container */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    min-width: 200px;
    display: none;
    position: absolute;
    background-color: white;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 10;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.3s;
}
.dropdown-content a:hover {
    background-color: lightsteelblue;
}

#myInput {
    width: 90%;
    box-sizing: border-box;
    background-repeat: no-repeat;
    font-size: 16px;
    padding: 10px 10px;
    margin: 5px 5%;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.show {
    display: block;
}

.btnback button {
    width: 150px;
    background-color: white;
    color: black;
    padding: 10px;
    font-size: 16px;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    transition: opacity 0.3s;
}
.btnback button:hover {
    opacity: 0.8;
}

/* ------------------------------------------------------------- */
/* MOBILE / TABLET-LAYOUTS (RESPONSIVE BREAKPOINTS)              */
/* ------------------------------------------------------------- */

/* TABLET-LAYOUT (min-width: 601px und max-width: 991px) */
@media only screen and (min-width: 601px) and (max-width: 991px) {
    
    /* Hauptlayout: Alles gestapelt, um Platz für den Inhalt zu schaffen */
    section {
        flex-direction: column; /* Stapelt Nav, Article, Aside */
    }

    .navbar, aside {
        width: 100%; /* Volle Breite */
        min-width: auto;
        padding: 10px 0;
        text-align: center;
    }
    
    /* Die Navigation soll auf Tablets oben sein */
    .navbar { order: 1; }
    article { order: 2; width: 100%; }
    aside { order: 3; } /* Rechte Seitenleiste kommt nach dem Inhalt */

    /* Header: Logo, Titel und Dropdown bleiben nebeneinander, aber die Boxen
       werden neu verteilt, um mehr Platz für den Titel zu schaffen */
    header .box1 { width: 25%; }
    header .box2 { width: 50%; }
    header .box3 { width: 25%; }
    
    /* Tageskarten für Tablet: 2 Spalten */
    .day-card-container {
        grid-template-columns: repeat(2, 1fr);
    }
}


/* MOBILE-LAYOUT (max-width: 600px) */
@media only screen and (max-width: 600px) {
    
    /* Header: Vertikal stapeln */
    header {
        flex-direction: column; 
        height: auto;
    }
    header .box1, header .box2, header .box3 {
        width: 100%;
        padding: 5px 0;
    }
    header .box1 { order: 1; } /* Logo zuerst */
    header .box2 { order: 2; } /* Titel/Untertitel */
    header .box3 { order: 3; } /* Dropdown zuletzt */

    /* Haupt-Sektion: Alles gestapelt */
    section {
        flex-direction: column;
    }

    /* Alle Hauptspalten auf 100% Breite setzen */
    .navbar, article, aside {
        width: 100%; 
        min-width: auto;
        height: auto;
        padding: 10px 0;
        margin: 0;
    }
    
    /* Navbar Links vertikal anordnen */
    .navbar ul {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .navbar li {
        width: 90%;
        text-align: center;
    }

    /* Footer: Boxen vertikal stapeln */
    footer {
        flex-direction: column;
        padding: 10px 0;
    }
    footer .box1, footer .box2, footer .box3 {
        width: 100%;
    }

    /* Dropdown Menü zentrieren */
    .dropdown {
        width: 100%;
    }
    .dropbtn {
        width: 80%;
    }
    .dropdown-content {
        width: 80%;
        left: 10%; /* Zentrieren */
    }

    /* Tageskarten für Mobile: 1 Spalte */
    .day-card-container {
        grid-template-columns: 1fr;
    }
    
    /* Zusätzlicher Platz zwischen den Karten im Mobil-Layout */
    .day-card {
        margin-bottom: 15px;
    }

    /* Die alten Tabellenstile für Mobilgeräte sind entfernt */
}