/*
 * assets/css/face-detector.css
 * استایل مدرن، شیشه‌ای (Glassmorphism) و لوکس برای ماژول هوشمند تشخیص فرم صورت با MediaPipe 478pt
 */

:root {
  --primary: #d39d4e;
  --primary-color: var(--primary);
  --primary-hover: #b8853d;
  --bg-dark: #0d0d0f;
  --bg-card: rgba(22, 22, 26, 0.7);
  --border-glass: rgba(255, 255, 255, 0.09);
  --text-light: #ffffff;
  --text-muted: #b5b5c0;
  --success-color: #2e7d32;
  --shadow-glow: rgba(211, 157, 78, 0.25);
  --danger: #c62828;
  --info: #1e88e5;
}

/* ظرف ماژول ردیاب چهره در صفحه */
.face-detector-module {
  margin: 40px auto 60px;
  max-width: 1100px;
  background: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(211, 157, 78, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(255, 255, 255, 0.03) 0%, transparent 45%);
  border-radius: 28px;
  border: 1px solid var(--border-glass);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  padding: 40px 30px;
  font-family: 'Vazirmatn', 'Outfit', sans-serif;
  direction: rtl;
  text-align: right;
  position: relative;
  color: var(--text-light);
}

/* ۱. بخش هدر و معرفی ماژول */
.face-detector-module .detector-header {
  text-align: center;
  margin-bottom: 25px;
}

.face-detector-module .header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(211, 157, 78, 0.08);
  border: 1px solid rgba(211, 157, 78, 0.15);
  color: var(--primary-color);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 18px;
  letter-spacing: 0.3px;
}

.face-detector-module .detector-header h2 {
  font-size: 32px;
  font-weight: 900;
  color: var(--text-light);
  margin-bottom: 15px;
}

.face-detector-module .detector-header h2 span {
  background: linear-gradient(135deg, #f5c842 30%, #d39d4e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px rgba(211, 157, 78, 0.3));
}

.face-detector-module .detector-header p {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ۲. بخش مراحل (Steps Section) */
.steps-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 35px;
  padding: 0 10px;
}

.step-item {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 22px 18px;
  text-align: center;
  flex: 1;
  max-width: 240px;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.55;
}

.step-item.active {
  opacity: 1;
  border-color: rgba(211, 157, 78, 0.25);
  background: rgba(211, 157, 78, 0.06);
  box-shadow: 0 8px 30px rgba(211, 157, 78, 0.08);
  transform: translateY(-2px);
}

.step-item.completed {
  opacity: 0.8;
  border-color: rgba(46, 125, 50, 0.3);
}

.step-number {
  position: absolute;
  top: -10px;
  right: -6px;
  width: 26px;
  height: 26px;
  background: var(--primary-color);
  color: #121214;
  font-size: 13px;
  font-weight: 900;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px var(--shadow-glow);
  transition: all 0.3s ease;
}

.step-item.completed .step-number {
  background: #4caf50;
}

.step-icon {
  margin-bottom: 10px;
}

.step-icon i {
  font-size: 26px;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.step-item.active .step-icon i {
  color: var(--primary-color);
  text-shadow: 0 0 15px var(--shadow-glow);
}

.step-item.completed .step-icon i {
  color: #4caf50;
}

.step-item h3 {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-light);
  margin-bottom: 5px;
}

.step-item p {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

.step-connector {
  color: rgba(255, 255, 255, 0.15);
  font-size: 16px;
  flex-shrink: 0;
}

/* ۳. شبکه بندی دو ستونه ردیاب */
.detector-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 25px;
  align-items: start;
}

/* ۴. جعبه دوربین (Camera Box) */
.camera-box {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  padding: 25px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background-color: #050506;
  border-radius: 18px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 50px rgba(0,0,0,0.9);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* نوار پیشرفت اسکن طلایی نئونی */
.scan-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 0%;
  height: 5px;
  background: linear-gradient(90deg, #d39d4e, #f5c842, #d39d4e);
  box-shadow: 0 0 12px var(--shadow-glow);
  z-index: 10;
  transition: width 0.1s linear;
}
.scan-progress-bar.hidden {
  display: none;
}

/* نکات پیشرفت اسکن شناور */
.scan-tips {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(13, 13, 15, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(211, 157, 78, 0.3);
  border-radius: 10px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  max-width: 90%;
  width: max-content;
  text-align: center;
  box-sizing: border-box;
}
.scan-tips.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(-10px);
}
.text-gold {
  color: #d39d4e;
}

/* اسکنر لیزری متحرک */
.scanner-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, transparent 5%, var(--primary-color) 50%, transparent 95%);
  box-shadow: 0 0 10px var(--primary-color), 0 0 20px var(--primary-color);
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.scanner-line.active {
  opacity: 1;
  animation: laserScan 3s linear infinite;
}

@keyframes laserScan {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}

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

#overlay, #detectorOverlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  object-fit: cover;
  transform: scaleX(-1);
  pointer-events: none;
}

