/* ==========================================
   FaceScore AI - Premium Modern Style Sheet
   ========================================== */

/* Design Tokens & Theme Variables */
:root {
  --font-main: 'Inter', sans-serif;
  --font-heading: 'Outfit', sans-serif;
  
  /* Dark Mode Palette (Default) */
  --bg-app: #09090b;
  --bg-card: rgba(24, 24, 27, 0.6);
  --bg-card-hover: rgba(39, 39, 42, 0.7);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.4);
  
  --text-main: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-inverse: #09090b;
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --secondary: #a855f7;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --accent-gradient-hover: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
  
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --danger: #ef4444;
  
  --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 50px -10px rgba(0, 0, 0, 0.7);
  --glass-blur: blur(16px);
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Mode Override */
html.light {
  --bg-app: #fafafa;
  --bg-card: rgba(244, 244, 245, 0.75);
  --bg-card-hover: rgba(228, 228, 231, 0.85);
  --border-color: rgba(9, 9, 11, 0.08);
  --border-focus: rgba(99, 102, 241, 0.6);
  
  --text-main: #09090b;
  --text-muted: #71717a;
  --text-inverse: #fafafa;
  
  --shadow-sm: 0 2px 8px -2px rgba(9, 9, 11, 0.1);
  --shadow-md: 0 10px 25px -5px rgba(9, 9, 11, 0.1);
  --shadow-lg: 0 20px 40px -10px rgba(9, 9, 11, 0.15);
  
  --glass-blur: blur(12px);
}

/* CSS Resets & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* Typography Utility */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.w-full { width: 100%; }
.h-full { height: 100%; }
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-2 { margin-bottom: 8px; }
.ml-2 { margin-left: 8px; }
.p-6 { padding: 24px; }
.p-4 { padding: 16px; }
.inline-block { display: inline-block; }
.cursor-pointer { cursor: pointer; }

/* Status Text Classes */
.text-green { color: var(--success); }
.text-orange { color: var(--warning); }
.text-red { color: var(--danger); }
.accent-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Premium Buttons & Cards */
.cta-button {
  background: var(--accent-gradient);
  color: var(--text-inverse);
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 80px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 15px -3px rgba(99, 102, 241, 0.4);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -3px rgba(99, 102, 241, 0.6);
  background: var(--accent-gradient-hover);
}
.cta-button:active {
  transform: translateY(0);
}

.secondary-button {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-weight: 500;
  padding: 12px 24px;
  border-radius: 80px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background var(--transition-fast), border var(--transition-fast), transform var(--transition-fast);
}
.secondary-button:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
  transform: translateY(-1px);
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  transition: transform var(--transition-normal), border var(--transition-normal), box-shadow var(--transition-normal);
}
.glass-card:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md);
}

/* Header & Navigation */
.main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 9, 11, 0.7);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-normal), border var(--transition-normal);
}
html.light .main-header {
  background: rgba(250, 250, 250, 0.75);
}

.header-container {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.logo-icon-wrap {
  width: 42px;
  height: 42px;
  background: var(--accent-gradient);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-inverse);
  box-shadow: 0 4px 12px -3px rgba(99, 102, 241, 0.5);
}
.logo-icon {
  width: 24px;
  height: 24px;
}
.logo-text {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.5px;
}

.desktop-nav {
  display: flex;
  gap: 8px;
}
.nav-link {
  padding: 8px 16px;
  border-radius: 40px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast);
}
.nav-link:hover, .nav-link.active {
  color: var(--text-main);
  background: var(--bg-card-hover);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-toggle-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: var(--bg-card);
  transition: background var(--transition-fast), border var(--transition-fast);
}
.theme-toggle-btn:hover {
  border-color: var(--border-focus);
  background: var(--bg-card-hover);
}
.theme-toggle-btn .sun-icon { display: none; }
.theme-toggle-btn .moon-icon { display: block; }
html.light .theme-toggle-btn .sun-icon { display: block; }
html.light .theme-toggle-btn .moon-icon { display: none; }

