/* components/measure-pd/measure-pd.css */

.pd-page-wrapper {
  direction: rtl;
  font-family: 'Outfit', 'Vazirmatn', sans-serif;
  color: #333;
  background-color: #fafafa;
  overflow-x: hidden;
}

/* ۱. بخش هرو (Hero Section) */
.pd-hero-section {
  position: relative;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, #111 0%, #2c251c 100%);
  color: #fff;
  overflow: hidden;
  padding: 20px;
}

.pd-hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0.15;
}

.pd-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, transparent 20%, rgba(0, 0, 0, 0.8) 100%);
}

.pd-hero-content {
  position: relative;
  z-index: 2;
  max-width: 850px;
}

.hero-tag {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
  animation: fadeInDown 0.8s ease;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 15px;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #ddd;
}

/* ۲. کانتینر تب‌ها */
.pd-tabs-container {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  border: 1px solid #eee;
  margin-top: -30px;
  position: relative;
  z-index: 10;
  overflow: hidden;
}

.pd-tabs-header {
  display: flex;
  background-color: #1a1a1a;
  border-bottom: 2px solid var(--primary);
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
}

.pd-tabs-header::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.pd-tab-btn {
  flex: 1;
  min-width: 150px;
  padding: 16px 20px;
  background: none;
  border: none;
  color: #bbb;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.pd-tab-btn i {
  font-size: 1.1rem;
}

.pd-tab-btn:hover {
  background-color: rgba(211, 157, 78, 0.08);
  color: #fff;
}

.pd-tab-btn.active {
  background-color: var(--primary);
  color: #1a1a1a;
}

.pd-tabs-content {
  padding: 30px;
}

.pd-tab-pane {
  display: none;
  animation: fadeIn 0.4s ease;
}

.pd-tab-pane.active {
  display: block;
}

.pane-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 10px;
  position: relative;
  padding-bottom: 10px;
}

.pane-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 50px;
  height: 3px;
  background-color: var(--primary);
}

.pane-desc {
  color: #666;
  margin-bottom: 25px;
  font-size: 0.95rem;
  line-height: 1.7;
}

/* تب ۱: ابزار آنلاین کالیبراسیون */
.online-tool-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
  align-items: start;
}

@media (max-width: 991px) {
  .online-tool-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

.instruction-steps {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 25px;
}

.inst-step {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  background: #fcfbf9;
  padding: 12px 15px;
  border-radius: 10px;
  border-right: 3px solid var(--primary);
}

.step-num {
  background-color: var(--primary);
  color: #1a1a1a;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.inst-step p {
  margin: 0;
  font-size: 0.9rem;
  color: #444;
  line-height: 1.6;
}

/* ۲.۱ انتخابگر روش هوشمند اندازه‌گیری */
.pd-ai-mode-toggle-wrap {
  margin-bottom: 25px;
}

.pd-ai-mode-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

@media (max-width: 768px) {
  .pd-ai-mode-cards {
    grid-template-columns: 1fr;
  }
}

.pd-ai-mode-card {
  display: flex;
  align-items: center;
  gap: 15px;
  background: #fdfbf7;
  border: 2px solid #e7ded0;
  border-radius: 12px;
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.pd-ai-mode-card input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.pd-ai-mode-card:hover {
  border-color: var(--primary);
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(211, 157, 78, 0.12);
}

.pd-ai-mode-card.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, #fffdfa 0%, #fff7eb 100%);
  box-shadow: 0 8px 20px rgba(211, 157, 78, 0.18);
}

.mode-card-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background-color: rgba(211, 157, 78, 0.12);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  transition: all 0.3s;
}

.pd-ai-mode-card.active .mode-card-icon {
  background-color: var(--primary);
  color: #1a1a1a;
}

.mode-card-info {
  flex: 1;
}

