/* ============================================================
   UMFN Modern Voicemail Styles — v2.0
   Compressed, aligned, accessible, fun ✦
   ============================================================ */

/* ── Wrapper & Section ─────────────────────────────────────── */
.umfn-vb-wrapper {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin: 24px 0 16px;
}

.umfn-vb-section {
  background: #fff;
  border: 1px solid #ebebeb;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}

.umfn-vb-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #f9f9fb 0%, #f3f4f8 100%);
  padding: 13px 18px;
  border-bottom: 1px solid #ebebeb;
}

.umfn-vb-section-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #2d2d3a;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: .01em;
}

.umfn-vb-section-header h3 i {
  color: #7c6fef;
  font-size: 15px;
}

.umfn-vb-section-content {
  padding: 10px 14px 14px;
  max-height: 580px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #ddd transparent;
}

.umfn-vb-section-content::-webkit-scrollbar { width: 5px; }
.umfn-vb-section-content::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 4px;
}

/* ── Empty state ──────────────────────────────────────────── */
.umfn-vb-empty {
  border: 1.5px dashed #e0e0e0;
  border-radius: 10px;
  padding: 22px 18px;
  color: #aaa;
  background: #fafafa;
  text-align: center;
  font-size: 13px;
}

/* ── Table wrapper ────────────────────────────────────────── */
.umfn-vb-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ── Table base ───────────────────────────────────────────── */
.umfn-vb-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 4px;
  table-layout: auto;
}

.umfn-vb-table thead tr {
  background: transparent;
}

.umfn-vb-table th {
  padding: 6px 10px;
  text-align: left;
  font-weight: 700;
  font-size: 10px;
  color: #9a9ab0;
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
  border-bottom: 1px solid #ebebeb;
}

/* ── Voicemail rows ───────────────────────────────────────── */
.umfn-vb-row {
  background: #fafafa;
  border-radius: 10px;
  transition: background .18s, box-shadow .18s;
}

.umfn-vb-row:hover {
  background: #f3f1ff;
  box-shadow: 0 2px 10px rgba(124,111,239,.1);
}

.umfn-vb-table td {
  padding: 8px 10px;
  border: none;
  font-size: 12.5px;
  color: #3a3a4a;
  vertical-align: middle;
  /* row separation via spacing on <tbody> rows */
  border-top: 4px solid transparent;
}

/* First and last td get rounded corners on the row */
.umfn-vb-row td:first-child {
  border-radius: 10px 0 0 10px;
  padding-left: 14px;
}
.umfn-vb-row td:last-child {
  border-radius: 0 10px 10px 0;
  padding-right: 14px;
}

/* ── Column sizing ────────────────────────────────────────── */
/* From/To */
.umfn-vb-table th:nth-child(1),
.umfn-vb-table td:nth-child(1) {
  width: 18%;
  min-width: 90px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

/* Date */
.umfn-vb-table th:nth-child(2),
.umfn-vb-table td:nth-child(2) {
  width: 16%;
  min-width: 85px;
  white-space: nowrap;
  color: #777;
  font-size: 11.5px;
}

/* Reason (advisor only) — squeezes in when present */
.umfn-vb-table th:nth-child(3):not(:last-child),
.umfn-vb-table td:nth-child(3):not(:last-child) {
  width: 16%;
  min-width: 70px;
  font-size: 11px;
  color: #888;
}

/* Audio cell */
.umfn-vb-cell-audio {
  min-width: 180px;
  width: auto;
}

/* Actions cell */
.umfn-vb-cell-actions {
  width: 54px;
  min-width: 54px;
  text-align: center;
}

/* ── Audio card ───────────────────────────────────────────── */
.umfn-vb-audio-card {
  display: flex;
  align-items: center;
  gap: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  border-radius: 0;
}

/* Override compressed card wrapper styles from old CSS */
.umfn-vb-audio-card.umfn-vb-audio-compressed {
  background: transparent !important;
  box-shadow: none !important;
  gap: 0 !important;
  padding: 0 !important;
  min-width: 0 !important;
}

/* The native audio player — styled to be sleek */
.umfn-vb-audio-modern {
  display: block;
  width: 100% !important;
  min-width: 155px !important;
  max-width: 220px !important;
  height: 30px !important;
  accent-color: #7c6fef;
  border-radius: 20px;
  background: transparent;
  box-shadow: none !important;
  /* compact chrome audio height */
  -webkit-appearance: none;
}

/* ── Trash / action buttons ───────────────────────────────── */
.umfn-vb-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.umfn-vb-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 11px;
  background: #7c6fef;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s, transform .12s, box-shadow .18s;
  white-space: nowrap;
  line-height: 1;
  gap: 5px;
}

.umfn-vb-action-btn:hover {
  background: #6355d4;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(124,111,239,.3);
}