/* راهنمای زنده (Live Guide) */
.live-guide {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  max-width: 90%;
  width: max-content;
  text-align: center;
  animation: guideSlideUp 0.3s ease;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.live-guide.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(10px);
}

.live-guide i {
  font-size: 16px;
}

.live-guide.guide-warning {
  border-color: rgba(255, 193, 7, 0.3);
  color: #ffd54f;
}

.live-guide.guide-success {
  border-color: rgba(76, 175, 80, 0.3);
  color: #81c784;
}

.live-guide.guide-error {
  border-color: rgba(244, 67, 54, 0.3);
  color: #ef5350;
}

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

/* لایه وضعیت روی دوربین */
.status-overlay, .camera-status-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(18, 18, 20, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 8;
  padding: 30px;
}

.status-overlay.hidden, .camera-status-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.status-icon {
  font-size: 40px;
  color: var(--primary-color);
  margin-bottom: 20px;
  text-shadow: 0 0 20px var(--shadow-glow);
}

.status-overlay p, .status-msg-text {
  font-size: 15px;
  color: var(--text-light);
  margin-bottom: 15px;
  font-weight: 700;
  text-align: center;
}

.status-sub-text {
  font-size: 12px;
  color: #888;
}

.spinner, .spinner-glow {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(211, 157, 78, 0.1);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s infinite linear;
  box-shadow: 0 0 15px var(--shadow-glow);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* دکمه‌های کنترل */
.control-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
}

.btn-primary {
  background: var(--primary-color);
  color: #121214;
  box-shadow: 0 4px 15px var(--shadow-glow);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(211, 157, 78, 0.35);
}

.btn-primary:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.3);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: #c62828;
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(198, 40, 40, 0.2);
}

.btn-secondary:hover {
  background: #b71c1c;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(198, 40, 40, 0.35);
}

.hidden {
  display: none !important;
}

/* نشانگر اسکن ذخیره‌شده چهره */
.saved-scan-indicator {
  position: absolute;
  top: 14px;
  right: 14px;
  left: 14px;
  background: rgba(18, 18, 20, 0.88);
  border: 1px solid rgba(74, 222, 128, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 10px 16px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  z-index: 10;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  animation: savedBadgeSlideDown 0.3s ease;
}

.saved-scan-indicator i {
  font-size: 17px;
  color: #4ade80;
}

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

/* بخش آپلود عکس */
.upload-section {
  margin-top: 20px;
}

.upload-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.upload-divider::before,
.upload-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-glass);
}

.upload-divider span {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.btn-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: var(--text-light);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
}

.btn-upload:hover {
  background: rgba(211, 157, 78, 0.08);
  border-color: rgba(211, 157, 78, 0.3);
  color: var(--primary-color);
  box-shadow: 0 0 15px rgba(211, 157, 78, 0.08);
}

.btn-upload i {
  font-size: 18px;
  color: var(--primary-color);
}

.upload-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 8px;
  text-align: center;
}

