﻿.header-banner,
.site-footer {
    display: none;
}

.qanda-chat {
    display: flex;
    column-gap: 20px;
    padding: 20px 0;
}

.sidebar {
    flex: 1;
}

.search-bar {
    margin: 20px;
}

#searchMessagesInput {
    border: 1px solid var(--border-color);
}

.qanda-expert-list {
    display: flex;
    flex-direction: column;
    row-gap: 16px;
    padding: 0 20px 20px;
}

.qanda-expert-item {
    display: flex;
    align-items: center;
    column-gap: 10px;
    cursor: pointer;
}

.qanda-expert-avatar {
    position: relative;
    width: 50px;
}

    .qanda-expert-avatar img:first-child {
        width: 100%;
        height: 50px;
        object-fit: cover;
        border-radius: 50%;
    }

    .qanda-expert-avatar img:nth-child(2) {
        position: absolute;
        bottom: 0;
        right: 0;
        width: 12px;
        height: 12px;
    }

.qanda-expert-info {
    display: flex;
    flex-direction: column;
    row-gap: 2px;
}

.qanda-expert-name {
    font-size: 14px;
    font-weight: 700;
    line-height: 20px;
    color: #2D3748;
}

.qanda-expert-level {
    font-size: 12px;
    font-weight: 400;
    line-height: 20px;
}

.qanda-expert-chat {
    cursor: pointer;
    display: flex;
    padding: 6px;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    border-radius: 6px;
    background: #F0F3F8;
}

    .qanda-expert-chat img {
        width: 16px;
        height: 16px;
    }

.qanda-image {
    flex: 1;
    width: 156px;
}

    .qanda-image img {
        width: 100%;
        object-fit: contain;
        border-radius: 4px;
    }

.qanda-chat-wrapper {
    flex: 3;
    border-radius: 4px;
    border: 1px solid #E4E4E4;
}

.qanda-chat-header {
    padding: 16px 40px;
    border-bottom: 1px solid #E4E4E4;
}

.qanda-chat-content,
.qanda-chat-right,
.qanda-chat-left {
    display: flex;
    flex-direction: column;
}

.qanda-chat-content {
    /*min-height: max-content;*/
    max-height: 50vh;
    min-height: 50vh;
    justify-content: flex-start;
    row-gap: 10px;
    padding: 40px;
    overflow-y: auto;
}

.qanda-chat-right,
.qanda-chat-left {
    row-gap: 4px;
}

.qanda-chat-right {
    align-items: flex-end;
    margin-left: 120px;
}

.qanda-chat-left {
    align-items: flex-start;
    margin-right: 120px;
}

.qanda-chat-left-info {
    display: flex;
    column-gap: 10px;
    align-items: center;
}

    .qanda-chat-left-info img {
        width: 32px;
        height: 32px;
        object-fit: cover;
        border-radius: 50%;
    }

.qanda-chat-left-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
}

.qanda-chat-left-time {
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
}

.qanda-chat-left-content {
    padding: 10px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 20px;
    background-color: #f5f5f5;
    position: relative;
}

.qanda-chat-right-content {
    padding: 10px;
    border-radius: 10px;
    background: rgba(232, 174, 14, 0.20);
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    position: relative;
}

.qanda-chat-right-time {
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
}

.qanda-chat-send {
    display: flex;
    align-items: flex-end;
    padding: 16px 40px;
    column-gap: 10px;
    border-top: 1px solid #E4E4E4;
}

input[type=text] {
    border: none;
}

.qanda-chat-send-input {
    background-color: transparent;
}

.qanda-chat-send-btn {
    display: flex;
    align-items: center;
    column-gap: 4px;
    padding: 12px 16px;
    border: none;
    outline: none;
    border-radius: 6px;
    color: #003B8E;
    background: rgba(182, 0, 2, 0.10);
    font-size: 14px;
    font-weight: 400;
    line-height: 20px;
}

.qanda-chat-send-input {
    height: 43px !important;
}

.qanda-chat-send-btn .img-send {
    width: 20px;
    height: 20px;
}

.qanda-chat-content::-webkit-scrollbar-track {
    background: transparent;
}