.mode-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.badge-recommended {
  background: linear-gradient(135deg, #d39d4e 0%, #b88335 100%);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.mode-card-desc {
  font-size: 0.82rem;
  color: #666;
  line-height: 1.5;
}

.tool-actions {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.btn-tool {
  flex: 1;
  min-width: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.92rem;
  transition: all 0.3s ease;
  text-align: center;
  border: none;
}

.btn-webcam-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #be8b3e 100%);
  color: #1a1a1a;
  box-shadow: 0 6px 18px rgba(211, 157, 78, 0.3);
}

.btn-webcam-primary:hover {
  background: linear-gradient(135deg, #e4ad5e 0%, var(--primary) 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(211, 157, 78, 0.4);
}

.btn-upload-secondary {
  background-color: #1a1a1a;
  color: #fff;
  border: 1px solid #333;
}

.btn-upload-secondary:hover {
  background-color: #2a2a2a;
  color: var(--primary);
  border-color: var(--primary);
}

/* پنل وب‌کم پیشرفته هوش مصنوعی */
.webcam-panel {
  background: #111;
  border-radius: 16px;
  padding: 16px;
  margin-top: 20px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
  border: 1px solid #2a2a2a;
  animation: fadeIn 0.4s ease;
}

.webcam-live-status-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.status-indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #ff9500;
  box-shadow: 0 0 8px #ff9500;
  transition: all 0.3s;
}

.status-indicator-dot.ready {
  background-color: #34c759;
  box-shadow: 0 0 10px #34c759;
}

.status-indicator-dot.warn {
  background-color: #ff3b30;
  box-shadow: 0 0 8px #ff3b30;
}

.status-indicator-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: #eee;
}

.webcam-wrapper {
  position: relative;
  aspect-ratio: 4/3;
  width: 100%;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
}

#webcamVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.webcam-mesh-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: scaleX(-1);
  pointer-events: none;
  z-index: 5;
}

/* اورلی راهنمای هوش مصنوعی */
.webcam-ai-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* کادر بیضی راهنما */
.face-oval-guide {
  position: relative;
  width: 52%;
  height: 68%;
  border-radius: 50% / 45%;
  border: 3px dashed rgba(211, 157, 78, 0.6);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 20px;
  transition: all 0.3s ease;
}

.face-oval-guide.aligned {
  border: 3px solid #34c759;
  box-shadow: 0 0 20px rgba(52, 199, 89, 0.5), 0 0 0 9999px rgba(0, 0, 0, 0.4);
}

.face-oval-guide.warning {
  border-color: #ff3b30;
}

.scanner-laser-line {
  position: absolute;
  top: 15%;
  left: 10%;
  right: 10%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  box-shadow: 0 0 8px var(--primary);
  animation: scanLine 2.5s ease-in-out infinite alternate;
  opacity: 0.7;
}

.face-oval-guide.aligned .scanner-laser-line {
  background: linear-gradient(90deg, transparent, #34c759, transparent);
  box-shadow: 0 0 10px #34c759;
}

@keyframes scanLine {
  0% { top: 15%; }
  100% { top: 85%; }
}

.card-outline-box {
  width: 80%;
  height: 42px;
  border: 2px dashed rgba(211, 157, 78, 0.8);
  background: rgba(0, 0, 0, 0.55);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  text-shadow: 0 1px 3px #000;
  transition: all 0.3s;
}

.card-outline-box.hide {
  display: none;
}

/* چک‌لیست زنده */
.live-checklist {
  position: absolute;
  bottom: 12px;
  display: flex;
  gap: 8px;
  z-index: 12;
  flex-wrap: wrap;
  justify-content: center;
}

.check-pill {
  background: rgba(0, 0, 0, 0.75);
  color: #aaa;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.3s;
}

.check-pill.ready {
  background: rgba(52, 199, 89, 0.2);
  color: #34c759;
  border-color: #34c759;
}

.check-pill.warn {
  background: rgba(255, 59, 48, 0.2);
  color: #ff3b30;
  border-color: #ff3b30;
}

/* تایمر شمارش معکوس */
.countdown-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 25;
  animation: fadeIn 0.2s ease;
}

.countdown-number {
  font-size: 6rem;
  font-weight: 900;
  color: var(--primary);
  text-shadow: 0 0 25px rgba(211, 157, 78, 0.8);
  animation: countdownPop 1s ease-in-out infinite;
  line-height: 1;
}