.mobile-menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Mobile side drawer */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100vh;
  z-index: 105;
  background: var(--bg-app);
  border-left: 1px solid var(--border-color);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-drawer.open {
  right: 0;
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-links {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.drawer-link {
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--text-muted);
  font-weight: 500;
  transition: color var(--transition-fast), background var(--transition-fast);
}
.drawer-link:hover, .drawer-link.active {
  color: var(--text-main);
  background: var(--bg-card-hover);
}
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 104;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Tab Panels */
.tab-panel {
  display: none;
  animation: fadeIn 0.4s ease-out;
}
.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Home Panel Styling */
.section-divider {
  height: 1px;
  background: radial-gradient(circle, var(--border-color) 0%, transparent 80%);
  margin: 80px 0;
}

.hero-section {
  position: relative;
  padding: 80px 0;
  overflow: hidden;
}
.hero-bg-gradients {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}
.gradient-ball {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
}
.ball-1 {
  top: -10%;
  right: 10%;
  width: 400px;
  height: 400px;
  background: var(--primary);
}
.ball-2 {
  bottom: 10%;
  left: -5%;
  width: 500px;
  height: 500px;
  background: var(--secondary);
}

.tagline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 6px 16px;
  border-radius: 40px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 24px;
}
.tag-icon {
  width: 14px;
  height: 14px;
  color: var(--secondary);
}

.hero-title {
  font-size: 3.5rem;
  line-height: 1.15;
  margin-bottom: 20px;
}
.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-description {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  max-width: 540px;
}
.hero-buttons {
  display: flex;
  gap: 16px;
  margin-bottom: 40px;
}

.hero-stats-badge {
  display: flex;
  align-items: center;
  gap: 16px;
}
.avatar-group {
  display: flex;
}
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--bg-app);
  overflow: hidden;
  margin-left: -10px;
}
.avatar:first-child { margin-left: 0; }
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.badge-text {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.stars {
  display: flex;
  gap: 2px;
}
.stars i {
  width: 14px;
  height: 14px;
  color: var(--warning);
}
.fill-star {
  fill: var(--warning);
}

.hero-visual-card {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.visual-glass-card {
  background: rgba(24, 24, 27, 0.4);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 28px;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.card-scanner-sim {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  width: 100%;
  max-width: 380px;
}
.hero-face-img {
  width: 100%;
  display: block;
  filter: grayscale(20%);
}
.scanner-line-sim {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, transparent, #a855f7, #6366f1, transparent);
  box-shadow: 0 0 10px #6366f1;
  animation: scanSim 3.5s infinite ease-in-out;
}
@keyframes scanSim {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}

.landmark-nodes-sim .node {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #6366f1;
  border-radius: 50%;
  box-shadow: 0 0 8px #6366f1;
  animation: nodePulse 1.5s infinite alternate;
}
@keyframes nodePulse {
  0% { transform: scale(0.8); opacity: 0.5; }
  100% { transform: scale(1.4); opacity: 1; }
}

.n-1 { top: 35%; left: 38%; animation-delay: 0.1s; }
.n-2 { top: 35%; left: 62%; animation-delay: 0.3s; }
.n-3 { top: 48%; left: 50%; animation-delay: 0.5s; }
.n-4 { top: 62%; left: 40%; animation-delay: 0.2s; }
.n-5 { top: 62%; left: 60%; animation-delay: 0.4s; }
.n-6 { top: 78%; left: 50%; animation-delay: 0.6s; }
.n-7 { top: 55%; left: 24%; animation-delay: 0.7s; }

.floating-score-card {
  position: absolute;
  top: -15px;
  left: -20px;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-md);
  animation: floatAnim 4s infinite ease-in-out;
}
.floating-metrics-card {
  position: absolute;
  bottom: -15px;
  right: -20px;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 160px;
  box-shadow: var(--shadow-md);
  animation: floatAnim 4s infinite ease-in-out;
  animation-delay: 2s;
}

@keyframes floatAnim {
  0% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0); }
}

.fl-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: var(--text-inverse);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fl-details {
  display: flex;
  flex-direction: column;
}
.fl-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.fl-status {
  font-size: 0.85rem;
  font-weight: 600;
}
.fl-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
}
.fl-bar {
  width: 50px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}
.fl-bar-fill {
  height: 100%;
  background: var(--primary);
}

