/* =========================
   MODAL BASE
========================= */

.messageModal{
    width:420px;
    max-width:95%;
    height:80vh;

    background:#111827;
    color:#e5eff9;

    border-radius:18px;
    overflow:hidden;

    display:flex;
    flex-direction:column;

    box-shadow:
        0 20px 60px rgba(0,0,0,0.35);
}

/* =========================
   HEADER
========================= */

.msgHeader{
    display:flex;
    align-items:center;
    justify-content:space-between;

    gap:12px;

    padding:16px 18px;

    background:
        linear-gradient(
            135deg,
            #0c076e,
            #801286
        );

    border-bottom:
        1px solid rgba(255,255,255,0.08);
}

.msgHeader h3{
    margin:0;
    font-size:16px;
    font-weight:700;
    color:#fff;
}

.msgHeader small{
    display:block;
    margin-top:2px;

    font-size:12px;
    opacity:.85;
    color:#dbeafe;
}

.iconBox{
    min-width:42px;
    width:42px;
    height:42px;

    display:flex;
    align-items:center;
    justify-content:center;

    font-size:18px;

    border-radius:12px;

    background:
        rgba(255,255,255,0.15);

    backdrop-filter:blur(4px);
}

/* =========================
   CLOSE BUTTON
========================= */

.closeBtn{
    border:none;
    background:transparent;

    color:#fff;

    font-size:28px;
    line-height:1;

    cursor:pointer;

    transition:.2s ease;
}

.closeBtn:hover{
    transform:scale(1.1);
    opacity:.8;
}

/* =========================
   BODY
========================= */

.msgBody{
    flex:1;

    overflow-y:auto;

    padding:16px;

    background:#0b1220;
}

/* SCROLLBAR */

.msgBody::-webkit-scrollbar{
    width:8px;
}

.msgBody::-webkit-scrollbar-thumb{
    background:#334155;
    border-radius:20px;
}

.msgBody::-webkit-scrollbar-track{
    background:transparent;
}

/* =========================
   MESSAGE ITEM
========================= */

.msgItem{
    display:flex;
    gap:12px;

    margin-bottom:18px;

    position:relative;
}

.dot{
    width:10px;
    height:10px;

    min-width:10px;

    border-radius:50%;

    margin-top:14px;

    background:#6366f1;

    box-shadow:
        0 0 12px rgba(99,102,241,.7);
}

.msgCard{
    flex:1;

    background:#111827;

    border:
        1px solid #1f2937;

    border-radius:14px;

    padding:14px;

    transition:.2s ease;
}

.msgCard:hover{
    border-color:#374151;

    transform:translateY(-1px);
}

/* =========================
   META
========================= */

.meta{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;

    margin-bottom:8px;

    font-size:11px;
}

.sender{
    font-weight:700;
    color:#f8fafc;
}

.time{
    color:#94a3b8;
    white-space:nowrap;
}

/* =========================
   TEXT
========================= */

.text{
    font-size:13px;
    line-height:1.6;

    color:#d1d5db;

    word-wrap:break-word;
}

/* =========================
   ATTACHMENT
========================= */

.attach{
    margin-top:12px;
}

/* =========================
   IMAGE THUMB
========================= */

.thumbWrap{
    display:inline-block;

    overflow:hidden;

    border-radius:14px;

    cursor:pointer;

    border:
        1px solid rgba(255,255,255,0.08);

    background:#0f172a;

    transition:.25s ease;
}

.thumbWrap:hover{
    transform:translateY(-2px);

    box-shadow:
        0 10px 25px rgba(0,0,0,0.35);
}

.thumb{
    display:block;

    width:100%;
    max-width:220px;
    height:auto;

    object-fit:cover;

    transition:.25s ease;
}

.thumb:hover{
    transform:scale(1.03);
    opacity:.95;
}

/* =========================
   FILE BUTTON
========================= */

.file{
    display:inline-flex;
    align-items:center;
    gap:8px;

    padding:10px 14px;

    border-radius:10px;

    background:#1e293b;

    color:#93c5fd;

    text-decoration:none;

    font-size:13px;
    font-weight:600;

    transition:.2s ease;
}

.file:hover{
    background:#334155;
    color:#fff;
}

/* =========================
   EMPTY STATE
========================= */

.emptyState{
    height:100%;

    display:flex;
    align-items:center;
    justify-content:center;

    text-align:center;

    color:#64748b;

    font-size:14px;
}


/* =========================
   IMAGE MODAL
========================= */

.imgModal{
    position:fixed;
    inset:0;

    width:100%;
    height:100%;

    display:none;

    justify-content:center;
    align-items:center;

    z-index:99999;
}

.imgModal.show{
    display:flex;
}

/* DARK OVERLAY */
.imgOverlay{
    position:absolute;
    inset:0;
    background:rgba(255,255,255,.88);
    backdrop-filter:blur(6px);
}

/* IMAGE CONTAINER */
.imgBox{
    position:relative;
    z-index:2;

    width:auto;
    max-width:70vw;
    max-height:75vh;

    background:#ffffff;

    border-radius:20px;

    padding:16px;

    border:1px solid #e5e7eb;

    box-shadow:
    0 20px 60px rgba(0,0,0,.12);

    display:flex;
    justify-content:center;
    align-items:center;

    animation:zoomIn .2s ease;
}

/* CLOSE BUTTON */
.imgClose{
    position:absolute;
    top:10px;
    right:10px;

    width:36px;
    height:36px;

    border:none;
    border-radius:50%;

    background:#f3f4f6;
    color:#374151;

    font-size:18px;
    cursor:pointer;

    display:flex;
    justify-content:center;
    align-items:center;

    transition:.2s ease;
}

.imgClose:hover{
    background:#ef4444;
    color:#fff;
}

/* IMAGE */
#imgPreview{
    max-width:100%;
    max-height:68vh;

    border-radius:12px;

    object-fit:contain;

    display:block;
}


/* ANIMATION */
@keyframes zoomIn{

    from{
        opacity:0;
        transform:scale(.92);
    }

    to{
        opacity:1;
        transform:scale(1);
    }
}

/* MOBILE */
@media(max-width:768px){

    .imgBox{
        max-width:92vw;
        max-height:80vh;
        padding:10px;
    }

    #imgPreview{
        max-height:72vh;
    }
}