/* =========================================
   GLOBAL PAGE
========================================= */
*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body{
    background:#eef2f7;
    font-family:'Segoe UI',sans-serif;
    overflow:hidden;
}

/* =========================================
   PAGE
========================================= */
.discussion-page{
    width:calc(100% - 235px);

    height:100vh;

    margin-left:220px;

    padding-top:85px;
    padding-left:20px;
    padding-right:15px;
    padding-bottom:15px;

    overflow:hidden;
}

/* =========================================
   LAYOUT
========================================= */
.discussion-layout{
    display:grid;

    grid-template-columns:320px 1fr;

    gap:18px;

    height:calc(100vh - 100px);

    width:100%;
}

/* =========================================
   SIDEBAR
========================================= */
.discussion-sidebar{
    background:#ffffff;

    border-radius:28px;

    border:1px solid #dbe3ec;

    overflow:hidden;

    display:flex;
    flex-direction:column;

    box-shadow:
    0 10px 30px rgba(15,23,42,0.06);
}

.sidebar-top{
    padding:22px;

    border-bottom:1px solid #e2e8f0;

    background:#f8fafc;
}

#searchInput{
    width:100%;

    padding:14px 16px;

    border-radius:14px;

    border:1px solid #dbe3ec;

    outline:none;

    font-size:14px;

    margin-bottom:18px;

    transition:0.25s;
}

#searchInput:focus{
    border-color:#3b82f6;
    box-shadow:
    0 0 0 4px rgba(59,130,246,0.10);
}

.event-filters{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
}

.filter-btn{
    border:none;

    background:#e2e8f0;

    padding:10px 16px;

    border-radius:12px;

    cursor:pointer;

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

    transition:0.25s;
}

.filter-btn:hover{
    background:#cbd5e1;
}

.filter-btn.active{
    background:#2563eb;
    color:#fff;
}

/* =========================================
   EVENT LIST
========================================= */
.event-list{
    flex:1;
    overflow-y:auto;

    padding:18px;
}

.event-card{
    background:#ffffff;

    border:1px solid #e2e8f0;

    border-radius:20px;

    padding:18px;

    margin-bottom:16px;

    cursor:pointer;

    transition:0.25s;
}

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

    border-color:#3b82f6;

    box-shadow:
    0 10px 24px rgba(37,99,235,0.10);
}

.event-card.active{
    border-color:#2563eb;

    background:#eff6ff;
}

.event-card-top{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:10px;
}

.event-card h3{
    font-size:16px;
    color:#0f172a;
    line-height:1.5;
}

.event-meta{
    margin-top:10px;

    font-size:13px;
    color:#64748b;
}

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

    background:#22c55e;

    border-radius:50%;
}


/* =========================================
   CHAT AREA
========================================= */
.chat-area{
    background:#ffffff;

    border-radius:28px;

    border:1px solid #dbe3ec;

    overflow:hidden;

    display:flex;
    flex-direction:column;

    box-shadow:
    0 10px 30px rgba(15,23,42,0.06);

    height:calc(100vh - 100px);
}

/* =========================================
   DISCUSSION CONTAINER
========================================= */
.discussion-container{
    flex:1;

    overflow-y:auto;

    padding:20px;

    min-height:0;
}

/* =========================================
   FIXED MESSAGE FORM
========================================= */
.message-form-sticky{
    flex-shrink:0;

    background:#ffffff;

    padding:18px 24px 22px;

    border-top:1px solid #e2e8f0;

    box-shadow:
    0 -5px 20px rgba(15,23,42,0.04);

    z-index:20;
}
/* =========================================
   PLACEHOLDER
========================================= */
.chat-placeholder{
    height:100%;

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

    text-align:center;

    color:#64748b;
}

.chat-placeholder i{
    font-size:70px;
    margin-bottom:20px;

    color:#cbd5e1;
}

.chat-placeholder h2{
    font-size:28px;
    color:#0f172a;
    margin-bottom:10px;
}

/* =========================================
   HEADER
========================================= */
.chat-header{
    margin-bottom:28px;
}

.chat-header h2{
    font-size:28px;
    color:#0f172a;
}

/* =========================================
   MESSAGE WRAPPER
========================================= */
.message-wrapper{
    display:flex;
    flex-direction:column;
    gap:22px;
}

