/* ===== Map container ===== */
#uzb-map {
  width: 100%;
  height: 560px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

#uzb-map svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* SVG region paths */
#uzb-map svg path.region-path {
  fill: var(--region-fill, #7fc97f);
  transition: fill 0.18s ease, opacity 0.12s ease;
  cursor: pointer;
  stroke: #ffffff;
  stroke-width: 1.6px;
  stroke-linejoin: round;
  stroke-linecap: round;
  paint-order: stroke fill markers;
  vector-effect: non-scaling-stroke;
}

#uzb-map svg path.region-path:hover {
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.12));
  stroke-width: 2.2px;
}

#uzb-map svg path.region-active {
  fill: var(--region-active-fill, #2e7d32) !important;
  stroke-width: 2.2px !important;
}

/* Tooltip */
#mapTooltip {
  position: fixed;
  display: none;
  pointer-events: none;
  z-index: 9999;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  transform-origin: left top;
  white-space: nowrap;
}

/* Region info card */
#regionInfoCard {
  max-width: 400px;
  z-index: 1000;
}

#regionInfoCard .bg-light {
  background-color: rgba(255, 245, 240, 0.9);
  padding: 15px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#regionInfoCard img {
  width: 100%;
  height: auto;
  object-fit: cover;
  max-height: 160px;
}

/* Chart wrappers and sizes */
.chart-wrap {
  width: 100%;
  height: 320px;
  position: relative;
}

canvas#viloyatChart,
canvas#tumanChart {
  width: 100% !important;
  height: 100% !important;
}

/* Tuman chart height */
#tumanChart {
  min-height: 280px;
  max-height: 420px;
}

/* Custom legend */
#viloyatLegend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  justify-content: center;
  margin-top: 6px;
}

/* Legend item */
.vilo-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.03);
  cursor: pointer;
  user-select: none;
  border: 1px solid rgba(0, 0, 0, 0.04);
  transition: transform .12s ease, box-shadow .12s ease;
  font-size: 13px;
}

.vilo-legend-item:active {
  transform: translateY(1px);
}

.vilo-legend-item .swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}

/* Allow legend text to wrap so long names show fully on mobile */
.vilo-legend-item .label-text {
  white-space: normal;
  /* allow wrap */
  word-break: break-word;
  /* break long words */
  max-width: 180px;
  line-height: 1.1;
}

/* Hidden / crossed / selected styles */
.vilo-legend-item.hidden {
  opacity: 0.55;
}

.vilo-legend-item.crossed .label-text {
  text-decoration: line-through;
  color: #888;
}

.vilo-legend-item.selected {
  box-shadow: 0 6px 18px rgba(60, 179, 113, 0.12);
  transform: translateY(-2px);
  border-color: rgba(60, 179, 113, 0.18);
}

/* Mobile: 2-column grid, scrollable if many items */
@media (max-width: 767.98px) {
  .chart-wrap {
    height: 260px;
  }

  #tumanChart {
    min-height: 240px;
  }

  #viloyatLegend {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    align-items: start;
    justify-items: stretch;
    max-height: 240px;
    /* scroll if too many */
    overflow-y: auto;
    padding-right: 6px;
  }

  .vilo-legend-item {
    width: 100%;
    padding: 8px;
  }

  .vilo-legend-item .label-text {
    max-width: calc(100% - 36px);
    font-size: 13px;
  }
}

/* Very small phones */
@media (max-width: 575.98px) {
  .chart-wrap {
    height: 220px;
  }

  #tumanChart {
    min-height: 200px;
  }

  #viloyatLegend {
    max-height: 260px;
  }

  .vilo-legend-item .label-text {
    font-size: 12px;
  }
}

/* ===== New styles for statistic cards (home + dashboard) ===== */

