﻿/* ============================================================================
   CAS Comments (chat) — global styles.
   Global (not .razor.css) so they also reach Radzen child components.
   Used by: FormComponentComments, CASChatMenuItem (ProblemSolving.Forms)
            CASChatBanner (ProblemSolving.Shared)
   ========================================================================== */

/* ---------- Steps list item ---------- */
.cas-chat-menu-item {
    display: flex;
    align-items: center;
    min-height: 37px;
}

.cas-chat-menu-text {
    display: flex !important;
    align-items: center !important;
    gap: 0.35rem;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.5 !important;
}

.cas-chat-menu-icon {
    display: inline-flex !important;
    align-items: center;
    font-size: 1.15rem !important;
    line-height: 1 !important;
    vertical-align: middle;
}

.cas-chat-menu-mobile {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.cas-chat-badge {
    display: inline-block;
    min-width: 1.4rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--rz-danger);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.4rem;
    text-align: center;
}

/* ---------- Header ---------- */
.cas-chat-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    column-gap: 0.5rem;
    padding: 0.25rem;
}

.cas-chat-header-right {
    display: flex;
    justify-content: flex-end;
}

.cas-chat-team {
    text-align: center;
    font-size: 0.8rem;
    color: var(--rz-text-secondary-color, #6c757d);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0.15rem 0 0.75rem;
}

/* ---------- Message list ---------- */
.cas-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    height: calc(100dvh - 26rem);
    min-height: 320px;
    overflow-y: auto;
    padding: 0.75rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 10px;
}

.cas-chat-empty {
    margin: auto;
    color: #6c757d;
    font-size: 0.9rem;
}

.cas-chat-msg {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    align-self: flex-start;
}

.cas-chat-msg.mine {
    align-self: flex-end;
    align-items: flex-end;
}

.cas-chat-sender {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #0c5460;
    margin: 0 0.3rem 0.2rem;
}

/* WIPRO profile picture next to the sender's name */
.cas-chat-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #dee2e6;
    background: #fff;
    flex-shrink: 0;
}

.cas-chat-bubble {
    padding: 0.5rem 0.8rem;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    background: #fff;
    border: 1px solid #dee2e6;
    word-break: break-word;
    white-space: pre-wrap;
    color: #212529;
}

.cas-chat-msg.mine .cas-chat-bubble {
    background: #0c5460;
    color: #fff;
    border-color: #0c5460;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 4px;
}

.cas-chat-photo {
    display: block;
    max-width: 260px;
    max-height: 320px;
    width: 100%;
    border-radius: 10px;
    object-fit: cover;
}

.cas-chat-file {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: inherit !important;
    text-decoration: none;
    font-weight: 600;
}

.cas-chat-file:hover {
    text-decoration: underline;
}

.cas-chat-file-size {
    font-weight: 400;
    font-size: 0.75rem;
    opacity: 0.8;
}

.cas-chat-bubble a + .cas-chat-text {
    margin-top: 0.4rem;
}

.cas-chat-time {
    font-size: 0.68rem;
    color: #6c757d;
    margin: 0.15rem 0.35rem 0;
}

/* @mention highlights — must read on both the white and the dark "mine" bubble. */
.cas-chat-mention {
    font-weight: 700;
    color: #0b5ed7;
    background: rgba(13, 110, 253, .12);
    border-radius: 4px;
    padding: 0 2px;
}

.cas-chat-mention-me {
    color: #8a6d00;
    background: #fff3cd;
}

.cas-chat-msg.mine .cas-chat-mention {
    color: #cfe2ff;
    background: rgba(255, 255, 255, .18);
}

.cas-chat-msg.mine .cas-chat-mention-me {
    color: #fff3cd;
    background: rgba(255, 193, 7, .35);
}

/* ---------- Pending attachment chip ---------- */
.cas-chat-pending {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.6rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fff;
}

.cas-chat-pending img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 6px;
}