/* Before/After Section */
.section-header {
  margin-bottom: 48px;
}
.section-tag {
  display: inline-block;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 40px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.section-title {
  font-size: 2.25rem;
  margin-bottom: 12px;
}
.section-subtitle {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

.slider-wrapper {
  max-width: 800px;
  margin: 0 auto;
}
.slider-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  user-select: none;
  cursor: ew-resize;
}
.slide-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.slide-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.before-image {
  z-index: 10;
}
.after-image {
  z-index: 20;
  width: 50%; /* Default overlap split */
  overflow: hidden;
}
/* To simulate improvement, let's slightly adjust visual metrics */
.simulated-after {
  transform: scale(1.02) translateX(4px);
  filter: contrast(1.08) brightness(1.02);
}

.slider-label {
  position: absolute;
  bottom: 20px;
  background: rgba(9, 9, 11, 0.7);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.label-before { left: 20px; }
.label-after { right: 20px; }

.slider-handle {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  background: #fff;
  z-index: 30;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  transform: translateX(-50%);
}
.handle-line {
  position: absolute;
  height: 100%;
  width: 2px;
  background: var(--accent-gradient);
  left: 1px;
}
.handle-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  color: var(--text-inverse);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid var(--bg-app);
}

.slider-instructions {
  text-align: center;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.inline-icon {
  width: 14px;
  height: 14px;
  vertical-align: middle;
  margin-right: 4px;
}

/* Feature Cards */
.feature-card {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.feature-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.feature-icon-box.bg-purple { background: linear-gradient(135deg, #a855f7, #6366f1); }
.feature-icon-box.bg-blue { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.feature-icon-box.bg-pink { background: linear-gradient(135deg, #ec4899, #f43f5e); }

.feature-card-title {
  font-size: 1.25rem;
}
.feature-card-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Statistics Counters */
.stats-section {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: 28px;
  padding: 48px;
}
.stat-number {
  display: block;
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}
.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Testimonials */
.testimonial-card {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  justify-content: space-between;
}
.t-rating {
  display: flex;
  gap: 4px;
}
.t-comment {
  font-size: 0.95rem;
  font-style: italic;
  color: var(--text-main);
  line-height: 1.6;
}
.t-user {
  display: flex;
  align-items: center;
  gap: 12px;
}
.t-user img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}
.t-name {
  font-size: 0.9rem;
  font-weight: 600;
}
.t-title {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Pricing Section */
.pricing-box {
  display: flex;
  justify-content: center;
  max-width: 450px;
  margin: 0 auto;
}
.pricing-card {
  padding: 48px 32px;
  position: relative;
  overflow: hidden;
  text-align: center;
  width: 100%;
}
.pricing-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--accent-gradient);
}
.pricing-badge {
  display: inline-block;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 40px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.plan-name {
  font-size: 1.5rem;
  margin-bottom: 8px;
}
.plan-price {
  margin-bottom: 16px;
}
.plan-price .currency {
  font-size: 1.5rem;
  vertical-align: top;
  font-weight: 600;
}
.plan-price .price-val {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
}
.plan-price .duration {
  color: var(--text-muted);
  font-size: 0.95rem;
}
.plan-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}
.plan-features {
  list-style: none;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 36px;
}
.plan-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}
.check-icon {
  width: 16px;
  height: 16px;
  color: var(--success);
}

/* FAQ Accordion */
.faq-accordion-wrap {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color var(--transition-fast);
}
.faq-item:hover {
  border-color: var(--border-focus);
}
.faq-question {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 600;
  user-select: none;
}
.faq-chevron {
  width: 20px;
  height: 20px;
  transition: transform var(--transition-normal);
}
.faq-item.active .faq-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  padding: 0 24px;
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}
.faq-item.active .faq-answer {
  max-height: 200px;
  padding-bottom: 20px;
}

/* ==========================================
   AI Scanner Tab Panel
   ========================================== */
.scanner-container {
  padding-top: 40px;
}

.disclaimer-alert-card {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 16px;
  padding: 16px 20px;
  display: flex;
  gap: 16px;
  max-width: 1000px;
  margin: 0 auto 32px auto;
  align-items: center;
}
.disclaimer-alert-card .alert-icon {
  color: var(--warning);
  display: flex;
  align-items: center;
}
.disclaimer-alert-card .alert-body {
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.5;
}

.grid-scanner-main {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
}

.scanner-workspace {
  padding: 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 500px;
}

.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border-color);
  border-radius: 20px;
  padding: 60px 40px;
  text-align: center;
  transition: border-color var(--transition-normal), background var(--transition-normal);
}
.upload-zone.drag-active {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.03);
}
.upload-icon-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.upload-zone h3 {
  font-size: 1.35rem;
  margin-bottom: 8px;
}
.upload-zone p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}
.upload-buttons {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
}
.upload-tips {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: 320px;
}

