/* ============================================
   AI Smart Health Device Platform - Design System
   ============================================ */

/* === 1. CSS Variables / Design Tokens === */
:root {
  --bg-primary: #0A0E1A;
  --bg-secondary: #111827;
  --bg-tertiary: #1E293B;
  --bg-card: rgba(17, 24, 39, 0.8);
  --bg-glass: rgba(17, 24, 39, 0.6);
  --border-color: rgba(30, 41, 59, 0.8);
  --border-glow: rgba(6, 182, 212, 0.3);
  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-tertiary: #64748B;
  --ai-cyan: #06B6D4;
  --ai-purple: #8B5CF6;
  --health-green: #10B981;
  --warning-amber: #F59E0B;
  --alert-red: #EF4444;
  --vital-pink: #EC4899;
  --gradient-primary: linear-gradient(135deg, #06B6D4, #8B5CF6);
  --gradient-health: linear-gradient(135deg, #10B981, #06B6D4);
  --gradient-vital: linear-gradient(135deg, #EC4899, #8B5CF6);
  --gradient-warm: linear-gradient(135deg, #F59E0B, #EF4444);
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --space-xs: 4px; --space-sm: 8px; --space-md: 16px;
  --space-lg: 24px; --space-xl: 32px; --space-2xl: 48px; --space-3xl: 64px;
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px;
  --radius-xl: 24px; --radius-full: 9999px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-glow-cyan: 0 0 20px rgba(6,182,212,0.3);
  --shadow-glow-purple: 0 0 20px rgba(139,92,246,0.3);
  --transition-fast: 200ms cubic-bezier(0.16,1,0.3,1);
  --transition-normal: 400ms cubic-bezier(0.16,1,0.3,1);
  --transition-slow: 600ms cubic-bezier(0.16,1,0.3,1);
  --header-height: 60px;
  --bottom-nav-height: 64px;
}

[data-theme="light"] {
  --bg-primary: #F8FAFC; --bg-secondary: #FFFFFF; --bg-tertiary: #F1F5F9;
  --bg-card: rgba(255,255,255,0.9); --bg-glass: rgba(255,255,255,0.7);
  --border-color: rgba(226,232,240,0.8);
  --text-primary: #0F172A; --text-secondary: #475569; --text-tertiary: #94A3B8;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
}

/* === 2. Reset & Base === */
*,*::before,*::after { margin:0; padding:0; box-sizing:border-box; }
html { font-size:16px; scroll-behavior:smooth; -webkit-text-size-adjust:100%; }
body {
  font-family: var(--font-primary); background: var(--bg-primary);
  color: var(--text-primary); line-height:1.6; overflow-x:hidden;
  min-height:100vh; -webkit-font-smoothing:antialiased;
}
a { color:var(--ai-cyan); text-decoration:none; }
img { max-width:100%; height:auto; display:block; }
button { font-family:inherit; cursor:pointer; border:none; outline:none; background:none; }
input,select,textarea { font-family:inherit; font-size:inherit; border:none; outline:none; background:none; }
ul,ol { list-style:none; }
::-webkit-scrollbar { width:6px; height:6px; }
::-webkit-scrollbar-track { background:var(--bg-primary); }
::-webkit-scrollbar-thumb { background:var(--bg-tertiary); border-radius:var(--radius-full); }

/* === 3. Loading Screen - Planet Tech Theme === */
#loading-screen {
  position:fixed; inset:0; z-index:10000;
  background: radial-gradient(ellipse at 50% 40%, #152952 0%, #0c1530 50%, #050a18 100%);
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  transition: opacity 1s ease, visibility 1s ease;
  overflow:hidden;
}
#loading-screen.hidden { opacity:0; visibility:hidden; pointer-events:none; }

/* Space background image */
.loading-space-bg { position:absolute; inset:0; z-index:0; }
.loading-space-img {
  width:100%; height:100%; object-fit:cover; opacity:0.55;
  filter: blur(1px) saturate(1.5) brightness(1.3);
}
.loading-space-overlay {
  position:absolute; inset:0;
  background: radial-gradient(ellipse at center 40%, rgba(6,182,212,0.05) 10%, rgba(5,10,24,0.6) 70%);
}

/* Stars */
.loading-stars { position:absolute; inset:0; z-index:1; pointer-events:none; }
.star {
  position:absolute; border-radius:50%; background:#fff;
  animation: starTwinkle var(--dur, 3s) ease-in-out infinite var(--delay, 0s);
}
@keyframes starTwinkle {
  0%,100% { opacity:0.4; transform:scale(0.8); }
  50% { opacity:1; transform:scale(1.4); }
}

/* Planet wrapper */
.loading-planet-wrapper {
  position:relative; width:220px; height:220px; z-index:2;
  display:flex; align-items:center; justify-content:center;
  margin-bottom: var(--space-xl);
}

/* Planet core */
.loading-planet-core {
  width:110px; height:110px; border-radius:50%; position:relative;
  background: radial-gradient(circle at 35% 35%, #2a5aa0, #132d5e 50%, #0a1a3a 80%);
  box-shadow:
    inset -8px -8px 20px rgba(0,0,0,0.4),
    inset 4px 4px 15px rgba(6,182,212,0.3),
    0 0 60px rgba(6,182,212,0.4),
    0 0 120px rgba(139,92,246,0.3),
    0 0 180px rgba(6,182,212,0.15);
  animation: planetFloat 6s ease-in-out infinite;
  overflow:hidden;
}
@keyframes planetFloat {
  0%,100% { transform:translateY(0); }
  50% { transform:translateY(-8px); }
}

/* Planet surface texture */
.loading-planet-core::before {
  content:''; position:absolute; inset:0; border-radius:50%;
  background:
    radial-gradient(circle at 60% 30%, rgba(6,182,212,0.12) 0%, transparent 40%),
    radial-gradient(circle at 25% 70%, rgba(139,92,246,0.1) 0%, transparent 35%),
    radial-gradient(circle at 80% 60%, rgba(16,185,129,0.08) 0%, transparent 25%);
  animation: planetSurface 20s linear infinite;
}
@keyframes planetSurface { 0% { transform:rotate(0deg); } 100% { transform:rotate(360deg); } }

/* Planet glow */
.planet-glow {
  position:absolute; inset:-30px; border-radius:50%;
  background: radial-gradient(circle, rgba(6,182,212,0.2) 25%, rgba(139,92,246,0.1) 50%, transparent 70%);
  animation: glowPulse 3s ease-in-out infinite;
}
@keyframes glowPulse {
  0%,100% { opacity:0.5; transform:scale(1); }
  50% { opacity:1; transform:scale(1.1); }
}

/* Planet rings */
.planet-ring {
  position:absolute; border-radius:50%; border:1px solid;
  top:50%; left:50%; transform:translate(-50%,-50%);
}
.planet-ring.ring-1 {
  width:160px; height:50px;
  border-color: rgba(6,182,212,0.3);
  transform: translate(-50%,-50%) rotateX(75deg) rotateZ(-15deg);
  animation: ringRotate1 8s linear infinite;
  box-shadow: 0 0 8px rgba(6,182,212,0.15);
}
.planet-ring.ring-2 {
  width:190px; height:60px;
  border-color: rgba(139,92,246,0.2);
  transform: translate(-50%,-50%) rotateX(75deg) rotateZ(20deg);
  animation: ringRotate2 12s linear infinite;
  box-shadow: 0 0 8px rgba(139,92,246,0.1);
}
@keyframes ringRotate1 { 0% { transform:translate(-50%,-50%) rotateX(75deg) rotateZ(-15deg); } 100% { transform:translate(-50%,-50%) rotateX(75deg) rotateZ(345deg); } }
@keyframes ringRotate2 { 0% { transform:translate(-50%,-50%) rotateX(75deg) rotateZ(20deg); } 100% { transform:translate(-50%,-50%) rotateX(75deg) rotateZ(380deg); } }

/* Scan line */
.planet-scan-line {
  position:absolute; width:100%; height:2px; top:0; left:0;
  background: linear-gradient(90deg, transparent, rgba(6,182,212,0.6), transparent);
  animation: scanLine 3s ease-in-out infinite;
  border-radius:50%;
}
@keyframes scanLine {
  0% { top:0; opacity:0; }
  10% { opacity:1; }
  90% { opacity:1; }
  100% { top:100%; opacity:0; }
}

/* Orbital paths */
.loading-orbit {
  position:absolute; border-radius:50%; border:1px dashed rgba(6,182,212,0.12);
  top:50%; left:50%; transform:translate(-50%,-50%);
}
.loading-orbit.orbit-1 { width:240px; height:240px; animation:orbitSpin 10s linear infinite; }
.loading-orbit.orbit-2 { width:300px; height:300px; animation:orbitSpin 15s linear infinite reverse; border-color:rgba(139,92,246,0.1); }
.loading-orbit.orbit-3 { width:360px; height:360px; animation:orbitSpin 20s linear infinite; border-color:rgba(16,185,129,0.08); }
@keyframes orbitSpin { 0% { transform:translate(-50%,-50%) rotate(0deg); } 100% { transform:translate(-50%,-50%) rotate(360deg); } }

.orbit-dot {
  position:absolute; width:6px; height:6px; border-radius:50%;
  top:-3px; left:50%; transform:translateX(-50%);
}
.orbit-1 .orbit-dot { background:var(--ai-cyan); box-shadow:0 0 16px var(--ai-cyan), 0 0 30px rgba(6,182,212,0.5); }
.orbit-2 .orbit-dot { background:var(--ai-purple); box-shadow:0 0 16px var(--ai-purple), 0 0 30px rgba(139,92,246,0.5); }
.orbit-3 .orbit-dot { background:var(--health-green); box-shadow:0 0 16px var(--health-green), 0 0 30px rgba(16,185,129,0.5); }

/* HUD elements */
.loading-hud {
  position:absolute; top:var(--space-lg); left:var(--space-lg); right:var(--space-lg);
  display:flex; justify-content:space-between; z-index:3;
}
.hud-item { display:flex; flex-direction:column; gap:4px; }
.hud-label {
  font-size:0.625rem; letter-spacing:3px; color:rgba(6,182,212,0.5);
  text-transform:uppercase; font-family:var(--font-mono);
}
.hud-value {
  font-size:0.75rem; letter-spacing:2px; color:var(--ai-cyan);
  font-family:var(--font-mono); animation:textPulse 2s ease-in-out infinite;
}
.hud-signal { color:var(--health-green); }
.signal-dots { animation:dotsBlink 1.5s step-end infinite; }
@keyframes dotsBlink { 0%,100% { opacity:1; } 33% { opacity:0; } 66% { opacity:0.5; } }

/* Progress */
.loading-progress-container {
  position:relative; z-index:3; display:flex; align-items:center; gap:var(--space-sm);
  margin-bottom:var(--space-md);
}
.loading-progress {
  width:200px; height:3px; background:rgba(255,255,255,0.08);
  border-radius:var(--radius-full); overflow:hidden;
  box-shadow: inset 0 0 4px rgba(0,0,0,0.3);
}
.loading-progress-bar {
  height:100%; background: linear-gradient(90deg, var(--ai-cyan), var(--ai-purple));
  border-radius:var(--radius-full); width:0%; transition:width 0.3s ease;
  box-shadow: 0 0 8px rgba(6,182,212,0.4);
}
.loading-percent {
  font-size:0.75rem; color:var(--ai-cyan); font-family:var(--font-mono);
  min-width:32px; text-align:right;
}
.loading-text {
  position:relative; z-index:3;
  color:rgba(255,255,255,0.5); font-size:0.75rem;
  letter-spacing:3px; text-transform:uppercase;
  animation:textPulse 2.5s ease-in-out infinite;
  font-family:var(--font-mono);
}
@keyframes textPulse { 0%,100% { opacity:0.4; } 50% { opacity:1; } }

.loading-brand {
  position:absolute; bottom:var(--space-xl); z-index:3;
  font-size:0.875rem; letter-spacing:6px; text-transform:uppercase;
  color:rgba(255,255,255,0.15); font-weight:300;
}

/* === 4. Auth Screen === */
#auth-screen {
  position:fixed; inset:0; z-index:9000;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(6,182,212,0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(139,92,246,0.08) 0%, transparent 40%),
    linear-gradient(180deg, #0f1f45 0%, #0a1535 40%, #050a18 100%);
  display:none; align-items:center; justify-content:center; padding:var(--space-md);
  overflow-y:auto;
}
#auth-screen.active { display:flex; }
#auth-screen::before {
  content:''; position:absolute; inset:0;
  background:url('../assets/loading-planet.jpeg') center/cover no-repeat;
  opacity:0.25; filter:brightness(1.2) saturate(1.3);
  pointer-events:none;
}
#auth-screen::after {
  content:''; position:absolute; inset:0;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 30%, rgba(5,10,24,0.7) 100%);
  pointer-events:none;
}
.auth-container {
  width:100%; max-width:440px; background:transparent;
  border:none; border-radius:var(--radius-xl); padding:var(--space-2xl); position:relative; overflow:visible;
  z-index:1;
}
.auth-container::before { display:none; }
.auth-logo { text-align:center; margin-bottom:var(--space-xl); }
.auth-logo h1 {
  font-size:1.5rem; font-weight:700;
  background:var(--gradient-primary); -webkit-background-clip:text;
  -webkit-text-fill-color:transparent; background-clip:text;
}
.auth-logo p { color:var(--text-secondary); font-size:0.875rem; margin-top:var(--space-xs); }

.auth-tabs {
  display:flex; gap:var(--space-sm); margin-bottom:var(--space-xl);
  background:rgba(255,255,255,0.05); border-radius:var(--radius-md); padding:4px;
  border:1px solid rgba(255,255,255,0.08);
}
.auth-tab {
  flex:1; padding:var(--space-sm) var(--space-md); border-radius:var(--radius-sm);
  color:rgba(255,255,255,0.5); font-size:0.875rem; font-weight:500;
  transition:all var(--transition-fast); text-align:center;
}
.auth-tab.active { background:var(--gradient-primary); color:white; box-shadow:0 0 15px rgba(6,182,212,0.3); }
.auth-form { display:none; }
.auth-form.active { display:block; }

.form-group { margin-bottom:var(--space-md); }
.form-label { display:block; color:rgba(255,255,255,0.7); font-size:0.8125rem; margin-bottom:var(--space-xs); font-weight:500; text-shadow:0 1px 3px rgba(0,0,0,0.5); }
.form-input {
  width:100%; padding:12px 16px; background:rgba(255,255,255,0.06);
  border:1px solid rgba(255,255,255,0.12); border-radius:var(--radius-md);
  color:var(--text-primary); font-size:0.9375rem; transition:all var(--transition-fast);
}
.form-input:focus { border-color:var(--ai-cyan); box-shadow:0 0 0 3px rgba(6,182,212,0.1); }
.form-input::placeholder { color:var(--text-tertiary); }

.input-with-icon { position:relative; }
.input-with-icon .form-input { padding-left:44px; }
.input-icon { position:absolute; left:14px; top:50%; transform:translateY(-50%); color:var(--text-tertiary); }

.phone-input-group { display:flex; gap:var(--space-sm); }
.phone-input-group .country-code {
  width:80px; padding:12px 8px; background:var(--bg-tertiary);
  border:1px solid var(--border-color); border-radius:var(--radius-md);
  color:var(--text-primary); font-size:0.9375rem;
}
.phone-input-group .form-input { flex:1; }

.sms-input-group { display:flex; gap:var(--space-sm); }
.sms-input-group .form-input { flex:1; }
.sms-btn {
  padding:12px 16px; background:var(--bg-tertiary); border:1px solid var(--border-color);
  border-radius:var(--radius-md); color:var(--ai-cyan); font-size:0.8125rem;
  white-space:nowrap; transition:all var(--transition-fast);
}
.sms-btn:hover { background:rgba(6,182,212,0.1); }

.auth-options { display:flex; justify-content:space-between; align-items:center; margin-bottom:var(--space-lg); font-size:0.8125rem; }
.auth-options label { display:flex; align-items:center; gap:var(--space-xs); color:var(--text-secondary); cursor:pointer; }

.btn-primary {
  width:100%; padding:14px; background:var(--gradient-primary);
  border-radius:var(--radius-md); color:white; font-size:1rem; font-weight:600;
  transition:all var(--transition-fast); position:relative; overflow:hidden;
}
.btn-primary:hover { transform:translateY(-1px); box-shadow:var(--shadow-glow-cyan); }
.btn-primary::after {
  content:''; position:absolute; inset:0;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,0.2),transparent);
  transform:translateX(-100%); transition:transform 0.6s;
}
.btn-primary:hover::after { transform:translateX(100%); }