.stat-card-dashboard,
.stat-card {
  background: #ffffff;
  padding: 18px;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(31, 41, 55, 0.06);
  text-align: center;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.stat-icon,
.stat-icon-dashboard {
  font-size: 36px;
  color: #2e7d32;
  display: inline-block;
  margin-bottom: 6px;
}

.stat-count,
.stat-count-dashboard {
  font-weight: 700;
  font-size: 34px;
  color: #23313a;
  margin: 0;
}

/* Mini stat card inside chart (chart ichidagi qisqa ma'lumot) */
.stat-mini-card {
  background: linear-gradient(135deg, #f5f7fa 0%, #e8f5e9 100%);
  border-left: 4px solid #2e7d32;
  padding: 12px 15px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-mini-card p {
  margin: 0;
  color: #2e7d32;
  font-size: 13px;
}

.stat-count-mini {
  font-weight: 700;
  font-size: 28px;
  color: #1b5e20;
  margin: 4px 0 0 0 !important;
}

/* small subtitle */
.stat-card h3,
.stat-card-dashboard h5 {
  margin: 0;
  font-weight: 600;
  color: #2e7d32;
}

/* Animations (subtle pop-in) */
@keyframes popIn {
  from {
    transform: translateY(6px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.animate-pop-in {
  animation: popIn .32s ease both;
}

/* Responsive tweaks for homepage */
@media (max-width: 767.98px) {

  .stat-count,
  .stat-count-dashboard {
    font-size: 28px;
  }

  .stat-card,
  .stat-card-dashboard {
    min-height: 120px;
    padding: 14px;
  }
}

/* Region shef top card wrapper */
.region-shef-top-card-container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
}

.region-shef-card {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #fff;
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.region-shef-card img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
}

/* Accessibility: reduced motion */
@media (prefers-reduced-motion: reduce) {
  .animate-pop-in {
    animation: none !important;
  }

  * {
    transition: none !important;
  }
}






/* ////// */

/* ===== Year selector (statistics page) =====
   Joylash: statistics.css faylining oxiriga qo'shing
   Elementlar: #yearForm, #yearSelect, #yearForm label
*/

:root {
  --stat-accent: #3cb371;
  /* asosiy yashil rang */
  --stat-muted: rgba(0, 0, 0, 0.55);
  --stat-bg: #ffffff;
  --stat-border: rgba(0, 0, 0, 0.06);
}

/* Form wrapper */
#yearForm {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
}

/* Label */
#yearForm label {
  font-size: 14px;
  color: var(--stat-muted);
  font-weight: 600;
  margin-bottom: 0;
  display: inline-block;
  letter-spacing: 0.1px;
}

/* Select base */
#yearSelect {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: var(--stat-bg);
  border: 1px solid var(--stat-border);
  padding: 6px 34px 6px 10px;
  /* room for custom arrow on right */
  border-radius: 8px;
  font-size: 14px;
  color: #23313a;
  min-width: 100px;
  box-shadow: 0 6px 18px rgba(31, 41, 55, 0.04);
  transition: box-shadow .15s ease, transform .06s ease, border-color .12s ease;
  cursor: pointer;
}

/* Focus / hover */
#yearSelect:focus,
#yearSelect:hover {
  outline: none;
  border-color: rgba(60, 179, 113, 0.25);
  box-shadow: 0 8px 22px rgba(60, 179, 113, 0.06);
  transform: translateY(-1px);
}

/* Custom arrow (CSS-only) */
#yearSelect {
  background-image: linear-gradient(45deg, transparent 50%, var(--stat-muted) 50%),
    linear-gradient(135deg, var(--stat-muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) calc(50% - 4px), calc(100% - 8px) calc(50% - 4px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

/* When opened on some browsers arrow may invert; keep consistent */
#yearSelect:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

/* Small button-like style for select when inside narrow containers */
@media (max-width: 767.98px) {
  #yearForm {
    margin-left: 6px;
    gap: 6px;
  }

  #yearSelect {
    min-width: 88px;
    font-size: 13px;
    padding: 6px 30px 6px 8px;
  }

  #yearForm label {
    font-size: 13px;
  }
}



/* Tiny accessible hint - focus visible */
#yearSelect:focus-visible {
  outline: 3px solid rgba(60, 179, 113, 0.12);
  outline-offset: 2px;
}

/* Optional: make the select look like a pill when placed in header */
.header-year-style #yearSelect {
  border-radius: 999px;
  padding-left: 12px;
  padding-right: 36px;
}

/* Disable motion for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {

  #yearSelect,
  #yearForm {
    transition: none !important;
    transform: none !important;
  }
}