:root {
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --accent-color: #8b5cf6;
  --accent-secondary: #7c3aed;
  --light-color: #f8fafc;
  --dark-color: #0f172a;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --info-color: #3b82f6;
  --bg-main: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 15px rgba(0, 0, 0, 0.08);
  /* Chrome heights (navbar + tabs + footer + gaps) — dùng cho calc(100vh - ...) */
  --chrome-height: 175px;
}

@media (max-width: 991px) {
  :root {
    /* Khi stack dọc, card không còn dùng chrome height nữa để tránh phồng */
    --chrome-height: 0px;
  }
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-size: 14px;
}

body {
  font-family: "Segoe UI", "Roboto", sans-serif;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.maintenance-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  overflow: hidden;
  place-items: center;
  padding: 24px;
  color: #f5f3ff;
  background: linear-gradient(135deg, #1a0a2e 0%, #2d1b4e 28%, #3d2a5f 52%, #4a3070 76%, #1a0a2e 100%);
  background-size: 400% 400%;
  animation: maintenanceGradient 15s ease-in-out infinite;
}

.maintenance-screen__particles,
.maintenance-screen__stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.maintenance-screen__particles span {
  position: absolute;
  bottom: -10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(192, 132, 252, 0.6);
  animation: maintenanceFloat 20s ease-in-out infinite;
}

.maintenance-screen__particles span:nth-child(1) { left: 8%; animation-delay: 0s; animation-duration: 24s; }
.maintenance-screen__particles span:nth-child(2) { left: 18%; animation-delay: 2s; animation-duration: 20s; }
.maintenance-screen__particles span:nth-child(3) { left: 31%; animation-delay: 4s; animation-duration: 28s; }
.maintenance-screen__particles span:nth-child(4) { left: 44%; animation-delay: 1s; animation-duration: 22s; }
.maintenance-screen__particles span:nth-child(5) { left: 57%; animation-delay: 3s; animation-duration: 26s; }
.maintenance-screen__particles span:nth-child(6) { left: 68%; animation-delay: 5s; animation-duration: 24s; }
.maintenance-screen__particles span:nth-child(7) { left: 79%; animation-delay: 1.5s; animation-duration: 21s; }
.maintenance-screen__particles span:nth-child(8) { left: 90%; animation-delay: 3.5s; animation-duration: 27s; }
.maintenance-screen__particles span:nth-child(9) { left: 14%; animation-delay: 4.5s; animation-duration: 19s; }
.maintenance-screen__particles span:nth-child(10) { left: 39%; animation-delay: 6s; animation-duration: 30s; }
.maintenance-screen__particles span:nth-child(11) { left: 63%; animation-delay: 0.5s; animation-duration: 18s; }
.maintenance-screen__particles span:nth-child(12) { left: 87%; animation-delay: 2.5s; animation-duration: 23s; }

.maintenance-screen__particles span:nth-child(odd) {
  background: rgba(216, 180, 254, 0.5);
}

.maintenance-screen__particles span:nth-child(3n) {
  width: 4px;
  height: 4px;
  background: rgba(167, 139, 250, 0.4);
}

.maintenance-screen__stars span {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff;
  animation: maintenanceTwinkle 3s ease-in-out infinite;
}

.maintenance-screen__stars span:nth-child(1) { top: 12%; left: 14%; animation-delay: 0s; }
.maintenance-screen__stars span:nth-child(2) { top: 20%; left: 84%; animation-delay: 0.5s; }
.maintenance-screen__stars span:nth-child(3) { top: 62%; left: 6%; animation-delay: 1s; }
.maintenance-screen__stars span:nth-child(4) { top: 80%; left: 90%; animation-delay: 1.5s; }
.maintenance-screen__stars span:nth-child(5) { top: 40%; left: 95%; animation-delay: 2s; }
.maintenance-screen__stars span:nth-child(6) { top: 16%; left: 50%; animation-delay: 0.3s; }

.maintenance-screen__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
  animation: maintenanceOrbFloat 10s ease-in-out infinite;
}

.maintenance-screen__orb--one {
  width: 400px;
  height: 400px;
  top: -120px;
  left: -100px;
  background: radial-gradient(circle, #9333ea 0%, transparent 70%);
}

.maintenance-screen__orb--two {
  right: -70px;
  bottom: -80px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, #a855f7 0%, transparent 70%);
  animation-delay: 4s;
}

.maintenance-card {
  position: relative;
  z-index: 1;
  width: min(100%, 600px);
  padding: 48px 40px;
  overflow: hidden;
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(10, 4, 28, 0.35);
  backdrop-filter: blur(20px);
  animation: maintenanceEnter 700ms cubic-bezier(0.23, 1, 0.32, 1) both;
}

.maintenance-card::before {
  position: absolute;
  top: 0;
  right: 8%;
  left: 8%;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(216, 180, 254, 0.75), transparent);
}

.maintenance-card__rings span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 200px;
  border: 2px solid rgba(192, 132, 252, 0.24);
  border-radius: 50%;
  pointer-events: none;
  animation: maintenancePulse 3s ease-out infinite;
}

.maintenance-card__rings span:nth-child(2) { animation-delay: 1s; }
.maintenance-card__rings span:nth-child(3) { animation-delay: 2s; }