.auth-divider { display:flex; align-items:center; gap:var(--space-md); margin:var(--space-xl) 0; color:rgba(255,255,255,0.4); font-size:0.8125rem; }
.auth-divider::before,.auth-divider::after { content:''; flex:1; height:1px; background:rgba(255,255,255,0.1); }

.social-login { display:flex; gap:var(--space-md); justify-content:center; }
.social-btn {
  width:48px; height:48px; border-radius:var(--radius-md); background:rgba(255,255,255,0.06);
  border:1px solid rgba(255,255,255,0.12); display:flex; align-items:center; justify-content:center;
  color:rgba(255,255,255,0.6); transition:all var(--transition-fast); font-size:1.25rem;
}
.social-btn:hover { border-color:var(--ai-cyan); color:var(--ai-cyan); transform:translateY(-2px); background:rgba(6,182,212,0.1); }
.auth-footer { text-align:center; margin-top:var(--space-lg); font-size:0.8125rem; color:rgba(255,255,255,0.4); text-shadow:0 1px 3px rgba(0,0,0,0.5); }

/* Guest Browse */
.guest-browse-section { text-align:center; margin-top:var(--space-lg); }
.btn-guest {
  display:inline-flex; align-items:center; gap:8px;
  padding:12px 32px; background:transparent;
  border:1px solid rgba(6,182,212,0.4); border-radius:var(--radius-md);
  color:var(--ai-cyan); font-size:0.9rem; font-weight:500;
  cursor:pointer; transition:all var(--transition-fast);
}
.btn-guest:hover { background:rgba(6,182,212,0.1); border-color:var(--ai-cyan); box-shadow:0 0 20px rgba(6,182,212,0.2); }
.btn-guest svg, .btn-guest i { width:18px; height:18px; }
.guest-hint { font-size:0.75rem; color:rgba(255,255,255,0.35); margin-top:var(--space-xs); text-shadow:0 1px 3px rgba(0,0,0,0.5); }

