* {
    font-family: Vazirm;
}

html.light {
    --primary-text-color: #000000;
    --secondary-text-color: #707579;
    --message-highlightning-color: hsla(85, 44.648999999999994%, 25.855999999999998%, .4);
    --message-background-color: #ffffff;
    --imessage-background-color: #E6FECB;
}

html.light::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: url(img/chat-bg-br.png);
    background-size: 100% 100%;
    background-color: inherit;
    background-attachment: fixed;
    z-index: -5;
}

html.light::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: url(img/chat-bg-pattern-light.png);
    background-position: 100% 0;
    background-size: 100%;
    background-repeat: repeat;
    z-index: -1;
    background-attachment: fixed;
    /*mix-blend-mode: overlay;*/
}

body {
    margin: 0;
}

header {
    padding: 15px;
    position: sticky;
    top: 0px;
}

footer {
    position: sticky;
    bottom: 0;
    padding-top: 10px;
    padding-bottom: 30px;
}

.flex {
    display: flex;
}
.vertical {
    flex-direction: column;
}

.fill {
    width: 100%;
}

date {
    display: flex;
    color: #ffffff;
    align-items: center;
    justify-content: center;
}

date > div {
    border-radius: 999px;
    padding: 2px 10px 2px 10px;
    background-color: var(--message-highlightning-color);
    font-size: 14px;
}

.topButton {
    width: calc(128px / 3);
    height: calc(128px / 3);
    border-radius: 999px;
}

.chatTitle {
    height: calc(128px / 3);
    border-radius: 999px;
    display: flex;
    flex-direction: column;
    gap: 0px;
    padding: 0 15px 0 15px;
}

.chatTitle > span.title {
    font-weight: 500;
    padding: 0px;
    margin-bottom: -5px;
    padding-top: 2px;
    text-align: center;
}

.chatTitle > span.status {
    font-size: 13px;
    text-align: center;
    padding: 0px;
    color: var(--secondary-text-color);

}


.glass {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(15px) saturate(150%);
  -webkit-backdrop-filter: blur(15px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
}

/* Animated liquid ripple */
.glass::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.4), transparent 70%);
  animation: moveLiquid 6s linear infinite;
  opacity: 0.5;
}

@keyframes moveLiquid {
  0% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(10%, 10%);
  }
  100% {
    transform: translate(0, 0);
  }
}

message {
    align-items: flex-end;
    gap: 5px;
}

message > div.avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

message > div.ballon {
    background-color: var(--message-background-color);
    padding: 10px;
    line-height: 20px;
    border-radius: 10px 20px 20px 0;;
    max-width: 70%;
    display: flex;
    flex-direction: column;
}

message > div.ballon > h5.userName {
    font-weight: 500;
    font-size: 16px;
    margin: 0px;
    margin-bottom: 3px;
}
message > div.ballon > pre {
    margin: 0px;
    unicode-bidi: plaintext;
    word-break: break-word;
    white-space: pre-line;
}
message > div.ballon > span.time {
    margin: 0px;
    text-align: right;
    font-size: 13px;
    color: var(--secondary-text-color);
    margin-top: 5px;
    margin-bottom: -5px;
}

message > div.ballon > div.replyBox {
    display: flex;
    flex-direction: column;
    border-left: 5px solid #8146D0;
    background-color: rgba(129, 70, 208,0.1);
    border-radius: 5px;
    padding: 5px;
    margin-bottom: 10px;
}

message > div.ballon > div.replyBox > h5.userNameReply  {
    font-weight: 500;
    font-size: 16px;
    margin: 0px;
}