.maintenance-illustration {
  position: relative;
  display: grid;
  width: 112px;
  height: 112px;
  margin: 0 auto 24px;
  place-items: center;
  color: #f3e8ff;
  font-size: 52px;
  filter: drop-shadow(0 0 20px rgba(192, 132, 252, 0.65));
  animation: maintenanceFloatIcon 2.8s ease-in-out infinite;
}

.maintenance-illustration__halo {
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(216, 180, 254, 0.35);
  border-radius: 50%;
  box-shadow: inset 0 0 24px rgba(192, 132, 252, 0.2), 0 0 30px rgba(168, 85, 247, 0.2);
}

.maintenance-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 8px 18px;
  color: #e9d5ff;
  font-size: 13px;
  font-weight: 600;
  background: rgba(147, 112, 219, 0.2);
  border: 1px solid rgba(192, 132, 252, 0.4);
  border-radius: 999px;
}

.maintenance-badge i {
  color: #fbbf24;
}

.maintenance-card h1 {
  margin: 0 0 16px;
  color: #fff;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 800;
  line-height: 1.3;
  text-shadow: 0 0 30px rgba(192, 132, 252, 0.5);
}

.maintenance-card p {
  max-width: 490px;
  margin: 0 auto 24px;
  color: #c4b5fd;
  font-size: 15px;
  line-height: 1.7;
}

.maintenance-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: #ddd6fe;
  font-size: 13px;
}

.maintenance-status__dot {
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 14px rgba(74, 222, 128, 0.9);
  animation: maintenanceDot 1.5s ease-in-out infinite;
}

.maintenance-progress {
  width: min(100%, 280px);
  height: 5px;
  margin: 0 auto 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.maintenance-progress span {
  display: block;
  width: 42%;
  height: 100%;
  background: linear-gradient(90deg, #a855f7, #d8b4fe);
  border-radius: inherit;
  animation: maintenanceProgress 2.4s ease-in-out infinite;
}

.maintenance-card small {
  color: #a78bfa;
  font-size: 12px;
}

@keyframes maintenanceGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes maintenanceFloat {
  0%, 100% { transform: translateY(100vh) scale(0); opacity: 0; }
  10%, 90% { transform: translateY(10vh) scale(1); opacity: 1; }
  100% { transform: translateY(-10vh) scale(0); opacity: 0; }
}

@keyframes maintenanceTwinkle {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.5); }
}

@keyframes maintenanceOrbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
}

@keyframes maintenanceEnter {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes maintenancePulse {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

@keyframes maintenanceFloatIcon {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-10px) rotate(4deg); }
}

@keyframes maintenanceDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.75); }
}

@keyframes maintenanceProgress {
  0% { transform: translateX(-150%); }
  100% { transform: translateX(360%); }
}

@media (prefers-reduced-motion: reduce) {
  .maintenance-screen,
  .maintenance-screen__particles span,
  .maintenance-screen__stars span,
  .maintenance-screen__orb,
  .maintenance-card,
  .maintenance-card__rings span,
  .maintenance-illustration,
  .maintenance-status__dot,
  .maintenance-progress span {
    animation: none;
  }
}

@media (max-width: 640px) {
  .maintenance-screen {
    padding: 16px;
  }

  .maintenance-card {
    padding: 34px 22px;
    border-radius: 20px;
  }

  .maintenance-illustration {
    width: 92px;
    height: 92px;
    margin-bottom: 18px;
    font-size: 42px;
  }

  .maintenance-card p {
    font-size: 14px;
  }
}

/* Footer fixed đáy màn hình, chừa khoảng trống cho nội dung */
.page-content {
  flex: 1 0 auto;
  padding-bottom: 48px;
}

.navbar {
  background: var(--bg-main);
  border-radius: 10px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 10px 14px 0;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
}

.navbar-brand {
  font-weight: 600;
  font-size: 16px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.navbar-brand i {
  margin-right: 6px;
  font-size: 18px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--accent-color)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.main-container {
  margin: 0 auto;
  padding: 0 12px;
  overflow: overlay;
}

.card {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-bottom: 8px;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.card-header {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--accent-color)
  );
  color: white;
  font-weight: 600;
  padding: 10px 14px;
  border-bottom: none;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 14px 16px;
}

.form-control,
.form-select {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.1);
  outline: none;
}

.form-control::placeholder {
  color: var(--text-muted);
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--accent-color)
  );
  border: none;
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  width: 100%;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

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

/* Large primary button */
.btn-lg-custom {
  padding: 8px 20px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  width: auto !important;
  white-space: nowrap !important;
  min-width: 150px;
  border-radius: 6px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--accent-color)
  ) !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25) !important;
}

.btn-lg-custom:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4) !important;
}

/* Button CheckLive TikTok */
.btn-checklive {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--accent-color)
  );
  border: none;
  color: white;
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.btn-checklive:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  opacity: 0.95;
  color: white;
}

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

.btn-checklive:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* TikTok Check Results CSS */
/* Chỉ cuộn danh sách kết quả, không để card tăng chiều cao vô hạn. */
#tiktokResultsList {
  max-height: 520px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 6px 2px 2px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

#tiktokResultsList .result-card-item {
  min-width: 0;
}

/* Status badges */
.status-badge {
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  display: inline-block;
}
.status-live {
  background-color: var(--success-color);
  color: #fff;
}
.status-die {
  background-color: var(--danger-color);
  color: #fff;
}
.status-unknown {
  background-color: var(--warning-color);
  color: #fff;
}

