:root {
    --darkgreen-color: #6BBF8A;
    --green-color-chat: #729641;
    --red-color: #bb2d3b;
    --black-color: black;
    --white-color: white;
    /*--ghost-white*/
    --lightgray-color: #EFF1F5;
    --gray-color: #7B7D81;
}
.chat-container {
    width: 100%;
    height: 100%;
    min-height: 400px;
    display: flex;
    flex-direction: column;
   /* background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;*/
    overflow: hidden;
    direction: rtl;
}


/* Header */

/*.chat-header {
    flex: 0 0 auto;
    min-height: 64px;
    padding: 10px 16px;
    border-bottom: 1px solid #eeeeee;
    display: flex;
    align-items: center;
    background: #ffffff;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eeeeee;
    font-size: 17px;
}

.chat-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-title {
    font-size: 15px;
    font-weight: 600;
}

.chat-status {
    font-size: 11px;
    color: #777777;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4caf50;
}*/


/*    Chat Header */

.ehr-chat-header {
    display: flex;
    align-items: center;
    height: 58px;
    min-height: 58px;
    padding: 0 16px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.ehr-chat-header-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    background: var(--lightgray-color); /*#eef5ff;*/
    color: var(--gray-color) /*#0d6efd;*/
}

.ehr-chat-header-info {
    margin-right: 10px;
}

.ehr-chat-header-name {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.ehr-chat-header-status {
    margin-top: 2px;
    font-size: 11px;
    color: #22a05a;
}

/* Messages */

.chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
}

.chat-message-row {
    width: 100%;
    display: flex;
    margin-bottom: 8px;
}

    .chat-message-row.mine {
        justify-content: flex-start;
    }

    .chat-message-row.other {
        justify-content: flex-end;
    }

.chat-message {
    max-width: min(75%, 500px);
    padding: 8px 11px 5px;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.chat-message-row.mine .chat-message {
    background: var(--green-color-chat); /*#e7f1ff;*/
    border-bottom-right-radius: 3px;
}

.chat-message-row.other .chat-message {
    background: #ffffff;
    border-bottom-left-radius: 3px;
}

.chat-message-text {
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
}


.chat-message-time {
    font-size: 10px;
    color: var(--black-color) ;/*#888888;*/
}

.chat-message-row.mine .chat-message-time {
    text-align: left;
    direction: ltr;
}
.chat-message-row.other .chat-message-time {
    text-align: right;
    direction: rtl;
}
/*   Messages */

.ehr-chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px;
}
.chat-messages-loading {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #888;
    font-size: 13px;
}

.chat-empty {
    height: 100%;
    width: 100%;
    text-align: center;
    align-content: center;
}

/* Image */

.chat-image {
    display: block;
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    object-fit: contain;
}


/* File */

.chat-file-message {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
}

.chat-file-icon {
    font-size: 25px;
}




/* Attachment Preview */