/* === 5. Main App Layout === */
#main-app { display:none; min-height:100vh; }
#main-app.active { display:block; }

.app-header {
  position:fixed; top:0; left:0; right:0; height:var(--header-height);
  background:var(--bg-glass); backdrop-filter:blur(20px);
  border-bottom:1px solid var(--border-color); z-index:1000;
  display:flex; align-items:center; padding:0 var(--space-lg);
}
.header-logo {
  font-size:1.25rem; font-weight:700;
  background:var(--gradient-primary); -webkit-background-clip:text;
  -webkit-text-fill-color:transparent; background-clip:text; margin-right:auto;
}
.header-nav { display:none; gap:var(--space-lg); margin-right:var(--space-lg); }
.header-nav a {
  color:var(--text-secondary); font-size:0.875rem; font-weight:500;
  transition:color var(--transition-fast); position:relative;
}
.header-nav a:hover,.header-nav a.active { color:var(--text-primary); }
.header-nav a.active::after {
  content:''; position:absolute; bottom:-4px; left:0; right:0;
  height:2px; background:var(--gradient-primary); border-radius:var(--radius-full);
}
.header-actions { display:flex; align-items:center; gap:var(--space-md); }
.header-action-btn {
  width:40px; height:40px; border-radius:var(--radius-md); background:var(--bg-tertiary);
  display:flex; align-items:center; justify-content:center;
  color:var(--text-secondary); transition:all var(--transition-fast); position:relative;
}
.header-action-btn:hover { color:var(--ai-cyan); background:rgba(6,182,212,0.1); }
.header-action-btn .badge {
  position:absolute; top:-2px; right:-2px; width:18px; height:18px;
  background:var(--alert-red); border-radius:50%; font-size:0.625rem;
  display:flex; align-items:center; justify-content:center; color:white; font-weight:600;
}
.header-avatar {
  width:36px; height:36px; border-radius:50%; background:var(--gradient-primary);
  display:flex; align-items:center; justify-content:center;
  color:white; font-weight:600; font-size:0.875rem; cursor:pointer;
}

.app-content { margin-top:var(--header-height); padding-bottom:var(--bottom-nav-height); min-height:calc(100vh - var(--header-height)); }
.page-section { display:none; animation:fadeInUp 0.4s ease; }
.page-section.active { display:block; }
@keyframes fadeInUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }

/* === 6. Bottom Navigation === */
.bottom-nav {
  position:fixed; bottom:0; left:0; right:0; height:var(--bottom-nav-height);
  background:var(--bg-glass); backdrop-filter:blur(20px);
  border-top:1px solid var(--border-color); z-index:1000;
  display:flex; align-items:center; justify-content:space-around; padding:0 var(--space-sm);
}
.bottom-nav-item {
  display:flex; flex-direction:column; align-items:center; gap:2px;
  padding:var(--space-sm); color:var(--text-tertiary);
  transition:color var(--transition-fast); position:relative; min-width:56px;
}
.bottom-nav-item.active { color:var(--ai-cyan); }
.bottom-nav-item .nav-icon { width:24px; height:24px; }
.bottom-nav-item .nav-label { font-size:0.625rem; font-weight:500; }
.bottom-nav-item.active::before {
  content:''; position:absolute; top:0; left:50%; transform:translateX(-50%);
  width:24px; height:2px; background:var(--gradient-primary); border-radius:var(--radius-full);
}

/* === 7. Common Components === */
.card {
  background:var(--bg-card); backdrop-filter:blur(20px);
  border:1px solid var(--border-color); border-radius:var(--radius-lg);
  padding:var(--space-lg); transition:all var(--transition-fast);
}
.card:hover { border-color:var(--border-glow); transform:translateY(-2px); box-shadow:var(--shadow-glow-cyan); }

.section-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:var(--space-lg); padding:0 var(--space-lg); }
.section-title { font-size:1.25rem; font-weight:700; }
.section-more { color:var(--ai-cyan); font-size:0.875rem; font-weight:500; }

.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:var(--space-sm);
  padding:10px 20px; border-radius:var(--radius-md); font-size:0.875rem;
  font-weight:500; transition:all var(--transition-fast);
}
.btn-glow { background:var(--gradient-primary); color:white; box-shadow:var(--shadow-glow-cyan); }
.btn-glow:hover { transform:translateY(-1px); box-shadow:0 0 30px rgba(6,182,212,0.4); }
.btn-outline { border:1px solid var(--border-color); color:var(--text-primary); background:transparent; }
.btn-outline:hover { border-color:var(--ai-cyan); color:var(--ai-cyan); }
.btn-sm { padding:6px 12px; font-size:0.75rem; }
.btn-lg { padding:14px 28px; font-size:1rem; }

.tag { display:inline-flex; align-items:center; padding:4px 10px; border-radius:var(--radius-full); font-size:0.75rem; font-weight:500; }
.tag-cyan { background:rgba(6,182,212,0.15); color:var(--ai-cyan); }
.tag-purple { background:rgba(139,92,246,0.15); color:var(--ai-purple); }
.tag-green { background:rgba(16,185,129,0.15); color:var(--health-green); }
.tag-red { background:rgba(239,68,68,0.15); color:var(--alert-red); }
.tag-amber { background:rgba(245,158,11,0.15); color:var(--warning-amber); }

.scroll-row {
  display:flex; gap:var(--space-md); overflow-x:auto;
  padding:0 var(--space-lg) var(--space-md); scroll-snap-type:x mandatory;
  -webkit-overflow-scrolling:touch; scrollbar-width:none;
}
.scroll-row::-webkit-scrollbar { display:none; }
.scroll-row > * { scroll-snap-align:start; flex-shrink:0; }

/* === 8. Home Page === */
.hero-banner {
  position:relative; margin:var(--space-md); border-radius:var(--radius-xl);
  overflow:hidden; height:200px;
}
.banner-slide { position:absolute; inset:0; opacity:0; transition:opacity 0.6s ease; }
.banner-slide.active { opacity:1; }
.banner-gradient { position:absolute; inset:0; }
.banner-content { position:absolute; bottom:0; left:0; right:0; padding:var(--space-lg); background:linear-gradient(transparent,rgba(0,0,0,0.7)); }
.banner-content h2 { font-size:1.25rem; font-weight:700; margin-bottom:var(--space-xs); color:#fff; }
.banner-content p { font-size:0.8125rem; color:rgba(255,255,255,0.8); }
.banner-dots { position:absolute; bottom:var(--space-md); right:var(--space-md); display:flex; gap:6px; }
.banner-dot { width:6px; height:6px; border-radius:50%; background:rgba(255,255,255,0.4); transition:all var(--transition-fast); }
.banner-dot.active { width:18px; border-radius:var(--radius-full); background:var(--ai-cyan); }

.ai-assistant-entry {
  margin:var(--space-md) var(--space-lg); padding:var(--space-lg);
  background:var(--gradient-primary); border-radius:var(--radius-lg);
  display:flex; align-items:center; gap:var(--space-md);
  cursor:pointer; transition:all var(--transition-fast); position:relative; overflow:hidden;
}
.ai-assistant-entry:hover { transform:scale(1.02); }
.ai-assistant-entry::before {
  content:''; position:absolute; inset:0;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,0.1),transparent);
  animation:shimmer 3s infinite;
}
@keyframes shimmer { 0% { transform:translateX(-100%); } 100% { transform:translateX(100%); } }
.ai-avatar { width:48px; height:48px; border-radius:50%; background:rgba(255,255,255,0.2); display:flex; align-items:center; justify-content:center; font-size:1.5rem; }
.ai-assistant-info h3 { font-size:1rem; font-weight:600; color:white; }
.ai-assistant-info p { font-size:0.8125rem; color:rgba(255,255,255,0.8); }