@keyframes countdownPop {
  0% { transform: scale(0.6); opacity: 0; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.countdown-subtext {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 15px;
}

/* افکت فلش شاتر */
.shutter-flash {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 30;
  transition: opacity 0.15s ease-out;
}

.shutter-flash.active {
  opacity: 0.95;
  transition: none;
}

/* کنترل‌های وب‌کم */
.webcam-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  gap: 15px;
  flex-wrap: wrap;
}

.webcam-aux-actions {
  display: flex;
  gap: 8px;
}

.btn-icon-aux {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #222;
  border: 1px solid #333;
  color: #ccc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-size: 0.9rem;
}

.btn-icon-aux:hover {
  background: #333;
  color: #fff;
}

.btn-icon-aux.muted {
  color: #ff3b30;
}

.webcam-main-actions {
  display: flex;
  gap: 10px;
}

.btn-action {
  padding: 9px 18px;
  border-radius: 8px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
}

.btn-capture {
  background: var(--primary);
  color: #1a1a1a;
}

.btn-capture:hover {
  background: #e4ad5e;
}

.btn-cancel {
  background: #333;
  color: #eee;
}

.btn-cancel:hover {
  background: #444;
  color: #fff;
}

/* جعبه بوم (Canvas Card) */
.canvas-card {
  border: 2px dashed #ddd;
  background: #fdfdfd;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-height: 420px;
  transition: all 0.3s ease;
}

.canvas-card.active-img {
  border: 1px solid #e0d8cc;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
}

.canvas-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid #eee;
  padding-bottom: 12px;
}

.canvas-status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #555;
  font-size: 0.85rem;
  font-weight: 600;
}

.canvas-status-badge i {
  color: var(--primary);
}

.pd-mode-selector {
  display: flex;
  gap: 8px;
  background: #f4f4f4;
  padding: 4px;
  border-radius: 25px;
}

.mode-pill {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #666;
  transition: all 0.2s;
  user-select: none;
}

.mode-pill input {
  display: none;
}

.mode-pill:has(input:checked) {
  background: #fff;
  color: #1a1a1a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.canvas-viewport {
  position: relative;
  width: 100%;
  height: 420px;
  border-radius: 12px;
  background-color: #f7f7f7;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.canvas-placeholder {
  text-align: center;
  padding: 30px;
  color: #777;
  max-width: 400px;
}

.placeholder-animation {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.placeholder-icon-ai {
  position: absolute;
  font-size: 4rem;
  color: var(--primary);
  opacity: 0.35;
  animation: pulseGlow 2s infinite ease-in-out;
}

.placeholder-icon-face {
  font-size: 2.2rem;
  color: #555;
  z-index: 2;
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); opacity: 0.35; }
  50% { transform: scale(1.1); opacity: 0.6; }
}

.canvas-placeholder h4 {
  font-size: 1.1rem;
  font-weight: 800;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.canvas-placeholder p {
  font-size: 0.86rem;
  color: #666;
  line-height: 1.6;
  margin-bottom: 15px;
}

.placeholder-badges {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.76rem;
  color: #888;
}

.placeholder-badges span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.canvas-image-container {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: inline-block;
  user-select: none;
  -webkit-user-drag: none;
}

#sourceImage {
  display: block;
  max-width: 100%;
  max-height: 420px;
  pointer-events: none;
  object-fit: contain;
}

.canvas-lines-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 15;
}

/* ذره‌بین بزرگ‌نمایی مارکرها */
.marker-loupe {
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  z-index: 35;
  pointer-events: none;
  background: #000;
  transform: translate(-50%, -130%);
}

#loupeCanvas {
  width: 100%;
  height: 100%;
}

.loupe-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
}

.loupe-crosshair::before,
.loupe-crosshair::after {
  content: '';
  position: absolute;
  background: var(--primary);
}

.loupe-crosshair::before {
  top: 5px;
  left: -8px;
  width: 28px;
  height: 2px;
}

.loupe-crosshair::after {
  top: -8px;
  left: 5px;
  width: 2px;
  height: 28px;
}

/* نشانگرها */
.pd-marker {
  position: absolute;
  width: 36px;
  height: 36px;
  transform: translate(-50%, -50%);
  cursor: grab;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: none;
}

.pd-marker:active {
  cursor: grabbing;
}

.marker-crosshair {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 1px dashed rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.marker-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #fff;
  border: 2px solid #000;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
  transition: transform 0.2s;
  pointer-events: none;
}

.pd-marker:hover .marker-dot {
  transform: scale(1.3);
}

/* رنگ‌بندی نشانگرها */
.marker-card .marker-dot {
  background-color: var(--primary);
  border-color: #fff;
}

.marker-card .marker-crosshair {
  border-color: var(--primary);
}

.marker-pupil .marker-dot {
  background-color: #ff3b30;
  border-color: #fff;
}

.marker-pupil .marker-crosshair {
  border-color: #ff3b30;
}

.marker-nose .marker-dot {
  background-color: #34c759;
  border-color: #fff;
}

.marker-nose .marker-crosshair {
  border-color: #34c759;
}