/* ۵. بخش نتایج (Results Section) */
.results-box {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  padding: 25px;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  height: 100%;
  transition: all 0.5s ease;
}

.results-box.hidden {
  opacity: 0;
  transform: translateY(20px);
}

.result-header-label {
  font-size: 13px;
  color: var(--primary-color);
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: block;
}

/* آیکون فرم‌های ۷ گانه صورت */
.shape-icons-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.shape-result-icon {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 12px 6px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.shape-result-icon svg {
  width: 24px;
  height: 30px;
  fill: currentColor;
  color: var(--text-muted);
  transition: all 0.3s ease;
}

.shape-result-icon.active {
  background: rgba(211, 157, 78, 0.12);
  border-color: var(--primary-color);
  color: var(--text-light);
  box-shadow: 0 0 25px rgba(211, 157, 78, 0.2);
  transform: translateY(-4px) scale(1.05);
}

.shape-result-icon.active svg {
  color: var(--primary-color);
  filter: drop-shadow(0 0 10px var(--shadow-glow));
  transform: scale(1.15);
}

.shape-pct {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--text-muted);
  font-weight: 600;
  transition: all 0.3s ease;
}

.shape-result-icon.active .shape-pct {
  background: rgba(211, 157, 78, 0.25);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(211, 157, 78, 0.2);
}

/* نوار اطمینان */
.confidence-section {
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.confidence-value {
  font-weight: 900;
  font-size: 14px;
  color: var(--primary-color);
}

.confidence-track {
  margin-top: 8px;
  height: 8px;
}

.confidence-fill {
  background: linear-gradient(90deg, #d39d4e, #f5c842, #d39d4e);
  background-size: 200% 100%;
  animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* کارت جزئیات فرم صورت */
.shape-details-card {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-glass);
  padding: 20px;
  border-radius: 16px;
  margin-bottom: 20px;
}

.shape-title-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.shape-details-card h2 {
  font-size: 20px;
  font-weight: 900;
  color: var(--primary-color);
  margin-bottom: 0;
}

.hybrid-shape-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(211, 157, 78, 0.12);
  border: 1px solid rgba(211, 157, 78, 0.3);
  color: #f5c842;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 0.2px;
  animation: pulseGlow 2.5s infinite;
}

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

.hybrid-shape-box {
  background: rgba(211, 157, 78, 0.06);
  border: 1px dashed rgba(211, 157, 78, 0.25);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 18px;
}

.hybrid-shape-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #f5c842;
  font-weight: 800;
  margin-bottom: 6px;
}

.hybrid-shape-box p {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
  margin-bottom: 0;
}

.shape-details-card p {
  font-size: 13.5px;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 15px;
}

/* لیست فریم‌های پیشنهادی */
.rec-frame-list-wrapper {
  margin-bottom: 20px;
}

.rec-frame-list-wrapper h3 {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.rec-frame-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
}

.rec-frame-list li {
  background: rgba(46, 125, 50, 0.08);
  border: 1px solid rgba(46, 125, 50, 0.2);
  color: #81c784;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rec-avoid-box {
  background: rgba(198, 40, 40, 0.05);
  border: 1px dashed rgba(198, 40, 40, 0.2);
  border-radius: 12px;
  padding: 12px 15px;
  font-size: 12.5px;
  color: #ef5350;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.rec-avoid-box i {
  margin-top: 3px;
}

/* محاسبات هندسی */
.metrics-section {
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 20px;
  margin-bottom: 20px;
}

.metrics-section h3 {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 15px;
}

.ratio-item {
  margin-bottom: 15px;
}

.ratio-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-light);
}

.ratio-label {
  color: var(--text-muted);
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--primary-color);
  width: 0%;
  border-radius: 10px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px var(--shadow-glow);
}

/* ۶. بخش فریم‌های پیشنهادی (Glasses Showcase) */
.recommended-glasses {
  margin-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 35px;
}

.rec-header-wrapper {
  text-align: center;
  margin-bottom: 30px;
}

.recommended-glasses h2 {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 10px;
  color: var(--text-light);
}

