/* Modular CSS slice extracted from zalo-integration.css (1443-1978) */

.zalo-item-avatar-img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-color, #e2e8f0);
}

.zalo-item-avatar-placeholder {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  flex-shrink: 0;
}

.zalo-item-avatar-placeholder.bg-group {
  background: linear-gradient(135deg, #0068ff 0%, #3b82f6 100%);
}

.zalo-item-avatar-placeholder.bg-user {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.zalo-item-avatar-placeholder.avatar-palette-0 {
  background: linear-gradient(135deg, #0068ff 0%, #3b82f6 100%);
}

.zalo-item-avatar-placeholder.avatar-palette-1 {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

.zalo-item-avatar-placeholder.avatar-palette-2 {
  background: linear-gradient(135deg, #059669 0%, #0d9488 100%);
}

.zalo-item-avatar-placeholder.avatar-palette-3 {
  background: linear-gradient(135deg, #ea580c 0%, #f59e0b 100%);
}

.zalo-item-avatar-placeholder.avatar-palette-4 {
  background: linear-gradient(135deg, #e11d48 0%, #db2777 100%);
}

.zalo-item-avatar-placeholder.avatar-palette-5 {
  background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
}

.zalo-item-info {
  min-width: 0;
  flex: 1;
}

.zalo-item-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-main, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zalo-item-sub {
  font-size: 0.74rem;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.zalo-item-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: 0.5rem;
  flex-shrink: 0;
}

.zalo-type-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  white-space: nowrap;
}

.zalo-type-pill.badge-group {
  background: rgba(0, 104, 255, 0.1);
  color: var(--zalo-primary, #0068ff);
  border: 1px solid rgba(0, 104, 255, 0.2);
}

.zalo-type-pill.badge-user {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.zalo-item-check {
  color: var(--zalo-primary, #0068ff);
  font-weight: 800;
  font-size: 0.95rem;
}

.zalo-picker-match {
  background: #fef08a;
  color: #854d0e;
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 800;
}

.zalo-picker-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted, #64748b);
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.zalo-picker-empty .empty-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

/* ====================================================================
   LIVE PREVIEW MESSAGE CARD (EXAM & STUDENT REPORTS)
   ==================================================================== */
.zalo-live-preview-box {
  background: #f0f2f5;
  border-radius: 12px;
  padding: 0.85rem;
  border: 1px solid #e4e6eb;
  margin-top: 0.75rem;
}

.zalo-live-preview-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #65676b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.zalo-bubble-chat {
  background: #ffffff;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-size: 0.84rem;
  line-height: 1.55;
  color: #050505;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  border-left: 3.5px solid var(--zalo-primary, #0068ff);
}

/* ====================================================================
   STUDENT SINGLE ZALO DISPATCH MODAL
   ==================================================================== */
.student-zalo-modal-container {
  max-width: 540px;
}

.student-info-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.student-summary-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.student-summary-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.student-summary-name {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text-main, #0f172a);
}

.student-summary-meta {
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
}

.student-summary-score-badge {
  text-align: right;
}

.student-score-num {
  font-size: 1.25rem;
  font-weight: 900;
  color: #059669;
}

.student-score-max {
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
}

.student-smart-suggest-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ecfdf5;
  border: 1px dashed #6ee7b7;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.85rem;
}

.smart-suggest-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: #065f46;
}

.smart-suggest-btn {
  background: #10b981;
  color: white;
  border: none;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.smart-suggest-btn:hover {
  background: #059669;
}

/* Submissions Table Zalo Button */
.btn-zalo-single-student {
  color: var(--zalo-primary, #0068ff) !important;
  border-color: var(--zalo-primary-border, rgba(0, 104, 255, 0.35)) !important;
  background: var(--zalo-primary-soft, rgba(0, 104, 255, 0.06)) !important;
  font-weight: 700 !important;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-zalo-single-student:hover {
  background: var(--zalo-primary, #0068ff) !important;
  color: #ffffff !important;
  border-color: var(--zalo-primary, #0068ff) !important;
}

/* Exam Zalo Dispatch Modal Styles */
.exam-zalo-mode-card {
  display: block;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.exam-zalo-mode-card:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.exam-zalo-mode-card.active {
  border-color: var(--zalo-primary, #0068ff);
  background: var(--zalo-primary-soft, rgba(0, 104, 255, 0.05));
  box-shadow: 0 0 0 1px var(--zalo-primary, #0068ff);
}

.exam-zalo-student-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  transition: background 0.15s;
  cursor: pointer;
}

.exam-zalo-student-row:hover {
  background: #e2e8f0;
}

.exam-zalo-student-row.selected {
  background: #eff6ff;
}

.exam-zalo-student-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

.exam-zalo-student-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.exam-zalo-student-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exam-zalo-student-score {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.exam-zalo-student-score.score-high {
  background: #dcfce7;
  color: #166534;
}

.exam-zalo-student-score.score-mid {
  background: #fef3c7;
  color: #92400e;
}

.exam-zalo-student-score.score-low {
  background: #fee2e2;
  color: #991b1b;
}

.exam-zalo-student-score.score-pending {
  background: #f1f5f9;
  color: #64748b;
}

@media (max-width: 640px) {
  .exam-zalo-modes-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ====================================================================
   QUICK MOBILE SHARE BAR (SAO CHÉP & MỞ ZALO APP)
   ==================================================================== */
.zalo-mobile-quick-actions {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.zalo-mobile-quick-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 700;
  color: #334155;
}

.zalo-mobile-quick-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.btn-zalo-quick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 40px;
  touch-action: manipulation;
  user-select: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-zalo-quick:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

.btn-zalo-quick:active {
  transform: translateY(0);
}

.btn-zalo-quick .btn-icon {
  font-size: 1rem;
  line-height: 1;
}

.btn-zalo-quick.btn-open-app {
  background: linear-gradient(135deg, #0068ff 0%, #0056d6 100%);
  border-color: #0068ff;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 104, 255, 0.25);
}

.btn-zalo-quick.btn-open-app:hover {
  background: linear-gradient(135deg, #005ce6 0%, #004bbd 100%);
  border-color: #005ce6;
  box-shadow: 0 4px 10px rgba(0, 104, 255, 0.35);
}

.btn-zalo-quick.copied {
  background: #10b981 !important;
  border-color: #10b981 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3) !important;
}

@media (max-width: 480px) {
  .zalo-mobile-quick-btns {
    grid-template-columns: 1fr;
  }
}

/* --- Compact Mode for Small Height Viewports on Desktop (<= 650px) --- */
@media (max-height: 650px) and (min-width: 641px) {
  .zalo-modal-container {
    height: 98vh !important;
    max-height: 98vh !important;
  }

  .zalo-modal-header {
    padding: 0.5rem 1rem !important;
  }

  .zalo-modal-footer {
    padding: 0.5rem 1rem !important;
  }

  .zalo-modal-tabs {
    padding: 0.2rem 1rem 0 1rem !important;
  }

  .zalo-connected-banner {
    padding: 0.45rem 0.75rem !important;
    margin-bottom: 0.65rem !important;
  }

  .zalo-avatar {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.85rem !important;
  }

  .zalo-picker-list-container {
    max-height: 220px !important;
  }
}

/* --- Compact Mode for Mobile Landscape (<= 500px height) --- */
@media (max-height: 500px) and (max-width: 640px) {
  .zalo-modal-header {
    padding: 0.4rem 0.85rem !important;
  }

  .zalo-picker-mobile-header {
    padding: 0.45rem 0.85rem !important;
  }

  .zalo-picker-search-bar {
    padding: 0.4rem 0.85rem !important;
  }

  .zalo-picker-tabs {
    padding: 0.3rem 0.85rem !important;
  }
}