message > div.ballon > div.replyBox > span  {
    display: inline-block; /* or block, depending on layout needs */
    max-width: 100%; /* or a specific width */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

msgbox {
    display: flex;
    gap: 8px;
    flex-direction: column;
    padding-left: 10px;
    padding-right: 10px;
}

imessage {
    align-items: flex-end;
    justify-content: flex-end;
    gap: 5px;
}


imessage > div.ballon {
    background-color: var(--imessage-background-color);
    padding: 10px;
    line-height: 20px;
    border-radius: 20px 20px 10px 20px;
    max-width: 70%;
    display: flex;
    flex-direction: column;
}

imessage > div.ballon > pre {
    margin: 0px;
    unicode-bidi: plaintext;
    word-break: break-word;
    white-space: pre-line;
}
imessage > div.ballon > span.time {
    margin: 0px;
    text-align: right;
    font-size: 13px;
    color: var(--secondary-text-color);
    margin-top: 5px;
    margin-bottom: -5px;
}

imessage > div.ballon > div.replyBox {
    display: flex;
    flex-direction: column;
    border-left: 5px solid #49A32E;
    background-color: rgba(73, 163, 46, 0.1);
    border-radius: 5px;
    padding: 5px;
    margin-bottom: 10px;
}

imessage > div.ballon > div.replyBox > h5.userNameReply  {
    font-weight: 500;
    font-size: 16px;
    margin: 0px;
}

imessage > div.ballon > div.replyBox > span  {
    display: inline-block; /* or block, depending on layout needs */
    max-width: 100%; /* or a specific width */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.bottomButton {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: flex;
    justify-content: center;
    align-items: center;
}

svg.strokeIt > path {
    stroke: var(--primary-text-color);
}

svg.fillIt > path {
    fill: var(--primary-text-color);
}

.inputBox {
    width: calc(100vw - 150px);
    min-height: 40px;
    max-height: 400px;
    border-radius: 20px;
    display: flex;
    justify-content: flex-start;
    padding-right: 2px;
    padding-left: 5px;
    align-items: flex-end;
    gap: 5px;
}

.glassNoBefore {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(15px) saturate(150%);
  -webkit-backdrop-filter: blur(15px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
  /*overflow: hidden;*/
}

textarea.reset-styles {
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    background: transparent;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    /* color: inherit; */
    /* font-family: inherit; */
    font-size: 16px;
    line-height: 20px;
     /* --- Setting MINIMUM height --- */
  /* Let's define it based on a few lines for clarity */
    min-height: calc(20px * 1); /* 4 lines + padding/border */
    max-height: calc(20px * 12 + 20px); /* 10 lines + padding/border */
    
    resize: none; 
    overflow-y: auto; /* Use auto so scrollbar appears ONLY when needed */
    padding-top: 10px;
    padding-bottom: 10px;

    display: block; /* Important for width: 100% to work as expected */
    width: 100%;
    box-sizing: border-box; /* Already included, but good to remember */
    border-radius: 10px;
    unicode-bidi: plaintext;
    word-break: break-word;
}

textarea::placeholder {
  color: var(--secondary-text-color);
}


div#sendButton {
    background-color: blue;
    /* padding-top: 5px; */
    /* padding-bottom: 5px; */
    width: 60px;
    height: 36px;
    display: flex
;
    justify-content: center;
    align-items: center;
    border-radius: 32px;
    margin-bottom: 2px;
}

message > date {
    visibility: hidden;
    opacity: 0;
}

message:hover > date {
  visibility: visible; /* Make it visible when parent is hovered */
  opacity: 1; /* Make it fully visible if using opacity transitions */
}




message[sender="1"] + message[sender="1"], message[sender="2"] + message[sender="2"], message[sender="3"] + message[sender="3"], message[sender="4"] + message[sender="4"], message[sender="5"] + message[sender="5"], message[sender="6"] + message[sender="6"], message[sender="7"] + message[sender="7"], message[sender="8"] + message[sender="8"], message[sender="9"] + message[sender="9"], imessage + imessage {
    margin-top: -5px;
}


message[sender="1"] + message[sender="1"] .ballon .userName, message[sender="2"] + message[sender="2"] .ballon .userName, message[sender="3"] + message[sender="3"] .ballon .userName, message[sender="4"] + message[sender="4"] .ballon .userName, message[sender="5"] + message[sender="5"] .ballon .userName, message[sender="6"] + message[sender="6"] .ballon .userName, message[sender="7"] + message[sender="7"] .ballon .userName, message[sender="8"] + message[sender="8"] .ballon .userName, message[sender="9"] + message[sender="9"] .ballon .userName {
    display: none;
}

/*
message .NzAHok{
    visibility: hidden;
}


date.element-top-hidden {
    opacity: 0.5;
}

date {
    position: sticky;
    top: 70px;
}
*/