/* Result card */
.result-card-item {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
}
.result-account {
  font-family: "Courier New", monospace;
  font-size: 13px;
  color: #333;
  white-space: nowrap;
  overflow-x: auto;
  word-break: break-all;
  margin-top: 8px;
}

/* Summary badges */
.summary-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  margin: 0 4px;
}
.summary-live {
  background-color: var(--success-color);
  color: #fff;
}
.summary-die {
  background-color: var(--danger-color);
  color: #fff;
}
.summary-unknown {
  background-color: var(--warning-color);
  color: #fff;
}

/* Filter buttons */
.filter-btn {
  padding: 4px 12px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid #d0d7de;
  background-color: #ffffff;
  color: #1f2933;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}
.filter-btn:hover {
  background-color: rgba(139, 92, 246, 0.08);
  border-color: var(--accent-color);
  color: var(--accent-color);
}
.filter-btn.active {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--accent-color)
  );
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Copy buttons */
.copy-btn-live {
  background-color: var(--success-color);
  border-color: var(--success-color);
  color: #fff;
}
.copy-btn-live:hover {
  background-color: #059669;
  border-color: #059669;
  color: #fff;
}
.copy-btn-die {
  background-color: var(--danger-color);
  border-color: var(--danger-color);
  color: #fff;
}
.copy-btn-die:hover {
  background-color: #dc2626;
  border-color: #dc2626;
  color: #fff;
}
.copy-btn-unknown {
  background-color: var(--warning-color);
  border-color: var(--warning-color);
  color: #fff;
}
.copy-btn-unknown:hover {
  background-color: #d97706;
  border-color: #d97706;
  color: #fff;
}

/* Proxy section */
.proxy-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e0e0e0;
}

/* Button outline-light */
.btn-outline-light {
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
  color: #fff !important;
  background-color: rgba(255, 255, 255, 0.2) !important;
  font-weight: 600 !important;
  padding: 6px 12px !important;
  transition: all 0.3s ease !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2) !important;
  font-size: 13px !important;
}
.btn-outline-light * {
  color: #fff !important;
}
.btn-outline-light:hover {
  background-color: rgba(255, 255, 255, 0.4) !important;
  border-color: rgba(255, 255, 255, 1) !important;
  color: #1e293b !important;
  transform: translateY(-1px) !important;
}
.btn-outline-light:hover * {
  color: #1e293b !important;
}

/* Fix hotline/email không bị nhảy 2 dòng */
.navbar-contact {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 350px;
}
.navbar-contact > div {
  flex: 1 1 0;
  min-width: 0;
}
.navbar-contact .leading-tight {
  line-height: 1.2;
}
.navbar-contact .leading-tight p {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0;
  font-size: 13px;
}

/* Navbar buttons - API Docs & Language Switcher */
.navbar .navbar-btn-api,
.navbar .lang-btn {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--accent-color)
  );
  border: none;
  color: #ffffff;
  font-weight: 600;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.navbar .navbar-btn-api:hover,
.navbar .lang-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  opacity: 0.95;
}
.navbar .navbar-btn-api i,
.navbar .lang-btn i {
  color: #ffffff;
  font-size: 13px;
}
.navbar .navbar-btn-api:hover i,
.navbar .lang-btn:hover i {
  color: #ffffff;
}

/* Navbar dropdown */
.navbar .nav-dropdown {
  position: relative;
}
.navbar .nav-dropdown .dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  min-width: 130px;
  padding: 6px;
  z-index: 200;
}
.navbar .nav-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-primary);
  text-decoration: none;
  transition: background 0.15s;
}
.navbar .nav-dropdown .dropdown-item:hover {
  background-color: rgba(139, 92, 246, 0.08);
  color: var(--accent-color);
}
.navbar .nav-dropdown .dropdown-item.active {
  background-color: rgba(139, 92, 246, 0.12);
  color: var(--accent-color);
  font-weight: 600;
}

/* Tabs chuyển tính năng - Mobile Responsive */
.feature-tabs-container {
  margin: 8px 12px 6px;
  display: flex;
  justify-content: center;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.feature-tabs-container::-webkit-scrollbar {
  display: none;
}
.feature-tabs {
  display: inline-flex;
  background: var(--bg-tertiary);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  white-space: nowrap;
  min-width: max-content;
  position: relative;
  z-index: 1;
}
.feature-tab {
  border: none;
  background: transparent;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.feature-tab:hover {
  background: rgba(139, 92, 246, 0.08);
  color: var(--accent-color);
}
.feature-tab.active {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--accent-color)
  );
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Tabs - small screens */
@media (max-width: 768px) {
  .feature-tabs-container {
    margin: 6px 8px 4px;
    justify-content: flex-start;
  }
  .feature-tabs {
    padding: 3px;
    gap: 3px;
    border-radius: 8px;
  }
  .feature-tab {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: 6px;
  }
}

@media (max-width: 480px) {
  .feature-tabs-container {
    margin: 4px 6px 4px;
  }
  .feature-tab {
    padding: 5px 8px;
    font-size: 11.5px;
  }
}

/* Card header realtime style */
.card-header-realtime {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--accent-color)
  );
  color: white;
  padding: 12px 16px;
  border-bottom: none;
}

/* Realtime indicator dot - blinking red */
.realtime-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #f44336;
  border-radius: 50%;
  margin-left: 5px;
  vertical-align: middle;
  animation: blinkDot 1.5s infinite;
}

/* "LIVE" badge next to tab */
.realtime-badge {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background-color: #f44336;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 5px;
  text-transform: uppercase;
}

