/* The chat-container will take the full viewport height */
.chat-container {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100vh; /* Full viewport height */
    max-width: 600px;
    width: 100%;
    margin: 0;
    padding: 0; /* Padding to imitate a box */
    background-color: black;
    /*border: 1px solid #36801d;*/
    border-radius: 6px;
    box-shadow: 0 2px 3px rgba(10, 10, 10, 0.1); /* Shadow to mimic a box */

    /* wrap links */
    overflow-x: hidden;
}

/* The chat-box should take remaining space and scroll if necessary */
.chat-box {
    padding: 15px;
    overflow-y: auto;
    flex-grow: 1;
    background-color: black;
}

.msg-datetime{
    color: lightgrey;
    font-size: 9px;
    margin-bottom: 5px;
    padding: 10px;
    word-wrap: break-word;
    clear: both;
    text-align: center;
}

.msg-status{
    color: lightgrey;
    font-size: 9px;
    margin-bottom: 5px;
    word-wrap: break-word;
    clear: both;
    text-align: right;
}

.a-message-bubble {
    position: relative;
    overflow: visible; /* allow reply btn outside bubble */
    margin: 0.2rem 0;
    clear: both;
    display: flex;             /* flex so reply-btn can center with the message */
    align-items: center;       /* vertical-center inside container */
}

/* Existing message style stays as-is */
.a-message {
    max-width: 70%;
    padding: 10px;
    margin-bottom: 5px;
    border-radius: 15px;
    word-wrap: break-word;
    clear: both;
    color: black;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* Align sender/receiver */
.a-message.sender {
    background: cornflowerblue;
}
.a-message.receiver {
    background: #f1f0f0;
}
.a-message-bubble.sender .reply-btn {
}

/* Reply icon */
.a-message-bubble .reply-btn {
    background: none;
    cursor: pointer;
    color: #888;
    opacity: 0;
    transition: opacity 0.2s ease;
    padding: 0.5rem;
}

/* Show on hover */
.a-message-bubble:hover .reply-btn {
    opacity: 1;
}

/* Reply btn positioning outside */
.a-message-bubble.sender .reply-btn {
    order: 0;
    margin-left: auto;
}
.a-message-bubble.receiver .reply-btn {
    order: 1;
    margin-right: auto;
}


/* The input-box should remain fixed at the bottom */
.input-box {
    padding: 10px 10px 0 0;
    border-top: 1px solid #222222;
    background-color: black;
}

.input-box #preview-container{
    margin-top: 10px;
}

/* Styling for input and send button */
.input-box .control {
    /*display: flex;*/
    align-items: center;
}

.input-box input {
    margin-right: 1px;
}

.input-box button {
    white-space: nowrap;
}

.message-not-sent{
    font-style: italic;
    color: darkgray;
    font-size: 10px;
}

.textarea.is-rounded-custom {
    border-radius: 9999px;
    resize: none;
    height: 2.5em;
    padding-left: 1rem;
    padding-right: 1rem;
    line-height: 1.5em;
    flex-grow: 1; /* Take remaining space, but allow button */
    min-width: 0; /* Important to allow shrinking */
}

.button.is-circular {
    width: 2.5em;
    height: 2.5em;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Button should not shrink */
}

.textarea-button-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* space between textarea and button */
    width: 100%;

    position: relative;
    transition: all 0.3s ease;
}

.columns.is-vcentered.is-gapless {
    margin-bottom: 0.25rem;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .chat-container {
        height: 90vh; /* Slightly larger height on smaller screens */
        max-width: 90%;
        padding: 15px;
    }
}

@media screen and (max-width: 480px) {
    .chat-container {
        height: 87vh; /* Almost full screen on very small devices */
        max-width: 100%;
        padding: 9px;
        border-radius: 4px; /* Softer border on smaller screens */
    }
}


#message {
    flex-grow: 1;
    transition: all 0.3s ease;
}

.hide-left-buttons #shareLocation,
.hide-left-buttons #camera {
    display: none !important;
}

.hide-left-buttons #toggle-buttons {
    display: inline-flex !important;
}

.textarea-expanded #message {
    margin-left: 0 !important;
    width: 100% !important;
}

/*.fab {*/
/*    position: absolute;*/
/*    bottom: 6rem;*/
/*    left: 1rem;*/
/*    width: 48px;*/
/*    height: 48px;*/
/*    border-radius: 50%;*/
/*    background-color: rgba(50, 115, 220, 0.6); !* translucent blue *!*/
/*    color: white;*/
/*    border: none;*/
/*    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);*/
/*    display: flex;*/
/*    align-items: center;*/
/*    justify-content: center;*/
/*    font-size: 1rem;*/
/*    z-index: 10;*/
/*    cursor: pointer;*/
/*}*/

/*.fab:hover {*/
/*    background-color: #2759a5;*/
/*}*/

.fab {
    position: absolute;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: rgba(50, 115, 220, 0.6); /* translucent blue */
    color: white;
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    z-index: 10;
    cursor: pointer;
    transition: background-color 0.3s;
}

.fab:hover {
    background-color: rgba(50, 115, 220, 0.9);
}

#back-button.fab {
    bottom: 6rem;
    left: 1rem;
}

#scroll-bottom.fab.scroll-down {
    bottom: 6rem;
    left: 50%;
    transform: translateX(-50%);
}

#scroll-bottom.fab.highlight {
    background-color: #6acc4c; /* bright red */
    box-shadow: 0 0 10px #6acc4c, 0 0 20px #6acc4c;
}

.link-preview {
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-top: 8px;
    padding: 8px;
    background-color: #f9f9f9;
    max-width: 300px;
    font-family: sans-serif;
}

.link-preview-anchor {
    display: flex;
    text-decoration: none;
    color: darkblue;
}

.link-preview-image {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 8px;
}

.link-preview-meta h4 {
    margin: 0 0 4px;
    font-size: 1em;
}

.link-preview-meta p {
    margin: 0;
    font-size: 0.85em;
    color: #555;
}

.youtube-embed {
    margin-top: 8px;
    border-radius: 6px;
    overflow: hidden;
    max-width: 100%;
}

.reply-preview {
    background: #e8e8e8;
    padding: 0.5rem;
    border-left: 4px solid cornflowerblue;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #333;
}

.reply-preview-text {
    flex: 1;
    padding-right: 0.5rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.reply-preview-cancel {
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
}

blockquote {
    border-left: 4px solid #72d891;       /* accent color on the left */
    padding: 0.5rem 1rem 0.5rem 2rem; /* extra left padding for the quote */
    margin: 1rem 0;
    background: #d6caca;                  /* light background */
    color: #555;
    font-style: italic;
    border-radius: 0.3rem;
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Add a cool quotation mark at the top left corner */
blockquote::before {
    content: "“";
    font-size: 2.5rem;
    color: #4A90E2;
    position: absolute;
    top: -0.5rem;
    left: 0.3rem;
    opacity: 0.3;
    pointer-events: none;
}