.cas-chat-pending-name {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Composer: [ emoji | input | attach camera ] (send) ---------- */
.cas-chat-composer {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.cas-chat-inputbar {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.15rem 0.35rem;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 22px;
}

.cas-chat-inputbar:focus-within {
    border-color: #0c5460;
    box-shadow: 0 0 0 0.15rem rgba(12, 84, 96, .2);
}

.cas-chat-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    padding: 0.45rem 0.25rem;
    font-size: 0.95rem;
}

.cas-chat-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #6c757d;
    cursor: pointer;
    flex-shrink: 0;
}

.cas-chat-icon-btn:hover {
    background: #eef1f3;
    color: #0c5460;
}

.cas-chat-icon-btn .rzi {
    font-size: 1.3rem;
    line-height: 1;
}

/* The InputFile is invisible but covers the icon so a click opens the file picker. */
.cas-chat-file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.cas-chat-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    background: var(--rz-primary, #0c5460);
    color: #fff;
    cursor: pointer;
}

.cas-chat-send:disabled {
    opacity: 0.45;
    cursor: default;
}

.cas-chat-send .rzi {
    font-size: 1.25rem;
    line-height: 1;
}

.cas-chat-hint {
    margin: 0.3rem 0.75rem 0;
    font-size: 0.75rem;
    color: #6c757d;
    line-height: 1.3;
}

/* ---------- Pop-up panels (above the composer) ---------- */
.cas-chat-emoji-panel {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    z-index: 1200;
    display: grid;
    grid-template-columns: repeat(8, 34px);
    gap: 4px;
    width: max-content;
    max-width: 92vw;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

.cas-chat-emoji {
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    padding: 0;
    border-radius: 6px;
    cursor: pointer;
}

.cas-chat-emoji:hover {
    background: #f0f0f0;
}

.cas-chat-mention-panel {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    right: 50px;
    z-index: 1200;
    max-height: 300px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

.cas-chat-mention-option {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: .9rem;
}

.cas-chat-mention-option:hover {
    background: #e8f0fe;
}

.cas-chat-mention-at {
    color: #6c757d;
    font-weight: 700;
}

/* @all row: a group icon in place of a profile picture */
.cas-chat-mention-all-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e8f0fe;
    color: #0c5460;
    flex-shrink: 0;
}

.cas-chat-mention-all-icon .rzi {
    font-size: 1rem;
    line-height: 1;
}

.cas-chat-mention-name {
    font-weight: 600;
}

.cas-chat-mention-detail {
    color: #6c757d;
    font-size: 0.8rem;
}

/* ---------- App-wide @mention banner ---------- */
.cas-chat-banner {
    position: fixed;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: min(640px, calc(100vw - 1.5rem));
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: #fff3cd;
    border: 2px solid #fd7e14;
    border-radius: 0.5rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    color: #0c5460;
}

.cas-chat-banner-icon {
    font-size: 1.3rem !important;
    color: #fd7e14 !important;
    margin-top: 0.1rem;
}

.cas-chat-banner-items {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.cas-chat-banner-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.cas-chat-banner-item a {
    color: #b02a00;
    font-weight: 700;
    text-decoration: none;
}

.cas-chat-banner-item a:hover {
    text-decoration: underline;
}

.cas-chat-banner-close {
    background: none;
    border: none;
    padding: 0.1rem 0.4rem;
    color: #6c757d;
    cursor: pointer;
    line-height: 1;
}

.cas-chat-banner-close:hover {
    color: #dc3545;
}

/* ---------- Camera ---------- */
.cas-chat-camera-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
}

.cas-chat-camera {
    width: min(720px, calc(100vw - 2rem));
    background: #fff;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.cas-chat-camera-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
}

.cas-chat-camera-video {
    display: block;
    width: 100%;
    max-height: 60vh;
    background: #000;
    border-radius: 8px;
    object-fit: contain;
}

.cas-chat-camera-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