.recommended-glasses h2 span {
  color: var(--primary-color);
  background: linear-gradient(135deg, #e5b56e 0%, #d39d4e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.rec-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 20px auto;
  line-height: 1.6;
}

/* فیلترهای هوشمند: نوع عینک + جنسیت */
.rec-filters-holder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 25px;
}

.rec-type-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  padding: 5px;
  border-radius: 14px;
  border: 1px solid var(--border-glass);
}

.rec-type-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.rec-type-btn:hover {
  color: var(--text-light);
  background: rgba(255, 255, 255, 0.06);
}

.rec-type-btn.active {
  background: linear-gradient(135deg, #e5b56e 0%, #d39d4e 100%);
  color: #121214;
  box-shadow: 0 4px 15px rgba(211, 157, 78, 0.3);
}

.rec-gender-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.rec-gender-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.25s ease;
}

.rec-gender-btn:hover {
  color: var(--text-light);
  border-color: rgba(211, 157, 78, 0.3);
  background: rgba(255, 255, 255, 0.06);
}

.rec-gender-btn.active {
  background: rgba(211, 157, 78, 0.15);
  color: var(--primary-color);
  border-color: var(--primary-color);
  box-shadow: 0 0 10px rgba(211, 157, 78, 0.15);
}

/* شبکه کارت‌های محصولات */
.glasses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.glass-product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
}

.glass-product-card:hover {
  transform: translateY(-6px);
  border-color: rgba(211, 157, 78, 0.45);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45), 0 0 25px rgba(211, 157, 78, 0.12);
}

.glass-product-image {
  background: #ffffff;
  padding: 0;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.glass-badges-top {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 2;
}

.glass-brand-badge {
  background: rgba(18, 18, 20, 0.9);
  color: #e5b56e;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
  border: 1px solid rgba(229, 181, 110, 0.2);
}

.glass-meta-badge {
  background: rgba(240, 240, 245, 0.95);
  color: #222;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
}

.glass-product-image img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  transform: none;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-product-card:hover .glass-product-image img {
  transform: scale(1.03);
}

.glass-product-info {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.glass-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.glass-style-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(211, 157, 78, 0.1);
  color: var(--primary-color);
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(211, 157, 78, 0.25);
}

/* باکس دلیل پیشنهاد هوش مصنوعی */
.glass-why-box {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  background: linear-gradient(135deg, rgba(211, 157, 78, 0.08) 0%, rgba(30, 136, 229, 0.05) 100%);
  border: 1px dashed rgba(211, 157, 78, 0.3);
  padding: 7px 9px;
  border-radius: 8px;
  margin-bottom: 8px;
  line-height: 1.45;
}

.glass-why-box i {
  color: var(--primary-color);
  font-size: 11px;
  margin-top: 2px;
  flex-shrink: 0;
}

.glass-why-box span {
  font-size: 11px;
  font-weight: 700;
  color: #e0d0b8;
}

.glass-product-info h3 {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-light);
  margin: 0 0 6px 0;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 40px;
}

.glass-sku-code {
  font-size: 11px;
  color: var(--text-muted);
}

.glass-sku-code span {
  color: #bbb;
  font-family: monospace;
}

.glass-card-bottom {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 12px;
}

.glass-price-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.glass-price-old {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.glass-price-old del {
  color: #777;
}

.glass-discount-badge {
  background: rgba(239, 83, 80, 0.18);
  color: #ff6b6b;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid rgba(239, 83, 80, 0.35);
}

.glass-price-current {
  font-size: 15px;
  font-weight: 900;
  color: var(--primary-color);
}

.glass-card-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.glass-buy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-light);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 800;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.glass-buy-btn i {
  font-size: 11px;
  transition: transform 0.25s ease;
}