/* Processing Workspace */
.processing-zone {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
}
.canvas-wrapper {
  position: relative;
  max-width: 100%;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
  background: #000;
}
.canvas-wrapper img {
  display: block;
  max-width: 100%;
  max-height: 480px;
  width: auto;
  height: auto;
}
.canvas-wrapper canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.scanner-laser-bar {
  position: absolute;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent-gradient);
  box-shadow: 0 0 12px #6366f1;
  z-index: 5;
  pointer-events: none;
  opacity: 0;
}
.scanner-laser-bar.scanning {
  opacity: 1;
  animation: laserSweep 2s infinite linear;
}
@keyframes laserSweep {
  0% { top: 0%; }
  100% { top: 100%; }
}

.scanner-progress-info {
  width: 100%;
}
.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 8px;
  font-weight: 500;
}
.progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 16px;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  transition: width 0.3s ease;
}

.console-logs-wrap {
  background: #000;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 16px;
  height: 100px;
  overflow-y: auto;
}
.console-logs {
  list-style: none;
  font-family: monospace;
  font-size: 0.78rem;
  color: #10b981;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Sidebar Dashboard results */
.scanner-results-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.empty-results-state {
  height: 100%;
  padding: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.empty-icon {
  width: 48px;
  height: 48px;
  color: var(--text-muted);
}
.empty-results-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.score-main-card {
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.score-circle-container {
  position: relative;
  width: 160px;
  height: 160px;
}
.score-ring-svg {
  transform: rotate(-90deg);
}
.score-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
}
html.light .score-ring-bg {
  stroke: rgba(9, 9, 11, 0.05);
}
.score-ring-fill {
  fill: none;
  stroke: url(#accent-grad-svg); /* Simulated gradient standard */
  stroke: var(--primary);
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease-out;
}
.score-value-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.score-num {
  font-size: 2.8rem;
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1;
}
.score-max {
  font-size: 1rem;
  color: var(--text-muted);
  align-self: flex-end;
  margin-bottom: 40px;
}

.score-rating-label h3 {
  font-size: 1.45rem;
  margin-bottom: 4px;
}
.score-rating-label p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.confidence-badge-wrap {
  display: flex;
  gap: 8px;
}
.conf-pill, .info-pill {
  padding: 4px 12px;
  border-radius: 40px;
  font-size: 0.75rem;
  font-weight: 600;
}
.conf-pill {
  background: var(--success-glow);
  color: var(--success);
}
.info-pill {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
  display: flex;
  align-items: center;
  gap: 4px;
}

.sidebar-heading {
  font-size: 1.15rem;
  margin-top: 10px;
  margin-bottom: 4px;
}

/* Metrics breakdown grids */
.metrics-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 12px;
}
.metric-row-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 14px 18px;
}
.m-row-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.m-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}
html.light .m-bar-wrap {
  background: rgba(9, 9, 11, 0.05);
}
.m-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  width: 0;
  transition: width 1s ease-out;
}

/* Formula Showcase Accordion */
.formula-card {
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
}
.formula-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}
.formula-header h4 {
  font-size: 0.9rem;
  font-weight: 600;
}
.formula-body {
  padding: 0 20px 20px 20px;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
}
.formula-intro {
  color: var(--text-muted);
  margin-top: 12px;
  margin-bottom: 12px;
}
.formula-math-block {
  background: #000;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
}
.formula-math-block code {
  font-family: monospace;
  color: #a855f7;
  white-space: nowrap;
}
.formula-weights-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.weight-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 4px;
}

.face-shape-result-card {
  padding: 20px;
}
.shape-badge {
  display: inline-block;
  background: var(--accent-gradient);
  color: var(--text-inverse);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}
