﻿.message-row {
    display: flex;
    margin-bottom: 8px; /* Increased from 2px */
}

    .message-row.you {
        justify-content: flex-end;
    }

    .message-row.them {
        justify-content: flex-start;
    }

        /* Add more space when sender changes */
        .message-row.you + .message-row.them,
        .message-row.them + .message-row.you {
            margin-top: 8px; /* Increased from 4px */
        }



.bubble .emoji {
    font-size: 1.3em;
    padding: 2px 4px;
    border-radius: 6px;
    margin: 0 1px;
}

.bubble {
    max-width: 80%;
    padding: 6px 12px;
    border-radius: 16px;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: pre-wrap;
    font-size: 15px;
    word-break: keep-all;
    overflow-wrap: break-word;
}

    .bubble.you {
        background-color: #4e9ef7;
        color: white;
        border-bottom-right-radius: 0;
    }

    .bubble.them {
        background-color: #e5e5ea;
        color: black;
        border-bottom-left-radius: 0;
    }

.avatar-ChatStart {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 6px;
}

.avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 6px;
}

.message-content {
    display: flex;
    flex-direction: column;
}

.message-wrapper {
    display: flex;
    align-items: flex-end;
}

.emoji {
    font-size: 1.3em;
    width: 20px;
    height: 20px;
    vertical-align: middle;
}

.input-row {
    display: flex;
    align-items: center;
    margin-top: 10px;
    gap: 8px;
}

#messageInput {
    flex: 1;
    resize: none;
    padding: 6px;
    font-size: 15px;
    border-radius: 8px;
    border: 1px solid #ccc;
    height: 40px;
}

#emojiBtn {
    font-size: 20px;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background: white;
    cursor: pointer;
    height: 40px;
}

#emojiBtn, #thumbsUpBtn, #sendBtn {
    font-size: 20px;
    background: none;
    border: none;
    cursor: pointer;
}

.send-button {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background-color: #0084ff;
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background-image: url('http://localhost:59287/img/send-button.png');
    background-size: 18px 18px;
    background-repeat: no-repeat;
    background-position: center;
}

    .send-button:hover {
        background-color: #0071e3;
    }

#chatbox {
    width: 900px;
    height: 500px;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: keep-all;
}

/* Clean, single definition for send button */
.send-button {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background-color: #0084ff;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background-color 0.2s ease;
}

    .send-button:hover {
        background-color: #0071e3;
    }

    /* Only show arrow if no SVG child */
    .send-button:empty::before {
        content: "→";
        font-size: 18px;
        font-weight: bold;
    }

/* Typing indicator styles */
.typing-indicator {
    display: none; /* Hidden by default */
}

    .typing-indicator.show {
        display: flex;
    }

.typing-bubble {
    background-color: #e5e5ea;
    border-radius: 16px;
    border-bottom-left-radius: 0;
    padding: 12px 16px;
    min-width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #999;
    animation: typing-bounce 1.4s infinite ease-in-out;
}

    .typing-dot:nth-child(1) {
        animation-delay: -0.32s;
    }

    .typing-dot:nth-child(2) {
        animation-delay: -0.16s;
    }

    .typing-dot:nth-child(3) {
        animation-delay: 0s;
    }

@keyframes typing-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.time-separator {
    text-align: center;
    color: gray;
    font-size: 13px;
    margin: 16px 0;
}

.timestamp {
    text-align: center;
    font-size: 13px;
    color: gray;
    margin: 16px 0;
}


.read-receipt {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
    height: 16px !important;
    text-align: right;
    font-size: 0; /* This eliminates any text node spacing */
}

    .read-receipt img.avatar-read {
        width: 31px !important; /*Size of read avatar*/
        height: 40px !important; /*Size of read avatar*/
        border-radius: 50%;
        object-fit: cover;
        display: inline-block !important;
        margin: 0 !important;
        padding: 0 !important;
        vertical-align: top !important;
    }


/* ChatStart page begin */

/* ========= Base layout ========= */

/* Row wrapper: avatar | text column */
.chat-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 8px;
    margin-bottom: 10px; /* space between items */
    background: #fff;
    border-radius: 12px;
}

/* Avatar block (wrapped by its own <a>) */
.avatar-wrap {
    display: block;
    position: relative;
    flex: 0 0 var(--avatar, 84px); /* was 56px → 56 * 1.5 = 84 */
    width: var(--avatar, 84px); /* was 56px → 56 * 1.5 = 84 */
    height: var(--avatar, 84px); /* was 56px → 56 * 1.5 = 84 */
    text-decoration: none; /* no underline on hover */
    color: inherit;
    cursor: pointer;
}

