/* =========================================
   MODERN CHAT UI - GRP 7 EDITION
   ========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-image: url('/dark-background.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hidden { display: none !important; }

/* =========================================
   LOGIN SEITE (GLASSMORPHISM)
   ========================================= */
.username-page-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    width: 380px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.headline-box {
    background: white;
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    margin: 10px 0 20px;
    border: 2px solid #eee;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.3s;
}

.form-control:focus { border-color: #b600ff; }

.custom-button {
    width: 100%;
    background: #b600ff;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, background 0.3s;
}

.custom-button:hover {
    background: #7c00ff;
    transform: translateY(-2px);
}

/* =========================================
   CHAT CONTAINER
   ========================================= */
.chat-container {
    width: 95%;
    max-width: 1100px;
    height: 85vh;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    border-radius: 25px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.chat-header {
    padding: 20px;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.leave-button {
    background: #ff4743;
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 10px;
    cursor: pointer;
}

/* =========================================
   MESSAGE AREA (BUBBLES)
   ========================================= */
#messageArea {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#messageArea li {
    list-style: none;
    padding: 12px 18px;
    border-radius: 20px;
    max-width: 70%;
    font-size: 15px;
    position: relative;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

/* Deine Blasen (Rechts) */
#messageArea li.me {
    align-self: flex-end;
    background: linear-gradient(135deg, #b600ff, #7c00ff);
    color: white;
    border-bottom-right-radius: 2px;
}

/* Andere Blasen (Links) */
#messageArea li.others {
    align-self: flex-start;
    background: white;
    color: #333;
    border-bottom-left-radius: 2px;
}

/* Bot Blasen (Links - Spezialfarbe) */
#messageArea li.bot {
    align-self: flex-start;
    background: #f0f4ff;
    border: 1px solid #d0d7de;
    color: #1a1a1a;
    border-bottom-left-radius: 2px;
}

.message-info {
    display: block;
    font-size: 10px;
    margin-bottom: 5px;
    font-weight: bold;
    opacity: 0.7;
}

/* =========================================
   INPUT AREA (UNTEN)
   ========================================= */
#messageForm {
    padding: 20px;
    background: white;
    border-top: 1px solid #eee;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

#message {
    flex: 1;
    height: 50px;
    border-radius: 25px;
    border: 2px solid #f0f0f0;
    padding: 0 20px;
    outline: none;
    transition: border-color 0.3s;
}

#message:focus { border-color: #b600ff; }

/* Toggle & Button Group */
.input-group-btn {
    display: flex;
    align-items: center;
    gap: 15px;
}

.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f8f8;
    padding: 8px 15px;
    border-radius: 20px;
}

/* Switch Styling */
.switch {
    position: relative;
    width: 40px;
    height: 22px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px; width: 16px;
    left: 3px; bottom: 3px;
    background: white;
    transition: 0.4s;
    border-radius: 50%;
}
input:checked + .slider { background: #b600ff; }
input:checked + .slider:before { transform: translateX(18px); }

.primary {
    background: #b600ff;
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(182, 0, 255, 0.3);
}
/* --- ANIMATION FÜR NEUE NACHRICHTEN --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#messageArea li {
    animation: fadeInUp 0.3s ease-out forwards;
}

/* Spezial-Style für die "Verbindet sich" Anzeige */
.connecting {
    text-align: center;
    color: #777;
    font-size: 0.9rem;
    margin: 10px 0;
}