@font-face {
    font-family: "Plus Jakarta Sans";
    src: url("../fonts/Plus_Jakarta_Sans/PlusJakartaSans-Medium.ttf")
        format("truetype");
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: "Figtree";
    src: url("../fonts/Figtree/Figtree-SemiBold.ttf") format("truetype");
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: "Satoshi";
    src: url("../fonts/satoshi/Satoshi-Regular.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: "Satoshi";
    src: url("../fonts/satoshi/Satoshi-Medium.otf") format("opentype");
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: "Satoshi";
    src: url("../fonts/satoshi/Satoshi-Bold.otf") format("opentype");
    font-weight: 700;
    font-style: normal;
}

/* New Messages UI Styles - replicate screenshot closely */

/* Layout */
.messages-view {
    background: #f5f6f8;
}

.messages-layout {
    display: grid;
    grid-template-columns: 352px 1fr; /* left inbox width to match item fill (352px) */
    gap: 24px;
    width: 100%;
    align-items: start; /* keep cards shorter with grey background beneath */
}

/* Left Sidebar (Inbox) */
.conversations-management-section {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    margin-bottom: 10px;
}

.conversations-management-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.conversations-management-section-header .label {
    font-weight: 700;
    font-family: "Satoshi", sans-serif;
    font-size: 18px;
    line-height: 24px;
    letter-spacing: 0%;
    color: #344054;
}

.conversations-management-main .tab-container {
    margin-bottom: 16px;
}

.conversations-list-section {
    /* flex: none; prevent sidebar stretching; show grey background below */
    height: 1000px; /* show ~8 chats, then scroll */
    overflow-y: auto;
    padding-right: 6px; /* room for scrollbar */
}
.conversations-list-main {
    margin: 0;
    padding: 0;
}
.conversations-list-item {
    display: flex;
    gap: 12px; /* Gap 12px */
    align-items: center; /* vertical alignment middle */
    background: #ffffff;
    padding: 12px 16px; /* Top 12, Right 16, Bottom 12, Left 16 */
    margin-bottom: 0;
    min-height: 98px; /* Hug (98px) */
    cursor: pointer;
    border-left: 4px solid transparent; /* space reserved for active state */
    border-bottom: 1px solid #1c15631a; /* separator under each chat */
    width: 100%;
    box-sizing: border-box; /* ensure padding fits within Fill (352px) */
}
.conversations-list-item:hover {
    border-color: #e5e7eb;
}
.conversations-list-item.active {
    border-left: 7px solid #69bb55; /* green accent */
    background: #ffffff; /* remove light green background on selected */
    border-bottom-color: #69bb55; /* green line under selected chat */
}
.conversation-avatar {
    height: 40px;
    margin-top: 10px;
    width: 40px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.conversation-content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.conversation-phone {
    font-family: "Satoshi", sans-serif;
    font-weight: 700; /* Bold */
    font-size: 14px;
    line-height: 14px; /* 100% */
    letter-spacing: 0;
    color: #2f353a;
    width: 202px;
    line-height: 100%;
    /* height: 13px;  commented to avoid clipping; can enable if required */
    display: inline-flex;
    align-items: center;
}
.conversation-timestamp {
    color: #6b7280;
    font-size: 12px;
    display: block;
}
.conversation-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}
.conversation-message {
    color: #4b5563;
    font-family: "Satoshi", sans-serif;
    font-weight: 400; /* Regular */
    font-size: 12px;
    line-height: 12px; /* 100% */
    letter-spacing: 0;
    width: 202px;
    height: 25px;
    overflow: hidden;
}
.conversation-counter.badge {
    background: #10b981;
    color: #fff;
    border-radius: 999px;
    font-size: 12px;
    padding: 5px 8px;
}

/* Right Conversation Area */
.selected-conversation-section-content {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
}
/* New wrapper to separate scroll area and composer */
.selected-conversation-body {
    display: flex;
    height:  calc(100vh - 435px);
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}
.selected-conversation-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    background-color: white;
}
.selected-conversation-avatar {
    height: 40px;
    width: 40px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
}
.selected-conversation-details {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.contact-number {
    font-weight: 700;
    font-size: 16px;
    line-height: 100%;
    letter-spacing: 0%;
    font-family: "Satoshi", sans-serif;
    color: #000000b8;
}
.contact-status {
    margin-top: 6px;
    color: #00000070;
    font-size: 14px;
    font-family: "Satoshi", sans-serif;
    font: 400;
    letter-spacing: 0%;
    line-height: 100%;
}
.options-btn {
    border: none;
    background: transparent;
    color: #6b7280;
}

.selected-conversation-main {
    flex: 1;
    background: #f4f4f7;
    overflow: hidden; /* contain inner list scroll only */
}

/* Chat messages */
.conversation-chat-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.chat-message {
    margin: 40px 0;
    max-width: 70%;
    display: grid;
    gap: 8px;
    width: max-content;
}
.chat-message.receive {
    justify-items: start;
}
.chat-message.sent {
    justify-items: end;
    margin-left: auto;
}

/* Add a bit of space between right-aligned messages and the scrollbar */
.chat-message.sent {
    padding-right: 20px;
}

.message-icon {
    display: flex;
}
.icon-left {
    justify-content: flex-start;
}
.icon-right {
    justify-content: flex-end;
}

.message-avatar {
    height: 28px;
    width: 28px;
    border-radius: 100%;
    background: #4ecdc4;
    color: #fff;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.user-avatar {
    background: #22c55e;
}

.message-wrapper {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 1px 1px rgba(16, 24, 40, 0.04);
    max-width: 1000px;
}
.chat-message.sent .message-wrapper {
    background: #eaf9e9;
    border-color: #d7f1d5;
}

.message-text {
    color: #111827;
    font-family: "Satoshi", sans-serif;
    font-weight: 500;
    font-style: normal;
    font-size: 16px;
    line-height: 24px;
}
.message-timelapse {
    color: #202021;
    font-size: 13px;
    display: block;
    justify-self: start;
    text-align: left;
    width: 100%;
}
.chat-message.sent .message-timelapse {
    justify-self: start;
    text-align: left;
}
.chat-message.receive .message-timelapse {
    justify-self: start;
    text-align: left;
}

/* Composer */
.composer-message {
    background: #f5f6f8;
    padding: 20px 0 0;
    position: sticky;
    bottom: 0px;
}

.chat-input-wrapper {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    position: relative;
    width: calc(100% - 140px);
    margin-right: 120px;
}
.input-container {
    display: grid;
    grid-template-columns: 52px 1fr 52px;
    gap: 10px;
    align-items: center;
}
.attachment-btn,
.ai-btn {
    height: 52px;
    width: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Separators: dark grey lines */
.attachment-btn {
    border-right: 1px solid #4b5563;
}
.ai-btn {
    border-left: 1px solid #4b5563;
    justify-self: end;
}

.message-input {
    border: none;
    resize: none;
    min-height: 44px;
    max-height: 160px;
    padding: 10px 12px;
    outline: none;
    font-size: 15px;
    background: transparent;
    color: #111827;
    font-family: 'Satoshi', sans-serif;
    font-weight: 500;
    font-style: normal;
    font-size: 16px;
    line-height: 24px;
}
.message-input {
    min-height: 52px;
    padding-top: 25px;
}
.message-input::placeholder {
    color: #6b7280;
}
.message-input::placeholder {
    color: #6b7280;
}
.send-button-container button,
.send-button-container .btn {
    height: 85px;
    width: 96px;
    padding: 0 18px;
    font-size: 15px;
    border-radius: 10px;
}
.send-button-container {
    position: absolute;
    right: -120px;
    top: 50%;
    transform: translateY(-50%);
}
.char-counter {
    color: #6b7280;
    font-size: 12px;
    display: block;
    text-align: right;
    padding-right: 143px;
    margin-top: 6px;
}

/* Empty states */
.empty-chat-state,
.empty-state {
    text-align: center;
    color: #6b7280;
}
.empty-logo {
    width: 36px;
    opacity: 0.8;
}

.conversations-management-section-header {
    min-height: 60px;
    padding: 10px 0;
}
.conversations-management-section-header .label {
    font-size: 18px;
}

.selected-conversation-header {
    padding: 18px 20px;
    min-height: 72px;
}
.selected-conversation-avatar {
    height: 52px;
    width: 52px;
    border-radius: 50%;
}

.selected-conversation-main {
    width: 100%;
    height: calc(100% - 230px);
    padding: 16px 16px 24px;
    overflow: hidden;
}
.composer-message {
    position: sticky;
    bottom: 0px;
}
.char-counter {
    right: 12px;
    bottom: 8px;
}

/* Date under message bubble */
.message-date {
    color: #9ca3af;
    font-size: 12px;
    margin-top: 2px;
}
/* Suggestions row shown on input focus */
.composer-suggestions {
    position: absolute;
    z-index: 1000;
    bottom: 100%;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.composer-suggestions .suggestion-chip {
    background: #ffffff;
    color: #1f2937;
    border-radius: 9999px;
    padding: 6px 10px;
    font-size: 14px;
    margin-left: 14px;
    line-height: 1;
    cursor: pointer;
}

/* Attached file chips shown within composer */
.attachments-preview {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}
.attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #eef2ff;
    color: #1f2937;
    border: 1px solid #c7d2fe;
    border-radius: 9999px;
    font-size: 12px;
}
.attachment-chip i {
    color: #4f46e5;
}

/* Make the conversation chat list scroll inside the main area */
.conversation-chat-list {
    max-height: calc(100vh - 550px);
    overflow-y: auto;
    padding: 0 0 10px 0;
}
/* UI tweaks: 32x32 plus button and lowered chat avatars */

.action__search__tab {
    margin-bottom: 4px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.chatlist__header {
    padding: 16px;
}


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

::-webkit-scrollbar-track {
    background: #fff;
}

::-webkit-scrollbar-thumb {
    background: #E5E7EB;
    border-radius: 16px
}

::-webkit-scrollbar-thumb:hover {
    background: #8d8e90;
}

.date-separator {
    display: flex;
    background: #ffffff;
    justify-content: center;
    padding: 9px 12px;
    border-radius: 33px;
}
.date__wrapper {
    display: flex;
    justify-content: center;
}
.date-text {
    font-family: "Satoshi", sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 100%;
    letter-spacing: 0px;
    color: #646c71;
}
.single__message__info {
    display: flex;
    gap: 10px;
}
.attachments-preview {
    margin-top: 8px;
}

.attachment-item {
    margin-bottom: 4px;
}

.attachment-preview {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.attachment-preview:hover {
    background: #e9e9e9;
}

.attachment-preview i {
    font-size: 18px;
    margin-right: 8px;
}

.attachment-info {
    display: flex;
    flex-direction: column;
}

.attachment-name {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.attachment-size {
    font-size: 12px;
    color: #666;
}

.loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
}
.empty-state-content,
.empty-messages-content {
    text-align: center;
    padding: 2rem;
    max-width: 400px;
}
.chat-empty-state,
.messages-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: white;
}
.chat-loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: white;
}

.loader-container {
    text-align: center;
    padding: 2rem;
}

.loading-text {
    margin-top: 1rem;
    color: #6c757d;
    font-size: 1.1rem;
}


.custom-dropdown {
    position: relative;
    display: inline-block;
}

.options-btn {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.2s ease;
}

.options-btn:hover,
.options-btn.active {
    background-color: #f8f9fa;
    color: #495057;
}

.dropdown__menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1000;
    min-width: 180px;
    padding: 0.5rem 0;
    margin: 0.125rem 0 0;
    font-size: 14px;
    color: #212529;
    text-align: left;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    clear: both;
    font-weight: 400;
    color: #212529;
    text-align: inherit;
    text-decoration: none;
    white-space: nowrap;
    background-color: transparent;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #16181b;
}

.dropdown-item.text-danger:hover {
    background-color: #f8d7da;
    color: #721c24;
}

.dropdown-menu.show {
    display: block;
}

/* New Conversation Modal Styles */
.add-conversation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal__content {
    position: relative;
    width: 668px;
    padding: 32px;
    background-color: white;
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
}

.modal-header {
    border-bottom: none !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0px !important;
}

.title {
    font-family: "Satoshi", sans-serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 30px;
    letter-spacing: 0%;
    color: #040404;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0px 12px 0px 0px !important;
    margin-top: 24px;
}

.form__input {
    border: 1px solid #d0d5dd;
    width: 100%;
    border-radius: 14px;
    margin-top: 6px;
    padding: 9px 14px;
    font-weight: 500;
    font-size: 16px;
    color: #565666;
    line-height: 26px;
    font-family: "Satoshi", sans-serif;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form__label {
    font-family: "Satoshi", sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 26px;
    letter-spacing: 0%;
    color: #565666;
}

.submit__buttons {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: flex-end;
    margin-top: 32px;
}

.text-danger {
    color: #dc3545;
    font-size: 14px;
    margin-top: 4px;
}

.modal-body::-webkit-scrollbar {
    width: 10px;
}

.modal-body::-webkit-scrollbar-track {
    background: #fff;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #e5e7eb;
    border-radius: 16px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #8d8e90;
}
.date-separator-wrapper {
    display: flex;
    justify-content: center;
    margin: 15px 0;
    position: relative;
}

.date-separator {
    background-color: #f8f9fa;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
    border: 1px solid #e9ecef;
}