/* Tehran News Map v3 — Dark Graphic Theme */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;600;700&display=swap');

:root {
  --tnm-color-default:      #2d5e38;
  --tnm-color-hover:        #3cb864;
  --tnm-color-border:       #1a3a20;
  --tnm-color-border-hover: #0a2e14;
  --tnm-color-text:         #c8ecd0;
  --tnm-color-bg-panel:     #111e12;
  --tnm-color-panel-header: #1e6b32;
  --tnm-color-panel-text:   #c8ecd0;
  --tnm-color-accent:       #3cb864;
  --tnm-color-label:        rgba(255,255,255,0.75);
  --tnm-border-radius:      16px;
  --tnm-anim-speed:         220ms;
}

/* ── Container ── */
.tnm-container {
  direction: rtl;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background: #0f1f0f;
  border-radius: var(--tnm-border-radius);
  overflow: hidden;
  box-shadow:
    0 2px 0 rgba(255,255,255,0.06) inset,
    0 20px 50px rgba(0,0,0,0.5),
    0 0 0 1px rgba(80,160,80,0.15);
  margin: 0 auto;
}

/* ── Header ── */
.tnm-header {
  background: linear-gradient(135deg, var(--tnm-color-panel-header) 0%, #0d3318 100%);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.tnm-header-icon { font-size: 1.9rem; filter: drop-shadow(0 2px 5px rgba(0,0,0,0.4)); }
.tnm-header-text { flex: 1; }
.tnm-title    { color: #fff; font-size: 1.15rem; font-weight: 700; margin: 0; }
.tnm-subtitle { color: rgba(255,255,255,0.55); font-size: 11.5px; margin: 3px 0 0; }
.tnm-badge {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  color: #a8e6b8;
  font-size: 11px;
  padding: 4px 13px;
  border-radius: 20px;
  white-space: nowrap;
}

/* ── Map wrapper ── */
.tnm-map-wrapper {
  background: linear-gradient(160deg, #162a18 0%, #0e200f 100%);
  padding: 18px;
  position: relative;
}

.tnm-svg-map {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 6px 24px rgba(0,0,0,0.55));
}

/* ── SVG paths ── */
.tnm-region-path {
  fill: var(--tnm-color-default);
  stroke: var(--tnm-color-border);
  stroke-width: 0.8;
  stroke-linejoin: round;
  stroke-linecap: round;
  paint-order: stroke fill;
  transition:
    fill var(--tnm-anim-speed) ease,
    filter var(--tnm-anim-speed) ease;
}

.tnm-region:hover .tnm-region-path {
  fill: var(--tnm-color-hover);
  filter: brightness(1.18) drop-shadow(0 0 9px rgba(60,184,100,0.55));
}

.tnm-region.tnm-active .tnm-region-path {
  fill: #28a855;
  filter: brightness(1.08) drop-shadow(0 0 14px rgba(40,168,85,0.65));
}

.tnm-region:focus { outline: none; }
.tnm-region:focus .tnm-region-path {
  stroke: rgba(255,255,255,0.6);
  stroke-width: 2;
}

/* ── Labels ── */
.tnm-region-label {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  font-size: 10px;
  font-weight: 700;
  fill: var(--tnm-color-label);
  pointer-events: none;
  user-select: none;
  transition: fill var(--tnm-anim-speed);
}

/* ── Tooltip ── */
.tnm-tooltip {
  position: absolute;
  background: rgba(8,22,10,0.95);
  backdrop-filter: blur(8px);
  color: #a8e6b8;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 180ms, transform 180ms;
  z-index: 100;
  border: 1px solid rgba(60,184,100,0.25);
  font-family: 'Vazirmatn', Tahoma, sans-serif;
}
.tnm-tooltip.tnm-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── News Panel ── */
.tnm-news-panel {
  background: var(--tnm-color-bg-panel);
  max-height: 0;
  overflow: hidden;
  transition: max-height .42s cubic-bezier(.4,0,.2,1);
  border-top: 2px solid var(--tnm-color-panel-header);
}
.tnm-news-panel.tnm-panel-open {
  max-height: 550px;
  overflow-y: auto;
}

.tnm-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
  background: linear-gradient(135deg, var(--tnm-color-panel-header), #0d3318);
  position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.tnm-panel-region-name {
  color: #a8e6b8;
  font-weight: 700;
  font-size: 15px;
}
.tnm-panel-close {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff;
  width: 30px; height: 30px;
  border-radius: 50%; cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background 200ms;
}
.tnm-panel-close:hover { background: rgba(255,255,255,0.22); }

.tnm-panel-body { padding: 16px 20px; }

/* Loading */
.tnm-loading {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 0; color: rgba(255,255,255,0.45); font-size: 14px;
}
.tnm-loading.tnm-hidden { display: none; }
.tnm-spinner {
  width: 22px; height: 22px;
  border: 3px solid rgba(255,255,255,0.12);
  border-top-color: var(--tnm-color-accent);
  border-radius: 50%;
  animation: tnm-spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes tnm-spin { to { transform: rotate(360deg); } }

/* News list */
.tnm-news-list { display: flex; flex-direction: column; gap: 12px; }

.tnm-news-item {
  display: flex; gap: 12px; padding: 13px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(60,184,100,0.12);
  border-radius: 10px;
  text-decoration: none; color: inherit;
  transition: background 200ms, border-color 200ms;
  animation: tnm-fadeUp .28s ease both;
  opacity: 0;
}
.tnm-news-item:hover {
  background: rgba(60,184,100,0.09);
  border-color: rgba(60,184,100,0.28);
  text-decoration: none;
}

@keyframes tnm-fadeUp {
  from { opacity:0; transform:translateY(7px); }
  to   { opacity:1; transform:translateY(0); }
}

.tnm-news-thumb {
  width: 65px; height: 52px; object-fit: cover;
  border-radius: 7px; flex-shrink: 0;
}
.tnm-news-thumb-placeholder {
  width: 65px; height: 52px; border-radius: 7px; flex-shrink: 0;
  background: linear-gradient(135deg, #1e5028, #2d7a3d);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.tnm-news-info { flex: 1; min-width: 0; }
.tnm-news-title {
  font-size: 14px; font-weight: 600;
  color: #c8ecd0; line-height: 1.55; margin: 0 0 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tnm-news-excerpt {
  font-size: 12px; color: rgba(255,255,255,0.42);
  line-height: 1.55; margin: 0 0 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tnm-news-date { font-size: 11px; color: rgba(255,255,255,0.3); }

/* No news */
.tnm-no-news {
  text-align: center; padding: 30px;
  color: rgba(255,255,255,0.35); font-size: 14px;
}
.tnm-no-news-icon { font-size: 2rem; display: block; margin-bottom: 8px; }

/* Panel footer */
.tnm-panel-footer { padding: 12px 20px 16px; border-top: 1px solid rgba(255,255,255,0.06); }
.tnm-view-all-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 22px;
  background: linear-gradient(135deg, var(--tnm-color-panel-header), #155224);
  color: #a8e6b8; border-radius: 10px;
  font-size: 13px; font-weight: 600;
  border: 1px solid rgba(60,184,100,0.22);
  text-decoration: none;
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  transition: filter 200ms, transform 150ms;
}
.tnm-view-all-btn:hover {
  filter: brightness(1.15); transform: translateY(-1px);
  color: #a8e6b8; text-decoration: none;
}

/* Scrollbar */
.tnm-news-panel::-webkit-scrollbar { width: 5px; }
.tnm-news-panel::-webkit-scrollbar-track { background: #0a1a0a; }
.tnm-news-panel::-webkit-scrollbar-thumb { background: #2d5e38; border-radius: 4px; }

/* Responsive */
@media (max-width: 580px) {
  .tnm-news-item { flex-direction: column; gap: 8px; }
  .tnm-news-thumb, .tnm-news-thumb-placeholder { width: 100%; height: 110px; }
  .tnm-panel-body { padding: 12px; }
  .tnm-header { padding: 14px 16px; gap: 10px; }
  .tnm-badge { display: none; }
}