/* =========================================
   MESSAGE CARD
========================================= */
.message-card{
    background:#ffffff;

    border:1px solid #e2e8f0;

    border-radius:24px;

    padding:24px;

    transition:0.25s;

    box-shadow:
    0 8px 25px rgba(15,23,42,0.05);
}

.message-card:hover{
    transform:translateY(-2px);
}

/* =========================================
   TOP BAR
========================================= */
.message-top{
    display:flex;
    justify-content:space-between;
    align-items:center;

    gap:20px;

    margin-bottom:18px;
}

.message-top-left{
    display:flex;
    align-items:center;
    gap:14px;

    flex-wrap:wrap;
}

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

    background:#eff6ff;
    color:#2563eb;

    padding:8px 14px;

    border-radius:999px;

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

.message-date{
    font-size:13px;
    color:#64748b;
}

.message-top-right{
    display:flex;
    align-items:center;
    gap:12px;
}

.reply-indicator{
    width:12px;
    height:12px;

    border-radius:50%;

    background:#22c55e;
}

.delete-btn{
    width:40px;
    height:40px;

    border:none;

    border-radius:12px;

    background:#fef2f2;

    color:#ef4444;

    cursor:pointer;

    transition:0.25s;
}

.delete-btn:hover{
    background:#ef4444;
    color:#fff;
}

/* =========================================
   MESSAGE TEXT
========================================= */
.message-text{
    font-size:15px;

    line-height:1.8;

    color:#334155;

    margin-bottom:20px;
}

/* =========================================
   ATTACHMENT
========================================= */
.message-attachment{
    margin-bottom:20px;
}

.attachment-preview{
    width:100%;
    max-width:320px;

    border-radius:18px;

    cursor:pointer;

    object-fit:cover;

    transition:0.25s;

    border:1px solid #dbe3ec;
}

.attachment-preview:hover{
    transform:scale(1.02);
}

.attachment-btn{
    display:inline-flex;
    align-items:center;
    gap:10px;

    padding:12px 18px;

    background:#f8fafc;

    border:1px solid #dbe3ec;

    border-radius:14px;

    text-decoration:none;

    color:#334155;

    font-weight:600;

    transition:0.25s;
}

.attachment-btn:hover{
    background:#eff6ff;
    border-color:#3b82f6;
}

/* =========================================
   ACTIONS
========================================= */
.message-actions{
    display:flex;
    align-items:center;
    gap:14px;

    flex-wrap:wrap;
}

.download-btn,
.reply-toggle{
    border:none;

    display:inline-flex;
    align-items:center;
    gap:10px;

    padding:12px 18px;

    border-radius:14px;

    cursor:pointer;

    text-decoration:none;

    font-weight:600;

    transition:0.25s;
}

.download-btn{
    background:#f1f5f9;
    color:#0f172a;
}

.download-btn:hover{
    background:#e2e8f0;
}

.reply-toggle{
    background:#2563eb;
    color:#fff;
}

.reply-toggle:hover{
    background:#1d4ed8;
}

/* =========================================
   REPLY CONTAINER
========================================= */
.reply-container{
    margin-top:22px;

    background:#f8fafc;

    border:1px solid #e2e8f0;

    border-radius:22px;

    padding:20px;
}

.reply-item{
    background:#ffffff;

    border:1px solid #e2e8f0;

    border-radius:18px;

    padding:16px;

    margin-bottom:14px;
}

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

    gap:10px;

    margin-bottom:10px;
}

.reply-user{
    font-weight:700;
    color:#0f172a;
}

.reply-date{
    font-size:12px;
    color:#64748b;
}

.reply-message{
    line-height:1.7;
    color:#334155;
}

/* =========================================
   REPLY FORM
========================================= */
.reply-form textarea{
    width:100%;

    min-height:90px;

    border:1px solid #dbe3ec;

    border-radius:16px;

    padding:16px;

    resize:none;

    outline:none;

    font-size:14px;

    margin-top:8px;
}

.reply-form textarea:focus{
    border-color:#3b82f6;
}

.reply-send-btn{
    margin-top:14px;

    border:none;

    background:#0f172a;

    color:#fff;

    padding:13px 18px;

    border-radius:14px;

    cursor:pointer;

    display:inline-flex;
    align-items:center;
    gap:10px;

    font-weight:600;

    transition:0.25s;
}

