﻿:root {
  --body-bg: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  --msger-bg: #fff;
  --border: 2px solid #ddd;
  --left-msg-bg: #ececec;
  --right-msg-bg: #579ffb;
}

html {
  box-sizing: border-box;
}

*,
*:before,
*:after {
  margin: 0;
  padding: 0;
  box-sizing: inherit;
}

.chatbody {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 90vh;
  font-family: Helvetica, sans-serif;
}

.msger {
  display: flex;
  flex-flow: column wrap;
  justify-content: space-between;
  width: 100%;
  max-width: 867px;
  height: 100%;
}

.msger-header {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  border-bottom: var(--border);
  background: #eee;
  color: #666;
}

.msger-chat {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}
.msger-chat::-webkit-scrollbar {
  width: 6px;
}
.msger-chat::-webkit-scrollbar-track {
    background: transparent;
}
.msger-chat::-webkit-scrollbar-thumb {
  background: #bdbdbd;
}
.msg {
  display: flex;
  align-items: flex-end;
  margin-bottom: 10px;
}
.msg:last-of-type {
  margin: 0;
}
.msg-img {
  width: 25px;
  height: 25px;
  margin-right: 10px;
  background: #ddd;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  border-radius: 50%;
}
.msg-bubble {
    padding: 15px;
    border-radius: 15px;
    font-size: 0.95rem;
    color: #F8F8FF;
    /*  background: var(--left-msg-bg);*/
}
.msg-info {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 10px;
  display: none;
}
.msg-info-name {
  margin-right: 10px;
  font-weight: bold;
}

.left-msg .msg-bubble {
  border-bottom-left-radius: 0;
}

.right-msg {
    flex-direction: column;
    max-width: 60%;
    margin-left: auto;
}

.right-msg .msg-bubble {
    background: #565656;
}

.right-msg .msg-img {
  margin: 0 0 0 10px;
}

.msger-inputarea {
  display: flex;
/*  border-top: var(--border);*/
/*  background: #eee;*/
}
.msger-inputarea * {
  padding: 10px;
  border: none;
  border-radius: 3px;
  font-size: 1em;
}
.msger-input {
    flex: 1;
    background: #57595a;
    color: #F8F8FF;
    border-radius: 20px;
}
.msger-input::-webkit-scrollbar {
    width: 6px;
}

.msger-input::-webkit-scrollbar-track {
    background: transparent;
}

.msger-input::-webkit-scrollbar-thumb {
    background: #bdbdbd;
}
.msger-send-btn {
  margin-left: 10px;
  background: rgb(0, 196, 65);
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.23s;
}
.msger-send-btn:hover {
  background: rgb(0, 180, 50);
}

.msger-chat {
    background-color: #454748;
}

.msg-text {
    margin-left: 0px;
}

.msg-text p {
    margin: 0;
}

textarea::placeholder {
    color: #F8F8F8;
}

table {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 350px;
    margin-bottom: 10px;
}

table tr th,
table tr td {
    border-right: 1px solid #bbb;
    border-bottom: 1px solid #bbb;
    padding: 5px;
}

    table tr th:first-child,
    table tr td:first-child {
        border-left: 1px solid #bbb;
    }

table tr th {
    background: #808080;
    border-top: 1px solid #bbb;
    text-align: left;
}

/* top-left border-radius */
table tr:first-child th:first-child {
    border-top-left-radius: 6px;
}

/* top-right border-radius */
table tr:first-child th:last-child {
    border-top-right-radius: 6px;
}

/* bottom-left border-radius */
table tr:last-child td:first-child {
    border-bottom-left-radius: 6px;
}

/* bottom-right border-radius */
table tr:last-child td:last-child {
    border-bottom-right-radius: 6px;
}

code.hljs {
    position: relative;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
    padding: 10px;
    display: block;
    overflow-x: auto;

    .label{
    position: absolute;
    color: lightgray;
    right: 4px;
    top: 4px;
    font-size: 0.9rem;
    }
}

pre {
    white-space: pre-wrap; /* Since CSS 2.1 */
    white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
    white-space: -pre-wrap; /* Opera 4-6 */
    white-space: -o-pre-wrap; /* Opera 7 */
    word-wrap: break-word; /* Internet Explorer 5.5+ */
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.modal {
    z-index: 1055 !important;
}

.modal-backdrop {
    z-index: 1050 !important;
}

/* 調整 modal 視窗顏色 */
.modal-content {
    background-color: #333 !important;
    color: white;
}

.modal-header {
    background-color: #444 !important;
    color: white;
}

.modal-footer {
    background-color: #444 !important;
    color: white;
}

/* 改變背景遮罩的顏色 */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5) !important;
}

.project-item {
    position: relative;
    padding: 10px 10px;
    display: flex;
    align-items: center;
    background-color: #343a40; /* Bootstrap bg-dark */
    color: white;
}

.project-name {
    display: flex;
    align-items: center;
    flex-grow: 1;
    cursor: pointer;
}

.msg-actions {
    visibility: hidden; 
    margin-top: 10px; /* Space between msg-text and msg-actions */
    gap: 10px;
    justify-content: center; 
    position: relative;
    left: 0;
    right: 0;
    z-index: 10; 
    opacity: 0;
    transition: opacity 0.3s ease;
}

.right-msg:hover .msg-actions {
    visibility: visible;
    opacity: 1;
}

.edit-btn, .save-btn, .cancel-btn {
    font-size: 28px;
    cursor: pointer;
    color: #F8F8FF;
}

.save-btn, .cancel-btn {
    visibility: hidden;
    opacity: 0;
}

.editing .save-btn, .editing .cancel-btn {
    visibility: visible;
    opacity: 1;
}