.health-overview { padding:var(--space-md) var(--space-lg); }
.health-overview-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:var(--space-md); }
.health-stat-card {
  background:var(--bg-card); border:1px solid var(--border-color);
  border-radius:var(--radius-lg); padding:var(--space-md); position:relative; overflow:hidden;
}
.health-stat-card::before { content:''; position:absolute; top:0; left:0; right:0; height:3px; }
.health-stat-card.heart::before { background:var(--alert-red); }
.health-stat-card.spo2::before { background:var(--ai-cyan); }
.health-stat-card.steps::before { background:var(--health-green); }
.health-stat-card.sleep::before { background:var(--ai-purple); }
.stat-icon { width:32px; height:32px; border-radius:var(--radius-sm); display:flex; align-items:center; justify-content:center; margin-bottom:var(--space-sm); font-size:1rem; }
.health-stat-card.heart .stat-icon { background:rgba(239,68,68,0.15); color:var(--alert-red); }
.health-stat-card.spo2 .stat-icon { background:rgba(6,182,212,0.15); color:var(--ai-cyan); }
.health-stat-card.steps .stat-icon { background:rgba(16,185,129,0.15); color:var(--health-green); }
.health-stat-card.sleep .stat-icon { background:rgba(139,92,246,0.15); color:var(--ai-purple); }
.stat-value { font-size:1.5rem; font-weight:700; font-family:var(--font-mono); line-height:1; margin-bottom:2px; }
.stat-label { font-size:0.75rem; color:var(--text-tertiary); }
.stat-trend { display:inline-flex; align-items:center; gap:2px; font-size:0.6875rem; margin-top:var(--space-xs); }
.stat-trend.up { color:var(--health-green); }
.stat-trend.down { color:var(--alert-red); }
.demo-badge {
  display:inline-flex; align-items:center; gap:4px; padding:2px 6px;
  background:rgba(245,158,11,0.15); border-radius:var(--radius-full);
  font-size:0.625rem; color:var(--warning-amber); margin-top:var(--space-xs);
}

/* Product Carousel */
.product-carousel {
  position:relative; margin:0 var(--space-lg); overflow:hidden;
  border-radius:var(--radius-xl);
}
.carousel-track {
  display:flex; transition:transform 0.4s cubic-bezier(0.25,0.8,0.25,1);
  will-change:transform; cursor:grab;
}
.carousel-track.dragging { transition:none; cursor:grabbing; }
.carousel-slide {
  flex:0 0 100%; padding:0 4px; box-sizing:border-box;
}
.carousel-card {
  background:var(--bg-card); border:1px solid var(--border-color);
  border-radius:var(--radius-xl); overflow:hidden;
  display:flex; gap:var(--space-md); padding:var(--space-md);
  transition:all var(--transition-fast);
}
.carousel-card:active { transform:scale(0.98); }
.carousel-card-img {
  width:120px; height:120px; border-radius:var(--radius-lg);
  object-fit:cover; flex-shrink:0; background:var(--bg-tertiary);
}
.carousel-card-info {
  flex:1; display:flex; flex-direction:column; justify-content:space-between;
  min-width:0;
}
.carousel-card-name {
  font-size:1rem; font-weight:600; color:var(--text-primary);
  margin-bottom:4px; line-height:1.3;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.carousel-card-desc {
  font-size:0.75rem; color:var(--text-tertiary); margin-bottom:8px;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.carousel-card-bottom {
  display:flex; align-items:center; justify-content:space-between;
}
.carousel-card-price {
  font-size:1.125rem; font-weight:700; color:var(--ai-cyan);
}
.carousel-card-btn {
  width:36px; height:36px; border-radius:50%;
  background:var(--gradient-primary); border:none;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; transition:all var(--transition-fast);
}
.carousel-card-btn:active { transform:scale(0.9); }
.carousel-card-btn svg { width:18px; height:18px; stroke:white; }
.carousel-dots {
  display:flex; justify-content:center; gap:6px;
  padding:var(--space-sm) 0 var(--space-md);
}
.carousel-dot {
  width:6px; height:6px; border-radius:50%;
  background:var(--border-color); transition:all 0.3s ease;
}
.carousel-dot.active {
  width:20px; border-radius:3px;
  background:var(--gradient-primary);
}

/* Product Cards */
.product-card {
  width:160px; background:var(--bg-card); border:1px solid var(--border-color);
  border-radius:var(--radius-lg); overflow:hidden; transition:all var(--transition-fast);
}
.product-card:hover { transform:translateY(-4px); box-shadow:var(--shadow-glow-cyan); }
.product-image {
  width:100%; height:160px; background:var(--bg-tertiary);
  display:flex; align-items:center; justify-content:center; font-size:3rem; position:relative;
}
.product-badge { position:absolute; top:var(--space-sm); left:var(--space-sm); padding:2px 8px; border-radius:var(--radius-full); font-size:0.625rem; font-weight:600; }
.product-badge.hot { background:var(--alert-red); color:white; }
.product-badge.new { background:var(--ai-cyan); color:white; }
.product-badge.sale { background:var(--warning-amber); color:white; }
.product-info { padding:var(--space-md); }
.product-name { font-size:0.8125rem; font-weight:500; margin-bottom:var(--space-xs); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.product-price { font-size:1rem; font-weight:700; color:var(--alert-red); font-family:var(--font-mono); }
.product-price .original { font-size:0.75rem; color:var(--text-tertiary); text-decoration:line-through; margin-left:var(--space-xs); font-weight:400; }
.product-rating { display:flex; align-items:center; gap:4px; margin-top:var(--space-xs); font-size:0.75rem; color:var(--warning-amber); }

/* === 9. Mall / Shop === */
.search-bar { margin:var(--space-md) var(--space-lg); position:relative; }
.search-bar input {
  width:100%; padding:12px 16px 12px 44px; background:var(--bg-tertiary);
  border:1px solid var(--border-color); border-radius:var(--radius-full);
  color:var(--text-primary); font-size:0.9375rem;
}
.search-bar input:focus { border-color:var(--ai-cyan); }
.search-bar .search-icon { position:absolute; left:16px; top:50%; transform:translateY(-50%); color:var(--text-tertiary); }

.category-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:var(--space-md); padding:var(--space-md) var(--space-lg); }
.category-item {
  display:flex; flex-direction:column; align-items:center; gap:var(--space-sm);
  padding:var(--space-md); background:var(--bg-card); border:1px solid var(--border-color);
  border-radius:var(--radius-lg); transition:all var(--transition-fast); cursor:pointer;
}
.category-item:hover { border-color:var(--ai-cyan); transform:translateY(-2px); }
.category-icon { width:48px; height:48px; border-radius:var(--radius-md); background:var(--gradient-primary); display:flex; align-items:center; justify-content:center; font-size:1.5rem; }
.category-name { font-size:0.75rem; font-weight:500; text-align:center; color:var(--text-secondary); }

.product-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:var(--space-md); padding:var(--space-md) var(--space-lg); }
.product-grid .product-card { width:100%; }

.filter-bar { display:flex; gap:var(--space-sm); padding:var(--space-md) var(--space-lg); overflow-x:auto; scrollbar-width:none; }
.filter-bar::-webkit-scrollbar { display:none; }
.filter-chip {
  padding:6px 14px; border-radius:var(--radius-full); background:var(--bg-tertiary);
  border:1px solid var(--border-color); color:var(--text-secondary);
  font-size:0.8125rem; white-space:nowrap; transition:all var(--transition-fast);
}
.filter-chip.active { background:rgba(6,182,212,0.15); border-color:var(--ai-cyan); color:var(--ai-cyan); }

/* === 10. Product Detail === */
.product-detail { padding:var(--space-md); }
.product-gallery {
  position:relative; border-radius:var(--radius-lg); overflow:hidden;
  background:var(--bg-tertiary); height:300px;
  display:flex; align-items:center; justify-content:center; font-size:5rem; margin-bottom:var(--space-lg);
}
.product-detail-info { padding:0 var(--space-sm); }
.product-detail-price { font-size:1.75rem; font-weight:700; color:var(--alert-red); font-family:var(--font-mono); margin-bottom:var(--space-sm); }
.product-detail-name { font-size:1.125rem; font-weight:600; margin-bottom:var(--space-sm); line-height:1.4; }
.product-detail-desc { font-size:0.875rem; color:var(--text-secondary); margin-bottom:var(--space-lg); line-height:1.6; }
.product-specs { margin-bottom:var(--space-lg); }
.spec-row { display:flex; padding:var(--space-sm) 0; border-bottom:1px solid var(--border-color); font-size:0.875rem; }
.spec-label { width:100px; color:var(--text-tertiary); flex-shrink:0; }
.spec-value { color:var(--text-primary); }
.product-actions {
  display:flex; gap:var(--space-md); padding:var(--space-lg) var(--space-md);
  position:sticky; bottom:var(--bottom-nav-height); background:var(--bg-primary);
  border-top:1px solid var(--border-color);
}
.product-actions .btn { flex:1; }

/* === 11. AI Health === */
.ai-health-center { padding:var(--space-md) var(--space-lg); }
.ai-chat-entry {
  background:var(--gradient-primary); border-radius:var(--radius-xl);
  padding:var(--space-xl); margin-bottom:var(--space-xl); position:relative; overflow:hidden;
}
.ai-chat-entry::before {
  content:''; position:absolute; top:-50%; right:-50%; width:200%; height:200%;
  background:radial-gradient(circle,rgba(255,255,255,0.1) 0%,transparent 60%);
  animation:rotateGlow 10s linear infinite;
}
@keyframes rotateGlow { from { transform:rotate(0deg); } to { transform:rotate(360deg); } }
.ai-chat-entry h3 { font-size:1.25rem; color:white; margin-bottom:var(--space-sm); position:relative; }
.ai-chat-entry p { color:rgba(255,255,255,0.8); font-size:0.875rem; margin-bottom:var(--space-lg); position:relative; }
.ai-health-modules { display:grid; grid-template-columns:repeat(2,1fr); gap:var(--space-md); }
.ai-module-card {
  background:var(--bg-card); border:1px solid var(--border-color);
  border-radius:var(--radius-lg); padding:var(--space-lg); text-align:center;
  transition:all var(--transition-fast); cursor:pointer;
}
.ai-module-card:hover { border-color:var(--ai-cyan); transform:translateY(-2px); }
.ai-module-icon { width:48px; height:48px; border-radius:var(--radius-md); margin:0 auto var(--space-md); display:flex; align-items:center; justify-content:center; font-size:1.5rem; }
.ai-module-name { font-size:0.875rem; font-weight:500; margin-bottom:var(--space-xs); }
.ai-module-desc { font-size:0.75rem; color:var(--text-tertiary); }

/* AI Chat Panel */
.ai-chat-panel { display:none; position:fixed; inset:0; z-index:2000; background:var(--bg-primary); flex-direction:column; }
.ai-chat-panel.active { display:flex; }
.chat-header { height:var(--header-height); display:flex; align-items:center; padding:0 var(--space-lg); border-bottom:1px solid var(--border-color); gap:var(--space-md); }
.chat-back { width:36px; height:36px; display:flex; align-items:center; justify-content:center; color:var(--text-secondary); border-radius:var(--radius-sm); }
.chat-back:hover { background:var(--bg-tertiary); }
.chat-title { font-weight:600; flex:1; }
.chat-messages { flex:1; overflow-y:auto; padding:var(--space-lg); display:flex; flex-direction:column; gap:var(--space-md); }
.chat-message { max-width:80%; padding:var(--space-md); border-radius:var(--radius-lg); font-size:0.9375rem; line-height:1.5; }
.chat-message.ai { background:var(--bg-tertiary); align-self:flex-start; border-bottom-left-radius:4px; }
.chat-message.user { background:var(--gradient-primary); color:white; align-self:flex-end; border-bottom-right-radius:4px; }
.chat-input-area { padding:var(--space-md) var(--space-lg); border-top:1px solid var(--border-color); display:flex; gap:var(--space-md); }
.chat-input { flex:1; padding:12px 16px; background:var(--bg-tertiary); border:1px solid var(--border-color); border-radius:var(--radius-full); color:var(--text-primary); font-size:0.9375rem; }
.chat-send { width:44px; height:44px; border-radius:50%; background:var(--gradient-primary); display:flex; align-items:center; justify-content:center; color:white; }

/* === 12. Device Management === */
.device-management { padding:var(--space-md) var(--space-lg); }
.my-devices { display:grid; gap:var(--space-md); margin-bottom:var(--space-xl); }
.device-card {
  background:var(--bg-card); border:1px solid var(--border-color);
  border-radius:var(--radius-lg); padding:var(--space-lg);
  display:flex; align-items:center; gap:var(--space-md);
}
.device-icon { width:56px; height:56px; border-radius:var(--radius-md); background:var(--gradient-primary); display:flex; align-items:center; justify-content:center; font-size:1.5rem; flex-shrink:0; }
.device-info { flex:1; }
.device-name { font-weight:600; margin-bottom:2px; }
.device-status { font-size:0.8125rem; display:flex; align-items:center; gap:4px; }
.device-status.online { color:var(--health-green); }
.device-status.offline { color:var(--text-tertiary); }
.status-dot { width:6px; height:6px; border-radius:50%; }
.status-dot.online { background:var(--health-green); }
.status-dot.offline { background:var(--text-tertiary); }
.device-battery { font-size:0.75rem; color:var(--text-tertiary); margin-top:2px; }
.device-sync { font-size:0.75rem; color:var(--text-tertiary); }

.health-data-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:var(--space-md); }
.health-data-card { background:var(--bg-card); border:1px solid var(--border-color); border-radius:var(--radius-lg); padding:var(--space-md); }
.data-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:var(--space-sm); }
.data-title { font-size:0.8125rem; color:var(--text-secondary); }
.data-value { font-size:1.75rem; font-weight:700; font-family:var(--font-mono); margin-bottom:2px; }
.data-unit { font-size:0.875rem; color:var(--text-tertiary); font-weight:400; }
.data-chart { height:40px; margin-top:var(--space-sm); display:flex; align-items:flex-end; gap:2px; }
.data-bar { flex:1; background:var(--gradient-primary); border-radius:2px 2px 0 0; min-height:4px; opacity:0.6; transition:opacity var(--transition-fast); }
.data-bar:hover { opacity:1; }

