/* Remove underline from all hyperlinks */
a, a:hover, a:focus, a:visited {
  text-decoration: none !important;
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* Student documents report: ~20% smaller type and UI (80% scale) */
.report-page {
  zoom: 0.8;
}

/* ---- Message Centre ---- */

.msg-centre-page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.msg-centre-page-header h1 {
  font-weight: 700 !important;
  margin: 0;
  font-size: 1.6rem;
}
.msg-centre-page-header .fa {
  font-size: 1.5rem;
  color: #0078d4;
}
.msg-centre-breadcrumb {
  font-size: 13px;
  color: #666;
  margin-bottom: 6px;
}
.msg-centre-breadcrumb a {
  color: #0078d4;
}
.msg-centre-breadcrumb .fa-chevron-right {
  font-size: 10px;
  color: #aaa;
  margin: 0 4px;
}

.msg-centre-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.msg-centre-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
  color: #fff;
  flex-wrap: wrap;
  gap: 8px;
}
.msg-centre-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
}
.msg-centre-header .badge {
  background: rgba(255,255,255,.2);
  color: #fff;
  font-weight: 500;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
}
.msg-centre-search {
  position: relative;
}
.msg-centre-search input {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff;
  border-radius: 20px;
  padding: 5px 14px 5px 32px;
  font-size: 13px;
  width: 180px;
  transition: background .2s, width .2s;
}
.msg-centre-search input::placeholder {
  color: rgba(255,255,255,.6);
}
.msg-centre-search input:focus {
  background: rgba(255,255,255,.25);
  outline: none;
  width: 220px;
  box-shadow: none;
}
.msg-centre-search .fa {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,.6);
  font-size: 13px;
}

.msg-centre-body {
  height: 460px;
  overflow-y: auto;
  padding: 16px 20px;
  background: #f7f9fc;
}
.msg-centre-body::-webkit-scrollbar {
  width: 6px;
}
.msg-centre-body::-webkit-scrollbar-thumb {
  background: #c0c6cc;
  border-radius: 3px;
}

.msg-centre-footer {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 14px 20px;
  background: #fff;
  border-top: 1px solid #e8ecef;
}
.msg-centre-footer textarea {
  flex: 1;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  transition: border-color .2s;
  font-family: inherit;
}
.msg-centre-footer textarea:focus {
  border-color: #0078d4;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0,120,212,.12);
}
.msg-centre-footer .btn-send {
  background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.msg-centre-footer .btn-send:hover:not(:disabled) {
  opacity: .9;
  transform: translateY(-1px);
}
.msg-centre-footer .btn-send:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* Message bubbles */
.msg-bubble-wrap {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  align-items: flex-start;
}
.msg-bubble-wrap--self {
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  letter-spacing: .5px;
}
.msg-avatar--other {
  background: #0078d4;
}
.msg-avatar--self {
  background: #107c10;
}

.msg-bubble {
  max-width: 70%;
  padding: 10px 16px;
  border-radius: 12px;
  position: relative;
  word-wrap: break-word;
  line-height: 1.45;
}
.msg-bubble--other {
  background: #fff;
  border: 1px solid #e0e4ea;
  border-top-left-radius: 2px;
  color: #1a1a1a;
}
.msg-bubble--self {
  background: #e8f5e9;
  border: 1px solid #c8e6c9;
  border-top-right-radius: 2px;
  color: #1a1a1a;
}

.msg-sender {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 2px;
}
.msg-bubble--other .msg-sender {
  color: #0078d4;
}
.msg-bubble--self .msg-sender {
  color: #107c10;
}

.msg-text {
  font-size: 14px;
  color: #333;
}

.msg-time {
  font-size: 11px;
  color: #999;
  margin-top: 4px;
  text-align: right;
}

/* Sidebar card (shared by student + admin) */
.msg-info-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
  padding: 20px;
}

/* Student sidebar — structured card with header + body */
.msg-sidebar-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
  overflow: hidden;
}
.msg-sidebar-header {
  background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.msg-sidebar-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 17px;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.35);
}
.msg-sidebar-name {
  font-weight: 600;
  font-size: 15px;
  color: #fff;
}
.msg-sidebar-role {
  font-size: 12px;
  color: rgba(255,255,255,.75);
  margin-top: 2px;
}
.msg-status-dot {
  font-size: 8px;
  color: #4caf50;
  margin-right: 3px;
}
.msg-sidebar-body {
  padding: 16px 20px;
}
.msg-sidebar-section-label {
  font-size: 11px;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 8px;
}
.msg-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: 13.5px;
  color: #444;
}
.msg-sidebar-item .fa {
  color: #0078d4;
  width: 16px;
  text-align: center;
  font-size: 14px;
}
.msg-sidebar-divider {
  height: 1px;
  background: #f0f0f0;
  margin: 12px 0;
}

/* Toggle button group (admin/faculty switch) */
.msg-toggle-group {
  display: flex;
  background: #f0f2f5;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
  margin-bottom: 16px;
}
.msg-toggle-group label {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  transition: all .2s;
  margin: 0;
}
.msg-toggle-group input[type="radio"] {
  display: none;
}
.msg-toggle-group input[type="radio"]:checked + label {
  background: #0078d4;
  color: #fff;
  box-shadow: 0 1px 4px rgba(0,120,212,.25);
}

/* Student list */
.msg-student-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 420px;
  overflow-y: auto;
}
.msg-student-list::-webkit-scrollbar {
  width: 5px;
}
.msg-student-list::-webkit-scrollbar-thumb {
  background: #d0d0d0;
  border-radius: 3px;
}
.msg-student-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
  border-bottom: 1px solid #f5f5f5;
}
.msg-student-item:last-child {
  border-bottom: none;
}
.msg-student-item:hover {
  background: #f0f4ff;
}
.msg-student-item.active {
  background: #e3f0fc;
}
.msg-student-item .msg-student-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #e0e4ea;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
}
.msg-student-item .msg-student-name {
  flex: 1;
  font-size: 14px;
  color: #1a1a1a;
  min-width: 0;
}
.msg-student-item .msg-student-name b {
  font-weight: 600;
}
.msg-student-item .badge-unread {
  background: #0078d4;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
}
.msg-student-item .badge-read {
  font-size: 10px;
  color: #aaa;
}

/* Empty state */
.msg-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #aaa;
  text-align: center;
  padding: 40px 20px;
}
.msg-empty-state .fa {
  font-size: 48px;
  margin-bottom: 16px;
  color: #d0d5dd;
}
.msg-empty-state p {
  font-size: 15px;
  margin: 0;
}

/* Legacy compat — keep for JS that still references these */
.chat-item {
  height: auto;
  overflow-y: visible;
  background: transparent;
}
.chat-reply-container {
  border: none;
  padding: 0;
  margin: 0;
}

/* Responsive */
@media (max-width: 991px) {
  .msg-centre-body {
    height: 360px;
  }
  .msg-bubble {
    max-width: 85%;
  }
  .msg-centre-search input {
    width: 140px;
  }
  .msg-centre-search input:focus {
    width: 160px;
  }
}
@media (max-width: 575px) {
  .msg-centre-header {
    padding: 12px 14px;
  }
  .msg-centre-footer {
    padding: 10px 14px;
  }
  .msg-centre-body {
    padding: 12px 14px;
    height: 300px;
  }
}