.face-shape-result-card h4 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}
.face-shape-result-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.scanner-result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.suggestions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.suggestion-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  gap: 14px;
}
.s-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.s-info-body h5 {
  font-size: 0.9rem;
  margin-bottom: 4px;
}
.s-info-body p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ==========================================
   Face Exercises Library Panel
   ========================================== */
.exercises-filter-bar {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 32px;
}
.search-box-wrap {
  position: relative;
  width: 100%;
}
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 20px;
  height: 20px;
}
.search-box-wrap input {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  padding: 14px 16px 14px 48px;
  border-radius: 12px;
  font-size: 0.95rem;
  transition: border-color var(--transition-fast);
}
.search-box-wrap input:focus {
  border-color: var(--primary);
}

.category-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.category-pill {
  padding: 8px 18px;
  border-radius: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.category-pill:hover, .category-pill.active {
  background: var(--primary);
  color: var(--text-inverse);
  border-color: var(--primary);
}

.exercises-grid-container {
  margin-bottom: 40px;
}
.exercise-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}
.ex-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.ex-category-tag {
  background: rgba(99, 102, 241, 0.08);
  color: var(--primary);
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 600;
}
.ex-difficulty-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}
.ex-difficulty-badge.beginner { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.ex-difficulty-badge.intermediate { background: rgba(245, 158, 11, 0.1); color: var(--warning); }
.ex-difficulty-badge.advanced { background: rgba(239, 68, 68, 0.1); color: var(--danger); }

.exercise-card h4 {
  font-size: 1.15rem;
  line-height: 1.3;
}
.ex-short-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ex-quick-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

/* ==========================================
   Interactive Utilities Panel
   ========================================== */
.utilities-tabs-wrap {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
}
.utility-sidebar-menu {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: fit-content;
}
.util-menu-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}
.util-menu-btn i {
  width: 18px;
  height: 18px;
}
.util-menu-btn:hover, .util-menu-btn.active {
  background: var(--bg-card-hover);
  color: var(--text-main);
}
.util-menu-btn.active {
  border-left: 3px solid var(--primary);
  border-radius: 0 12px 12px 0;
  padding-left: 13px;
}

.utility-content-wrap {
  min-height: 480px;
}
.utility-sub-panel {
  display: none;
  animation: fadeIn 0.3s ease-out;
}
.utility-sub-panel.active {
  display: block;
}

/* Golden Ratio Canvas Overlay */
.ratio-tool-layout {
  gap: 24px;
}
.ratio-canvas-box {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ratio-canvas-placeholder {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 20px;
  text-align: center;
}
.ratio-canvas-box img {
  max-width: 100%;
  max-height: 100%;
  display: none;
}
.ratio-canvas-box canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.proportions-readout {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
}
.proportions-readout h4 {
  font-size: 0.9rem;
  margin-bottom: 12px;
}
.ratio-output-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 8px;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 4px;
}
.ratio-output-row .val {
  font-weight: 700;
  color: var(--primary);
}
.ratio-phi-notice {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.slider-group label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}
.slider-group input[type="range"] {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  appearance: none;
  outline: none;
  margin: 6px 0 12px 0;
}
.slider-group input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  transition: transform var(--transition-fast);
}
.slider-group input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Quiz Container */
.quiz-container-box {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
}
.quiz-progress-indicator {
  font-size: 0.78rem;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 12px;
}
.quiz-question-title {
  font-size: 1.25rem;
  margin-bottom: 20px;
}
.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.quiz-opt-btn {
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 14px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.92rem;
  transition: all var(--transition-fast);
}
.quiz-opt-btn:hover {
  border-color: var(--border-focus);
  background: var(--bg-card-hover);
}

.quiz-result-box {
  background: rgba(16, 185, 129, 0.04);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
}
.quiz-result-box h2 {
  font-size: 2.25rem;
  margin: 8px 0 16px 0;
}
.quiz-result-box p {
  color: var(--text-muted);
}

/* Color Analysis Canvas */
.color-image-container {
  width: 100%;
  aspect-ratio: 1;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.color-placeholder-txt {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 20px;
  text-align: center;
}
.color-image-container img {
  max-width: 100%;
  max-height: 100%;
  display: none;
}
.color-overlay-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  opacity: 0.85;
}