.feature-panel {
  transition: opacity 0.25s ease;
  opacity: 0;
  display: none;
}
.feature-panel.active {
  opacity: 1;
  display: block;
}

.count-inline {
  flex-shrink: 0;
  flex: 0 0 auto;
}

.count-badge {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--accent-color)
  );
  color: white;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 50px;
  font-size: 13px;
  white-space: nowrap;
  display: inline-block;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.25);
}

.mode-selector {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.mode-option {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mode-option input[type="radio"] {
  display: none;
}

.mode-option label {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 13px;
}

.mode-option input[type="radio"]:checked + label {
  border-color: var(--accent-color);
  background-color: rgba(139, 92, 246, 0.08);
  box-shadow: 0 0 0 2px var(--accent-color);
}

.mode-option label i {
  font-size: 14px;
  margin-right: 5px;
  color: var(--primary-color);
}

.mode-option label:hover {
  background-color: rgba(139, 92, 246, 0.04);
}

@media (max-width: 767.98px) {
  .mode-selector {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  .mode-option {
    flex: 0 0 100%;
    max-width: 100%;
  }
  .mode-option label {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  .count-inline {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    min-width: 0;
    margin-top: 0;
  }
}

.result-container {
  display: none;
  margin-bottom: 55px;
}

.account-result {
  margin-bottom: 8px;
  overflow: hidden;
  min-height: 45px;
}

.account-header {
  cursor: pointer;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.account-toggle-btn {
  cursor: pointer;
  transition: transform 0.3s ease;
}

.account-content {
  padding: 10px 12px;
  display: block;
  height: auto;
  overflow: hidden;
  transition: height 0.5s ease-out;
}

.account-toggle-btn.rotate {
  transform: rotate(180deg);
}

.account-content.open {
  display: block;
  height: auto;
}
.account-email {
  font-weight: 600;
  color: var(--accent-color);
  font-size: 15px;
}

.message-count-badge {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--success-color);
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 50px;
  font-weight: 600;
}

.account-status {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 50px;
}

/* Status badges */
.status-badge {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  display: inline-block;
}

/* Result card */
.result-card-item {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.result-account {
  font-family: "Courier New", monospace;
  font-size: 13px;
  color: #333;
  white-space: nowrap;
  overflow-x: auto;
  word-break: break-all;
  margin-top: 6px;
}

/* Summary badges */
.summary-badge {
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  margin: 0 4px;
}

/* Filter buttons */
.filter-btn {
  padding: 4px 12px;
  font-size: 12px;
  border-radius: 4px;
  border: 1px solid #d0d7de;
  background-color: #ffffff;
  color: #1f2933;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}
.filter-btn:hover {
  background-color: rgba(139, 92, 246, 0.08);
  border-color: var(--accent-color);
  color: var(--accent-color);
}
.filter-btn.active {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--accent-color)
  );
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.status-success {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--success-color);
}

.status-error {
  background-color: rgba(239, 68, 68, 0.15);
  color: var(--danger-color);
}

.message-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.message-table thead th {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 600;
  padding: 8px 10px;
  border-bottom: 2px solid var(--border-color);
  font-size: 13px;
}

.message-table tbody tr:hover {
  background-color: var(--bg-secondary);
}

.message-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  font-size: 13px;
}

.message-subject {
  font-weight: 500;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  white-space: normal;
  line-height: 1.4;
  font-size: 13px;
}

.message-date {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.code-container {
  display: flex;
  align-items: center;
}

.code-text {
  font-family: "Courier New", monospace;
  background-color: var(--bg-secondary);
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--accent-color);
  font-weight: 600;
  font-size: 13px;
}

.copy-btn {
  background: none;
  border: none;
  color: var(--accent-color);
  font-size: 14px;
  margin-left: 5px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.copy-btn:hover {
  color: var(--primary-color);
}

.empty-state {
  text-align: center;
  padding: 24px;
  color: var(--text-secondary);
  font-size: 14px;
}

.empty-state i {
  font-size: 32px;
  color: var(--border-color);
  margin-bottom: 12px;
}

.footer {
  background-color: var(--bg-main);
  color: var(--text-secondary);
  padding: 14px 0;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  border-top: 1px solid var(--border-color);
  font-size: 14px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 20px;
  font-size: 14px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent-color);
}

/* Responsive adjustments */
/* Responsive adjustments - Mobile */
@media (max-width: 768px) {
  .maintenance-banner {
    align-items: flex-start;
    margin: 8px 8px 0;
    padding: 10px;
  }

  .maintenance-banner__content {
    display: block;
  }

  .maintenance-banner__content strong,
  .maintenance-banner__content span {
    display: block;
  }

  .logo-container {
    width: 100%;
  }

  .mode-option label {
    padding: 8px 16px;
    font-size: 14px;
  }

  .mode-option label i {
    font-size: 24px;
  }

  /* Main container - full width on mobile, no footer gap */
  .main-container {
    padding: 0 12px;
    margin-bottom: 0;
  }

  /* Ẩn footer trên mobile */
  .footer {
    display: none;
  }

  /* page-content không cần padding bottom cho footer */
  .page-content {
    padding-bottom: 16px;
  }

  /* Card body padding on mobile */
  .card-body {
    padding: 14px;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 14px;
  }

  .footer-links {
    flex-direction: column;
    gap: 8px;
  }

  .message-table {
    font-size: 14px;
    display: block;
    overflow-x: auto;
  }

  /* Form controls on mobile */
  .form-control,
  .form-select {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  /* Navbar container mobile */
  .navbar .container-fluid {
    padding-left: 0;
    padding-right: 0;
  }

  /* Mode selector mobile */
  .mode-selector {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .mode-selector::-webkit-scrollbar {
    display: none;
  }
  .mode-option {
    flex: 0 0 auto;
  }
  .mode-option label {
    width: auto;
    justify-content: center;
    font-size: 13px;
    padding: 8px 12px;
  }
  .mode-option label i {
    font-size: 18px;
  }

  /* Button on mobile */
  .btn-lg-custom {
    width: 100% !important;
  }

  /* Email fake badge - keep visible */
  #emailfakeBadge {
    display: inline-block !important;
  }

  /* Meta row on modal - stack on mobile */
  .emailfake-meta-row {
    flex-direction: column;
    gap: 12px;
  }
}

/* Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Hiệu ứng vòng tròn phóng to */
@keyframes pulseIcon {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.pulse-icon {
  position: relative;
}

.pulse-icon::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 2px solid rgb(0, 149, 255);
  border-radius: 50%;
  animation: pulseIcon 1.5s infinite;
}

/* View more button */
.view-more-btn {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 600;
  padding: 6px 12px;
  border: none;
  background: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 13px;
}

.view-more-btn:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* Email content modal */
.email-content {
  max-width: 100%;
  overflow-x: auto;
  word-wrap: break-word;
  font-size: 14px;
  line-height: 1.6;
}

.email-content--html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

.email-content--html img {
  max-width: 100%;
  height: auto;
}

.email-content--html a {
  color: var(--info-color, #2196f3);
  text-decoration: underline;
}

.email-content--html p,
.email-content--html div {
  margin-bottom: 0.5em;
}

.email-content--html table {
  border-collapse: collapse;
  width: 100%;
}

.email-content--html td,
.email-content--html th {
  border: 1px solid #ddd;
  padding: 4px 8px;
}

.email-content--text {
  white-space: pre-wrap;
  font-size: 14px;
}

/* === Email Fake Modal Styles === */
#emailfakeModal .modal-dialog {
  margin: 0;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 576px) {
  #emailfakeModal .modal-dialog {
    margin: 20px auto;
    max-width: 680px;
    min-height: auto;
    display: block;
  }
}

#emailfakeModal .modal-content {
  border-radius: 12px;
  border: none;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

@media (max-width: 575.98px) {
  #emailfakeModal {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  #emailfakeModal .modal-dialog {
    padding-left: 8px;
    padding-right: 8px;
  }
  #emailfakeModal .modal-content {
    border-radius: 10px;
  }
}

#emailfakeModal .modal-header {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--accent-color)
  );
  color: white;
  padding: 14px 18px;
  border-bottom: none;
}

