/* ========================================================
   MAILTHRONE STUDENT INBOXES - ENTERPRISE PREMIUM UI
   Google Workspace / Material Design 3 Aesthetics
   ======================================================== */

/* --- Inbox Container (3-column layout) --- */
.inbox-container {
    display: flex;
    height: calc(100vh - 210px);
    min-height: 520px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--color-bg-primary);
    box-shadow: 0 4px 16px -2px rgba(15,23,42,0.08);
}

/* --- Column 1: Mailbox List --- */
.mailbox-list-pane {
    width: 220px;
    flex-shrink: 0;
    border-right: 1px solid var(--color-border);
    overflow-y: auto;
    background: #fafbfc;
    display: flex;
    flex-direction: column;
}

.mailbox-item-nav {
    padding: 11px 14px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.12s ease;
    position: relative;
}

.mailbox-item-nav:hover { background: #f0f4ff; }

.mailbox-item-nav.active {
    background: #eff6ff;
    border-left: 3px solid var(--color-accent);
}

.mailbox-item-nav.active .mailbox-item-nav-addr { color: var(--color-accent); }

.mailbox-item-nav-addr {
    font-weight: 600;
    font-size: 11.5px;
    word-break: break-all;
    margin-bottom: 5px;
    color: #1e293b;
    line-height: 1.3;
}

.mailbox-item-nav-meta {
    font-size: 10px;
    color: var(--color-text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
}

/* --- Column 2: Thread List --- */
.thread-list-pane {
    width: 300px;
    flex-shrink: 0;
    border-right: 1px solid var(--color-border);
    overflow-y: auto;
    background: var(--color-bg-primary);
    display: flex;
    flex-direction: column;
}

.thread-item {
    padding: 13px 16px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.12s ease;
    position: relative;
}

.thread-item:hover { background: #f8fafc; }

.thread-item.active {
    background: #eff6ff;
    border-left: 3px solid var(--color-accent);
}

.thread-item.unread {
    background: #fefefe;
}

.thread-item.unread::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: #22c55e;
}

.thread-item.active.unread::before { display: none; }

.thread-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.thread-item-sender {
    font-weight: 600;
    font-size: 12.5px;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
}

.thread-item.unread .thread-item-sender { font-weight: 700; color: #0f172a; }

.thread-item-time {
    font-size: 10.5px;
    color: var(--color-text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

.thread-item-subject {
    font-size: 12.5px;
    font-weight: 500;
    color: #334155;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thread-item.unread .thread-item-subject { font-weight: 700; color: #0f172a; }

.thread-item-snippet {
    font-size: 11.5px;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Column 3: Thread Detail --- */
.thread-detail-pane {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    height: 100%;
    overflow-y: auto;
    background: #fafbfc;
}

.thread-header-bar {
    padding: 14px 22px;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.thread-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 140px);
}

.messages-scroller {
    flex: 1 1 auto;
    min-height: 180px;
    padding: 18px 22px;
    overflow-y: auto;
    background: #fafbfc;
}

/* --- Message Cards --- */
.message-card {
    border-radius: 14px;
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(15,23,42,0.04);
    transition: all 0.15s ease;
}

.message-card:hover {
    box-shadow: 0 4px 16px rgba(15,23,42,0.08);
    border-color: #cbd5e1;
}

.message-card.outbound { border-left: 1px solid #e2e8f0 !important; }
.message-card.inbound  { border-left: 1px solid #e2e8f0 !important; }

.message-card-header {
    padding: 12px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.message-sender { font-weight: 700; font-size: 13.5px; color: #0f172a; }
.message-recipient { font-size: 11.5px; color: #64748b; margin-top: 2px; }

.message-time {
    font-size: 11.5px;
    color: #64748b;
    white-space: nowrap;
}

.message-card-body {
    padding: 18px 20px;
    font-size: 14px;
    line-height: 1.65;
    color: #0f172a;
}

/* --- Reply Composer --- */
.reply-composer {
    flex: 0 0 auto;
    padding: 16px 22px 20px 22px;
    background: #ffffff;
    border-top: 1px solid #cbd5e1;
    box-shadow: 0 -4px 16px rgba(15,23,42,0.06);
    overflow-y: visible;
    margin-top: auto;
}

/* --- Attachments --- */
.attachments-list {
    padding: 10px 16px;
    border-top: 1px solid var(--color-border);
    background: #f8fafc;
}

.attachments-title {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.attachment-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    margin-right: 6px;
    margin-bottom: 6px;
    text-decoration: none;
    color: var(--color-text-primary);
    transition: all 0.12s ease;
}

.attachment-item:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* --- Searchable Student Dropdown --- */
.searchable-select-dropdown {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(15,23,42,0.12);
    z-index: 1000;
    overflow: hidden;
}

.searchable-student-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.1s ease;
    color: var(--color-text-primary);
}

.searchable-student-item:last-child { border-bottom: none; }
.searchable-student-item:hover { background: #f0f4ff; }
.searchable-student-item.active { background: #eff6ff; font-weight: 600; }

/* --- Student Profile Card (banner style) --- */
.student-profile-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(14,165,233,0.08);
}

.profile-card-info { display: flex; flex-direction: column; gap: 4px; }
.profile-card-name { font-size: 16px; font-weight: 700; color: #0f172a; }
.profile-card-meta { font-size: 12.5px; color: #475569; }
.profile-card-stats { display: flex; gap: 12px; }

.profile-stat-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 14px;
    border-radius: 8px;
    background: rgba(255,255,255,0.75);
    border: 1px solid rgba(186,230,253,0.8);
    min-width: 72px;
}

.profile-stat-val { font-size: 19px; font-weight: 700; color: #0f172a; }
.profile-stat-lbl { font-size: 10px; color: #64748b; text-transform: uppercase; font-weight: 600; margin-top: 2px; }