.qanda-chat-content::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.25);
    border-radius: 10px;
    transition: background-color 0.3s;
}

    .qanda-chat-content::-webkit-scrollbar-thumb:hover {
        background-color: rgba(0, 0, 0, 0.4);
    }

.qanda-chat-content::-webkit-scrollbar {
    width: 4px;
    opacity: 0;
}

.qanda-chat-content:hover::-webkit-scrollbar {
    opacity: 1;
}

.message-actions {
    display: none;
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
    top: 0;
    white-space: nowrap;
}

.qanda-chat-left-content .message-actions {
    left: calc(100% + 2px);
}

.qanda-chat-right-content .message-actions {
    right: calc(100% + 2px);
}

    .qanda-chat-left-content:hover .message-actions,
    .qanda-chat-left-content .message-actions:hover,
    .qanda-chat-right-content:hover .message-actions,
    .qanda-chat-right-content .message-actions:hover {
        display: flex;
        gap: 5px;
    }

.message-action-btn {
    padding: 5px 10px;
    border: none;
    background: #f0f0f0;
    cursor: pointer;
    border-radius: 3px;
    font-size: 12px;
}

    .message-action-btn:hover {
        background: #e0e0e0;
    }

.reaction-picker {
    display: none;
    position: fixed;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1001;
}

.reaction-emoji {
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    margin: 0 2px;
}

    .reaction-emoji:hover {
        transform: scale(1.2);
    }

.qanda-chat-right,
.qanda-chat-left {
    position: relative;
}

.search-messages {
    padding: 10px 40px;
    border-bottom: 1px solid #E4E4E4;
    display: none;
}

.search-results {
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 5px;
    display: none;
}

.search-result-item {
    padding: 8px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

    .search-result-item:hover {
        background: #f5f5f5;
    }

    .search-result-item.highlight {
        background: #fff3cd;
    }

.close-chat-btn {
    margin-left: auto;
    padding: 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
}

    .close-chat-btn:hover {
        background: #f0f0f0;
        border-radius: 4px;
    }

.chat-message-recalled .qanda-chat-right-content,
.chat-message-recalled .qanda-chat-left-content {
    color: #718096;
    font-style: italic;
}


@media only screen and (max-width: 768px) {
    .qanda-chat {
        padding-left: 10px;
        padding-right: 10px;
        flex-direction: column;
        row-gap: 20px;
    }

    .qanda-chat-left-time {
        white-space: nowrap;
    }
}

@keyframes skeleton-shimmer {
    0% {
        background-position: -200px 0;
    }

    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton-item {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.qanda-expert-avatar-skeleton {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.qanda-expert-name-skeleton {
    width: 200px;
    height: 20px;
    border-radius: 6px;
}

.qanda-expert-level-skeleton {
    width: 100px;
    height: 15px;
    border-radius: 6px;
}

.qanda-expert-chat-skeleton {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.search-result-date-header {
    padding: 8px 12px;
    background: #f0f2f5;
    font-weight: 600;
    font-size: 12px;
    color: #65676b;
    border-bottom: 1px solid #e4e6eb;
    position: sticky;
    top: 0;
    z-index: 10;
}

.search-result-item {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f2f5;
    cursor: pointer;
    transition: background 0.2s;
}

    .search-result-item:hover {
        background: #f5f6f8;
    }

.search-result-sender {
    font-weight: 600;
    font-size: 13px;
    color: #1877f2;
    margin-bottom: 4px;
}

.search-result-content {
    font-size: 14px;
    color: #050505;
    line-height: 1.4;
    margin-bottom: 4px;
    word-break: break-word;
}

    .search-result-content mark {
        background: #fff3cd;
        padding: 2px 0;
        border-radius: 2px;
    }

.search-result-time {
    font-size: 11px;
    color: #8a8d91;
}

.search-result-footer {
    padding: 8px 12px;
    text-align: center;
    background: #f8f9fa;
    border-top: 1px solid #e4e6eb;
}

.search-highlight {
    background: #fff3cd !important;
    border-radius: 8px;
    padding: 4px;
    transition: background 0.3s ease;
}

.search-highlight-text {
    background: #ffc107 !important;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 3px;
}

#searchResults {
    max-height: 400px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-top: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
