/* =======================================================
   Course Chat Room
======================================================= */

.chat-room-page{
    min-height:calc(100vh - 80px);
    background:#f5f7fb;
    display:grid;
    grid-template-columns:360px minmax(0,1fr);
}

.chat-course-panel{
    background:
        radial-gradient(circle at top left,rgba(37,99,235,.28),transparent 35%),
        linear-gradient(180deg,#020617,#0f172a);
    color:white;
    padding:34px;
}

.chat-kicker{
    display:inline-block;
    color:#93c5fd;
    font-size:12px;
    font-weight:900;
    text-transform:uppercase;
    letter-spacing:.1em;
    margin-bottom:16px;
}

.chat-course-panel h1{
    font-family:var(--font-heading);
    font-size:34px;
    line-height:1.15;
    margin:0 0 16px;
}

.chat-course-panel p{
    color:#cbd5e1;
    line-height:1.7;
    margin:0;
}

.chat-room-meta{
    display:grid;
    gap:12px;
    margin-top:28px;
}

.chat-room-meta span{
    background:rgba(255,255,255,.08);
    border:1px solid rgba(255,255,255,.12);
    border-radius:16px;
    padding:13px 14px;
    color:#e0f2fe;
    font-weight:800;
}

.chat-shell{
    height:calc(100vh - 80px);
    display:grid;
    grid-template-rows:auto 1fr auto;
    padding:24px;
    gap:18px;
}

.chat-header,
.chat-composer{
    background:white;
    border:1px solid #e2e8f0;
    border-radius:26px;
    box-shadow:0 18px 45px rgba(15,23,42,.08);
}

.chat-header{
    padding:20px 24px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px;
}

.chat-header strong{
    color:#0f172a;
    font-size:18px;
}

.chat-header p{
    color:#64748b;
    margin:4px 0 0;
}

.chat-status-dot{
    display:inline-block;
    width:10px;
    height:10px;
    background:#22c55e;
    border-radius:50%;
    margin-right:8px;
    box-shadow:0 0 0 6px rgba(34,197,94,.14);
}

.chat-back-link{
    color:#2563eb;
    text-decoration:none;
    font-weight:900;
    white-space:nowrap;
}

.chat-thread{
    overflow-y:auto;
    background:white;
    border:1px solid #e2e8f0;
    border-radius:30px;
    padding:26px;
    box-shadow:0 18px 45px rgba(15,23,42,.08);
    display:flex;
    flex-direction:column;
    gap:18px;
}

.chat-message{
    display:flex;
    gap:12px;
    max-width:75%;
}

.chat-message.me{
    margin-left:auto;
    flex-direction:row-reverse;
}

.chat-avatar{
    width:42px;
    height:42px;
    min-width:42px;
    border-radius:50%;
    background:#0f172a;
    color:white;
    display:grid;
    place-items:center;
    font-weight:900;
}

.chat-message.me .chat-avatar{
    background:#2563eb;
}

.chat-bubble{
    background:#f8fafc;
    border:1px solid #e2e8f0;
    border-radius:22px;
    padding:14px 16px;
}

.chat-message.me .chat-bubble{
    background:#2563eb;
    border-color:#2563eb;
    color:white;
}

.chat-message-top{
    display:flex;
    justify-content:space-between;
    gap:16px;
    align-items:center;
    margin-bottom:8px;
}

.chat-message-top strong{
    color:#0f172a;
    font-size:14px;
}

.chat-message-top span{
    color:#64748b;
    font-size:12px;
    white-space:nowrap;
}

.chat-message.me .chat-message-top strong,
.chat-message.me .chat-message-top span{
    color:white;
}

.chat-bubble p{
    margin:0;
    color:#334155;
    line-height:1.55;
}

.chat-message.me .chat-bubble p{
    color:white;
}

.chat-composer{
    padding:14px;
    display:grid;
    grid-template-columns:1fr auto;
    gap:12px;
}

.chat-composer input{
    border:1px solid #cbd5e1;
    background:#f8fafc;
    border-radius:18px;
    padding:15px 17px;
    font-size:15px;
    outline:none;
}

.chat-composer input:focus{
    background:white;
    border-color:#2563eb;
    box-shadow:0 0 0 5px rgba(37,99,235,.12);
}

.chat-composer button{
    border:none;
    background:#2563eb;
    color:white;
    border-radius:18px;
    padding:0 24px;
    font-weight:900;
    cursor:pointer;
}

.chat-empty-state{
    margin:auto;
    text-align:center;
    color:#64748b;
}

.chat-empty-state div{
    font-size:54px;
    margin-bottom:14px;
}

.chat-empty-state h2{
    color:#0f172a;
    font-family:var(--font-heading);
    font-size:34px;
    margin:0 0 8px;
}

.chat-empty-state p{
    margin:0;
}

@media(max-width:900px){
    .chat-room-page{
        grid-template-columns:1fr;
    }

    .chat-course-panel{
        padding:28px;
    }

    .chat-shell{
        height:auto;
        min-height:calc(100vh - 80px);
    }

    .chat-thread{
        min-height:480px;
    }
}

@media(max-width:600px){
    .chat-shell{
        padding:14px;
    }

    .chat-header{
        flex-direction:column;
        align-items:flex-start;
    }

    .chat-message{
        max-width:92%;
    }

    .chat-composer{
        grid-template-columns:1fr;
    }

    .chat-composer button{
        padding:15px;
    }
}