/* --- Base Layout --- */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

#chat-container {
    width: 90%;
    max-width: 800px;
    height: 80vh;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* --- Message Area --- */
#messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.msg {
    padding: 8px 12px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
    background: #e4e6eb;
    color: #050505;
    align-self: flex-start;
}

/* --- Input Area --- */
#input-area {
    padding: 15px;
    border-top: 1px solid #ddd;
    display: flex;
    gap: 10px;
    background: #f9f9f9;
}

#msg-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 20px;
    outline: none;
}

#send-btn {
    padding: 10px 20px;
    background-color: #0084ff;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

#send-btn:hover {
    background-color: #0073e6;
}

/* --- Rank Styling (The Part You Wanted!) --- */

/* User Rank 0: Regular */
.rank-0 {
    border-left: 3px solid #ccc;
}

/* User Rank 5: Moderator */
.rank-5 {
    border-left: 3px solid #3498db;
    background-color: #ebf5fb;
}
.rank-5::before {
    content: "MOD";
    font-size: 9px;
    font-weight: bold;
    color: #3498db;
    display: block;
}

/* User Rank 10: Admin */
.rank-10 {
    border-left: 3px solid #e74c3c;
    background-color: #fdedec;
    font-weight: 500;
}
.rank-10::before {
    content: "ADMIN";
    font-size: 9px;
    font-weight: bold;
    color: #e74c3c;
    display: block;
}

/* User Rank 100: Owner/Root */
.rank-100 {
    background: linear-gradient(to right, #fef9e7, #ffffff);
    border: 1px solid #f1c40f;
    font-weight: bold;
}
.rank-100::before {
    content: "OWNER 👑";
    font-size: 10px;
    color: #f1c40f;
    display: block;
}

/* --- Country Flag Placeholder --- */
/* If you decide to use a flag sprite sheet or emoji */
.msg span.country {
    font-style: normal;
    margin-right: 5px;
    filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.1));
}

/* --- Login Page Specifics --- */
.login-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-align: center;
    width: 320px;
}

.login-container input {
    width: 100%;
    margin-bottom: 15px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
}

.login-container button {
    width: 100%;
    padding: 12px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
}