/* === 13. Profile === */
.profile-header { text-align:center; padding:var(--space-2xl) var(--space-lg); background:var(--bg-card); border-bottom:1px solid var(--border-color); }
.profile-avatar { width:80px; height:80px; border-radius:50%; background:var(--gradient-primary); display:flex; align-items:center; justify-content:center; font-size:2rem; color:white; margin:0 auto var(--space-md); border:3px solid var(--ai-cyan); box-shadow:var(--shadow-glow-cyan); }
.profile-name { font-size:1.25rem; font-weight:600; margin-bottom:var(--space-xs); }
.profile-email { font-size:0.875rem; color:var(--text-secondary); }
.profile-stats { display:flex; justify-content:center; gap:var(--space-2xl); margin-top:var(--space-lg); }
.profile-stat { text-align:center; }
.profile-stat-value { font-size:1.25rem; font-weight:700; font-family:var(--font-mono); }
.profile-stat-label { font-size:0.75rem; color:var(--text-tertiary); }

.menu-list { padding:var(--space-md) var(--space-lg); }
.menu-group { margin-bottom:var(--space-lg); }
.menu-group-title { font-size:0.75rem; color:var(--text-tertiary); text-transform:uppercase; letter-spacing:1px; margin-bottom:var(--space-sm); padding-left:var(--space-sm); }
.menu-item { display:flex; align-items:center; gap:var(--space-md); padding:var(--space-md); border-radius:var(--radius-md); transition:background var(--transition-fast); cursor:pointer; }
.menu-item:hover { background:var(--bg-tertiary); }
.menu-icon { width:40px; height:40px; border-radius:var(--radius-md); background:var(--bg-tertiary); display:flex; align-items:center; justify-content:center; font-size:1.125rem; }
.menu-text { flex:1; }
.menu-text .menu-label { font-size:0.9375rem; font-weight:500; }
.menu-text .menu-desc { font-size:0.75rem; color:var(--text-tertiary); }
.menu-arrow { color:var(--text-tertiary); }

/* === 14. Community === */
.community-feed { padding:var(--space-md) var(--space-lg); }
.post-card { background:var(--bg-card); border:1px solid var(--border-color); border-radius:var(--radius-lg); padding:var(--space-lg); margin-bottom:var(--space-md); }
.post-header { display:flex; align-items:center; gap:var(--space-md); margin-bottom:var(--space-md); }
.post-avatar { width:40px; height:40px; border-radius:50%; background:var(--gradient-primary); display:flex; align-items:center; justify-content:center; color:white; font-weight:600; font-size:0.875rem; }
.post-user-info { flex:1; }
.post-username { font-weight:600; font-size:0.9375rem; }
.post-time { font-size:0.75rem; color:var(--text-tertiary); }
.post-content { font-size:0.9375rem; line-height:1.6; margin-bottom:var(--space-md); }
.post-images { display:grid; grid-template-columns:repeat(3,1fr); gap:var(--space-sm); margin-bottom:var(--space-md); border-radius:var(--radius-md); overflow:hidden; }
.post-image { aspect-ratio:1; background:var(--bg-tertiary); display:flex; align-items:center; justify-content:center; font-size:1.5rem; }
.post-actions { display:flex; gap:var(--space-xl); }
.post-action { display:flex; align-items:center; gap:var(--space-xs); color:var(--text-tertiary); font-size:0.8125rem; transition:color var(--transition-fast); cursor:pointer; }
.post-action:hover { color:var(--ai-cyan); }
.post-action.liked { color:var(--alert-red); }

/* === 15. Brand Zone === */
.brand-zone { padding:var(--space-md) var(--space-lg); }
.brand-card { background:var(--bg-card); border:1px solid var(--border-color); border-radius:var(--radius-lg); padding:var(--space-xl); text-align:center; margin-bottom:var(--space-md); }
.brand-logo { width:80px; height:80px; border-radius:var(--radius-md); background:var(--bg-tertiary); display:flex; align-items:center; justify-content:center; font-size:2rem; margin:0 auto var(--space-md); }
.brand-name { font-size:1.125rem; font-weight:600; margin-bottom:var(--space-sm); }
.brand-desc { font-size:0.875rem; color:var(--text-secondary); line-height:1.5; }

