/* ==========================
   global.css – Basis & Reset
   ========================== */

/* Grundlegendes Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* macht Padding/Borders berechenbar */
}

html, body {
    height: 100%;
    font-family: Arial, sans-serif;
}

body {
    display: flex;
    flex-direction: column; /* Header + Main + Footer vertikal */
}

/* Typografie – Überschriften & Text */

/* H1 – H6 Überschrift */
h1 {
    font-size: 2rem;       /* ca. 32px */
    font-weight: bold;
    margin-bottom: 1rem;
    line-height: 1.3;
    color: #222;
}

h2 {
    font-size: 1.75rem;    /* ca. 28px */
    font-weight: bold;
    margin-bottom: 0.85rem;
    line-height: 1.3;
    color: #333;
}

h3 {
    font-size: 1.5rem;     /* ca. 24px */
    font-weight: bold;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    color: #444;
}

h4 {
    font-size: clamp(1.25rem, 1.2rem + 0.3vw, 1.35rem); /* 20–22px */
    font-weight: bold;
    margin-bottom: 0.65rem;
    line-height: 1.3;
    color: #555;
}

h5 {
    font-size: clamp(1.125rem, 1rem + 0.3vw, 1.25rem); /* 18–20px */
    font-weight: bold;
    margin-bottom: 0.5rem;
    line-height: 1.25;
    color: #666;
}

h6 {
    font-size: clamp(1rem, 0.9rem + 0.2vw, 1.125rem); /* 16–18px */
    font-weight: bold;
    margin-bottom: 0.4rem;
    line-height: 1.2;
    color: #777;
}

/* Absätze und Fließtext bleiben wie zuvor, aber responsive Schriftgröße */
p {
    font-size: clamp(1rem, 0.95rem + 0.2vw, 1.125rem); /* 16–18px */
    line-height: 1.6;
    margin-bottom: 1rem;
    color: #555;
}


/* Kleine Texte / Hinweise */
small, .small-text {
    font-size: clamp(0.875rem, 0.85rem + 0.1vw, 0.95rem); /* 14–15px */
    color: #777;
    line-height: 1.4;
}

/* Links im Text */
a {
    color: #3366cc;
    text-decoration: none;
}

a:hover, a:focus {
    text-decoration: underline;
}

/* Listen */
ul, ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Blockquotes */
blockquote {
    border-left: 4px solid #ccc;
    padding-left: 1rem;
    margin-left: 0;
    margin-right: 0;
    color: #666;
    font-style: italic;
}

/* Horizontale Linie */
hr {
    border: none;
    border-top: 1px solid #ccc;
    margin: 1.5rem 0;
}

/* Kleine Hilfs-Klasse für Abstand */
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 2rem !important; }


/* Optional: Responsive line-height */
h1, h2, h3, h4, h5, h6, p {
    line-height: clamp(1.2, 1.25 + 0.2vw, 1.6);
}

/* Header */

header {
    width: 100%;
    height: 60px;
    background-color: #333;
    color: #fff;
    position: fixed; /* immer oben */
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 1000; /* über Nav/Main */
}

/* Footer */

footer {
    width: 100%;
    height: 40px;
    background-color: #333;
    color: #fff;
    text-align: center;
    line-height: 40px;
    flex-shrink: 0; /* verhindert Schrumpfen in flex Layout */
    position: fixed; /* fixiert am unteren Rand */
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* Navigation (links) & Aside (rechts) */

nav, aside {
    width: 200px;
    background-color: #f2f2f2;
    position: fixed;
    top: 60px; /* unter Header */
    bottom: 40px; /* oberhalb Footer */
    overflow-y: auto; /* Scrollbar wenn Inhalt hoch */
    padding: 10px;
}

/* Navigation links */
nav {
    left: 0;
}

aside {
    right: 0;
}

/* Scrollbar Styling für Nav/Aside optional */

nav::-webkit-scrollbar,
aside::-webkit-scrollbar {
    width: 6px;
}

nav::-webkit-scrollbar-thumb,
aside::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.3);
    border-radius: 3px;
}

