/* reset margin, padding and set box-sizing for all elements */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    height: 100%;
    font-family: 'Segoe UI', sans-serif;
    background-color: #2c2f33;
    color: #fff;
}

#chat_header {
    height: 60px;
    background-color: #2f3136;
    border-bottom: 1px solid #202225;
    padding: 16px;
    font-size: 18px;
}

#panel_username_input {
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    background-color: #eee;
    z-index: 1;
}


#panel_messages {
    height: calc(100% - 130px);
    /* account for height of header and footer */
    overflow-y: scroll;
    padding: 20px;
    background-color: #36393f;
}

#panel_messages::-webkit-scrollbar {
    width: 10px;
}

#panel_messages::-webkit-scrollbar-track {
    background: #2c2f33;
    /* Same as body background */
    border-radius: 10px;
}

#panel_messages::-webkit-scrollbar-thumb {
    background-color: #555;
    /* Scrollbar thumb color */
    border-radius: 10px;
    border: 2px solid #2c2f33;
    /* Padding around thumb */
}

#panel_messages::-webkit-scrollbar-thumb:hover {
    background-color: #888;
}

.message {
    background-color: #40444b;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.private-message {
    background-color: #2f3136;
    border-left: 4px solid #7289da;
    font-style: italic;
    opacity: 0.9;
}

.message-header {
    font-weight: bold;
    color: #7289da;
    font-size: 0.85em;
    margin-bottom: 4px;
}

.message-header .timestamp {
    font-weight: normal;
    color: #999;
    font-size: 0.8em;
    margin-left: 8px;
}

.username {
    font-weight: bold;
    color: #7289da;
}

.text {
    margin-top: 4px;
    margin-top: 4px;
    white-space: pre-line;
}

#panel_chat_input {
    height: 70px;
    background-color: #40444b;
    border-top: 1px solid #202225;
    padding: 12px;
}

#panel_chat_input input {
    width: calc(100% - 90px);
    padding: 10px;
    border: none;
    border-radius: 4px;
    background-color: #2f3136;
    color: #fff;
    float: left;
}

#panel_chat_input input:disabled {
    color: #999;
}

#panel_chat_input button {
    width: 70px;
    float: right;
    padding: 10px;
    background-color: #7289da;
    border: none;
    color: #fff;
    border-radius: 4px;
}

#panel_chat_input button:hover {
    background-color: #5b6eae;
}



#panel_login {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #2f3136;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-panel {
    background-color: #40444b;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.login-panel h2 {
    margin-bottom: 20px;
    color: #fff;
}

.login-panel p {
    margin-bottom: 20px;
    color: #fff;
}

.login-panel .error-message {
    background-color: #ff5555;
    color: #fff;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 10px;
    text-align: center;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

#login_form {
    display: block;
}

#panel_login_username_textbox {
    padding: 12px;
    width: 250px;
    font-size: 16px;
    border-radius: 6px;
    border: none;
    background-color: #2c2f33;
    color: #fff;
    margin-bottom: 15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

#panel_login_password_textbox {
    padding: 12px;
    width: 250px;
    font-size: 16px;
    border-radius: 6px;
    border: none;
    background-color: #2c2f33;
    color: #fff;
    margin-bottom: 15px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

#panel_login_submit_button {
    padding: 10px 20px;
    background-color: #7289da;
    border: none;
    color: #fff;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
}

#panel_login_submit_button:hover {
    background-color: #5b6eae;
}

.hidden {
    display: none;
}