/* 1. Globales Reset und Typografie */
* {
    box-sizing: border-box; /* Wichtig für responsives Layout */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Modernere Schriftart */
    font-size: 16px; /* Standard-Basis-Schriftgröße */
    line-height: 1.6; /* Etwas lockererer Zeilenabstand */
    margin: 0;
    padding: 0;
}

/* 2. Body und Hauptlayout-Zentrierung */
body {
    min-height: 100vh; /* Mindesthöhe des Viewports */
    background-image: linear-gradient(to bottom, rgb(223, 236, 248), rgb(178, 173, 246));
    padding: 20px; /* Etwas Polsterung um den Inhalt */
}

/* Haupt-Container für Zentrierung und maximale Breite */
.main-content-wrapper {
    max-width: 1200px; /* Maximale Breite für Desktop-Ansicht */
    margin: 0 auto; /* Zentriert den Hauptinhalt */
    padding: 0 15px; /* Innenabstand für kleinere Bildschirme */
}

/* 3. Header/Titel-Element (h1) */
h1 {
    margin: 20px 0; /* Vertikaler Abstand */
    background-color: rgb(176, 193, 247);
    color: rgb(0, 0, 0);
    text-align: center;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Modernerer Schatten */
    border-radius: 8px;
    font-size: 2em; /* Relative Größe */
    width: 100%; /* Volle Breite im Container */
}

/* 4. Flex-Container für Hauptinhalte */
.flex-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Responsives Grid */
    gap: 20px; /* Abstand zwischen den Grid-Elementen */
    margin: 20px 0;
    padding: 0;
}

/* 5. Ticker-Elemente (c1 und ticker-wrapper-v) */
.c1, .ticker-wrapper-v {
    margin: 15px 0; /* Entfernt die festen margin-left/right Werte */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.c1 {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    background: red;
    padding: 0 10px;
}

.c1 h2 {
    margin: 0 20px;
    color: white;
    font-size: 2em;
    line-height: 44px;
    white-space: nowrap;
    animation: ticker 15s linear infinite;
}
/* -------------------------------------------------- */
/* 1. WRAPPER (Sichtfenster) */
/* -------------------------------------------------- */
.ticker-wrapper-v {
    display: flex;
    height: 36px; /* Sichtbare Höhe */
    background-color: #f0f0f0;
    overflow: hidden; /* Versteckt alles außerhalb der 36px */
    border-left: 1px solid #ccc;
}

.ticker-wrapper-v .heading {
    background-color: rgb(137, 161, 238);
    color: rgb(0, 0, 0);
    padding: 5px 10px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    font-weight: bold;
}

/* -------------------------------------------------- */
/* 2. TICKER-LISTE (Der animierte Teil) */
/* -------------------------------------------------- */
.news-ticker-v {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
    z-index: 999;
    
    /* Langschreibweise, um alle Werte explizit zu setzen */
    animation-name: tic-v;
    animation-duration: 16s;
    animation-timing-function: linear; /* Wichtig: Gleichmäßige Geschwindigkeit */
    animation-iteration-count: infinite;
    animation-direction: normal; /* Wichtig: Verhindert das Zurücklaufen */
}

/* -------------------------------------------------- */
/* 3. EINZELNES ITEM */
/* -------------------------------------------------- */
.news-ticker-v li {
    height: 36px; /* Muss der Höhe des Wrappers entsprechen */
    line-height: 36px; /* Zentriert den Text vertikal */
    padding: 0 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.news-ticker-v li a {
    text-decoration: none;
    color: inherit;
}

/* -------------------------------------------------- */
/* 4. KEYFRAMES (Die Bewegung) */
/* -------------------------------------------------- */
@keyframes tic-v {
    /* Startposition */
    0% {
        transform: translateY(0);
    }
    /* Endposition: Verschiebung um 50% der Gesamthöhe (Höhe des Original-Inhalts) */
    100% {
        transform: translateY(-50%); 
    }
}

/* 6. Uhren-Element (#clock) */
#clock {
    display: flex;
    align-items: center;
    justify-content: center; /* Zentrierung */
    font-size: 1.5em;
    font-family: Arial, sans-serif;
    color: rgb(0, 0, 0);
    margin: 10px 0;
}

#time {
    padding: 4px;
}

/* 7. Listen und Tabellen */
ul {
    text-align: left; /* Listenpunkte linksbündig */
    list-style-type: none;
    padding: 0;
}

li {
    padding: 8px 0;
}

table {
    width: 100%; /* Volle Breite im Container */
    max-width: 400px; /* Maximale Breite für Lesbarkeit */
    margin: 10px auto; /* Zentrierung */
    padding: 0;
    border-collapse: collapse;
    color: rgb(0, 0, 0);
    font-size: 0.9em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    overflow: hidden; /* Für border-radius */
}

th, td {
    padding: 10px;
    border: 1px solid #ddd; /* Leichte Trennlinien */
    text-align: left;
}

th {
    background-color: #f4f4f4;
    font-weight: bold;
}

/* 8. Button-Stile */
button {
    background-color: rgb(172, 189, 243);
    margin: 6px;
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    color: rgb(0, 0, 0);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: rgb(150, 170, 230);
}

/* 9. Farbklassen (b1, b2, b3) */
.b1, .b2, .b3 {
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 5px;
}

.b1 {
    background-color: rgb(196, 200, 246);
}

.b2 {
    background-color: rgb(220, 226, 246);
}

.b3 {
    background-color: rgb(227, 250, 201);
}

/* 10. Media Queries für feinere Anpassungen */

/* Tablet-Ansicht */
@media (max-width: 1000px) {
    h1 {
        font-size: 1.8em;
    }
    .flex-container {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
    }
}

/* Mobile-Ansicht */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    .main-content-wrapper {
        padding: 0 10px;
    }
    h1 {
        font-size: 1.5em;
        padding: 10px;
    }
    .flex-container {
        grid-template-columns: 1fr; /* Eine Spalte */
        gap: 10px;
    }
    #clock {
        font-size: 1.2em;
    }
    .c1 h2 {
        font-size: 0.9em;
    }
    .ticker-wrapper-v {
        height: 30px;
    }
    .news-ticker-v li {
        line-height: 30px;
    }
}

/* 11. Animationen */
@keyframes ticker {
    0% {
      transform: translateX(100%);
    }
    100% {
      transform: translateX(-100%);
    }
}

/* KORRIGIERTE ANIMATION FÜR 5 ELEMENTE (36px Höhe) */
@keyframes tic-v {
    0%   {margin-top: 0;}
    16%  {margin-top: 0;} /* Element 1 halten */
    20%  {margin-top: -36px;} /* Übergang zu Element 2 */
    36%  {margin-top: -36px;} /* Element 2 halten */
    40%  {margin-top: -72px;} /* Übergang zu Element 3 */
    56%  {margin-top: -72px;} /* Element 3 halten */
    60%  {margin-top: -108px;} /* Übergang zu Element 4 */
    76%  {margin-top: -108px;} /* Element 4 halten */
    80%  {margin-top: -144px;} /* Übergang zu Element 5 */
    96%  {margin-top: -144px;} /* Element 5 halten */
    100% {margin-top: 0;} /* Sofortiger Sprung zurück zu Element 1 */
}