/* Trash-only: icon circle */
.umfn-remove-btn,
.umfn-vb-action-btn.umfn-remove-btn,
.umfn-vb-action-btn.umfn-remove-btn.umfn-trash-only {
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  background: #fff !important;
  color: #e53935 !important;
  border: 1.5px solid #ffd0ce !important;
  box-shadow: 0 1px 5px rgba(229,57,53,.10) !important;
  font-size: 13px !important;
  flex-shrink: 0;
}

.umfn-remove-btn:hover,
.umfn-vb-action-btn.umfn-remove-btn:hover,
.umfn-vb-action-btn.umfn-remove-btn.umfn-trash-only:hover {
  background: #e53935 !important;
  color: #fff !important;
  border-color: #e53935 !important;
  box-shadow: 0 3px 10px rgba(229,57,53,.25) !important;
  transform: scale(1.1) !important;
}

/* Callback / call-now button */
.umfn-callback-btn {
  background: #2196f3;
}
.umfn-callback-btn:hover {
  background: #1565c0;
}

/* Unblock button */
.umfn-unblock-btn {
  background: #e8f5e9;
  color: #2e7d32 !important;
  border: 1.5px solid #c8e6c9 !important;
}
.umfn-unblock-btn:hover {
  background: #4caf50 !important;
  color: #fff !important;
  border-color: #4caf50 !important;
}

/* Quick call (grayed when used) */
.umfn-quick-call-btn.is-used,
.umfn-quick-call-btn:disabled {
  background: #b0b0be !important;
  cursor: not-allowed;
  opacity: .85;
  transform: none !important;
  box-shadow: none !important;
}

/* ── Blocked users table ──────────────────────────────────── */
.umfn-vb-blocked-table {
  table-layout: auto;
  min-width: 420px;
}

.umfn-vb-blocked-table th:nth-child(1),
.umfn-vb-blocked-table td:nth-child(1) { width: 46%; }

.umfn-vb-blocked-table th:nth-child(2),
.umfn-vb-blocked-table td:nth-child(2) { width: 32%; }

.umfn-vb-blocked-table th:nth-child(3),
.umfn-vb-blocked-table td:nth-child(3) {
  width: 22%;
  text-align: right;
}

.umfn-vb-blocked-row td:last-child {
  text-align: right;
}

/* ── Modal ────────────────────────────────────────────────── */
.umfn-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.48);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.umfn-modal-content {
  background: #fff;
  border-radius: 12px;
  max-width: 460px;
  width: 92%;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  animation: umfnSlideUp .22s ease;
}

@keyframes umfnSlideUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.umfn-modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid #ebebeb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.umfn-modal-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #2d2d3a;
}

.umfn-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: #aaa;
  line-height: 1;
  padding: 0;
  transition: color .15s;
}
.umfn-modal-close:hover { color: #555; }

.umfn-modal-body { padding: 16px 18px; }
.umfn-modal-body p { margin: 0 0 10px; font-size: 13px; color: #555; }

.umfn-modal-footer {
  padding: 14px 18px;
  border-top: 1px solid #ebebeb;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.umfn-btn-cancel,
.umfn-btn-confirm {
  padding: 8px 18px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: background .15s;
}

.umfn-btn-cancel {
  background: #f2f2f4;
  color: #555;
}
.umfn-btn-cancel:hover { background: #e4e4e8; }

.umfn-btn-confirm {
  background: #7c6fef;
  color: #fff;
}
.umfn-btn-confirm:hover { background: #6355d4; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  .umfn-vb-section-content { padding: 8px 8px 12px; }

  /* Stack each row as a card on mobile */
  .umfn-vb-table,
  .umfn-vb-table thead,
  .umfn-vb-table tbody,
  .umfn-vb-table th,
  .umfn-vb-table td,
  .umfn-vb-table tr { display: block; width: 100%; }

  .umfn-vb-table thead { display: none; }

  .umfn-vb-row {
    margin-bottom: 10px;
    border-radius: 10px;
    border: 1px solid #ebebeb;
    padding: 4px 0;
  }

  .umfn-vb-row td:first-child,
  .umfn-vb-row td:last-child {
    border-radius: 0;
  }

  .umfn-vb-table td {
    padding: 7px 12px;
    border-top: none;
    display: flex;
    align-items: center;
    font-size: 12px;
  }

  .umfn-vb-table td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    color: #9a9ab0;
    letter-spacing: .05em;
    min-width: 72px;
    flex-shrink: 0;
  }

  .umfn-vb-cell-audio,
  .umfn-vb-cell-actions {
    justify-content: flex-start;
  }

  .umfn-vb-audio-modern {
    min-width: 130px !important;
    max-width: 180px !important;
  }

  .umfn-vb-actions {
    justify-content: flex-start;
  }

  .umfn-vb-blocked-table { min-width: 0; }
}