#emailfakeModal .modal-header .modal-title {
  font-size: 15px;
  font-weight: 600;
  color: white;
}

#emailfakeModal .modal-header .btn-close {
  filter: invert(1);
  opacity: 0.7;
}

#emailfakeModal .modal-body {
  padding: 0;
  max-height: 78vh;
  overflow-y: auto;
  overflow-x: hidden;
}

#emailfakeModal .modal-footer {
  border-top: 1px solid #f0f0f0;
  padding: 12px 18px;
}

/* Email fake modal sections */
.emailfake-modal-header {
  padding: 14px 18px 0;
}

.emailfake-meta-row {
  display: flex;
  gap: 24px;
  margin-bottom: 10px;
}

.emailfake-meta-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.emailfake-meta-icon {
  color: var(--accent-color);
  font-size: 14px;
  margin-top: 3px;
  flex-shrink: 0;
}

.emailfake-meta-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 2px;
}

.emailfake-meta-value {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
  word-break: break-all;
}

.emailfake-subject-row {
  font-size: 14px;
  color: var(--text-primary);
  padding: 8px 10px;
  background: var(--bg-secondary);
  border-radius: 6px;
  border-left: 3px solid var(--accent-color);
}

.emailfake-modal-code {
  margin: 14px 18px;
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  border: 1px solid #6ee7b7;
  border-radius: 10px;
  padding: 14px 18px;
}

.emailfake-otp {
  font-size: 28px;
  font-weight: 800;
  color: #065f46;
  letter-spacing: 0.12em;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
}

.emailfake-modal-divider {
  height: 1px;
  background: #f0f0f0;
  margin: 0 18px;
}

.emailfake-modal-body {
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
  white-space: normal;
  word-break: break-word;
}

/* Email HTML Body */
.emailfake-html-wrapper {
  padding: 14px 18px;
  text-align: center;
  overflow-x: auto;
  width: 100%;
  box-sizing: border-box;
}

.emailfake-html-body {
  display: inline-block;
  width: auto;
  max-width: 100%;
  min-width: 0;
  text-align: left;
  word-wrap: break-word;
  overflow-x: auto;
  box-sizing: border-box;
  padding: 14px;
}

.emailfake-html-body table {
  border-collapse: collapse;
  margin: 0 auto !important;
  text-align: left !important;
}

.emailfake-html-body img {
  max-width: 100% !important;
  height: auto;
}

.emailfake-html-body td,
.emailfake-html-body th {
  word-wrap: break-word;
  overflow-wrap: break-word;
  text-align: left !important;
  border-color: var(--border-color);
}

/* ============================================================
   Custom Toast Notifications (top-right corner)
============================================================ */
#toastContainer {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 340px;
  width: calc(100vw - 24px);
}