.chat-attachment-preview {
    flex: 0 0 auto;
    min-height: 46px;
    padding: 7px 12px;
    border-top: 1px solid #eeeeee;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}


.chat-remove-attachment {
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
}


/* Input */

.chat-input-container {
    flex: 0 0 auto;
    min-height: 60px;
    padding: 8px 10px;
    border-top: 1px solid #eeeeee;
    background: #ffffff;
    display: flex;
    align-items: flex-end;
    gap: 6px;
}

.chat-text-input {
    width: 100%;
    min-height: 40px;
    max-height: 120px;
    resize: none;
    border: 1px solid #dddddd;
    border-radius: 10px;
    padding: 9px 12px;
    outline: none;
    font-family: inherit;
    font-size: 13px;
    direction: rtl;
}

.chat-attachment-button,
.chat-audio-button,
.chat-send-button {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 17px;
}
.Send-Icon {
    color: var(--green-color-chat);
    transform: rotate(-135deg);
}
.chat-attachment-button {
    position: relative;
}

    .chat-attachment-button > i,
    .chat-audio-button > i,
    .chat-send-button > i {
        line-height:0;
    }

.chat-send-button:disabled {
    opacity: 0.35;
    cursor: no-drop;
}

/* Mobile */

@media (max-width: 576px) {

    .chat-container {
        border: 0;
        border-radius: 0;
        min-height: 100%;
    }

    .chat-message {
        max-width: 85%;
    }

    .chat-messages {
        padding: 10px;
    }

    /*    Chat Header */

    .ehr-chat-header {
        display: flex;
        align-items: center;
        height: 58px;
        min-height: 58px;
        padding: 0 16px;
        background: #fff;
        border-bottom: 1px solid #e5e7eb;
    }

    .ehr-chat-header-avatar {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        min-width: 38px;
        border-radius: 50%;
        background: var(--green-color-chat);/*#eef5ff;*/
        color: var(--white-color); /*#0d6efd;*/
    }

    .ehr-chat-header-info {
        margin-right: 10px;
    }

    .ehr-chat-header-name {
        font-size: 14px;
        font-weight: 600;
        color: #374151;
    }

    .ehr-chat-header-status {
        margin-top: 2px;
        font-size: 11px;
        color: #22a05a;
    }
    .chat-input-container {
        padding: 7px;
    }

    .chat-audio-button,
    .chat-attachment-button,
    .chat-send-button {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .chat-audio-message audio {
        max-width: 220px;
    }
}

.chat-audio-button.recording {
    color: #dc3545;
    animation: chat-recording-pulse 1s infinite;
}

/* =========================================================
   Recording Panel
   ========================================================= */

.chat-recording-panel {
    flex: 1 1 auto;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    direction: ltr;
    padding: 0 4px;
}


.chat-recording-info {
    display: flex;
    align-items: center;
    gap: 7px;
}


.chat-recording-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: #dc3545;
    animation: chat-recording-pulse 1s infinite;
}


.chat-recording-time {
    direction: ltr;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    font-variant-numeric: tabular-nums;
}


/* فقط مربع قرمز */

.chat-recording-stop {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
}


    .chat-recording-stop span {
        display: block;
        width: 14px;
        height: 14px;
        border-radius: 2px;
        background: #dc3545;
    }


    .chat-recording-stop:hover span {
        background: #bb2d3b;
    }


    .chat-recording-stop:active span {
        transform: scale(.9);
    }


@keyframes chat-recording-pulse {

    50% {
        opacity: .4;
    }
}


/* =========================================================
   Recorded Audio Preview
   ========================================================= */

.chat-recording-preview {
    flex: 1 1 auto;
    min-width: 0;
    height: 40px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    direction: ltr;
}

/* فقط مثلث */
.chat-preview-play-button {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.chat-preview-play-icon {
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 10px solid var(--green-color-chat);
    margin-left: 2px;
}

/* Waveform کوچک */
.chat-preview-waveform {
    flex: 1 1 auto;
    min-width: 0;
    height: 26px;
    display: flex;
    align-items: center;
    gap: 1.5px;
    overflow: hidden;
}

.chat-preview-bar {
    flex: 1 1 0;
    min-width: 1px;
    max-width: 3px;
    border-radius: 2px;
    background: lightgray;
}

/* زمان کنار waveform */
.chat-preview-duration {
    flex: 0 0 auto;
    direction: ltr;
    font-size: 11px;
    line-height: 1;
    color: #777;
    white-space: nowrap;
}

/* سطل زباله */
.chat-remove-recording {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    color: #888;
    cursor: pointer;
}

    .chat-remove-recording i {
        font-size: 15px;
        line-height:0;
    }

    .chat-remove-recording:hover {
        color: #dc3545;
    }
/* ******************************
            audio design
    ***************************** */
.chat-audio-message {
    direction: ltr;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 280px;
    min-height: 64px;
    padding: 9px 11px;
    background: var(--white-color);
    border-radius: 16px;
    box-sizing: border-box;
}


/* =========================================================
   Play Button
   ========================================================= */

.chat-audio-play-button {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: var(--green-color-chat);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

    .chat-audio-play-button:hover {
        background: var(--darkgreen-color);
    }

    .chat-audio-play-button:active {
        transform: scale(.95);
    }


/* =========================================================
   Play Icon
   ========================================================= */

.chat-audio-play-icon {
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 12px solid white;
    margin-left: 3px;
}


/* =========================================================
   Stop Icon
   ========================================================= */

.chat-audio-stop-icon {
    width: 13px;
    height: 13px;
    background: white;
    border-radius: 2px;
}


/* =========================================================
   Content
   ========================================================= */

.chat-audio-content {
    flex: 1;
    min-width: 0;
}
/* =========================================================
   Waveform
   ========================================================= */

.chat-audio-waveform {
    height: 34px;
    display: flex;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    user-select: none;
}
.chat-audio-bar {
    flex: 1;
    min-width: 2px;
    max-width: 4px;
    border-radius: 3px;
    background:lightgray;
    transition: background-color .08s linear;
}

    .chat-audio-bar.played {
        background: var(--green-color-chat);
    }


/* =========================================================
   Footer
   ========================================================= */

.chat-audio-footer {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: 1px;
    font-size: 10px;
    line-height: 12px;
    color: #888;
}

.chat-audio-duration {
    direction: ltr;
}

.chat-audio-sent-time {
    display: none;
}

/* =========================================================
   RTL Chat
   ========================================================= */

.chat-message-row.other .chat-audio-message,
.chat-message-row.mine .chat-audio-message {
    direction: ltr;
}

/* ************** The End of audio design ****************** */