/* style.css */

/* Grundlegende CSS-Variablen für Light/Dark Mode */
:root {
    /* Light Mode */
    --bg-color: #f0f2f5; /* Heller Hintergrund */
    --text-color: #1f2937; /* Dunkler Text (gray-900) */
    --card-bg: #ffffff; /* Heller Kartenhintergrund */
    --card-border: #e2e8f0; /* Heller Kartenrand (gray-200) */
    --header-bg: #2563eb; /* Blauer Header (blue-600) */
    --header-text: #ffffff; /* Weißer Header-Text */
    --sidebar-bg: #ffffff; /* Helle Sidebar */
    --sidebar-border: #e2e8f0; /* Heller Sidebar-Rand */
    --chat-bg: #f9fafb; /* Heller Chat-Bereich (gray-50) */
    --chat-border: #e2e8f0; /* Heller Chat-Rand */
    --chat-input-bg: #ffffff; /* Helles Chat-Eingabefeld */
    --chat-other-msg-bg: #e5e7eb; /* Hintergrund für andere Nachrichten (gray-200) */
    --chat-other-msg-text: #1f2937; /* Text für andere Nachrichten (gray-800) */
    --chat-info-text: #6b7280; /* Info-Text (gray-500) */
    --link-color: #2563eb; /* Standard-Linkfarbe (blue-600) */
    --link-hover-color: #1d4ed8; /* Standard-Link-Hoverfarbe (blue-700) */
}

/* Dark Mode Variablen */
html.dark {
    /* Dark Mode */
    --bg-color: #1a202c; /* Dunkler Hintergrund (Sehr dunkles Grau / Fast Schwarz) */
    --text-color: #e2e8f0; /* Heller Text (helles Grau für gute Lesbarkeit) */
    --card-bg: #2d3748; /* Dunklerer Kartenhintergrund (Dunkles Grau) */
    --card-border: #4a5568; /* Dunkler Kartenrand (Mittleres Grau) */
    --header-bg: #1a202c; /* Dunkler Header (wie Hintergrund für Einheitlichkeit) */
    --header-text: #ffffff; /* Weißer Header-Text */
    --sidebar-bg: #2d3748; /* Dunkle Sidebar (Dunkles Grau) */
    --sidebar-border: #4a5568; /* Dunkler Sidebar-Rand */
    --chat-bg: #1f2937; /* Dunkler Chat-Bereich (Dunkleres Grau) */
    --chat-border: #4a5568; /* Dunkler Chat-Rand */
    --chat-input-bg: #2d3748; /* Dunkles Chat-Eingabefeld */
    --chat-other-msg-bg: #4a5568; /* Hintergrund für andere Nachrichten (Mittleres Grau) */
    --chat-other-msg-text: #f0f2f5; /* Text für andere Nachrichten (sehr helles Grau für Kontrast) */
    --chat-info-text: #cbd5e0; /* Info-Text (helleres Grau für bessere Lesbarkeit auf dunklem BG) */
    --link-color: #60a5fa; /* Heller Link (Blau-400) */
    --link-hover-color: #3b82f6; /* Heller Link-Hover (Blau-500) */
}

/* Allgemeine Body-Styles */
body {
    font-family: "Inter", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease; /* Sanfter Übergang */
    line-height: 1.5; /* Verbesserte Lesbarkeit */
}

