/*--------------------------------------------------------------
# Conversation Page / WhatsApp Style
--------------------------------------------------------------*/

.conversation-chat-card {
    background: #ffffff;
    border-radius: 24px;
    border: 1px solid rgba(15, 23, 42, 0.07);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    position: relative;
}


/*--------------------------------------------------------------
# Chat Header
--------------------------------------------------------------*/

.conversation-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    background: #f0f2f5;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    flex-wrap: wrap;
}

.conversation-chat-user {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.conversation-chat-user-text {
    min-width: 0;
}

.conversation-chat-avatar {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #50c5ff 0%, #20a4e6 100%);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 10px 20px rgba(80, 197, 255, 0.22);
}

.conversation-chat-user h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #111b21;
    font-family: var(--nav-font);
    line-height: 1.25;
}

.conversation-chat-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.conversation-chat-meta .chip {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: #0f172a;
    font-weight: 600;
    font-size: 0.76rem;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 999px;
}


/*--------------------------------------------------------------
# Status Chips
--------------------------------------------------------------*/

.status-active {
    background: rgba(34, 197, 94, 0.12) !important;
    color: #166534 !important;
    border-color: rgba(34, 197, 94, 0.20) !important;
}

.status-draft {
    background: rgba(148, 163, 184, 0.12) !important;
    color: #475569 !important;
    border-color: rgba(148, 163, 184, 0.20) !important;
}

.status-public-chip {
    background: rgba(59, 130, 246, 0.10) !important;
    color: #1d4ed8 !important;
    border-color: rgba(59, 130, 246, 0.18) !important;
}

.status-private-chip {
    background: rgba(168, 85, 247, 0.10) !important;
    color: #7e22ce !important;
    border-color: rgba(168, 85, 247, 0.18) !important;
}


/*--------------------------------------------------------------
# Direction Hint
--------------------------------------------------------------*/

.chat-direction-hint {
    display: flex;
    justify-content: center;
    padding: 10px 14px 0;
    background: #efeae2;
}

.chat-direction-hint span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.76rem;
    font-weight: 600;
    color: #54656f;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(15, 23, 42, 0.05);
    padding: 8px 14px;
    border-radius: 999px;
}

.chat-direction-hint i {
    color: #50c5ff;
}


/*--------------------------------------------------------------
# Chat Stream
--------------------------------------------------------------*/

.whatsapp-chat-stream {
    position: relative;
    background: linear-gradient(rgba(239, 234, 226, 0.96), rgba(239, 234, 226, 0.96)), radial-gradient(circle at top left, rgba(80, 197, 255, 0.05), transparent 28%), radial-gradient(circle at bottom right, rgba(80, 197, 255, 0.04), transparent 24%);
    padding: 18px 16px 14px;
    max-height: 72vh;
    min-height: 420px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.whatsapp-chat-stream::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(15, 23, 42, 0.04) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
    opacity: 0.16;
}

.whatsapp-chat-stream>* {
    position: relative;
    z-index: 1;
}

.whatsapp-chat-stream::-webkit-scrollbar {
    width: 7px;
}

.whatsapp-chat-stream::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.16);
    border-radius: 999px;
}

.whatsapp-chat-stream::-webkit-scrollbar-track {
    background: transparent;
}


/*--------------------------------------------------------------
# Date Separator
--------------------------------------------------------------*/

.wa-date-separator {
    display: flex;
    justify-content: center;
    margin: 14px 0 12px;
}