/* 2025-10-02 Removed
.avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
*/

/* Online dot at ~5 o'clock */
.presence-dot {
    position: absolute;
    right: 0px; /* (moves right) */
    bottom: -17px; /* (moves down) */
    width: 16px;
    height: 16px;
    background: #31A73B; /* green was 22c55e */
    border: 1.5px solid #fff; /* subtle white ring */
    border-radius: 50%;
    display: none;
    z-index: 2;
}

    .presence-dot.online {
        display: block;
    }

/* Text column */
.chat-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
}

/* Main clickable text area -> Chat */
.chat-main-link {
    display: block;
    text-decoration: none; /* no underline on hover */
    color: inherit;
    cursor: pointer;
}

/* First line: name + meta */
.line1 {
    display: flex;
    align-items: center;
    min-width: 0;
}

/* Second line: preview + time */
.line2 {
    display: flex;
    align-items: baseline;
    min-width: 0;
    gap: 6px;
}

/* ========= Typography ========= */

/* Name (we render HTML via <asp:Literal>) */
.chat-name {
    font-size: 18px;
    font-weight: 600;
    color: #111;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1 1 auto;
}

/* Everything after each | (wrapped in <span class="meta">) */
.chat-main .meta {
    font-size: 0.8em; /* smaller meta */
    color: #666;
}

/* Preview container (we wrap via ItemDataBound) */
.chat-preview {
    color: #555;
}

    .chat-preview.unread {
        font-weight: 600;
        color: #111;
    }

/* Only the actual message text (wrapped in <span class="msg-text"> inside BuildPreview) */
.msg-text {
    font-size: 16px;
    line-height: 1.4;
}

/* Time after preview */
.chat-time {
    margin-left: 4px; /* tighter to message */
    color: #888;
    font-size: 13px;
    white-space: nowrap;
}

    .chat-time::before {
        content: " \00A0\00B7\00A0 ";
    }
/* NBSP · NBSP */

/* ========= Actions under the text ========= */

/* Two small links side-by-side: Sjá síðu | Spjalla */
.profile-actions {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85em; /* unified size */
    line-height: 1.3;
}

    /* Normalize both links exactly */
    .profile-actions a {
        font-size: inherit; /* same size for both */
        line-height: inherit;
        text-decoration: underline;
        color: #2563eb; /* consistent blue */
    }

/* ========= Responsive tweaks ========= */

@media (max-width: 640px) {
    .chat-item {
        gap: 10px;
        padding: 8px 8px;
    }

    .avatar-wrap {
        flex-basis: 44px;
        width: 44px;
        height: 44px;
    }

    .avatar {
        width: 44px;
        height: 44px;
    }

    .presence-dot {
        width: 11px;
        height: 11px;
        right: 1px;
        bottom: 1px;
        border-width: 1px;
    }

    .chat-name {
        font-size: 16px;
    }

    .chat-preview { /* base stays ~14-15px via .msg-text scale */
    }

    .chat-time {
        font-size: 12px;
    }
}

.line-info {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 2px; /* slight gap before the username */
}

.chat-main-link,
.chat-main-link:hover,
.chat-main-link:focus {
    text-decoration: none !important; /* no underline ever */
    color: inherit; /* keep normal text color */
}

.chat-main-link {
    display: block;
    margin-bottom: 6px;
    position: relative;
    z-index: 0;
}

.profile-actions {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

    .profile-actions a {
        text-decoration: underline;
        font-size: 15px;
        color: #2563eb;
    }

.chat-link, .ban-link {
    cursor: pointer;
}

/* ChatStart page end */



.typing-indicator {
    margin: 6px 0 0 0;
    display: flex;
    gap: 4px;
    align-items: center;
    height: 20px; /* reserve space to avoid layout jump */
}

    .typing-indicator .dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: #9ca3af; /* gray */
        display: inline-block;
        animation: ti-bounce 1s infinite ease-in-out;
    }

        .typing-indicator .dot:nth-child(2) {
            animation-delay: .15s;
        }

        .typing-indicator .dot:nth-child(3) {
            animation-delay: .30s;
        }

@keyframes ti-bounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: .6;
    }

    40% {
        transform: translateY(-4px);
        opacity: 1;
    }
}































/* Mobile begin ***********************************************************************************/

@media (max-width:480px) and (orientation: portrait), (max-height:480px) and (orientation: landscape) /* If the device screen area is under 480 in width or height then use mobile css layout */
{

    #chatbox {
        width: 99%;
        height: 400px;
        white-space: pre-wrap;
        overflow-wrap: break-word;
        word-break: keep-all;
    }
}

/* Mobile end ************************************************************************************/