.color-tab-controls {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.color-tab-btn {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.color-tab-btn.active {
  background: var(--primary);
  color: var(--text-inverse);
  border-color: var(--primary);
}

.palette-palette-guide h4 {
  font-size: 0.95rem;
  margin-bottom: 6px;
}
.palette-palette-guide p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* BMI Calculator */
.bmi-form {
  gap: 24px;
}
.bmi-inputs input {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.95rem;
  margin-top: 6px;
}
.bmi-inputs label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}
.bmi-results-box {
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.bmi-empty-txt {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.bmi-content {
  text-align: center;
}
.bmi-value-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 4px solid var(--primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.bmi-value-num {
  font-size: 1.8rem;
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.1;
}
.bmi-value-circle span:last-child {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Grooming card grids */
.grooming-grid {
  gap: 20px;
}
.groom-card {
  padding: 20px;
}
.groom-card h4 {
  font-size: 1rem;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.groom-card h4 i {
  width: 18px;
  height: 18px;
  color: var(--primary);
}
.groom-card ul {
  list-style: none;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.groom-card li strong {
  color: var(--primary);
}

.shape-selector-wrap select {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.95rem;
}

/* Celebrity Lookalike Finder */
.celeb-display-wrap {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.celeb-result-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  animation: fadeIn 0.4s ease-out;
}
.celeb-portraits {
  display: flex;
  align-items: center;
  gap: 24px;
}
.portrait-box {
  text-align: center;
}
.portrait-box img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary);
}
.portrait-box span {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
}
.celeb-match-percentage {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--success);
}
.celeb-similarity-bar {
  width: 100px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin: 6px 0;
}
.celeb-similarity-fill {
  height: 100%;
  background: var(--success);
}

/* Skincare lists */
.skincare-grid {
  gap: 20px;
}
.skin-card h4 {
  font-size: 0.98rem;
  margin-bottom: 12px;
  color: var(--primary);
}
.skin-card ul {
  list-style: none;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ==========================================
   Progress Tracker Tab Panel
   ========================================== */
.grid-tracker {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
}

.chart-widget-card {
  padding: 32px;
}
.chart-canvas-wrap {
  width: 100%;
  aspect-ratio: 16/10;
  position: relative;
}

.timeline-history-card {
  padding: 32px;
  display: flex;
  flex-direction: column;
  height: fit-content;
}
.history-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.clear-history-btn {
  font-size: 0.8rem;
  color: var(--danger);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.clear-history-btn i {
  width: 14px;
  height: 14px;
}

.history-list-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 480px;
  overflow-y: auto;
}
.history-empty-state {
  padding: 40px 20px;
  color: var(--text-muted);
}
.history-empty-state p {
  font-size: 0.85rem;
  margin-top: 10px;
}

.history-item-entry {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}
.history-item-entry:hover {
  border-color: var(--border-focus);
}
.h-entry-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.h-entry-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: var(--text-inverse);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.h-entry-info h5 {
  font-size: 0.95rem;
  margin-bottom: 2px;
}
.h-entry-info span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.h-entry-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.delete-history-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.delete-history-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* ==========================================
   Modals & Popups
   ========================================== */
.modal-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.modal-wrapper.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  width: 100%;
  max-width: 600px;
  border-radius: 24px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.92);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-wrapper.active .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
  margin-bottom: 16px;
}
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}
.modal-close:hover {
  border-color: var(--border-focus);
}

.modal-body {
  overflow-y: auto;
}
.modal-body.scroll-y {
  max-height: calc(80vh - 120px);
}

.modal-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  margin-top: 16px;
}

/* Camera Streaming modal specifics */
.camera-stream-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
}
#webcam-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror camera stream */
}
.camera-face-outline {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 55%;
  height: 70%;
  border: 2px dashed rgba(255, 255, 255, 0.4);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  pointer-events: none;
  box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.5);
}