/* Nav Links */

nav ul {
    list-style: none;
}

nav ul li {
    margin-bottom: 10px;
}

nav ul li a {
    text-decoration: none;
    color: #333;
}

nav ul li a:hover {
    text-decoration: underline;
}

/* Main Content */

main {
    flex: 1 0 auto; /* nimmt den verfügbaren Platz ein */
    margin-left: 200px; /* Platz für Nav */
    margin-right: 200px; /* Platz für Aside */
    padding: 2em;
    padding-top: 60px; 
    min-height: calc(100vh - 100px); /* Header + Footer Höhe berücksichtigen */
    background-color: #fff;
}

    /* Chat-Bereich */
    
    main.chat {
        display: flex;
        flex-direction: column; /* Nachrichten unten nach oben wachsen */
        height: calc(100vh - 60px - 40px); /* Header + Footer abziehen */
        margin-left: 200px; /* Platz für Nav */
        margin-right: 200px; /* Platz für Aside */
        padding: 1rem;
        background-color: #f9f9f9;
        overflow-y: auto; /* Scrollbar bei vielen Nachrichten */
        box-sizing: border-box;
    }
    
    /* Einzelne Nachrichten */
    .chat-message {
        max-width: 70%;
        margin-bottom: 0.5rem;
        padding: 0.5rem 0.75rem;
        border-radius: 8px;
        line-height: 1.4;
        word-wrap: break-word;
    }
    
    /* Nachricht vom aktuellen Benutzer */
    .chat-message.self {
        background-color: #3366cc;
        color: #fff;
        align-self: flex-end;
    }
    
    /* Nachricht von anderen */
    .chat-message.other {
        background-color: #e0e0e0;
        color: #333;
        align-self: flex-start;
    }
    
    /* Zeitstempel */
    .chat-timestamp {
        font-size: 0.75rem;
        color: #777;
        margin-top: 0.2rem;
        text-align: right;
    }
    
    /* Eingabefeld unten */
    .chat-input {
        display: flex;
        gap: 0.5rem;
        margin-top: auto; /* immer unten */
        padding-top: 0.5rem;
        border-top: 1px solid #ccc;
    }
    
    .chat-input input {
        flex: 1;
        padding: 0.5rem;
        border: 1px solid #ccc;
        border-radius: 5px;
    }
    
    .chat-input button {
        padding: 0.5rem 1rem;
        background-color: #3366cc;
        color: #fff;
        border: none;
        border-radius: 5px;
        cursor: pointer;
    }
    
    .chat-input button:hover {
        background-color: #254a99;
    }
    
    /* Scrollbar Styling */
    main.chat::-webkit-scrollbar {
        width: 6px;
    }
    
    main.chat::-webkit-scrollbar-thumb {
        background-color: rgba(0,0,0,0.3);
        border-radius: 3px;
    }

/* Tabellen / Tagesübersichten */

table {
    border-collapse: collapse;
    width: 100%;
}

table th,
table td {
    border: 1px solid #ccc;
    padding: 0.5em;
    text-align: left;
}

tr.tr1 {
    background-color: #fff9c4; /* hellgelb */
}

tr.tr2 {
    background-color: #fff176; /* gelb */
}

tr.tr3 {
    background-color: #ffe0b2; /* hellorange */
}

tr.tr4 {
    background-color: #ffb74d; /* orange */
}

/* Formulare – Login / Input */

.login-form {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-width: 300px;
}

.login-form label {
    font-weight: bold;
}

.login-form input {
    padding: 0.4rem;
    font-size: 1rem;
}

.login-form button {
    padding: 0.5rem;
    background-color: #3366cc;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.login-form button:hover {
    background-color: #254a99;
}

/* Responsive Hinweis */

@media (max-width: 768px) {
    main {
        margin-left: 0;
        margin-right: 0;
    }
    nav, aside {
        display: none;
    }
}