.wa-date-separator span {
    background: #d9fdd3;
    color: #54656f;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, 0.04);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}


/*--------------------------------------------------------------
# Message Rows
--------------------------------------------------------------*/

.wa-row {
    display: flex;
    margin-bottom: 8px;
    width: 100%;
    scroll-margin-top: 120px;
    transition: transform 0.2s ease;
}

.wa-me {
    justify-content: flex-end;
}

.wa-other {
    justify-content: flex-start;
}

.wa-bubble-wrap {
    max-width: min(82%, 760px);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wa-me .wa-bubble-wrap {
    align-items: flex-end;
}

.wa-other .wa-bubble-wrap {
    align-items: flex-start;
}


/*--------------------------------------------------------------
# Sender Name
--------------------------------------------------------------*/

.wa-meta-name {
    font-size: 0.74rem;
    font-weight: 700;
    color: #2563eb;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    line-height: 1.4;
}

.wa-me .wa-meta-name {
    color: #0f766e;
}

.wa-role {
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: #667781;
}


/*--------------------------------------------------------------
# Bubble
--------------------------------------------------------------*/

.wa-bubble {
    position: relative;
    min-width: 180px;
    max-width: 100%;
    padding: 8px 10px 7px;
    border-radius: 8px;
    box-shadow: 0 1px 1px rgba(15, 23, 42, 0.10);
    border: 1px solid rgba(15, 23, 42, 0.04);
    overflow: visible;
}

.wa-other .wa-bubble {
    background: #ffffff;
    color: #111b21;
    border-top-left-radius: 0;
}

.wa-me .wa-bubble {
    background: #d9fdd3;
    color: #111b21;
    border-top-right-radius: 0;
}

.wa-bubble::after {
    content: "";
    position: absolute;
    top: 0;
    width: 10px;
    height: 13px;
    background: transparent;
}

.wa-other .wa-bubble::after {
    left: -8px;
    border-top: 9px solid #ffffff;
    border-left: 9px solid transparent;
}

.wa-me .wa-bubble::after {
    right: -8px;
    border-top: 9px solid #d9fdd3;
    border-right: 9px solid transparent;
}


/*--------------------------------------------------------------
# Reply Snippet Inside Message
--------------------------------------------------------------*/

.wa-reply-snippet {
    border-left: 4px solid #53bdeb;
    background: rgba(15, 23, 42, 0.05);
    padding: 7px 9px;
    border-radius: 7px;
    margin-bottom: 6px;
    transition: 0.2s ease;
}

.wa-me .wa-reply-snippet {
    border-left-color: #0f766e;
    background: rgba(15, 118, 110, 0.08);
}

.wa-reply-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #1f6feb;
    margin-bottom: 2px;
    line-height: 1.35;
}

.wa-me .wa-reply-label {
    color: #0f766e;
}

.wa-reply-text {
    font-size: 0.8rem;
    color: #667781;
    line-height: 1.45;
    word-break: break-word;
}


/*--------------------------------------------------------------
# Message Text
--------------------------------------------------------------*/

.wa-text {
    font-size: 0.93rem;
    line-height: 1.6;
    color: #111b21;
    white-space: pre-wrap;
    word-break: break-word;
}


/*--------------------------------------------------------------
# Bubble Footer
--------------------------------------------------------------*/

.wa-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-end;
    margin-top: 6px;
}

.wa-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.wa-action-icon {
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(15, 23, 42, 0.06);
    color: #54656f;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    transition: all 0.2s ease;
}

.wa-action-icon:hover {
    background: rgba(80, 197, 255, 0.16);
    color: #0369a1;
}

.wa-action-panelist {
    border: none;
    background: rgba(15, 23, 42, 0.06);
    color: #334155;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.wa-action-panelist:hover {
    background: rgba(80, 197, 255, 0.14);
    color: #0369a1;
}

.wa-time {
    font-size: 0.7rem;
    color: #667781;
    white-space: nowrap;
    padding-bottom: 2px;
    align-self: flex-end;
}


/*--------------------------------------------------------------
# Composer
--------------------------------------------------------------*/

.wa-composer-card {
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    background: #f0f2f5;
    padding: 12px 14px 14px;
    position: sticky;
    bottom: 0;
    z-index: 5;
}

.wa-composer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.wa-sending-role {
    font-size: 0.84rem;
    color: #54656f;
    font-weight: 500;
}

.wa-sending-role strong {
    color: #111b21;
}