.custom-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-left: 3px solid #fff;
  pointer-events: all;
  animation: toastSlideIn 0.3s ease forwards;
  opacity: 0;
  transform: translateX(110%);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(110%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(110%);
  }
}

.custom-toast .toast-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
}

.custom-toast .toast-content {
  flex: 1;
  min-width: 0;
}

.custom-toast .toast-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 3px;
}

.custom-toast .toast-body {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-toast .toast-code {
  display: inline-block;
  margin-top: 5px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-family: "Courier New", monospace;
  font-size: 18px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 6px;
  letter-spacing: 0.1em;
}

.custom-toast .toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 2px;
  font-size: 13px;
  transition: color 0.2s;
  pointer-events: all;
}

.custom-toast .toast-close:hover {
  color: #fff;
}

@media (max-width: 576px) {
  #toastContainer {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
    width: auto;
  }
  .custom-toast .toast-body {
    white-space: normal;
  }
}

/* ============================================================
   Animations
============================================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes blinkDot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.3;
    transform: scale(0.7);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Hiệu ứng vòng tròn phóng to */
@keyframes pulseIcon {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

.pulse-icon {
  position: relative;
}

.pulse-icon::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 2px solid rgb(0, 149, 255);
  border-radius: 50%;
  animation: pulseIcon 1.5s infinite;
}

/* Responsive adjustments - Mobile */
@media (max-width: 768px) {
  .main-container {
    padding: 0 8px;
    margin-bottom: 0;
  }

  .footer {
    display: none;
  }

  .page-content {
    padding-bottom: 12px;
  }

  .card-body {
    padding: 12px;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }

  .footer-links {
    flex-direction: column;
    gap: 5px;
  }

  .message-table {
    font-size: 12px;
    display: block;
    overflow-x: auto;
  }

  .form-control,
  .form-select {
    font-size: 14px;
  }

  .mode-selector {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .mode-selector::-webkit-scrollbar {
    display: none;
  }
  .mode-option {
    flex: 0 0 auto;
  }
  .mode-option label {
    width: auto;
    justify-content: center;
    font-size: 12px;
    padding: 5px 8px;
  }

  .btn-lg-custom {
    width: 100% !important;
  }

  .emailfake-meta-row {
    flex-direction: column;
    gap: 8px;
  }
}

/* Copy buttons */
.copy-btn-live {
  background-color: var(--success-color);
  border-color: var(--success-color);
  color: #fff;
}
.copy-btn-live:hover {
  background-color: #059669;
  border-color: #059669;
  color: #fff;
}
.copy-btn-die {
  background-color: var(--danger-color);
  border-color: var(--danger-color);
  color: #fff;
}
.copy-btn-die:hover {
  background-color: #dc2626;
  border-color: #dc2626;
  color: #fff;
}
.copy-btn-unknown {
  background-color: var(--warning-color);
  border-color: var(--warning-color);
  color: #fff;
}
.copy-btn-unknown:hover {
  background-color: #d97706;
  border-color: #d97706;
  color: #fff;
}

/* ============================================================
   TempMail Tab Styles - Compact Layout
============================================================ */
#tab-tempmail .card-body {
  padding: 12px 14px;
}

#tab-tempmail .card-text {
  font-size: 13px;
  margin-bottom: 8px !important;
}

#tab-tempmail .form-label {
  font-size: 13px;
  margin-bottom: 5px;
}

#tab-tempmail .form-control,
#tab-tempmail .form-select {
  padding: 6px 10px;
  font-size: 13px;
}

#tab-tempmail .btn {
  padding: 6px 12px;
  font-size: 13px;
}

#tab-tempmail .list-group-item {
  background: var(--bg-main);
  border: none;
  border-bottom: 1px solid var(--border-color);
  padding: 10px 14px;
  transition: background-color 0.2s ease;
}

#tab-tempmail .list-group-item:hover {
  background: var(--bg-secondary);
}

#tab-tempmail .list-group-item:last-child {
  border-bottom: none;
}

#tab-tempmail .realtime-dot {
  background-color: var(--success-color);
}

#tab-tempmail .empty-state {
  padding: 24px;
  font-size: 13px;
}

#tab-tempmail .empty-state i {
  font-size: 32px;
  margin-bottom: 8px;
}

/* ============================================================
   TempMail Inbox Card - Gmail-style split layout
   (Chỉ áp dụng cho card "Hộp thư", không đổi form Tạo Email)
============================================================ */

/* Hai card trong tab TempMail luôn chiếm hết height khả dụng của viewport
   dù parent flex chain có hoạt động đúng hay không.
   Công thức: 100vh - (navbar + tabs + footer + gaps) */
#tab-tempmail.feature-panel.active {
  display: flex;
  flex-direction: column;
}

#tab-tempmail .row.g-2 {
  display: flex;
  flex-wrap: wrap;
  flex: 1 1 auto;
  min-height: 0;
}

#tab-tempmail .row.g-2 > [class*="col-"] {
  display: flex;
  align-items: stretch;
}

#tab-tempmail .row.g-2 > [class*="col-"] > .card {
  width: 100%;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: calc(100vh - var(--chrome-height));
}

#tab-tempmail .card-body.p-0 {
  padding: 0 !important;
}

