/**
 * Stats Tooltip Styles
 * CSS for statistics section tooltips
 */

.stats-section {
  background: #ffffff;
  padding: 2.143rem 0;
  margin: 0;
  /* Đảm bảo không có padding/margin thừa */
  border: none;
  box-sizing: border-box;
  font-family: "Noto Sans", Arial, Helvetica, Roboto, Lucida Sans Unicode,
    Microsoft Sans Serif, Segoe UI Symbol, STIXGeneral, Cambria Math,
    Arial Unicode MS, sans-serif !important;
}

.stats-section::before,
.stats-section::after {
  display: none !important;
}

.stats-section .containerr {
  /* Kế thừa từ .containerr global - không override padding */
}

.stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  padding: 1.5rem 0;
  border: none;
  border-radius: 0;
  gap: 2rem;
  flex-wrap: wrap;
}

.stat-item {
  flex: 1;
  text-align: left;
  min-width: 140px;
  padding: 0 1rem;
  border-left: 3px solid #5c5cb5;
  padding-left: 1.5rem;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-item:first-of-type {
  border-left: 3px solid #5c5cb5;
  padding-left: 1.5rem;
}

.stat-number {
  font-size: 24px !important;
  font-weight: 600;
  color: #5c5cb5 !important;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-align: left !important;
  font-family: "Noto Sans", Arial, Helvetica, Roboto, Lucida Sans Unicode,
    Microsoft Sans Serif, Segoe UI Symbol, STIXGeneral, Cambria Math,
    Arial Unicode MS, sans-serif !important;
  font-variant-numeric: tabular-nums !important;
  font-feature-settings: "tnum" 1 !important;
}

.stat-number .info-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  background-color: white;
  border: 2px solid #00275d;
  border-radius: 50%;
  color: #00275d;
  text-align: center;
  line-height: 12px;
  font-size: 10px;
  font-weight: bold;
  margin-left: 0.5rem;
  font-style: normal;
  cursor: pointer;
  position: relative;
  font-family: "Noto Sans", Arial, Helvetica, Roboto, Lucida Sans Unicode,
    Microsoft Sans Serif, Segoe UI Symbol, STIXGeneral, Cambria Math,
    Arial Unicode MS, sans-serif !important;
}

.stat-tooltip {
  display: none;
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border: 2px solid #ff6b35;
  border-radius: 4px;
  padding: 16px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  font-size: 14px;
  color: #333;
  z-index: 1000;
  min-width: 280px;
  max-width: 320px;
  white-space: normal;
  line-height: 1.5;
  font-family: "Noto Sans", Arial, Helvetica, Roboto, Lucida Sans Unicode,
    Microsoft Sans Serif, Segoe UI Symbol, STIXGeneral, Cambria Math,
    Arial Unicode MS, sans-serif !important;
  font-weight: normal;
  text-align: left;
}

.stat-tooltip::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-bottom-color: #ff6b35;
}

.stat-tooltip::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: white;
  margin-bottom: -2px;
}

.stat-tooltip.show {
  display: block;
  animation: fadeIn 0.2s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.stat-label {
  font-size: 12px;
  color: #000;
  line-height: 1.4;
  font-weight: 400;
  text-align: left !important;
  font-family: "Noto Sans", Arial, Helvetica, Roboto, Lucida Sans Unicode,
    Microsoft Sans Serif, Segoe UI Symbol, STIXGeneral, Cambria Math,
    Arial Unicode MS, sans-serif !important;
}

/* Force color for all text content in stat-number including N/A */
.stat-number,
.stat-number *,
.stat-number span,
.stat-number::before,
.stat-number::after {
  color: #5c5cb5 !important;
}

.stat-action {
  flex-shrink: 0;
  padding-left: 1.5rem;
  border-left: 3px solid #5c5cb5;
  display: flex;
  align-items: center;
  min-height: 56px;
}

.view-insights-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: transparent;
  color: #333;
  padding: 0.5rem;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: "Noto Sans", Arial, Helvetica, Roboto, Lucida Sans Unicode,
    Microsoft Sans Serif, Segoe UI Symbol, STIXGeneral, Cambria Math,
    Arial Unicode MS, sans-serif !important;
}

.view-insights-btn:hover {
  color: #236b7a;
  transform: translateX(2px);
}

.insights-text {
  transition: all 0.3s ease;
}

.view-insights-btn:hover .insights-text {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.arrow-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #5c5cb5;
  color: white;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(46, 139, 156, 0.2);
}

.view-insights-btn:hover .arrow-icon {
  background: #fff;
  color: #000;
  border: 1px solid #000;
  box-shadow: 0 4px 8px rgba(46, 139, 156, 0.3);
  transform: translateX(3px);
}

@media (max-width: 992px) {
  .stats-row {
    flex-direction: column;
    gap: 2rem;
  }

  .stat-item {
    text-align: center;
    border-left: none;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 0;
    min-width: auto;
    width: 100%;
  }

  .stat-item:last-of-type {
    border-bottom: none;
  }

  .stat-action {
    padding-left: 0;
    width: 100%;
    text-align: center;
  }

  .view-insights-btn {
    width: auto;
    display: inline-flex;
  }
}

@media (max-width: 768px) {
  /* Containerr sẽ tự động responsive theo global CSS */
}

@media (max-width: 576px) {
  .stats-section {
    padding: 1.5rem 0;
  }

  /* Containerr sẽ tự động responsive theo global CSS */

  .stats-row {
    padding: 1.5rem 0;
  }

  .stat-number {
    font-size: 1.75rem;
  }
}

/* Force left alignment for all stat content */
.stats-section .stat-item,
.stats-section .stat-number,
.stats-section .stat-label,
.stats-row .stat-item,
.stats-row .stat-number,
.stats-row .stat-label {
  text-align: left !important;
}

/* Force Noto Sans font for all stats section elements */
.stats-section,
.stats-section *,
.stats-section .stat-item,
.stats-section .stat-number,
.stats-section .stat-label,
.stats-section .view-insights-btn,
.stats-section .stat-tooltip,
.stats-section .info-icon {
  font-family: "Noto Sans", Arial, Helvetica, Roboto, Lucida Sans Unicode,
    Microsoft Sans Serif, Segoe UI Symbol, STIXGeneral, Cambria Math,
    Arial Unicode MS, sans-serif !important;
}

/* Đảm bảo số 0 hiển thị đúng, không phải chữ o */
.stat-number {
  font-variant-numeric: lining-nums tabular-nums !important;
  -webkit-font-feature-settings: "lnum", "tnum" !important;
  font-feature-settings: "lnum", "tnum" !important;
}

/* Fix cho trường hợp data có chữ 'o' thay vì số '0' */
.stat-number:before {
  content: none !important;
}

/* Fallback: Force monospace numbers */
.stat-number {
  font-family: "SF Mono", "Monaco", "Inconsolata", "Roboto Mono",
    "Source Code Pro", monospace, ElsevierSans, Arial, Helvetica, Roboto,
    Lucida Sans Unicode, Microsoft Sans Serif, Segoe UI Symbol, STIXGeneral,
    Cambria Math, Arial Unicode MS, sans-serif !important;
}
