 /* ============================================================
 *  map.css — استایل‌های نقشه و overlayها
 *  ⚠️ متن DXF بدون باکس (شبیه AutoCAD)
 * ============================================================ */

/* ═══ اطلاعات نقشه (بالا راست) ═══ */
#map-info {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1000;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  font-size: 12px;
  direction: rtl;
  color: var(--text-muted);
  backdrop-filter: blur(10px);
}

#map-info b {
  color: var(--color-profit);
  font-size: 13px;
  text-shadow: 0 0 10px var(--color-profit-glow);
}

/* ═══ پنل خروجی (پایین چپ) ═══ */
#export-panel {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 1000;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  padding: 14px 18px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  direction: rtl;
  min-width: 260px;
  backdrop-filter: blur(10px);
}

#export-panel b {
  color: var(--color-warning);
  text-shadow: 0 0 10px var(--color-warning-glow);
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
}

#export-panel .scale-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px 8px;
  margin-bottom: 10px;
}

#export-panel label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11px;
}

#export-panel input[type="radio"] {
  accent-color: var(--color-profit);
  cursor: pointer;
}

#export-panel button { width: 100%; margin-top: 4px; }

/* ═══ عنوان روی نقشه ═══ */
#map-title-overlay {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  z-index: 999;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  max-width: 80%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: none;
}

/* ═══ برچسب شماره نقاط ═══ */
.point-label {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #fff;
  font-weight: bold;
  font-size: 11px;
  text-shadow:
    0 0 3px #000, 0 0 3px #000,
    0 0 3px #000, 0 0 6px #000;
  text-align: center;
  line-height: 1;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════
   ⚠️ متن DXF — بدون باکس (شبیه AutoCAD)
   ═══════════════════════════════════════════ */

/* کلاس icon — بدون هرگونه باکس */
.dxf-text-no-box {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.dxf-text-no-box > div {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
  /* فقط یک سایه ملایم برای خوانایی روی ماهواره */
  text-shadow:
    0 0 2px #000,
    0 0 2px #000,
    0 0 3px #000;
}

/* متن‌ها با درگ جابه‌جا می‌شوند */
.dxf-text-no-box {
  cursor: move;
  user-select: none;
}

/* متن انتخاب‌شده — فقط هاله آبی، بدون کادر */
.dxf-text-selected > div {
  text-shadow:
    0 0 3px var(--color-info),
    0 0 7px var(--color-info),
    0 0 2px #000,
    0 0 2px #000;
}

/* ═══════════════════════════════════════════
   کادر فرضی MTEXT (مثل اتوکد) + دسته تغییر پهنا
   فقط روی متن انتخاب‌شده نمایش داده می‌شود
   ═══════════════════════════════════════════ */

.dxf-text-no-box > div.dxf-text-frame {
  position: relative;
  box-sizing: content-box;
  border: 1px dashed var(--color-info) !important;
  padding: 1px 3px !important;
  min-width: 12px;
}

.dxf-text-grip {
  position: absolute;
  top: 50%;
  right: -7px;
  transform: translateY(-50%);
  width: 11px;
  height: 22px;
  border: 1px solid #fff;
  border-radius: 3px;
  background: var(--color-info);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
  cursor: ew-resize;
  touch-action: none;
  z-index: 5;
}

/* در حین درگ لبه: متن و نقشه قفل می‌شوند */
body.dxf-resizing {
  cursor: ew-resize;
  user-select: none;
}

/* ═══ پنل شناور ویرایش متن ═══ */
#text-edit-panel {
  position: absolute;
  z-index: 1001;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  padding: 8px 10px;
  direction: rtl;
  min-width: 168px;
  backdrop-filter: blur(10px);
}

#text-edit-panel .tep-title {
  font-size: 11px;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 168px;
}

#text-edit-panel .tep-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

#text-edit-panel .tep-size {
  flex: 1;
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  color: var(--color-info);
}

#text-edit-panel button {
  flex: 1;
  min-width: 30px;
  padding: 4px 6px;
  font-size: 12px;
  font-weight: bold;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text-primary);
  cursor: pointer;
}

#text-edit-panel button:hover {
  background: var(--bg-hover);
  border-color: var(--color-info);
}

/* ورودی رنگ و زاویه در پنل متن */
#text-edit-panel input[type="color"] {
  flex: 0 0 auto;
  width: 34px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--bg-input);
  cursor: pointer;
}

#text-edit-panel input.tep-angle {
  flex: 1;
  min-width: 0;
  height: 24px;
  padding: 2px 6px;
  font-size: 12px;
  font-weight: bold;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  text-align: center;
}

#text-edit-panel .tep-unit {
  font-size: 12px;
  color: var(--text-muted);
}

#text-edit-panel input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#text-edit-panel .tep-tag {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

#text-edit-panel .tep-count {
  flex: 1;
  text-align: center;
  font-size: 11px;
  font-weight: bold;
  color: var(--color-info);
  white-space: nowrap;
}

#text-edit-panel #text-edit-delete:hover {
  border-color: var(--color-loss);
  color: var(--color-loss);
}

/* ═══ برچسب‌های اندازه‌گذاری ═══ */
.measure-label {
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: bold;
  white-space: nowrap;
  border: 1px solid rgba(64, 196, 255, 0.8);
  box-shadow: 0 0 10px rgba(64, 196, 255, 0.5);
  cursor: grab;
  user-select: none;
}

/* برچسب انتخاب‌شده — هاله پررنگ */
.measure-label-active {
  border-color: #40C4FF;
  box-shadow: 0 0 6px #fff, 0 0 14px rgba(64, 196, 255, 0.95);
  z-index: 800;
}

/* در حین درگ برچسب */
.measure-label-dragging {
  cursor: grabbing;
  opacity: 0.85;
}

.measure-point-icon {
  background: #40C4FF;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 10px rgba(64, 196, 255, 0.8);
}

/* ═══ حالت خروجی (پنهان‌سازی کنترل‌ها) ═══ */
.hide-for-export .leaflet-control-container {
  display: none !important;
} 
