/* Grundlegende Variablen & Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #ffffff;
    --text: #222222;
    --card: #f8f9fa;
    --border: #dee2e6;
    --text-muted: #5a5a5a;
    --accent: #0056b3;
    --headings: #222222;
    --accent-strong: #004fa3;
}

/* Dark-Mode-Variablen */
body.dark-mode {
    --bg: #222222;
    --text: #e0e0e0;
    --card: #333333;
    --border: #555555;
    --text-muted: #adb5bd;
    --accent: #6ea8fe;
    --headings: #ffffff;
    --accent-strong: #b7dbff;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Layout-Struktur für Sticky Footer */
.page-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header & Footer */
header,
footer {
    background-color: var(--card);
    width: 100%;
    padding: 1rem 0;
    border-color: var(--border);
    color: var(--text);
}

header {
    padding: 2rem 0;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.livetest-main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column; /* Diese Zeile ist neu */
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.limit-notice {
    position: relative; /* Wichtig für die Positionierung des Pfeils */
    background-color: var(--card);
    border: 1px solid var(--border);
    padding: 10px 15px;
    border-radius: 12px; /* Schön abgerundete Ecken */
    color: var(--text); /* Normale Textfarbe für besseren Kontrast */
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 20px; /* Etwas mehr Abstand für den Pfeil */
    display: inline-block; /* Passt die Breite an den Inhalt an */
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Der kleine Pfeil, der nach unten zeigt (die "Sprechblasen"-Spitze) */
.limit-notice::after {
    content: '';
    position: absolute;
    top: 100%; /* Positioniert den Pfeil am unteren Rand der Box */
    left: 50%;
    transform: translateX(-50%);
    
    /* Das CSS-Dreieck-Trick: Wir erstellen ein Dreieck aus den Rändern */
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid var(--card); /* Die Farbe des Pfeils */
}

footer {
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
    padding: 0 1rem;
    /* Added padding */
}

.footer-content a {
    color: var(--accent);
}

/* Seiten-spezifischer Hauptteil */
.livetest-main {
    flex: 1 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

#chat-container {
    width: 100%;
    max-width: 700px;
    height: 70vh;
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

#chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    max-width: 80%;
    line-height: 1.5;
}

.message.user {
    background-color: var(--accent);
    color: white;
    border-bottom-right-radius: 0;
    align-self: flex-end;
}

.message.ai {
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-bottom-left-radius: 0;
    align-self: flex-start;
}

#chat-form {
    display: flex;
    padding: 1rem;
    border-top: 1px solid var(--border);
}

#message-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 5px;
    background-color: var(--bg);
    color: var(--text);
    font-size: 1rem;
}

#chat-form button {
    /* Ändert den Button zu einem quadratischen Icon-Button */
    width: 48px;
    height: 48px;
    padding: 0;
    margin-left: 0.5rem;
    border: none;
    background-color: var(--accent);
    color: white; /* Das färbt das SVG-Icon */
    border-radius: 8px; /* Leicht abgerundete Ecken */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

#chat-form button:hover {
    /* Ein kleiner Effekt beim Darüberfahren */
    background-color: var(--accent-strong);
}

/* Optional: Stellt sicher, dass das SVG die richtige Größe hat */
#chat-form button svg {
    width: 24px;
    height: 24px;
}

#typing-indicator {
    padding: 0 1rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

#typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1s infinite;
}

#typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

#typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

.hidden {
    display: none !important;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1.0);
    }
}

/* ========================================= */
/* EXPLIZITE DARK MODE ÜBERSCHREIBUNGEN      */
/* ========================================= */

body.dark-mode header,
body.dark-mode footer {
    background-color: var(--card);
    border-color: var(--border);
    color: var(--text);
}

body.dark-mode #chat-container {
    border-color: var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

body.dark-mode .message.ai {
    background-color: var(--bg);
    border-color: var(--border);
}

body.dark-mode #message-input {
    background-color: var(--bg);
    border-color: var(--border);
    color: var(--text);
}

body.dark-mode #chat-form {
    border-top-color: var(--border);
}

body.dark-mode #typing-indicator span {
    background-color: var(--text-muted);
}

/* Dark Mode Toggle Stile */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--accent);
}

input:checked+.slider:before {
    transform: translateX(26px);
}

.dark-mode-lable {
    position: absolute;
    top: 50%;
    right: 100%;
    margin-right: 10px;
    transform: translateY(-50%);
    pointer-events: none;
    white-space: nowrap;
}

.live-link,
.live-link1 {
    color: #0056b3 !important;
    /* dunkleres Blau für besseren Kontrast */
}

body.dark-mode .live-link,
body.dark-mode .live-link1 {
    color: #ffffff !important;
    /* weißer Text für besseren Kontrast */
}

/* Mobile Anpassungen */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        justify-content: center;
        gap: 0.75rem;
    }
}