/* Farben und Designvariablen*/
:root {
    --primary: #4a90e2;
    --primary-dark: #3b7ed0;
    --bg: #f4f6f8;
    --sidebar-bg: #2f3542;
    --sidebar-text: #dfe4ea;
    --sidebar-active: #57606f;
    --user-msg-bg: #4a90e2;
    --bot-msg-bg: #dcdde1;
    --input-bg: #fff;
}

/* Style für body */
body {
    margin: 0;
    font-family: "Segoe UI", sans-serif;
    height: 100vh;
    display: flex;
    background-color: var(--bg);
}

/* Hauptcontainer*/
.container {
    display: flex;
    width: 100%;
    height: 100%;
}

/*Sidebar mit Kontaktliste*/
.contacts {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Scrollbar wenn Kontakte zu lang */
}

/*Abstand zwischen Benuztzern*/
.contact {
    padding: 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.2s ease;
}

/*Hover Effekt Kontakte*/
.contact:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/*Aktiver Kontakt wird dick*/
.contact.active {
    background-color: var(--sidebar-active);
    font-weight: bold;
}

/*Haupt Chatbereich*/
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg);
}

/*Kopfzeile im Chatbereich mit Kontaktname*/
.chat-header {
    padding: 18px;
    background-color: #ffffff;
    border-bottom: 1px solid #ccc;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

/*Container für Chatnachrichten*/
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: #f9fbfc;
}

/*Eingabebereich Styling*/
.chat-input {
    display: flex;
    border-top: 1px solid #dce3ea;
    background-color: #ffffff;
    padding: 10px;
}

/*Eingabefeld Styling*/
.chat-input input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ccd6e0;
    border-radius: 20px;
    font-size: 14px;
    background-color: var(--input-bg);
    outline: none;
}

/*Button Styling*/
.chat-input button {
    margin-left: 10px;
    padding: 10px 18px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 14px;
}

button:hover {
    background: var(--primary-dark);
}

/*CSS Layout für Login*/
#loginOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    background-color: var(--bg); /* Optional: Hintergrundfarbe */
    gap: 10px;
}

#loginOverlay input {
    padding: 8px;
    width: 200px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#loginOverlay button {
    padding: 8px 12px;
    margin: 1px;
    border: none;
    background-color: #4a90e2;
    color: white;
    border-radius: 4px;
    cursor: pointer;
}

#loginOverlay button:hover {
    background-color: #3b7ed0;
}

#clearButton {
    display: none;
}

#logoutButton {
    padding: 6px 12px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#logoutButton:hover {
    background-color: #c0392b;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.current-user-display {
    font-weight: bold;
    margin-right: 15px;
    color: #444;
}


.message-container {
    position: relative;
}

.delete-button {
    margin-left: 10px;
    background: red;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 2px 6px;
    cursor: pointer;
    display: none;
    font-size: 12px;
}

.message-container:hover .delete-button {
    display: inline-block;
}

.chat-messages a {
    color: var(--primary);
    text-decoration: underline;
}

.chat-messages a:hover {
    text-decoration: none;
}