.glass-product-card:hover .glass-buy-btn {
  background: linear-gradient(135deg, #e5b56e 0%, #d39d4e 100%);
  color: #121214;
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(211, 157, 78, 0.3);
}

.glass-buy-btn:hover i,
.glass-product-card:hover .glass-buy-btn i {
  transform: translateX(-4px);
}

/* بنر هوشمند خروجی به فروشگاه */
.rec-more-wrapper {
  margin-top: 35px;
}

.rec-more-banner {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(211, 157, 78, 0.06) 100%);
  border: 1px solid rgba(211, 157, 78, 0.3);
  border-radius: 20px;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  flex-wrap: wrap;
}

.rec-more-info {
  flex: 1;
  min-width: 260px;
  text-align: right;
}

.rec-more-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(211, 157, 78, 0.15);
  color: var(--primary-color);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.rec-more-info h3 {
  font-size: 17px;
  font-weight: 900;
  color: var(--text-light);
  margin: 0 0 6px 0;
}

.rec-more-info p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.rec-browse-all-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #e5b56e 0%, #d39d4e 100%);
  color: #121214;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 20px rgba(211, 157, 78, 0.25);
  white-space: nowrap;
}

.rec-browse-all-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(211, 157, 78, 0.4);
}

.rec-browse-all-btn i {
  transition: transform 0.25s ease;
}

.rec-browse-all-btn:hover i {
  transform: translateX(-4px);
}

/* چیپ‌های اختصاصی فرم‌های فریم داخل بنر */
.rec-shape-pills-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.rec-shape-pills-title {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 700;
  margin-left: 4px;
}

.rec-shape-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(211, 157, 78, 0.25);
  color: #e5b56e;
  padding: 5px 12px;
  border-radius: 18px;
  font-size: 11.5px;
  font-weight: 800;
  text-decoration: none;
  transition: all 0.25s ease;
}

.rec-shape-pill:hover {
  background: rgba(211, 157, 78, 0.18);
  border-color: var(--primary-color);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(211, 157, 78, 0.15);
}

.rec-shape-pill i {
  font-size: 10px;
  color: var(--primary-color);
}

/* اسکلت بارگذاری */
.skeleton-card {
  pointer-events: none;
  opacity: 0.7;
}

.skeleton-box,
.skeleton-line {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 35px 20px;
  color: var(--text-muted);
  font-weight: 700;
  border: 1.5px dashed var(--border-glass);
  border-radius: 16px;
  font-size: 13.5px;
}

/* ۷. ریسپانسیو ماژول */
@media (max-width: 992px) {
  .detector-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .face-detector-module {
    padding: 25px 18px;
    border-radius: 20px;
  }
}

@media (max-width: 768px) {
  .face-detector-module {
    padding: 20px 12px;
    margin: 25px auto 40px;
    border-radius: 18px;
  }

  .face-detector-module .detector-header h2 {
    font-size: 22px;
  }

  .face-detector-module .detector-header p {
    font-size: 12.5px;
  }

  .steps-section {
    gap: 6px;
    padding: 0;
    margin-bottom: 18px;
  }

  .step-connector {
    display: none;
  }

  .step-item {
    padding: 8px 3px;
    border-radius: 12px;
  }

  .step-number {
    position: static;
    width: 18px;
    height: 18px;
    font-size: 10px;
    margin-bottom: 2px;
  }

  .step-icon {
    display: none;
  }

  .step-item h3 {
    font-size: 10px;
  }

  .step-item p {
    display: none;
  }

  .camera-box, .results-box {
    padding: 14px 10px;
    border-radius: 16px;
  }

  .video-wrapper {
    max-height: 320px;
    min-height: 200px;
  }

  .shape-icons-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding-bottom: 6px;
  }

  .shape-result-icon {
    flex: 0 0 72px;
    scroll-snap-align: start;
    padding: 8px 2px;
    font-size: 10px;
  }

  .shape-result-icon svg {
    width: 18px;
    height: 22px;
  }

  .glasses-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .glass-product-image {
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .rec-more-banner {
    flex-direction: column;
    text-align: center;
    padding: 16px 12px;
  }

  .rec-more-info {
    text-align: center;
  }

  .rec-browse-all-btn {
    width: 100%;
  }
}
