* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: Arial, sans-serif;
}

body {
    display: flex;
    flex-direction: column;
}

.toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #F26419;
    color: white;
    display: flex;
    align-items: center;
    padding: 0 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 1000;
    -webkit-user-select: none;    /* Safari */
    -moz-user-select: none;       /* Firefox */
    -ms-user-select: none;        /* IE10+/Edge */
    user-select: none;            /* Standard */
}

.toolbar-left-icon {
    cursor: pointer;
    margin-right: 24px;
}

.app-title {
    flex-grow: 1;
    font-size: 20px;
    height: 22px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.app-title a {
    color: inherit;
    text-decoration: none;
}

.toolbar-icons {
    display: flex;
    gap: 16px;
}

.toolbar-icon {
    cursor: pointer;
}

.sidebar {
    position: fixed;
    top: 60px;
    left: -250px;
    width: 250px;
    height: calc(100% - 60px);
    background-color: white;
    box-shadow: 2px 0 4px rgba(0,0,0,0.2);
    transition: left 0.3s ease;
    z-index: 900;
    padding:15px;
    -webkit-user-select: none;    /* Safari */
    -moz-user-select: none;       /* Firefox */
    -ms-user-select: none;        /* IE10+/Edge */
    user-select: none;            /* Standard */
}

.sidebar.open {
    left: 0;
}

.sidebar p {
    margin: 20px 0;
}

.sidebar a {
    text-decoration: none;
    color: #F26419;
    font-weight: bold;
    align-items: center;
    display: flex;
}

.sidebar a span {
    margin-right: 10px;
}

.main-content {
    flex-grow: 1;
    margin-top: 60px;
    margin-bottom: 60px;
    padding: 0px;
    overflow-y: auto;
}

.bottom-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    min-height: 60px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    padding: 0 16px;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
    -webkit-user-select: none;    /* Safari */
    -moz-user-select: none;       /* Firefox */
    -ms-user-select: none;        /* IE10+/Edge */
    user-select: none;            /* Standard */
}

.chat-input-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
    margin-right: 16px;
}

.chat-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    margin-right: 10px;
    outline: none;
    font-size: 120%;
    font-family: inherit;
}

.send-button {
    background-color: #F26419;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.send-button:hover {
    background-color: #F22A19;
}

.new-chat-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #F26419;
  color: white;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.new-chat-button:hover {
    background-color: #F22A19;
}

.chatlist-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 10px;
}

#chatlist-placeholder {
    max-width: 500px;
    margin: 200px auto 0;
    text-align: center;
    color: #999999;
}

.chatlist-item {
    height: 60px;
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    margin-bottom: 15px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    -webkit-user-select: none;    /* Safari */
    -moz-user-select: none;       /* Firefox */
    -ms-user-select: none;        /* IE10+/Edge */
    user-select: none;            /* Standard */
}

.chat-avatar {
    width: 60px;
    height: 100%;
    background-color: #eee;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    font-size: 24px;
}
.chat-info {
    padding: 10px;
    flex-grow: 1;
}

.chatlist-item-name {
    font-weight: bold;
}

.chatlist-item-mail {
    color: #777;
}

.chatlist-item-time {
    color: #F26419;
    float: right;
}

.chat-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 0;
}

.messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.message-tpl {
    display: none;
}

.message {
    margin: 8px 0;
    max-width: 70%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.message.sent {
    align-self: flex-end;
}

.message.received {
    align-self: flex-start;
}

.message-bubble {
    padding: 12px 16px;
    border-radius: 15px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.message.sent .message-bubble {
    background-color: #F8BE52;
    border-top-right-radius: 5px;
}

.message.received .message-bubble {
    background-color: #eee;
    border-top-left-radius: 5px;
}

.message-sender {
    font-size: 0.8em;
    color: #128c7e;
    margin-bottom: 4px;
    font-weight: 500;
}

.message-content {
    font-size: 0.95em;
    line-height: 1.4;
/*    white-space: pre-wrap;*/
    word-wrap: break-word;
}

.message-meta {
    font-size: 0.75em;
    color: #667781;
    margin-top: 4px;
    display: flex;
    align-items: center;
}

.message.sent .message-meta {
    justify-content: flex-end;
}

.message-time {
    margin-right: 4px;
}

.message-status {
    color: #9C9C9C;
    font-size:18px !important;
}

.message-status-ok {
    color: #F8BE52;
    font-weight: bold !important;
}

.message-images {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.image-container {
    width: 150px;
    height: 150px;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-container:hover img {
    transform: scale(1.05);
}

.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.modal-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.close-modal {
    position: absolute;
    top: -30px;
    right: 0;
    color: white;
    font-size: 28px;
    cursor: pointer;
}

@media (max-width: 600px) {
    .image-container {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 600px) {
    .message {
        max-width: 85%;
    }
}

.auth-container, .settings-container {
    max-width: 400px;
    margin: 30px auto;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #efefef;
}

.auth-container h2, .settings-container h2 {
    text-align: center;
    margin-bottom: 20px;
}

.auth-container hr, .settings-container hr {
    margin: 10px 0;
    border: 1px solid #ccc;
}

.auth-container form, .settings-container, form {
    margin-bottom: 20px;
}

.alert {
    padding: 10px;
    margin-bottom: 20px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
}

.form-group input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

button {
    padding: 10px;
    background-color: #F26419;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background-color: #054c44;
}

.swal-button--confirm {
    background-color: #F26419;
}