/* === 16. Admin Panel === */
.admin-panel { padding:var(--space-md) var(--space-lg); }
.admin-stats { display:grid; grid-template-columns:repeat(2,1fr); gap:var(--space-md); margin-bottom:var(--space-xl); }
.admin-stat-card { background:var(--bg-card); border:1px solid var(--border-color); border-radius:var(--radius-lg); padding:var(--space-lg); }
.admin-stat-value { font-size:1.5rem; font-weight:700; font-family:var(--font-mono); margin-bottom:var(--space-xs); }
.admin-stat-label { font-size:0.8125rem; color:var(--text-secondary); }
.admin-stat-change { font-size:0.75rem; margin-top:var(--space-xs); }
.admin-stat-change.positive { color:var(--health-green); }
.admin-stat-change.negative { color:var(--alert-red); }
.admin-menu { display:grid; grid-template-columns:repeat(2,1fr); gap:var(--space-md); }
.admin-menu-item { background:var(--bg-card); border:1px solid var(--border-color); border-radius:var(--radius-lg); padding:var(--space-lg); text-align:center; transition:all var(--transition-fast); cursor:pointer; }
.admin-menu-item:hover { border-color:var(--ai-cyan); transform:translateY(-2px); }
.admin-menu-icon { font-size:1.5rem; margin-bottom:var(--space-sm); }
.admin-menu-name { font-size:0.8125rem; font-weight:500; }

/* === 17. Cart === */
.cart-page { padding:var(--space-md) var(--space-lg); }
.cart-item { display:flex; gap:var(--space-md); padding:var(--space-md) 0; border-bottom:1px solid var(--border-color); }
.cart-item-image { width:80px; height:80px; border-radius:var(--radius-md); background:var(--bg-tertiary); display:flex; align-items:center; justify-content:center; font-size:2rem; flex-shrink:0; }
.cart-item-info { flex:1; }
.cart-item-name { font-size:0.9375rem; font-weight:500; margin-bottom:var(--space-xs); }
.cart-item-price { font-size:1rem; font-weight:700; color:var(--alert-red); font-family:var(--font-mono); }
.cart-item-qty { display:flex; align-items:center; gap:var(--space-sm); margin-top:var(--space-sm); }
.qty-btn { width:28px; height:28px; border-radius:var(--radius-sm); background:var(--bg-tertiary); border:1px solid var(--border-color); color:var(--text-primary); display:flex; align-items:center; justify-content:center; font-size:1rem; }
.qty-value { font-weight:600; min-width:24px; text-align:center; }
.cart-summary { position:sticky; bottom:var(--bottom-nav-height); background:var(--bg-card); backdrop-filter:blur(20px); border-top:1px solid var(--border-color); padding:var(--space-md) var(--space-lg); display:flex; align-items:center; justify-content:space-between; }
.cart-total { font-size:1.25rem; font-weight:700; }
.cart-total span { color:var(--alert-red); font-family:var(--font-mono); }

/* === 18. Toast === */
.toast-container { position:fixed; top:calc(var(--header-height) + var(--space-md)); right:var(--space-md); z-index:5000; display:flex; flex-direction:column; gap:var(--space-sm); }
.toast {
  padding:var(--space-md) var(--space-lg); border-radius:var(--radius-md);
  background:var(--bg-card); backdrop-filter:blur(20px);
  border:1px solid var(--border-color); box-shadow:var(--shadow-lg);
  display:flex; align-items:center; gap:var(--space-sm); font-size:0.875rem;
  animation:toastIn 0.3s ease; min-width:250px;
}
.toast.success { border-left:3px solid var(--health-green); }
.toast.error { border-left:3px solid var(--alert-red); }
.toast.info { border-left:3px solid var(--ai-cyan); }
.toast.warning { border-left:3px solid var(--warning-amber); }
@keyframes toastIn { from { transform:translateX(100%); opacity:0; } to { transform:translateX(0); opacity:1; } }

/* === 19. Promotions === */
.promo-banner {
  margin:var(--space-md) var(--space-lg); padding:var(--space-xl);
  background:var(--gradient-warm); border-radius:var(--radius-lg);
  text-align:center; position:relative; overflow:hidden;
}
.promo-title { font-size:1.25rem; font-weight:700; color:white; margin-bottom:var(--space-xs); position:relative; }
.promo-desc { color:rgba(255,255,255,0.9); font-size:0.875rem; position:relative; }
.promo-timer { display:flex; justify-content:center; gap:var(--space-sm); margin-top:var(--space-md); position:relative; }
.timer-block { background:rgba(0,0,0,0.3); border-radius:var(--radius-sm); padding:var(--space-sm) var(--space-md); text-align:center; }
.timer-value { font-size:1.25rem; font-weight:700; color:white; font-family:var(--font-mono); }
.timer-label { font-size:0.625rem; color:rgba(255,255,255,0.7); }

/* === 20. Settings & Misc === */
.settings-page { padding:var(--space-md) var(--space-lg); }
.setting-item { display:flex; align-items:center; justify-content:space-between; padding:var(--space-md) 0; border-bottom:1px solid var(--border-color); }
.setting-label { font-size:0.9375rem; }
.setting-desc { font-size:0.75rem; color:var(--text-tertiary); }
.toggle-switch { width:48px; height:26px; background:var(--bg-tertiary); border-radius:var(--radius-full); position:relative; cursor:pointer; transition:background var(--transition-fast); }
.toggle-switch.active { background:var(--ai-cyan); }
.toggle-switch::after { content:''; position:absolute; top:3px; left:3px; width:20px; height:20px; background:white; border-radius:50%; transition:transform var(--transition-fast); }
.toggle-switch.active::after { transform:translateX(22px); }

.lang-select { padding:8px 12px; background:var(--bg-tertiary); border:1px solid var(--border-color); border-radius:var(--radius-md); color:var(--text-primary); font-size:0.875rem; }

/* Particle Canvas */
#particle-canvas { position:fixed; inset:0; z-index:-1; pointer-events:none; }

/* Health Disclaimer */
.health-disclaimer {
  margin:var(--space-md) var(--space-lg); padding:var(--space-md);
  background:rgba(245,158,11,0.1); border:1px solid rgba(245,158,11,0.3);
  border-radius:var(--radius-md); font-size:0.75rem; color:var(--warning-amber);
  display:flex; align-items:flex-start; gap:var(--space-sm);
}

/* === 21. Responsive === */
@media (min-width:768px) {
  .header-nav { display:flex; }
  .health-overview-grid { grid-template-columns:repeat(4,1fr); }
  .product-grid { grid-template-columns:repeat(3,1fr); }
  .category-grid { grid-template-columns:repeat(6,1fr); }
  .ai-health-modules { grid-template-columns:repeat(3,1fr); }
  .admin-stats { grid-template-columns:repeat(4,1fr); }
  .admin-menu { grid-template-columns:repeat(4,1fr); }
  .health-data-grid { grid-template-columns:repeat(4,1fr); }
  .hero-banner { height:300px; }
  .bottom-nav { display:none; }
  .app-content { padding-bottom:0; }
}

@media (min-width:1024px) {
  .product-grid { grid-template-columns:repeat(4,1fr); }
  .product-card { width:auto; }
  .hero-banner { height:400px; }
}

/* === 22. Animations === */
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.5; } }
@keyframes spin { from { transform:rotate(0deg); } to { transform:rotate(360deg); } }
@keyframes bounce { 0%,100% { transform:translateY(0); } 50% { transform:translateY(-5px); } }
.animate-pulse { animation:pulse 2s ease-in-out infinite; }
.animate-spin { animation:spin 1s linear infinite; }
.animate-bounce { animation:bounce 1s ease-in-out infinite; }

/* Staggered entrance */
.stagger-item { opacity:0; transform:translateY(20px); animation:staggerIn 0.5s ease forwards; }
@keyframes staggerIn { to { opacity:1; transform:translateY(0); } }

/* Glow text */
.glow-text { text-shadow:0 0 10px var(--ai-cyan), 0 0 20px var(--ai-cyan); }

/* Glass effect */
.glass { background:var(--bg-glass); backdrop-filter:blur(20px); border:1px solid var(--border-color); }

/* ============================================
   17. MOBILE SAFE AREA & PWA
   ============================================ */
:root {
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

html {
  padding-top: var(--sat);
  padding-bottom: var(--sab);
  padding-left: var(--sal);
  padding-right: var(--sar);
}

/* ============================================
   18. HAMBURGER BUTTON (Mobile)
   ============================================ */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.hamburger-btn:active { background: var(--hover-overlay); }

.hamburger-line {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 2.5px 0;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}
.hamburger-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger-btn.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   19. MOBILE DRAWER NAVIGATION
   ============================================ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: min(300px, 85vw);
  height: 100%;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  z-index: 999;
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: var(--sat);
  padding-bottom: var(--sab);
  padding-left: var(--sal);
}