/* Card Hộp thư: flex column để fill chiều cao bằng card Tạo Email */
.tempmail-inbox-card {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.tempmail-inbox-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

/* Header gọn 1 dòng, đồng bộ với card-header của card Tạo Email.
   .card-header cha có nền gradient xanh → icon phải màu trắng, KHÔNG phải primary color */
.tempmail-inbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  flex-shrink: 0;
  /* Cố định chiều cao bằng đúng card-header của card Tạo Email (~42px) */
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  box-sizing: border-box;
}

.tempmail-inbox-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
  overflow: visible;
  color: #ffffff;
}

.tempmail-inbox-title h6 {
  display: block !important;
  flex: 0 0 auto;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  margin: 0;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative;
  z-index: 2;
}

.tempmail-inbox-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.tempmail-inbox-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #ffffff;
}

.tempmail-inbox-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Badge "Tự động cập nhật" - nhỏ gọn + dot nhấp nháy rõ ràng */
.tempmail-inbox-title .badge {
  flex: 0 1 auto;
  min-width: max-content;
  font-size: 10.5px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.95) !important;
  color: #047857 !important;
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  visibility: visible;
  opacity: 1;
  position: relative;
  z-index: 2;
}

.tempmail-inbox-title .badge .realtime-dot-small {
  position: relative;
  z-index: 0;
}

.realtime-dot-small {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  display: inline-block;
  position: relative;
  animation: tempmail-pulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
  z-index: 0;
  overflow: hidden;
}

.realtime-dot-small::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #10b981;
  animation: tempmail-pulse-ring 1.4s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes tempmail-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.85); }
}

@keyframes tempmail-pulse-ring {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.4); opacity: 0; }
}

.bg-success-subtle {
  background-color: #d1fae5;
}

/* Button refresh - nền trắng trong suốt để không lẫn với gradient header */
.tempmail-refresh-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--primary-color);
  border-radius: 7px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.tempmail-refresh-btn:hover {
  background-color: #ffffff;
  border-color: #ffffff;
  color: var(--primary-hover);
  transform: scale(1.05);
}

.tempmail-refresh-btn.spinning i {
  animation: tempmail-spin 1s linear infinite;
}

@keyframes tempmail-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Group các action nằm bên phải header */
.tempmail-inbox-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Nút Demo - nền trắng trong suốt, có text để dễ thấy */
.tempmail-demo-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 9px;
  height: 28px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.95);
  color: var(--primary-color);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tempmail-demo-btn i {
  font-size: 11px;
}

.tempmail-demo-btn:hover {
  background-color: #ffffff;
  border-color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.tempmail-demo-btn.active {
  background-color: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
}

/* Search nằm trong cột danh sách bên trái, không chiếm phần preview */
.tempmail-search-row {
  width: 100%;
  flex: 0 0 auto;
  box-sizing: border-box;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
}

.tempmail-search-row .input-group {
  display: flex;
  width: 100%;
}

.tempmail-search-row .input-group .form-control {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

#tempmail-search {
  font-size: 13px;
}

/* Split container: chiếm phần height còn lại */
.tempmail-inbox-split {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

/* Left: message list (30%) */
.tempmail-list-section {
  width: 32%;
  min-width: 240px;
  max-width: 340px;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tempmail-list-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
}

.tempmail-list-empty i {
  font-size: 32px;
  color: var(--border-color);
  margin-bottom: 6px;
}

.tempmail-empty-illustration {
  position: relative;
  width: 92px;
  height: 86px;
  color: var(--primary-color);
  margin-bottom: 6px;
}

.tempmail-empty-spinner {
  width: 92px;
  height: 86px;
  display: block;
  opacity: 0.18;
  animation: tempmail-empty-spin 3s linear infinite;
}

.tempmail-empty-envelope {
  position: absolute;
  top: 16px;
  left: 24px;
  width: 48px;
  height: 48px;
  color: #bfdbfe;
}

@keyframes tempmail-empty-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.tempmail-list {
  flex: 1;
  overflow-y: auto;
}

.tempmail-list-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background-color 0.15s ease;
  position: relative;
}

.tempmail-list-item:hover {
  background: var(--bg-secondary);
}

.tempmail-list-item.active {
  background: #eff6ff;
  border-left: 3px solid var(--primary-color);
  padding-left: 11px;
}

.tempmail-list-item.unread .tempmail-item-from,
.tempmail-list-item.unread .tempmail-item-subject {
  font-weight: 700;
}

.tempmail-item-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.tempmail-item-content {
  flex: 1;
  min-width: 0;
}

.tempmail-item-top-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
}

.tempmail-item-from {
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 65%;
}

.tempmail-item-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.tempmail-item-subject {
  font-size: 12.5px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tempmail-item-preview {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tempmail-item-unread-dot {
  position: absolute;
  left: 4px;
  top: 16px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-color);
}

.tempmail-item-attachment {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Right: preview (70%) */
.tempmail-preview-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.tempmail-preview-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-align: center;
}

.tempmail-preview-empty i {
  font-size: 48px;
  color: var(--border-color);
}

.tempmail-preview-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.tempmail-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 20px 8px;
  flex-shrink: 0;
}

.tempmail-preview-subject {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
  margin: 0;
}

.tempmail-preview-actions {
  flex-shrink: 0;
  white-space: nowrap;
}

.tempmail-preview-meta {
  padding: 0 20px 12px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.tempmail-preview-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.tempmail-preview-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
  word-break: break-word;
}

.tempmail-preview-body img {
  max-width: 100%;
  height: auto;
}

