/* Grundlegendes Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Globales Styling */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh; /* Gesamte Höhe des Viewports */
    display: flex;
    flex-direction: column;
    background-color: #f4f4f9;
    color: #333;
}

/* Chat-Container */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(var(--vh, 1vh) * 100);
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Header */
.chat-header {
    background: #4caf50;
    color: white;
    padding: 15px;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    flex-shrink: 0; /* Feste Höhe */
}

/* Hauptbereich */
.chat-main {
    flex: 1; /* Nimmt den gesamten verfügbaren Platz ein */
    
    padding: 15px;
    background: #f9f9f9;
}

/* Nachrichten-Container */
.chat-messages {
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Nachrichten oben beginnen */
    height: calc(100vh - 150px); /* Dynamische Höhe: Header & Footer abziehen */
    overflow-y: auto; /* Scrollbar aktivieren */
    padding: 10px;
    gap: 10px; /* Abstand zwischen Nachrichten */
    scroll-behavior: smooth; /* Sanftes Scrollen */
    
    
}

.chat-message-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ddd;
    border: 1px solid #ccc;
}

.chat-message {
    background: #f1f1f1;
    border-radius: 8px;
    padding: 10px;
    max-width: 70%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
}

.chat-message strong {
    display: block;
    font-weight: bold;
    color: #4caf50;
}

.chat-time {
    font-size: 0.8em;
    color: #888;
    margin-top: 5px;
    text-align: left; /* Linksbündig */
    display: block; /* Sorgt dafür, dass es unter dem Text bleibt */
}

/* Footer */
.chat-footer {
    background: #f4f4f4;
    padding: 10px;
    flex-shrink: 0; /* Feste Höhe */
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1; /* Eingabefeld nimmt den restlichen Platz ein */
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
}

.chat-button {
    padding: 10px 15px;
    background-color: #4caf50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
}

.chat-button:hover {
    background-color: #45a049;
}

/* Login-Seite */
.login-container {
    width: 90%;
    max-width: 400px;
    margin: auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-header h1 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #4caf50;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: left;
}

.login-form label {
    font-size: 14px;
    color: #555;
}

.login-input {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.login-input:focus {
    border-color: #4caf50;
    outline: none;
}

.login-button {
    padding: 10px;
    font-size: 16px;
    color: white;
    background: #4caf50;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.login-button:hover {
    background: #45a049;
}

/* Registrierungslink */
.register-link {
    margin-top: 15px;
    font-size: 14px;
}

.register-link a {
    color: #4caf50;
    text-decoration: none;
}

.register-link a:hover {
    text-decoration: underline;
}

/* Datumstrenner */
.date-separator {
    text-align: center;
    margin: 15px 0;
    padding: 8px 0;
    background-color: #e0e0e0;
    color: #555;
    font-weight: bold;
    border-radius: 20px;
    font-size: 14px;
    width: 60%;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.new-message {
    background-color: #d1ffd1;
    transition: background-color 2s ease;
}
