﻿/* -------------------------------------------- */
/* 1) Ensure the chat container fills its parent */
/* -------------------------------------------- */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%; /* Fill all of “.middle-column” */
    overflow: hidden; /* Prevent outer overflow—only inner scroll */
}

/* -------------------------------------------- */
/* 2) Scrollable list of message bubbles        */
/* -------------------------------------------- */
.chat-messages {
    position:relative;
    flex: 1; /* Take all space above the reply bar */
    overflow-y: auto; /* Vertical scrolling if content exceeds */
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px; /* Spacing between each bubble */
    background-color: #FAFAFA; /* Very light gray behind the bubbles */
}

/* -------------------------------------------- */
/* 3) Bubble wrappers: justify left or right    */
/* -------------------------------------------- */
.incoming-message,
.outgoing-message,
.internal-message {
    display: flex;
    position: relative;
}

.incoming-message {
    justify-content: flex-start; /* Guest‐sent messages on left */
}

.outgoing-message {
    justify-content: flex-end; /* Host‐sent messages on right */
}

.internal-message {
    justify-content: flex-start; /* Host‐sent messages on right */
}
/* -------------------------------------------- */
/* 4) The “bubble” itself                       */
/* -------------------------------------------- */
.message-bubble {
    max-width: 70%; /* Never exceed 70% of width */
    padding: 10px 14px;
    border-radius: 16px;
    word-wrap: break-word;
    line-height: 1.4;
    position: relative;
    min-width: 50%;
}

/* Incoming vs. outgoing background & corner styling */
.incoming-message .message-bubble {
    background-color: #FFFFFF; /* White for guest messages */
    border: 1px solid #E0E0E0; /* Subtle border so it stands out */
    border-bottom-left-radius: 0; /* Flat corner on bottom-left */
    text-align: left;
}

.outgoing-message .message-bubble {
    background-color: #DCF8C6; /* Light green for host messages */
    border-bottom-right-radius: 0; /* Flat corner on bottom-right */
    text-align: right;
}

.internal-message .message-bubble {
    background-color: darkgreen; /* Light green for host messages */
    border-bottom-right-radius: 0; /* Flat corner on bottom-right */
    text-align: right;
}

/* -------------------------------------------- */
/* 4b) NEW: Unread differentiator                */
/* -------------------------------------------- */
.incoming-message.unread .message-bubble {
    background-color: #FFF3CD; /* Pale yellow for unread */
    border-left: 4px solid #FFC107; /* Gold‐tone accent on the left */
}

/* -------------------------------------------- */
/* 5) Timestamp styling                         */
/* -------------------------------------------- */
.time-date {
    font-size: 10px;
    color: #666;
    margin-top: 5px;
    display: block;
    text-align: right;
}

/* -------------------------------------------- */
/* 6) Message actions (for incoming)            */
/* -------------------------------------------- */
.message-actions {
    display: flex;
    gap: 5px;
    position: absolute;
    bottom: 5px; /* Float inside the bubble, bottom-left */
    left: 8px;
}

.action-button {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    color: #555;
    transition: color 0.3s ease;
}

    .action-button:hover {
        color: #007BFF; /* Blue on hover */
    }

/* -------------------------------------------- */
/* 7) “No messages” placeholder                 */
/* -------------------------------------------- */
.no-messages {
    margin: auto;
    color: #666;
    font-style: italic;
}

/* -------------------------------------------- */
/* 8) Reply bar pinned at bottom                */
/* -------------------------------------------- */
.chat-reply {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background-color: #FFF;
    border-top: 1px solid #DDD;
    flex-shrink: 0; /* Never shrink—always visible */
}

/* “Reply type” dropdowns (Email/SMS/WhatsApp/Chat/Airbnb) */
.reply-type {
    padding: 5px;
    border: 1px solid #CCC;
    border-radius: 5px;
    font-size: 14px;
    min-width: 100px;
}