.camera-tip {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* Multi-face popup cards */
.faces-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.face-select-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
}
.face-select-card:hover {
  border-color: var(--border-focus);
}
.face-select-card img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 12px;
  border: 2px solid var(--border-color);
}
.face-select-card span {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Exercise Details Modal Specifics */
.modal-content {
  max-width: 840px; /* Slightly wider modal for exercise layout */
}
.modal-exercise-layout {
  gap: 24px;
}
.ex-animation-wrapper {
  background: #000;
  aspect-ratio: 4/3;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-color);
  margin-bottom: 16px;
}

/* SVG exercise animations templates */
.ex-svg-visual {
  width: 100%;
  height: 100%;
  padding: 30px;
}
.ex-svg-head {
  fill: #1f1f22;
  stroke: #6366f1;
  stroke-width: 4;
}
.ex-svg-feature {
  stroke: #a855f7;
  stroke-linecap: round;
  stroke-width: 4;
  fill: none;
}
.anim-pulse {
  animation: svgPulse 2s infinite alternate ease-in-out;
  transform-origin: center;
}
@keyframes svgPulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.08); opacity: 1; }
}

.anim-jaw-flex {
  animation: jawFlex 1.5s infinite alternate ease-in-out;
  transform-origin: 50% 65%;
}
@keyframes jawFlex {
  0% { transform: translateY(0) scaleY(1); }
  100% { transform: translateY(12px) scaleY(1.06); }
}

.anim-eye-blink {
  animation: eyeBlink 3s infinite ease-in-out;
}
@keyframes eyeBlink {
  0%, 90%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(0.1); }
}

.exercise-quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.eq-stat {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}
.eq-stat .label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.eq-stat .val {
  font-size: 0.85rem;
  font-weight: 700;
}

.exercise-details-area {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ex-details-section h4 {
  font-size: 0.92rem;
  margin-bottom: 6px;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ex-details-section p, .ex-details-section li {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.target-muscles-txt {
  font-weight: 600;
  color: var(--text-main) !important;
}

.practice-routine-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 6px;
}
.pr-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}
.pr-box .num {
  display: block;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
}
.pr-box .lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ex-steps-ordered-list {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Footer elements */
.app-footer {
  background: #000;
  border-top: 1px solid var(--border-color);
  padding: 80px 0 20px 0;
  margin-top: 80px;
}
.footer-grid {
  margin-bottom: 60px;
}
.footer-col h4 {
  font-size: 0.95rem;
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.9rem;
}
.footer-col ul a {
  color: var(--text-muted);
}
.footer-col ul a:hover {
  color: var(--primary);
}
.brand-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.footer-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 260px;
}
.social-links {
  display: flex;
  gap: 12px;
}
.social-links a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}
.social-links a:hover {
  border-color: var(--border-focus);
  color: var(--primary);
}
.footer-info {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.footer-info i {
  width: 16px;
  height: 16px;
  color: var(--primary);
}
.footer-info-small {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 16px;
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
}
.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ==========================================
   Responsive Breakpoints
   ========================================== */
@media (max-width: 1024px) {
  html { font-size: 15px; }
  .grid-scanner-main, .grid-tracker, .utilities-tabs-wrap {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .utility-sidebar-menu {
    flex-direction: row;
    overflow-x: auto;
    width: 100%;
    padding-bottom: 8px;
  }
  .util-menu-btn {
    white-space: nowrap;
    width: auto;
  }
  .util-menu-btn.active {
    border-left: none;
    border-bottom: 3px solid var(--primary);
    border-radius: 0 0 12px 12px;
  }
  .hero-title { font-size: 3rem; }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .desktop-nav, .header-actions .nav-cta {
    display: none;
  }
  .mobile-menu-toggle {
    display: flex;
  }
  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-description {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-buttons {
    justify-content: center;
  }
  .hero-stats-badge {
    justify-content: center;
  }
  .hero-visual-card {
    margin-top: 40px;
  }
  .floating-score-card, .floating-metrics-card {
    display: none;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .modal-exercise-layout {
    grid-template-columns: 1fr;
  }
  .exercise-visual-area {
    margin-bottom: 24px;
  }
}

@media (max-width: 480px) {
  html { font-size: 14px; }
  .hero-title { font-size: 2.5rem; }
  .hero-buttons {
    flex-direction: column;
    width: 100%;
  }
  .hero-buttons button {
    width: 100%;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .category-pills {
    padding-bottom: 12px;
  }
  .footer-bottom-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}