.wa-role-switch {
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #ffffff;
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.wa-role-switch:hover {
    background: rgba(80, 197, 255, 0.10);
    border-color: rgba(80, 197, 255, 0.18);
    color: #0369a1;
}

.wa-composer-bar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: transparent;
}

.wa-composer-input {
    border: none !important;
    background: #ffffff !important;
    box-shadow: none !important;
    resize: none;
    min-height: 48px;
    max-height: 150px;
    padding: 12px 14px !important;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #111b21;
    border-radius: 24px !important;
}

.wa-composer-input::placeholder {
    color: #8696a0;
}

.wa-composer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.wa-circle-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #ffffff;
    color: #54656f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.wa-circle-btn:hover {
    background: #f8fafc;
    color: #0369a1;
}

.wa-send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #50c5ff 0%, #1798d8 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 10px 22px rgba(80, 197, 255, 0.22);
    transition: all 0.2s ease;
}

.wa-send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(80, 197, 255, 0.28);
}


/*--------------------------------------------------------------
# Reply Preview Above Composer
--------------------------------------------------------------*/

.wa-reply-preview {
    display: none;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 14px;
    padding: 10px 12px;
    margin-bottom: 10px;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.05);
}

.wa-reply-preview.show {
    display: flex;
}

.wa-reply-preview-bar {
    width: 4px;
    align-self: stretch;
    border-radius: 999px;
    background: #50c5ff;
}

.wa-reply-preview-title {
    font-size: 0.76rem;
    font-weight: 700;
    color: #0369a1;
    margin-bottom: 2px;
}

.wa-reply-preview-text {
    font-size: 0.84rem;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wa-reply-close {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(15, 23, 42, 0.06);
    color: #54656f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.wa-reply-close:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}


/*--------------------------------------------------------------
# Floating Scroll Button
--------------------------------------------------------------*/

.floating-scroll-down {
    position: absolute;
    right: 14px;
    bottom: 90px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 6;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.22s ease;
}

.floating-scroll-down.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}


/*--------------------------------------------------------------
# Empty State
--------------------------------------------------------------*/

.questions-empty-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px dashed rgba(80, 197, 255, 0.24);
    border-radius: 20px;
    padding: 32px 22px;
    text-align: center;
}

.questions-empty-icon {
    font-size: 2rem;
    color: #50c5ff;
}


/*--------------------------------------------------------------
# Bottom Action Buttons
--------------------------------------------------------------*/