.mobile-drawer.active {
  transform: translateX(0);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
}

.drawer-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-md);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.drawer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: white;
  flex-shrink: 0;
}

.drawer-user-info { flex: 1; min-width: 0; }
.drawer-user-name {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drawer-user-email {
  font-size: var(--text-xs);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-close {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s;
}
.drawer-close:active { background: var(--hover-overlay); }

.drawer-nav {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--space-sm) var(--space-sm);
}

.drawer-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}

.drawer-nav-item:active,
.drawer-nav-item.active {
  background: var(--bg-tertiary);
  color: var(--ai-cyan);
}

.drawer-nav-item.active {
  background: rgba(6, 182, 212, 0.1);
  border-left: 3px solid var(--ai-cyan);
}

.drawer-nav-icon {
  font-size: 20px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.drawer-footer {
  border-top: 1px solid var(--border-color);
  padding: var(--space-sm) var(--space-md);
  flex-shrink: 0;
  padding-bottom: calc(var(--space-sm) + var(--sab));
}

.drawer-theme-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  -webkit-tap-highlight-color: transparent;
}

.drawer-theme-toggle .toggle-switch {
  margin-left: auto;
  width: 44px;
  height: 24px;
  background: var(--bg-tertiary);
  border-radius: 12px;
  position: relative;
  transition: background 0.3s;
}
.drawer-theme-toggle .toggle-slider {
  width: 20px;
  height: 20px;
  background: var(--text-secondary);
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: all 0.3s;
}
body.light-mode .drawer-theme-toggle .toggle-switch { background: var(--ai-cyan); }
body.light-mode .drawer-theme-toggle .toggle-slider { left: 22px; background: white; }

/* ============================================
   20. PULL TO REFRESH
   ============================================ */
.pull-refresh {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-60px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  z-index: 900;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.pull-refresh.visible {
  transform: translateX(-50%) translateY(60px);
}

.pull-refresh.refreshing .pull-refresh-spinner {
  animation: spin 0.8s linear infinite;
}

.pull-refresh-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-color);
  border-top-color: var(--ai-cyan);
  border-radius: 50%;
  flex-shrink: 0;
}

.pull-refresh-text {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ============================================
   21. TOUCH RIPPLE EFFECT
   ============================================ */
.ripple-container {
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.3);
  transform: scale(0);
  animation: rippleAnim 0.6s ease-out forwards;
  pointer-events: none;
}

@keyframes rippleAnim {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ============================================
   22. MOBILE RESPONSIVE (< 768px)
   ============================================ */
@media (max-width: 767px) {
  /* Show hamburger, hide desktop nav */
  .hamburger-btn { display: flex; }
  .header-nav { display: none !important; }

  /* Header adjustments */
  .app-header {
    padding: var(--space-sm) var(--space-md);
    padding-top: calc(var(--space-sm) + var(--sat));
    padding-left: calc(var(--space-md) + var(--sal));
    padding-right: calc(var(--space-md) + var(--sar));
    gap: var(--space-sm);
  }
  .header-logo { font-size: 16px; }
  .header-actions { gap: 2px; }
  .header-action-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  .header-avatar { width: 32px; height: 32px; font-size: 12px; }

  /* Main content with bottom nav space */
  .main-content {
    padding-bottom: calc(72px + var(--sab) + 16px);
  }

  /* Bottom nav safe area */
  .bottom-nav {
    padding-bottom: calc(4px + var(--sab));
    padding-left: var(--sal);
    padding-right: var(--sar);
  }
  .bottom-nav-item {
    min-height: 52px;
    padding: 6px 4px;
  }
  .nav-icon { font-size: 20px; }
  .nav-label { font-size: 10px; }

  /* Page sections */
  .page-section {
    padding: var(--space-md);
    min-height: auto;
  }

  /* Hero section */
  .hero-section {
    padding: var(--space-lg) var(--space-md);
    min-height: auto;
  }
  .hero-title { font-size: 24px; line-height: 1.2; }
  .hero-subtitle { font-size: var(--text-sm); }
  .hero-actions { flex-direction: column; gap: var(--space-sm); }
  .hero-actions .btn { width: 100%; }

  /* Banner carousel */
  .banner-carousel { min-height: 180px; }
  .banner-slide { padding: var(--space-lg) var(--space-md); }
  .banner-title { font-size: 20px; }
  .banner-subtitle { font-size: var(--text-sm); }
  .banner-dots { bottom: var(--space-sm); }

  /* Section headers */
  .section-header {
    flex-direction: row;
    align-items: center;
    gap: var(--space-sm);
  }
  .section-title { font-size: 18px; }
  .section-link { font-size: var(--text-xs); }

  /* Health overview */
  .health-overview-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }
  .health-stat-card {
    padding: var(--space-md);
  }
  .health-stat-icon { font-size: 24px; }
  .health-stat-value { font-size: 22px; }
  .health-stat-label { font-size: var(--text-xs); }

  /* Product grid */
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }
  .product-card {
    padding: var(--space-sm);
  }
  .product-image { height: 120px; font-size: 32px; }
  .product-name { font-size: var(--text-sm); }
  .product-price { font-size: var(--text-sm); }
  .product-rating { font-size: var(--text-xs); }

  /* Promo banner */
  .promo-banner {
    padding: var(--space-md);
    flex-direction: column;
    text-align: center;
  }
  .promo-title { font-size: 18px; }
  .promo-timer { gap: 6px; }
  .promo-timer-unit {
    width: 40px;
    height: 40px;
    font-size: var(--text-sm);
  }

  /* Category grid */
  .category-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
  }
  .category-card {
    padding: var(--space-sm);
  }
  .category-icon { font-size: 28px; }
  .category-name { font-size: var(--text-xs); }

  /* Filter chips */
  .filter-chips {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    padding-bottom: var(--space-xs);
  }
  .filter-chips::-webkit-scrollbar { display: none; }
  .filter-chip { flex-shrink: 0; }

  /* Device list */
  .device-list { gap: var(--space-sm); }
  .device-card {
    padding: var(--space-md);
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }
  .device-status { align-self: flex-start; }

  /* Health data grid */
  .health-data-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }
  .health-data-card { padding: var(--space-md); }
  .health-data-icon { font-size: 24px; }
  .health-data-value { font-size: 20px; }
  .health-data-label { font-size: var(--text-xs); }

  /* Community */
  .community-grid {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }
  .community-post { padding: var(--space-md); }

  /* Brand grid */
  .brand-grid {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }
  .brand-card { padding: var(--space-md); }

  /* AI Health modules */
  .ai-modules-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }
  .ai-module-card { padding: var(--space-md); }
  .ai-module-icon { font-size: 28px; }
  .ai-module-name { font-size: var(--text-sm); }

  /* Profile */
  .profile-header {
    padding: var(--space-lg) var(--space-md);
  }
  .profile-avatar { width: 64px; height: 64px; font-size: 24px; }
  .profile-name { font-size: 18px; }
  .profile-stats { gap: var(--space-md); }
  .profile-stat-value { font-size: 18px; }

  /* Menu list */
  .menu-list { gap: 2px; }
  .menu-item {
    padding: var(--space-md);
    min-height: 52px;
  }
  .menu-icon { font-size: 18px; }
  .menu-label { font-size: var(--text-sm); }

  /* Cart */
  .cart-page { padding: 0; }
  .cart-summary {
    padding: var(--space-md);
    padding-bottom: calc(var(--space-md) + var(--sab));
  }

  /* Admin */
  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }
  .admin-stat-card { padding: var(--space-md); }
  .admin-stat-value { font-size: 22px; }
  .admin-menu {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  /* Auth page */
  .auth-page {
    padding: var(--space-md);
    padding-top: var(--space-lg);
  }
  .auth-card {
    padding: var(--space-md);
    border-radius: var(--radius-lg);
  }
  .auth-title { font-size: 22px; }
  .social-login { flex-direction: column; }
  .social-btn { width: 100%; justify-content: center; }

  /* Settings */
  .settings-page { padding: 0; }

  /* AI Chat */
  .ai-chat-panel {
    width: 100%;
    left: 0;
    border-radius: 0;
    padding-bottom: var(--sab);
  }
  .chat-input-area {
    padding: var(--space-sm) var(--space-md);
    padding-bottom: calc(var(--space-sm) + var(--sab));
  }

  /* FAQ */
  .faq-item { margin-bottom: var(--space-sm); }
  .faq-question { padding: var(--space-md); font-size: var(--text-sm); }
  .faq-answer { padding: 0 var(--space-md) var(--space-md); font-size: var(--text-xs); }

  /* Testimonials */
  .testimonial-grid {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }
  .testimonial-card { padding: var(--space-md); }

  /* Loading screen */
  .loading-screen {
    padding: var(--space-md);
  }
  .loading-logo { font-size: 28px; }
  .loading-subtitle { font-size: var(--text-xs); }
  .loading-progress { max-width: 240px; }
  .loading-status { font-size: 11px; }
}