/* Modul-Karten */
.module-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-color); /* Verwendet jetzt die Haupt-Textfarbe Variable */
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    border-radius: 0.75rem; /* rounded-lg */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); /* shadow-md */
    padding: 1.5rem; /* p-6 */
}
/* Anpassung spezifischer Textfarben in Modul-Karten für den Dark Mode */
/* Diese überschreiben die Standard-text-color, wenn sie nicht dynamisch sind */
html.dark .module-card .text-gray-800 { color: var(--text-color); }
html.dark .module-card .text-gray-700 { color: var(--text-color); }
html.dark .module-card .text-gray-600 { color: #a0aec0; } /* Etwas dunkler als Haupttext, aber noch lesbar */

/* Sidebar */
.sidebar {
    width: 250px;
    min-width: 250px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
    padding: 1.5rem;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Chat-Container */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 400px;
    border: 1px solid var(--chat-border);
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: var(--chat-bg);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.chat-messages {
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
    background-color: var(--chat-bg);
    word-wrap: break-word;
}
.chat-input-area {
    padding: 1rem;
    border-top: 1px solid var(--chat-border);
    background-color: var(--chat-input-bg);
    display: flex;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
/* Chat-Nachrichten Styling */
.chat-message {
    margin-bottom: 0.5rem;
}
.chat-message-own {
    text-align: right;
}
.chat-message-other {
    text-align: left;
}
.chat-message-content {
    display: inline-block;
    max-width: 80%;
    padding: 0.5rem 0.75rem;
    border-radius: 0.75rem;
}
.chat-message-own .chat-message-content {
    background-color: #3b82f6; /* blue-500 (Standard für eigene Nachrichten bleibt hell) */
    color: white;
}
.chat-message-other .chat-message-content {
    background-color: var(--chat-other-msg-bg);
    color: var(--chat-other-msg-text);
}
.chat-message-info {
    font-size: 0.75rem;
    color: var(--chat-info-text); /* Verwendet die angepasste Info-Textfarbe */
    margin-top: 0.25rem;
}

/* Links allgemein anpassen */
a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.3s ease;
}
a:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

/* Overwrite header for dark mode explicitly to match example */
.dark header {
    background-color: var(--header-bg); /* Nutzt die Header-BG Variable */
}

/* Formularfelder in Dark Mode spezifisch */
html.dark input:not([type="radio"]):not([type="checkbox"]),
html.dark select,
html.dark textarea {
    background-color: #2d3748; /* gray-800 */
    border-color: #4a5568; /* gray-600 */
    color: var(--text-color); /* Nutzt die globale Textfarbe */
}
html.dark input:focus,
html.dark select:focus,
html.dark textarea:focus {
    border-color: #60a5fa; /* blue-400 */
    box-shadow: 0 0 0 1px #60a5fa;
}

/* Für die Sidebar-Texte, die direkt Tailwind-Klassen nutzen */
html.dark .sidebar .text-gray-800 { color: var(--text-color); }
html.dark .sidebar .text-gray-700 { color: var(--text-color); }
html.dark .sidebar .text-gray-500 { color: var(--chat-info-text); } /* Nutzt die Infotextfarbe */
html.dark .sidebar .text-blue-500 { color: #93c5fd; } /* blue-300 für "Du" im Dark Mode */

/* Für die Modul-Karten, wo Tailwind-Klassen direkt Farben setzen */
html.dark .module-card .text-indigo-800 { color: #c7d2fe; } /* indigo-200 */
html.dark .module-card .text-purple-800 { color: #d8b4fe; } /* purple-200 */
html.dark .module-card .text-pink-800 { color: #fbcfe8; } /* pink-200 */
html.dark .module-card .text-blue-800 { color: #bfdbfe; } /* blue-200 */
html.dark .module-card .text-yellow-800 { color: #fde68a; } /* yellow-200 */
html.dark .module-card .text-green-800 { color: #bbf7d0; } /* green-200 */
html.dark .module-card .text-teal-800 { color: #99f6e4; } /* teal-200 */

/* Für die grauen Ränder der Tabellen etc. */
html.dark .divide-gray-200 { border-color: var(--card-border); }
html.dark .bg-gray-50 { background-color: #4a5568; /* gray-600 für table head */ }
html.dark .text-gray-500 { color: var(--chat-info-text); }
html.dark .bg-white { background-color: var(--card-bg); }
html.dark .min-w-full { background-color: var(--card-bg); }

/* Für Alerts */
html.dark .bg-red-100 { background-color: #b91c1c; color: white; } /* red-700 */
html.dark .text-red-800 { color: white; }
html.dark .bg-green-100 { background-color: #166534; color: white; } /* green-700 */
html.dark .text-green-800 { color: white; }
html.dark .bg-orange-100 { background-color: #9a3412; color: white; } /* orange-700 */
html.dark .text-orange-800 { color: white; }