/* Text area for typing reply */
.reply-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    resize: vertical; /* let user expand vertically */
    font-family: inherit;
    font-size: 0.95rem;
}

/* Send button styling */
.send-button {
    background-color: #007BFF;
    color: #FFF;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

    .send-button:hover {
        background-color: #0056B3;
    }

.editor-wrapper {
    display: flex;
    align-items: stretch;
    width: 100%;
    /* adjust height as needed */
    /* e.g. you might want a fixed height, or let it grow/shrink */
}

.tab‐box {
    display: flex;
    flex-direction: column;
    width: 48px; /* very narrow so it’s just a “tab” strip */
    border: 1px solid #ccc;
    border-right: none;
    background-color: #f5f5f5;
}

.tab‐button {
    writing-mode: vertical-rl; /* rotate text vertically */
    text-orientation: mixed; /* keep letters upright */
    padding: 8px 4px;
    cursor: pointer;
    user-select: none;
    text-align: center;
    border-bottom: 1px solid #ddd;
    font-size: 0.85rem;
}

    .tab‐button:last-child {
        border-bottom: none;
    }

    .tab‐button.active {
        background-color: white;
        font-weight: bold;
        border-left: 3px solid #0078d4; /* highlight the active tab */
    }

.editor‐content {
    flex: 1;
    border: 1px solid #ccc;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
}

.reply‐input {
    flex: 1;
    resize: vertical;
    padding: 0.5rem;
    font-size: 1rem;
}

.reply-input .ql-container {
    resize: vertical; /* allow vertical resizing */
    overflow: auto; /* must be auto/scroll for resize to work */
    min-height: 150px; /* you can adjust this to taste */
}

.reply-input .ql-editor {
    min-height: 120px; /* initial height of the editable area */
}

.reply-input .ql-container::after {
    content: "";
    display: block;
    width: 100%;
    height: 8px;
    cursor: ns-resize; /* show the resize cursor across the bottom edge */
    background: transparent;
    position: absolute;
    bottom: 0;
    left: 0;
}

.button‐row {
    margin-top: 3rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.refresh-icon {
    cursor: pointer;
    color: #32e70d;
}
/* Container around both toolbar + template dropdown */
.toolbar-container {
    width: 100%;
    max-width: 33%; /* never wider than one‐third */
    min-width: 200px; /* optional: ensure it doesn’t get too small */
    margin-bottom: 1rem; /* spacing below toolbar */
    align-self: flex-start;
}

/* The toolbar itself: flex to push items to opposite sides */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0.5rem;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Refresh button styling */
.refresh-button {
    background: none;
    border: none;
    font-size: 1.25rem; /* make the ⟳ icon a bit larger */
    cursor: pointer;
    color: #333; /* dark gray icon */
}

    .refresh-button:hover {
        color: #000; /* darker on hover */
    }

/* The select for “type” */
.reply-type {
    font-size: 0.9rem;
    padding: 0.3rem 0.5rem;
}

/* When the template‐select is shown, we put it in its own block,
       and match its width exactly to the toolbar above by also using width:100% */
.template-container {
    width: 100%;
    padding: 0.5rem 1rem; /* same left/right padding as .toolbar so they align perfectly */
    background-color: #fff; /* if you want it to have its own background */
    box-sizing: border-box;
    border-bottom: 1px solid #ccc; /* optional, if you want to separate it from content below */
}

    /* If you want the template dropdown itself to fill the entire toolbar width,
       you can add: */
    .template-container .reply-type {
        width: 100%;
        box-sizing: border-box;
    }

.message-bubble {
    position: relative;
    padding: 10px;
    border-radius: 8px;
    background: #f0f0f0;
}

.message-icon {
    position: absolute;
    font-size: 0.9rem;
    color: #888;
    right:10px !important;
}

.from-guest .message-icon {
    top: 6px;
    right: 6px;
}

.to-guest .message-icon {
    top: 6px;
    left: 6px;
}

.to-staff .message-icon {
    top: 6px;
    left: 6px;
}