.tempmail-preview-attachments {
  border-top: 1px solid var(--border-color);
  padding: 10px 20px;
  flex-shrink: 0;
  font-size: 13px;
  background: var(--bg-secondary);
}

.tempmail-attachment-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-primary);
}

.tempmail-attachment-chip i {
  color: var(--accent-color);
}

.tempmail-inbox-footer {
  padding: 8px 16px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  background: var(--bg-secondary);
  flex-shrink: 0;
}

/* Responsive: stack on small screens */
@media (max-width: 1199px) {
  #tab-tempmail.feature-panel.active {
    display: block;
  }
  #tab-tempmail .row.g-2 {
    display: block;
    gap: 12px;
  }
  #tab-tempmail .row.g-2 > [class*="col-"] {
    display: block;
    flex: 0 0 auto;
    max-width: 100%;
  }
  #tab-tempmail .row.g-2 > [class*="col-"] > .card {
    display: block;
    min-height: 0;
    height: auto;
  }
  .tempmail-inbox-card {
    min-height: 0;
    height: auto;
  }
  .tempmail-inbox-split {
    flex-direction: column;
    flex: 0 0 auto;
  }
  .tempmail-list-section {
    width: 100%;
    max-width: none;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    max-height: 260px;
    flex: 0 0 auto;
  }
  .tempmail-preview-section {
    min-height: 420px;
    flex: 0 0 auto;
  }
}

@media (max-width: 768px) {
  #tab-tempmail .card-body {
    padding: 10px 12px;
  }
  #tab-tempmail .card-text {
    font-size: 12.5px;
    line-height: 1.5;
  }
  #tab-tempmail .form-label {
    font-size: 12.5px;
    margin-bottom: 4px;
  }
  #tab-tempmail .form-control,
  #tab-tempmail .form-select {
    padding: 7px 10px;
    font-size: 13px;
  }
  #tab-tempmail .btn {
    padding: 7px 12px;
    font-size: 13px;
  }
  .tempmail-inbox-header {
    height: auto;
    min-height: 42px;
    max-height: none;
    padding: 8px 12px;
    flex-wrap: nowrap;
    row-gap: 0;
  }
  .tempmail-inbox-title h6 {
    font-size: 13px;
  }
  .tempmail-inbox-title .badge {
    font-size: 10px;
    padding: 3px 7px;
  }
  .tempmail-list-section {
    max-height: 220px;
  }
  .tempmail-preview-section {
    min-height: 320px;
  }
  .tempmail-preview-header {
    padding: 10px 14px 6px;
  }
  .tempmail-preview-meta {
    padding: 0 14px 10px;
  }
  .tempmail-preview-body {
    padding: 12px 14px;
    font-size: 13px;
  }
  .tempmail-preview-attachments {
    padding: 8px 14px;
  }
  .tempmail-inbox-footer {
    padding: 6px 12px;
  }
  .tempmail-search-row {
    padding: 6px 12px;
  }
}

@media (max-width: 480px) {
  #tab-tempmail .row.g-2 {
    gap: 8px;
  }
  #tab-tempmail .card-body {
    padding: 8px 10px;
  }
  #tab-tempmail .btn {
    padding: 6px 10px;
    font-size: 12.5px;
  }
  .tempmail-inbox-header {
    padding: 6px 10px;
    gap: 6px;
  }
  .tempmail-inbox-icon {
    width: 16px;
    height: 16px;
  }
  .tempmail-inbox-title h6 {
    font-size: 12.5px;
  }
  .tempmail-inbox-title .badge {
    font-size: 9.5px;
    padding: 2px 6px;
  }
  .realtime-dot-small {
    width: 6px;
    height: 6px;
  }
  .tempmail-refresh-btn {
    width: 28px;
    height: 28px;
  }
  .tempmail-search-row {
    padding: 6px 10px;
  }
  #tempmail-search {
    font-size: 12px;
  }
  .tempmail-list-item {
    padding: 8px 10px;
    gap: 8px;
  }
  .tempmail-item-avatar {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }
  .tempmail-item-from {
    font-size: 12px;
    max-width: 60%;
  }
  .tempmail-item-time {
    font-size: 10.5px;
  }
  .tempmail-item-subject {
    font-size: 12.5px;
  }
  .tempmail-item-preview {
    font-size: 11.5px;
  }
  .tempmail-list-empty,
  .tempmail-preview-empty {
    padding: 14px 10px;
  }
  .tempmail-list-empty i,
  .tempmail-preview-empty i {
    font-size: 36px;
  }
  .tempmail-preview-header {
    padding: 8px 12px 4px;
  }
  .tempmail-preview-subject {
    font-size: 14px;
  }
  .tempmail-preview-meta {
    padding: 0 12px 8px;
  }
  .tempmail-preview-avatar {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }
  .tempmail-preview-body {
    padding: 10px 12px;
    font-size: 12.5px;
    line-height: 1.6;
  }
  .tempmail-preview-attachments {
    padding: 6px 12px;
    font-size: 12px;
  }
  .tempmail-attachment-chip {
    padding: 5px 8px;
    font-size: 11.5px;
    gap: 4px;
  }
  .tempmail-inbox-footer {
    padding: 6px 10px;
    font-size: 11.5px;
  }
}

/* ============================================================
   Realtime notice (keep for initial connect feedback)
============================================================ */
#btnTiktokFile {
  font-size: 13px;
}

.tempmail-html-frame {
  height: 100%;
  width: 100%;
}