/* ============================================
   23. SMALL MOBILE (< 380px)
   ============================================ */
@media (max-width: 379px) {
  .page-section { padding: var(--space-sm); }
  .hero-title { font-size: 20px; }
  .health-overview-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr; }
  .ai-modules-grid { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: 1fr; }
  .admin-menu { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .bottom-nav-item { padding: 4px 2px; }
  .nav-label { font-size: 9px; }
}

/* ============================================
   24. TABLET OPTIMIZATIONS (768px - 1023px)
   ============================================ */
@media (min-width: 768px) and (max-width: 1023px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .health-data-grid { grid-template-columns: repeat(3, 1fr); }
  .admin-stats { grid-template-columns: repeat(4, 1fr); }
  .community-grid { grid-template-columns: repeat(2, 1fr); }
  .brand-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================
   25. MOBILE TOUCH ENHANCEMENTS
   ============================================ */
@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets */
  .btn, .btn-primary, .btn-glow {
    min-height: 44px;
    padding: var(--space-sm) var(--space-md);
  }
  .form-input, .form-select {
    min-height: 48px;
    font-size: 16px; /* Prevent iOS zoom */
  }
  .chat-input { font-size: 16px; }

  /* Remove hover effects on touch */
  .card:hover { transform: none; }
  .product-card:hover { transform: none; }
  .brand-card:hover { transform: none; }

  /* Active state instead of hover */
  .card:active { transform: scale(0.98); }
  .product-card:active { transform: scale(0.97); }
  .btn:active { transform: scale(0.96); }
  .btn-primary:active { transform: scale(0.96); }
  .bottom-nav-item:active { transform: scale(0.92); }

  /* Smooth scroll */
  .main-content {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
  }

  /* Prevent text selection on interactive elements */
  .bottom-nav-item,
  .drawer-nav-item,
  .btn,
  .btn-primary,
  .header-action-btn,
  .hamburger-btn {
    -webkit-user-select: none;
    user-select: none;
  }
}

/* ============================================
   26. LANDSCAPE MOBILE
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
  .loading-screen { padding: var(--space-sm); }
  .loading-dna { height: 50px; }
  .loading-heartbeat { height: 30px; }
  .loading-logo { font-size: 22px; }
  .hero-section { min-height: auto; padding: var(--space-md); }
  .banner-carousel { min-height: 140px; }
  .bottom-nav { display: none; }
  .main-content { padding-bottom: 0; }
  .auth-page { padding-top: var(--space-sm); }
}

/* ============================================
   27. DARK/LIGHT MODE TRANSITION
   ============================================ */
body.theme-transitioning,
body.theme-transitioning * {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}

/* ============================================
   28. SCROLL SNAP FOR HORIZONTAL SCROLL
   ============================================ */
.scroll-snap-x {
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.scroll-snap-x > * {
  scroll-snap-align: start;
}

/* ============================================
   29. MOBILE HEADER SHRINK ON SCROLL
   ============================================ */
.app-header.scrolled {
  padding-top: calc(var(--space-xs) + var(--sat));
  padding-bottom: var(--space-xs);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

@media (max-width: 767px) {
  .app-header.scrolled {
    padding-top: calc(var(--space-xs) + var(--sat));
    padding-bottom: var(--space-xs);
  }
  .app-header.scrolled .header-logo { font-size: 14px; }
  .app-header.scrolled .header-action-btn { width: 32px; height: 32px; font-size: 14px; }
}

/* ============================================
   30. ACCESSIBILITY - REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .page-section.active { transform: none !important; }
  .mobile-drawer { transition: none !important; }
}

/* ============================================
   31. LUCIDE ICON SYSTEM
   ============================================ */
/* Base Lucide icon sizing */
[data-lucide] {
  display: inline-block;
  vertical-align: middle;
  stroke-width: 2;
}

/* Navigation icons */
.nav-icon [data-lucide],
.drawer-nav-icon [data-lucide] {
  width: 22px;
  height: 22px;
  stroke: currentColor;
}

/* Bottom nav icons */
.bottom-nav .nav-icon [data-lucide] {
  width: 24px;
  height: 24px;
}

/* Header action icons */
.header-action-btn [data-lucide] {
  width: 20px;
  height: 20px;
  stroke: var(--text-secondary);
}

/* Input icons */
.input-icon [data-lucide] {
  width: 18px;
  height: 18px;
  stroke: var(--text-tertiary);
}

/* Stat icons */
.stat-icon [data-lucide] {
  width: 28px;
  height: 28px;
  stroke: currentColor;
}

/* Health stat card icon colors */
.health-stat-card.heart .stat-icon [data-lucide] { stroke: #EF4444; }
.health-stat-card.spo2 .stat-icon [data-lucide] { stroke: #3B82F6; }
.health-stat-card.steps .stat-icon [data-lucide] { stroke: #10B981; }
.health-stat-card.sleep .stat-icon [data-lucide] { stroke: #8B5CF6; }

/* Product/Category icons */
.product-lucide-icon,
.category-lucide-icon,
.cart-lucide-icon {
  width: 48px;
  height: 48px;
  stroke: var(--ai-cyan);
  opacity: 0.8;
}

.category-lucide-icon {
  width: 32px;
  height: 32px;
}

.cart-lucide-icon {
  width: 40px;
  height: 40px;
}

/* AI module icons */
.ai-module-lucide-icon {
  width: 40px;
  height: 40px;
  stroke: var(--ai-cyan);
}

/* Device icons */
.device-lucide-icon {
  width: 36px;
  height: 36px;
  stroke: var(--ai-cyan);
}

/* Brand icons */
.brand-lucide-icon {
  width: 48px;
  height: 48px;
  stroke: var(--ai-purple);
}

/* Menu icons */
.menu-lucide-icon {
  width: 22px;
  height: 22px;
  stroke: var(--ai-cyan);
}

/* Admin menu icons */
.admin-menu-lucide-icon {
  width: 28px;
  height: 28px;
  stroke: var(--ai-cyan);
}

/* Search icon */
.search-icon [data-lucide] {
  width: 18px;
  height: 18px;
  stroke: var(--text-tertiary);
}

/* News icons */
.news-lucide-icon {
  width: 32px;
  height: 32px;
  stroke: var(--ai-cyan);
}

/* Drawer close icon */
.drawer-close [data-lucide] {
  width: 20px;
  height: 20px;
  stroke: var(--text-secondary);
}

/* Theme toggle icon */
.drawer-theme-toggle [data-lucide] {
  width: 20px;
  height: 20px;
  stroke: var(--text-secondary);
}

/* Rating stars */
.rating-star {
  width: 14px;
  height: 14px;
  stroke: var(--warning-amber);
  fill: var(--warning-amber);
}
.rating-star-sm {
  width: 12px;
  height: 12px;
  stroke: var(--warning-amber);
  fill: var(--warning-amber);
  vertical-align: -1px;
}

/* Report icons */
.report-check {
  width: 16px;
  height: 16px;
  stroke: var(--health-green);
  vertical-align: -2px;
  margin-right: 4px;
}
.report-warn {
  width: 16px;
  height: 16px;
  stroke: var(--warning-amber);
  vertical-align: -2px;
  margin-right: 4px;
}

/* Post action icons */
.post-action-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  vertical-align: -2px;
  margin-right: 4px;
}

/* Empty cart icon */
.empty-cart-icon {
  width: 64px;
  height: 64px;
  stroke: var(--text-tertiary);
  opacity: 0.5;
}

/* Chat bot icon */
.chat-bot-icon {
  width: 32px;
  height: 32px;
  stroke: var(--ai-cyan);
}

/* Toast icons */
.toast-icon [data-lucide] {
  width: 20px;
  height: 20px;
}
}

/* === Product Real Images === */
.product-real-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-lg);
  transition: transform 0.3s ease;
}

.product-card:hover .product-real-img {
  transform: scale(1.05);
}

.product-detail-img {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  background: var(--bg-tertiary);
  border-radius: var(--radius-xl);
}

.product-gallery {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Health Stat Chart Styles */
.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.stat-chart {
  width: 100%;
  height: 40px;
  margin-top: 8px;
  border-radius: 6px;
  overflow: hidden;
  opacity: 0.9;
  transition: opacity var(--transition-fast);
}

.health-stat-card:hover .stat-chart {
  opacity: 1;
}

.stat-chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* AI Avatar Image */
.ai-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Chat Message with Avatar */
.chat-message {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.chat-message.bot {
  flex-direction: row;
}

.chat-message.user {
  flex-direction: row-reverse;
}

.chat-msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.chat-msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-msg-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.chat-message.bot .chat-msg-bubble {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-top-left-radius: 4px;
  color: var(--text-primary);
}

.chat-message.user .chat-msg-bubble {
  background: var(--gradient-primary);
  color: #fff;
  border-top-right-radius: 4px;
}