.marker-label {
  position: absolute;
  top: 100%;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.68rem;
  white-space: nowrap;
  pointer-events: none;
  margin-top: 5px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* فوتر بوم */
.canvas-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  border-top: 1px solid #eee;
  padding-top: 12px;
  flex-wrap: wrap;
}

.footer-tips-text {
  font-size: 0.78rem;
  color: #777;
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-tips-text i {
  color: var(--primary);
}

.footer-action-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-zoom {
  background: #f0f0f0;
  border: 1px solid #ddd;
  color: #444;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.88rem;
}

.btn-zoom:hover {
  background-color: #e5e5e5;
  color: #1a1a1a;
}

.btn-reset-markers {
  background: #fff;
  border: 1px solid #ccc;
  color: #555;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-reset-markers:hover {
  background-color: #f7f7f7;
  border-color: #999;
  color: #1a1a1a;
}

.btn-calculate {
  background-color: var(--primary);
  border: 1px solid var(--primary);
  color: #1a1a1a;
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-calculate:hover {
  background-color: #1a1a1a;
  border-color: #1a1a1a;
  color: var(--primary);
}

/* پنل نتایج */
.result-display-panel {
  margin-top: 25px;
}

.result-glow-box {
  background: linear-gradient(135deg, #151515 0%, #262119 100%);
  border: 2px solid var(--primary);
  color: #fff;
  border-radius: 16px;
  padding: 28px;
  text-align: center;
  box-shadow: 0 12px 35px rgba(211, 157, 78, 0.2);
  animation: scaleUp 0.4s ease;
  position: relative;
}

.result-accuracy-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(52, 199, 89, 0.15);
  color: #34c759;
  border: 1px solid rgba(52, 199, 89, 0.4);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.result-title {
  display: block;
  font-size: 0.95rem;
  color: #ccc;
  letter-spacing: 0.5px;
}

.result-value-wrap {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin: 10px 0;
}

.result-number {
  font-size: 3.8rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  text-shadow: 0 0 15px rgba(211, 157, 78, 0.35);
  font-family: 'Outfit', sans-serif;
}

.result-unit {
  font-size: 1.2rem;
  color: #bbb;
  font-weight: 600;
}

.dual-pd-breakdown {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin: 15px 0;
  background: rgba(255, 255, 255, 0.05);
  padding: 12px 20px;
  border-radius: 10px;
  display: inline-flex;
}

.dual-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dual-lbl {
  font-size: 0.75rem;
  color: #aaa;
}

.dual-val {
  font-size: 1.3rem;
  color: var(--primary);
  font-weight: 800;
}

.dual-unit {
  font-size: 0.7rem;
  color: #888;
}

.dual-pd-breakdown .separator {
  color: var(--primary);
  font-size: 1.2rem;
  font-weight: 700;
}

/* نوار مقایسه با رنج استاندارد */
.pd-range-indicator {
  max-width: 450px;
  margin: 15px auto 20px;
}

.pd-range-bar {
  position: relative;
  height: 16px;
  background: #333;
  border-radius: 10px;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pd-range-normal-zone {
  width: 60%;
  height: 100%;
  background: rgba(211, 157, 78, 0.3);
  border: 1px solid var(--primary);
  border-radius: 8px;
  font-size: 0.62rem;
  color: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pd-range-pointer {
  position: absolute;
  top: -6px;
  width: 4px;
  height: 28px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 0 6px #fff;
  transition: left 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  left: 50%;
}

.result-notes {
  font-size: 0.85rem;
  color: #bbb;
  max-width: 520px;
  margin: 0 auto 22px;
  line-height: 1.6;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-result-action {
  padding: 11px 22px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
  text-decoration: none;
}

.btn-copy-result {
  background-color: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.btn-copy-result:hover {
  background-color: #fff;
  color: #1a1a1a;
}

.btn-retake-scan {
  background-color: rgba(255, 255, 255, 0.1);
  color: #eee;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-retake-scan:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.btn-shop-with-pd {
  background: linear-gradient(135deg, var(--primary) 0%, #be8b3e 100%);
  color: #1a1a1a;
  border: none;
}

.btn-shop-with-pd:hover {
  background: #fff;
  color: #1a1a1a;
  transform: translateY(-2px);
}


/* تب ۲: اندازه‌گیری دستی با آینه */
.mirror-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 25px;
  margin-bottom: 30px;
}

.mirror-step-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s;
}

.mirror-step-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
  border-color: var(--primary);
}

.step-icon-header {
  position: relative;
  display: inline-block;
  margin-bottom: 15px;
}

.step-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: var(--primary);
  color: #1a1a1a;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.step-svg-wrap {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background-color: #fdfaf5;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(211, 157, 78, 0.15);
}

.step-svg-wrap svg {
  width: 36px;
  height: 36px;
}

.mirror-step-card h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 10px;
}

.mirror-step-card p {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.6;
  margin: 0;
}

.mirror-pro-tips {
  background: #fbf9f4;
  border-right: 4px solid var(--primary);
  border-radius: 8px;
  padding: 20px;
}

.mirror-pro-tips h5 {
  font-size: 1rem;
  font-weight: 700;
  color: #a07231;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mirror-pro-tips ul {
  padding-right: 20px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mirror-pro-tips li {
  font-size: 0.85rem;
  color: #555;
  line-height: 1.6;
}

/* تب ۳: راهنمای دوست */
.friend-steps-flow {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 700px;
  margin: 0 auto;
}

.friend-step-item {
  display: flex;
  gap: 25px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid #eee;
  padding: 20px;
  border-radius: 12px;
  transition: all 0.3s;
}

.friend-step-item:hover {
  border-color: var(--primary);
  box-shadow: 0 5px 15px rgba(0,0,0,0.03);
}

.friend-step-visual {
  width: 50px;
  height: 50px;
  background-color: #1a1a1a;
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.friend-step-info h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 6px;
}

.friend-step-info p {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.6;
  margin: 0;
}

/* تب ۴: چاپ خط‌کش */
.print-ruler-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

@media (max-width: 991px) {
  .print-ruler-wrapper {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

.alert-print-box {
  background-color: #fff9e6;
  border-right: 4px solid #ffcc00;
  padding: 15px;
  border-radius: 8px;
  display: flex;
  gap: 15px;
  align-items: flex-start;
  margin: 20px 0;
  font-size: 0.85rem;
}

.alert-print-box i {
  color: #cc9900;
  font-size: 1.3rem;
  margin-top: 2px;
}

.alert-print-box strong {
  display: block;
  margin-bottom: 5px;
  color: #333;
}

.alert-print-box p {
  margin: 0;
  color: #555;
  line-height: 1.5;
}

.btn-print-action {
  background-color: var(--primary);
  border: 1px solid var(--primary);
  color: #1a1a1a;
  padding: 12px 25px;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s;
}

.btn-print-action:hover {
  background-color: #1a1a1a;
  border-color: #1a1a1a;
  color: var(--primary);
}

.printable-ruler-preview {
  background: #f0f0f0;
  border-radius: 12px;
  padding: 30px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: auto;
}

.ruler-print-only-container {
  background: #fff;
  padding: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  width: 100%;
  max-width: 580px;
}

.calibration-box-card {
  width: 85.6mm;
  height: 54.0mm;
  border: 1.5px dashed #888;
  border-radius: 4.8mm;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 15px;
  background-color: #fafafa;
}

.calibration-box-card span {
  font-size: 0.75rem;
  font-weight: 700;
  color: #333;
}

.calibration-box-card p {
  font-size: 0.6rem;
  color: #777;
  margin: 5px 0 0 0;
  line-height: 1.4;
}

.ruler-svg-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}

.pd-printable-ruler-svg {
  width: 100%;
  max-width: 150mm;
  height: auto;
  border-radius: 2px;
}


/* ۳. استایل‌های پرینت (Print Styles) */
@media print {
  /* پنهان کردن همه‌چیز بجز کانتینر پرینت خط‌کش */
  body * {
    visibility: hidden;
  }
  
  .ruler-print-only-container,
  .ruler-print-only-container * {
    visibility: visible;
  }

  /* موقعیت دهی کانتینر پرینت روی صفحه */
  .ruler-print-only-container {
    position: absolute;
    left: 0;
    top: 50px;
    width: 100% !important;
    max-width: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    background: transparent !important;
  }

  /* فیکس کردن ابعاد کارت کالیبراسیون برای تطابق صد درصد با واقعیت */
  .calibration-box-card {
    width: 85.6mm !important;
    height: 54mm !important;
    border: 1.5px dashed #000 !important;
    box-sizing: border-box !important;
    margin-bottom: 20px !important;
    page-break-inside: avoid;
  }

  /* فیکس کردن ابعاد فیزیکی خط‌کش در خروجی چاپگر */
  .pd-printable-ruler-svg {
    width: 150mm !important;
    height: 40mm !important;
    box-sizing: border-box !important;
    page-break-inside: avoid;
  }
}

/* انیمیشن‌ها */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* تصاویر راهنما */
.method-visual-guide {
  margin: 20px 0;
  text-align: center;
  background: #fdfdfd;
  border: 1px solid #eee;
  padding: 15px;
  border-radius: 12px;
}

.method-visual-img {
  max-width: 100%;
  height: auto;
  max-height: 220px;
  border-radius: 8px;
  margin-bottom: 10px;
  display: block;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.visual-caption {
  font-size: 0.8rem;
  color: #666;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.guide-illustration-banner {
  display: flex;
  gap: 25px;
  align-items: center;
  background: #fff;
  border: 1px solid #eee;
  padding: 20px;
  border-radius: 16px;
  margin-bottom: 30px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

@media (max-width: 768px) {
  .guide-illustration-banner {
    flex-direction: column;
    text-align: center;
    padding: 15px;
  }
}

.guide-ill-img {
  max-width: 160px;
  height: auto;
  border-radius: 10px;
  border: 1px solid #eee;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.guide-ill-text h5 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-top: 0;
  margin-bottom: 8px;
}

.guide-ill-text p {
  font-size: 0.88rem;
  color: #555;
  line-height: 1.7;
  margin: 0;
}

/* اورلی‌های روی تصاویر راهنما */
.visual-image-wrapper {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.visual-overlay-badge {
  position: absolute;
  background-color: rgba(26, 26, 26, 0.9);
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 8px rgba(0,0,0,0.25);
  z-index: 10;
  animation: pulseGlow 2s infinite alternate;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 5px rgba(211, 157, 78, 0.3); }
  100% { box-shadow: 0 0 15px rgba(211, 157, 78, 0.7); }
}

/* اورلی‌های تصویر کارت بانکی */
.badge-eyes {
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
}

.badge-card {
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%);
}

.visual-overlay-line {
  position: absolute;
  border-bottom: 2px dashed #ff3b30;
  width: 80%;
  left: 10%;
  top: 30%;
  z-index: 5;
  pointer-events: none;
}

/* اورلی‌های تصویر آینه */
.badge-ruler {
  top: 10%;
  right: 50%;
  transform: translateX(50%);
  background-color: rgba(211, 157, 78, 0.95);
  color: #1a1a1a;
  border-color: #1a1a1a;
}

.badge-pupil-right {
  bottom: 10%;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(255, 59, 48, 0.95);
  color: #fff;
  border-color: #fff;
}

/* اورلی‌های تصویر دوست */
.badge-friend-eye {
  top: 12%;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(211, 157, 78, 0.95);
  color: #1a1a1a;
  border-color: #1a1a1a;
}

.badge-friend-ruler {
  bottom: 8%;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(26, 26, 26, 0.9);
  color: var(--primary);
  border-color: var(--primary);
}

/* ==========================================
   بخش توضیحات علمی و راهنمای قرارگیری صورت و کارت
   ========================================== */
.pd-why-card-info {
  background: linear-gradient(135deg, rgba(211, 157, 78, 0.05) 0%, rgba(26, 26, 26, 0.02) 100%);
  border: 1px solid rgba(211, 157, 78, 0.15);
  border-radius: 12px;
  padding: 20px;
  margin-top: 15px;
  margin-bottom: 25px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.pd-why-card-info .info-header,
.pd-position-guidelines .info-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.pd-why-card-info .info-header i {
  color: var(--primary);
  font-size: 1.25rem;
}

.pd-why-card-info h4,
.pd-position-guidelines h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
}

.pd-why-card-info p {
  font-size: 0.88rem;
  color: #555;
  line-height: 1.8;
  margin: 0;
}

.pd-position-guidelines {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 30px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.pd-position-guidelines .info-header i {
  color: #1a1a1a;
  font-size: 1.25rem;
}

.guideline-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 15px;
}

.guide-item {
  display: flex;
  align-items: start;
  gap: 15px;
  background: #fdfdfd;
  padding: 16px 18px;
  border-radius: 10px;
  border-right: 4px solid var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.01);
  transition: transform 0.25s, box-shadow 0.25s;
}

.guide-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

.guide-icon {
  background: #1a1a1a;
  color: var(--primary);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.guide-text strong {
  display: block;
  font-size: 0.95rem;
  color: #1a1a1a;
  margin-bottom: 6px;
}

.guide-text p {
  font-size: 0.86rem;
  color: #666;
  line-height: 1.65;
  margin: 0;
}