.reply-send-btn:hover{
    background:#1e293b;
}

/* =========================================
   MESSAGE FORM
========================================= */
#messageForm{
    margin-top:28px;

    background:#ffffff;

    border:1px solid #dbe3ec;

    border-radius:26px;

    padding:14px;

    box-shadow:
    0 8px 30px rgba(15,23,42,0.05);
}

#messageForm textarea{
    width:100%;

    min-height:130px;

    border:none;
    outline:none;

    resize:none;

    font-size:15px;

    line-height:1.8;

    color:#0f172a;

    background:transparent;
}

.message-form-bottom{
    margin-top:20px;

    display:flex;
    justify-content:space-between;
    align-items:flex-end;

    gap:20px;

    flex-wrap:wrap;
}

/* =========================================
   FILE UPLOAD
========================================= */
.upload-wrapper{
    display:flex;
    align-items:center;
    gap:12px;

    flex-wrap:wrap;
}

.custom-upload{
    display:inline-flex;
    align-items:center;
    gap:10px;

    background:#ffffff;

    border:1px solid #dbe3ec;

    padding:13px 18px;

    border-radius:16px;

    cursor:pointer;

    font-weight:600;

    color:#334155;

    transition:0.25s;

    width:fit-content;
}

.custom-upload:hover{
    background:#f8fafc;

    border-color:#3b82f6;

    transform:translateY(-1px);
}

.real-file{
    display:none;
}

.file-preview{
    background:#f8fafc;

    border:1px dashed #cbd5e1;

    border-radius:14px;

    padding:12px 14px;

    font-size:14px;

    color:#475569;

    min-width:220px;
    max-width:320px;

    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;

    display:flex;
    align-items:center;
    gap:10px;
}
/* =========================================
   SEND BUTTON
========================================= */
.message-send-btn{
    border:none;

    background:
    linear-gradient(
        135deg,
        #2563eb,
        #1d4ed8
    );

    color:#fff;

    padding:14px 24px;

    border-radius:16px;

    cursor:pointer;

    display:inline-flex;
    align-items:center;
    gap:10px;

    font-weight:700;

    transition:0.25s;
}

.message-send-btn:hover{
    transform:translateY(-2px);

    box-shadow:
    0 10px 25px rgba(37,99,235,0.25);
}

/* =========================================
   TOAST
========================================= */
#toastBox{
    position:fixed;

    top:25px;
    right:25px;

    z-index:99999;

    display:flex;
    flex-direction:column;

    gap:14px;
}

.toast{
    min-width:320px;

    background:#ffffff;

    border-radius:18px;

    padding:16px 18px;

    display:flex;
    align-items:center;
    gap:14px;

    box-shadow:
    0 10px 30px rgba(0,0,0,0.12);

    animation:toastSlide 0.35s ease;

    border-left:5px solid #22c55e;
}

.toast.error{
    border-left-color:#ef4444;
}

.toast.success i{
    color:#22c55e;
}

.toast.error i{
    color:#ef4444;
}

.toast i{
    font-size:20px;
}

.toast-text{
    font-size:14px;
    color:#334155;

    line-height:1.6;
}

@keyframes toastSlide{
    from{
        opacity:0;
        transform:translateX(60px);
    }
    to{
        opacity:1;
        transform:translateX(0);
    }
}

/* =========================================
   SCROLLBAR
========================================= */
.event-list::-webkit-scrollbar,
.discussion-container::-webkit-scrollbar{
    width:8px;
}

.event-list::-webkit-scrollbar-thumb,
.discussion-container::-webkit-scrollbar-thumb{
    background:#cbd5e1;
    border-radius:999px;
}

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

    .discussion-layout{
        grid-template-columns:1fr;
    }

    .discussion-page{
        margin-left:0;
        padding-top:80px;
    }

    .discussion-sidebar{
        height:320px;
    }
}

@media(max-width:700px){

    .message-top,
    .reply-top,
    .message-form-bottom{
        flex-direction:column;
        align-items:flex-start;
    }

    .message-actions{
        flex-direction:column;
        align-items:flex-start;
    }

    .attachment-preview{
        max-width:100%;
    }

    .toast{
        min-width:unset;
        width:90vw;
    }
}