.conversation-bottom-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.conversation-nav-btn {
    min-height: 46px;
    padding: 0 18px;
    border-radius: 14px;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.conversation-nav-btn-light {
    background: #ffffff;
    color: #111b21;
    border-color: rgba(15, 23, 42, 0.08);
}

.conversation-nav-btn-light:hover {
    background: #f8fafc;
    color: #111b21;
}

.conversation-nav-btn-primary {
    background: linear-gradient(135deg, #50c5ff 0%, #1798d8 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 10px 22px rgba(80, 197, 255, 0.20);
}

.conversation-nav-btn-primary:hover {
    color: #ffffff;
    transform: translateY(-1px);
}


/*--------------------------------------------------------------
# Bottom Helper Cards
--------------------------------------------------------------*/

.conversation-info-cards {
    margin-top: 22px !important;
}

.conversation-info-card {
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
    padding: 20px 18px;
    transition: all 0.25s ease;
}

.conversation-info-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.conversation-info-icon {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(80, 197, 255, 0.12);
    color: #50c5ff;
    font-size: 1.05rem;
    margin-bottom: 12px;
}

.conversation-info-card h4 {
    margin: 0 0 10px;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.conversation-info-card p {
    margin: 0;
    color: #475569;
    line-height: 1.7;
    font-size: 0.92rem;
}


/*--------------------------------------------------------------
# Jump Target Highlight
--------------------------------------------------------------*/

.wa-row:target .wa-bubble,
.wa-row.wa-highlight .wa-bubble {
    animation: targetPulse 1.1s ease;
    box-shadow: 0 0 0 4px rgba(80, 197, 255, 0.16), 0 1px 2px rgba(15, 23, 42, 0.10);
}

@keyframes targetPulse {
    0% {
        transform: scale(0.985);
    }
    40% {
        transform: scale(1.01);
    }
    100% {
        transform: scale(1);
    }
}


/*--------------------------------------------------------------
# Tablet
--------------------------------------------------------------*/

@media (max-width: 991px) {
    .whatsapp-chat-stream {
        max-height: 68vh;
        padding: 16px 14px 12px;
    }
    .conversation-chat-header {
        padding: 16px 14px;
    }
    .wa-composer-card {
        padding: 12px;
    }
    .wa-bubble-wrap {
        max-width: 88%;
    }
}


/*--------------------------------------------------------------
# Mobile
--------------------------------------------------------------*/

@media (max-width: 767px) {
    .conversation-chat-card {
        border-radius: 18px;
    }
    .conversation-chat-header {
        padding: 14px 12px;
        gap: 14px;
    }
    .conversation-chat-avatar {
        width: 42px;
        height: 42px;
        min-width: 42px;
        font-size: 0.92rem;
    }
    .conversation-chat-user h4 {
        font-size: 0.94rem;
    }
    .conversation-chat-meta {
        width: 100%;
    }
    .conversation-chat-meta .chip {
        font-size: 0.72rem;
        min-height: 32px;
        padding: 5px 10px;
    }
    .chat-direction-hint {
        padding: 10px 10px 0;
    }
    .chat-direction-hint span {
        width: 100%;
        justify-content: center;
        text-align: center;
        font-size: 0.74rem;
    }
    .whatsapp-chat-stream {
        max-height: 64vh;
        min-height: 360px;
        padding: 14px 10px 12px;
    }
    .wa-bubble-wrap {
        max-width: 94%;
    }
    .wa-bubble {
        min-width: auto;
        width: 100%;
        padding: 8px 9px 7px;
    }
    .wa-text {
        font-size: 0.9rem;
    }
    .wa-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 7px;
    }
    .wa-time {
        align-self: flex-end;
    }
    .wa-actions {
        width: 100%;
    }
    .wa-action-icon {
        width: 28px;
        height: 28px;
        font-size: 0.78rem;
    }
    .wa-action-panelist {
        width: 100%;
        justify-content: center;
        font-size: 0.7rem;
    }
    .wa-composer-top {
        align-items: stretch;
    }
    .wa-role-switch {
        width: 100%;
    }
    .wa-composer-bar {
        gap: 7px;
    }
    .wa-composer-input {
        min-height: 44px;
        padding: 10px 12px !important;
        font-size: 0.92rem;
    }
    .wa-circle-btn,
    .wa-send-btn {
        width: 42px;
        height: 42px;
    }
    .floating-scroll-down {
        right: 12px;
        bottom: 84px;
        width: 40px;
        height: 40px;
    }
    .wa-reply-preview {
        padding: 9px 10px;
        border-radius: 12px;
    }
    .conversation-bottom-actions {
        flex-direction: column;
    }
    .conversation-nav-btn {
        width: 100%;
    }
}


/*--------------------------------------------------------------
# Very Small Phones
--------------------------------------------------------------*/

@media (max-width: 420px) {
    .conversation-chat-header {
        padding: 12px 10px;
    }
    .whatsapp-chat-stream {
        min-height: 320px;
        padding: 12px 8px 10px;
    }
    .wa-bubble-wrap {
        max-width: 97%;
    }
    .wa-meta-name {
        padding: 0 6px;
    }
    .wa-bubble {
        padding: 8px 8px 7px;
    }
    .wa-reply-text,
    .wa-reply-preview-text {
        font-size: 0.78rem;
    }
    .wa-text {
        font-size: 0.88rem;
    }
    .wa-time {
        font-size: 0.68rem;
    }
}