/* ═══════════════════════════════════════════════════════════════════════════════
   TONGUE DIAGNOSIS v2.0 - Enhanced TCM Visual System
   ═══════════════════════════════════════════════════════════════════════════════ */

:root {
  --tongue-jade: #2D5A4A;
  --tongue-jade-glow: #4FFFB0;
  --tongue-terracotta: #C65D3B;
  --tongue-gold: #D4AF37;
  --tongue-ink: #0A0E14;
}

/* Ink wash animated background */
.tongue-ink-wash {
  background: 
    radial-gradient(ellipse at 15% 85%, rgba(88, 28, 135, 0.15) 0%, transparent 45%),
    radial-gradient(ellipse at 85% 15%, rgba(45, 90, 74, 0.12) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 50%, rgba(212, 175, 55, 0.04) 0%, transparent 60%),
    linear-gradient(135deg, var(--slate-900) 0%, #3b0764 50%, var(--slate-900) 100%);
  position: relative;
}

.tongue-ink-wash::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
}

/* Chinese seal stamp */
.tongue-seal {
  background: linear-gradient(135deg, var(--tongue-terracotta) 0%, #A64D2E 100%);
  color: #F5E6D3;
  padding: 0.4rem 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  border: 2px solid rgba(255, 138, 101, 0.6);
  box-shadow: 
    inset 0 0 15px rgba(0,0,0,0.4),
    0 4px 25px rgba(198, 93, 59, 0.4),
    0 0 0 1px rgba(255,255,255,0.1);
  transform: rotate(-1.5deg);
  font-size: 0.75rem;
}

/* Patient selector dropdown */
.tongue-patient-select {
  background: linear-gradient(135deg, rgba(26, 31, 42, 0.95) 0%, rgba(15, 19, 24, 0.98) 100%);
  border: 1px solid rgba(77, 255, 176, 0.3);
  color: var(--gray-200);
  padding: 0.6rem 2.5rem 0.6rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234FFFB0'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  min-width: 200px;
}

.tongue-patient-select:focus {
  outline: none;
  border-color: var(--tongue-jade-glow);
  box-shadow: 0 0 0 2px rgba(77, 255, 176, 0.2);
}

.tongue-patient-select option {
  background: #1a1f2a;
  color: var(--gray-200);
  padding: 0.5rem;
}

/* Camera container */
.tongue-camera-container {
  position: relative;
  background: #000;
  border-radius: 1rem;
  overflow: hidden;
  aspect-ratio: 4/3;
}

.tongue-camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror for selfie view */
}

/* Face/Tongue guide overlay */
.tongue-guide-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tongue-face-frame {
  width: 70%;
  height: 75%;
  border: 3px dashed rgba(77, 255, 176, 0.5);
  border-radius: 50% 50% 45% 45%;
  position: relative;
  animation: tongue-guide-pulse 2s ease-in-out infinite;
}

@keyframes tongue-guide-pulse {
  0%, 100% { border-color: rgba(77, 255, 176, 0.5); }
  50% { border-color: rgba(77, 255, 176, 0.8); }
}

.tongue-mouth-zone {
  position: absolute;
  bottom: 18%;
  left: 50%;
  transform: translateX(-50%);
  width: 45%;
  height: 28%;
  border: 2px solid var(--tongue-jade-glow);
  border-radius: 0 0 50% 50%;
  background: rgba(77, 255, 176, 0.08);
}

.tongue-mouth-zone::before {
  content: '👅 Position tongue here';
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.7rem;
  color: var(--tongue-jade-glow);
  text-shadow: 0 0 10px rgba(0,0,0,0.9);
  font-weight: 600;
}

.tongue-guide-text {
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  color: var(--tongue-jade-glow);
  font-size: 0.75rem;
  font-weight: 600;
  text-shadow: 0 2px 8px rgba(0,0,0,0.9);
  text-align: center;
}

.tongue-guide-corners {
  position: absolute;
  inset: 10%;
  pointer-events: none;
}

.tongue-guide-corners::before,
.tongue-guide-corners::after {
  content: '';
  position: absolute;
  width: 30px;
  height: 30px;
  border-color: var(--tongue-jade-glow);
  border-style: solid;
}

.tongue-guide-corners::before {
  top: 0;
  left: 0;
  border-width: 3px 0 0 3px;
}

.tongue-guide-corners::after {
  top: 0;
  right: 0;
  border-width: 3px 3px 0 0;
}

/* Drop zone with Chinese pattern */
.tongue-drop-zone {
  border: 3px dashed rgba(77, 255, 176, 0.25);
  background: 
    linear-gradient(135deg, rgba(45, 90, 74, 0.08) 0%, transparent 50%),
    radial-gradient(circle at center, rgba(45, 90, 74, 0.04) 0%, transparent 70%);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.tongue-drop-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    repeating-linear-gradient(45deg, transparent, transparent 20px, rgba(77, 255, 176, 0.02) 20px, rgba(77, 255, 176, 0.02) 40px),
    repeating-linear-gradient(-45deg, transparent, transparent 20px, rgba(77, 255, 176, 0.02) 20px, rgba(77, 255, 176, 0.02) 40px);
  opacity: 0.5;
}

.tongue-drop-zone.dragover {
  border-color: var(--tongue-jade-glow);
  background: 
    linear-gradient(135deg, rgba(45, 90, 74, 0.25) 0%, transparent 50%),
    radial-gradient(circle at center, rgba(77, 255, 176, 0.12) 0%, transparent 70%);
  box-shadow: 
    0 0 80px rgba(77, 255, 176, 0.15),
    inset 0 0 80px rgba(77, 255, 176, 0.08);
  transform: scale(1.01);
}

.tongue-drop-zone.has-image {
  border: 2px solid var(--tongue-jade);
  background: rgba(10, 14, 20, 0.9);
}

/* Tongue zone overlays */
.tongue-zone-overlay {
  position: absolute;
  border: 2px solid transparent;
  background: transparent;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  z-index: 10;
}

.tongue-zone-overlay:hover,
.tongue-zone-overlay.active {
  background: rgba(77, 255, 176, 0.12);
  border-color: var(--tongue-jade-glow);
  box-shadow: 
    0 0 25px rgba(77, 255, 176, 0.25),
    inset 0 0 15px rgba(77, 255, 176, 0.1);
}

.tongue-zone-overlay .zone-label {
  position: absolute;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--tongue-jade-glow);
  text-shadow: 0 0 10px rgba(0,0,0,0.9), 0 2px 4px rgba(0,0,0,0.8);
  opacity: 0;
  transition: opacity 0.3s;
  white-space: nowrap;
  letter-spacing: 0.05em;
}

.tongue-zone-overlay:hover .zone-label,
.tongue-zone-overlay.active .zone-label {
  opacity: 1;
}

/* Analysis cards with jade accent */
.tongue-card {
  background: linear-gradient(145deg, rgba(26, 31, 42, 0.95) 0%, rgba(15, 19, 24, 0.98) 100%);
  border: 1px solid rgba(77, 255, 176, 0.15);
  border-radius: 1rem;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.tongue-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--tongue-jade-glow), transparent);
}

/* Animated potency bars */
.tongue-potency-bar {
  height: 10px;
  background: rgba(45, 90, 74, 0.2);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

.tongue-potency-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.tongue-potency-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: tongue-shimmer 2.5s ease-in-out infinite;
}

@keyframes tongue-shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Bagua spinner */
.tongue-bagua-spinner {
  animation: tongue-rotate 6s linear infinite;
}

@keyframes tongue-rotate {
  to { transform: rotate(360deg); }
}

/* Meridian flow animation */
.tongue-meridian-flow {
  stroke-dasharray: 10 5;
  animation: tongue-flow 2s linear infinite;
}

@keyframes tongue-flow {
  to { stroke-dashoffset: -30; }
}

/* Pulse rings */
.tongue-pulse {
  animation: tongue-pulse-ring 2.5s ease-out infinite;
}

@keyframes tongue-pulse-ring {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 0.4; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

/* Herb pills with role colors */
.tongue-herb-pill {
  padding: 0.6rem 1rem;
  border-radius: 2rem;
  font-size: 0.8rem;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.tongue-herb-pill::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
}

.tongue-herb-pill:hover::before {
  opacity: 1;
}

.tongue-herb-pill:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.tongue-herb-chief {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.35) 0%, rgba(212, 175, 55, 0.15) 100%);
  border: 1px solid rgba(212, 175, 55, 0.5);
  color: #F4CF67;
}

.tongue-herb-deputy {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.35) 0%, rgba(59, 130, 246, 0.15) 100%);
  border: 1px solid rgba(59, 130, 246, 0.5);
  color: var(--blue-400);
}

.tongue-herb-assistant {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.35) 0%, rgba(168, 85, 247, 0.15) 100%);
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #C084FC;
}

.tongue-herb-envoy {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.35) 0%, rgba(34, 197, 94, 0.15) 100%);
  border: 1px solid rgba(34, 197, 94, 0.5);
  color: var(--green-400);
}

/* Five Element badges */
.tongue-element {
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
  font-size: 0.65rem;
  font-weight: 600;
}

.tongue-element-wood { background: rgba(34, 197, 94, 0.2); color: var(--green-400); border: 1px solid rgba(34, 197, 94, 0.4); }
.tongue-element-fire { background: rgba(239, 68, 68, 0.2); color: var(--red-400); border: 1px solid rgba(239, 68, 68, 0.4); }
.tongue-element-earth { background: rgba(234, 179, 8, 0.2); color: #FACC15; border: 1px solid rgba(234, 179, 8, 0.4); }
.tongue-element-metal { background: rgba(148, 163, 184, 0.2); color: var(--slate-300); border: 1px solid rgba(148, 163, 184, 0.4); }
.tongue-element-water { background: rgba(59, 130, 246, 0.2); color: var(--blue-400); border: 1px solid rgba(59, 130, 246, 0.4); }

/* Prose diagnosis styling */
.tongue-prose {
  font-family: 'Georgia', 'Times New Roman', serif;
  line-height: 1.85;
  color: var(--gray-300);
}

.tongue-prose p {
  margin-bottom: 1rem;
  text-indent: 1.5rem;
}

.tongue-prose p:first-child {
  text-indent: 0;
}

.tongue-prose strong {
  color: var(--tongue-jade-glow);
  font-weight: 600;
}

.tongue-prose em {
  color: var(--amber-400);
  font-style: italic;
}

/* Pattern severity indicators */
.tongue-severity-primary { 
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(239, 68, 68, 0.1) 100%);
  border-left: 3px solid var(--red-500);
}

.tongue-severity-secondary { 
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.25) 0%, rgba(251, 191, 36, 0.1) 100%);
  border-left: 3px solid var(--amber-400);
}

.tongue-severity-tertiary { 
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(59, 130, 246, 0.1) 100%);
  border-left: 3px solid var(--blue-500);
}

/* Scrollbar styling */
.tongue-scroll::-webkit-scrollbar { width: 6px; }
.tongue-scroll::-webkit-scrollbar-track { background: rgba(15, 23, 42, 0.5); border-radius: 3px; }
.tongue-scroll::-webkit-scrollbar-thumb { background: var(--tongue-jade); border-radius: 3px; }
.tongue-scroll::-webkit-scrollbar-thumb:hover { background: var(--tongue-jade-glow); }

/* Loading overlay */
.tongue-analyzing {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 20, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
  backdrop-filter: blur(8px);
}

/* History timeline */
.tongue-history-item {
  background: linear-gradient(135deg, rgba(26, 31, 42, 0.8) 0%, rgba(15, 19, 24, 0.9) 100%);
  border: 1px solid rgba(77, 255, 176, 0.1);
  border-radius: 0.5rem;
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tongue-history-item:hover {
  border-color: var(--tongue-jade-glow);
  background: linear-gradient(135deg, rgba(45, 90, 74, 0.2) 0%, rgba(15, 19, 24, 0.9) 100%);
}

.tongue-history-item.active {
  border-color: var(--tongue-jade-glow);
  box-shadow: 0 0 15px rgba(77, 255, 176, 0.2);
}

/* Comparison chart */
.tongue-comparison-bar {
  height: 8px;
  background: rgba(45, 90, 74, 0.2);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.tongue-comparison-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
}

/* Camera controls */
.tongue-camera-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tongue-camera-btn-capture {
  background: linear-gradient(135deg, var(--red-500) 0%, var(--red-600) 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.tongue-camera-btn-capture:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.tongue-camera-btn-capture:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Input mode tabs */
.tongue-input-tabs {
  display: flex;
  gap: 0.25rem;
  background: rgba(15, 23, 42, 0.5);
  padding: 0.25rem;
  border-radius: 0.5rem;
}

.tongue-input-tab {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  background: transparent;
  color: var(--gray-400);
  border: none;
}

.tongue-input-tab.active {
  background: var(--tongue-jade);
  color: white;
}

.tongue-input-tab:hover:not(.active) {
  background: rgba(77, 255, 176, 0.1);
  color: var(--tongue-jade-glow);
}

/* Add Patient Modal */
.tongue-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tongue-modal {
  background: linear-gradient(145deg, rgba(26, 31, 42, 0.98) 0%, rgba(15, 19, 24, 1) 100%);
  border: 1px solid rgba(77, 255, 176, 0.3);
  border-radius: 1rem;
  padding: 1.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.tongue-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(77, 255, 176, 0.2);
  border-radius: 0.5rem;
  color: var(--gray-200);
  font-size: 0.875rem;
}

.tongue-input:focus {
  outline: none;
  border-color: var(--tongue-jade-glow);
  box-shadow: 0 0 0 2px rgba(77, 255, 176, 0.1);
}

/* Timestamp badge */
.tongue-timestamp {
  font-size: 0.65rem;
  color: var(--gray-500);
  font-family: monospace;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   TONGUE DIAGNOSIS v3.0 - GOD-TIER VISUAL SYSTEM
   ═══════════════════════════════════════════════════════════════════════════════ */

:root {
  --tongue-jade: #2D5A4A;
  --tongue-jade-glow: #4FFFB0;
  --tongue-terracotta: #C65D3B;
  --tongue-gold: #D4AF37;
  --tongue-ink: #0A0E14;
  --tongue-crimson: var(--red-600);
  --tongue-purple: var(--violet-600);
  --tongue-ocean: #0EA5E9;
  
  /* Chakra colors */
  --chakra-root: var(--red-500);
  --chakra-sacral: var(--orange-500);
  --chakra-solar: var(--yellow-500);
  --chakra-heart: var(--green-500);
  --chakra-throat: #0EA5E9;
  --chakra-third-eye: var(--indigo-500);
  --chakra-crown: var(--purple-500);
}

/* Ink wash animated background */
.tongue-ink-wash {
  background: 
    radial-gradient(ellipse at 15% 85%, rgba(88, 28, 135, 0.15) 0%, transparent 45%),
    radial-gradient(ellipse at 85% 15%, rgba(45, 90, 74, 0.12) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 50%, rgba(212, 175, 55, 0.04) 0%, transparent 60%),
    linear-gradient(135deg, var(--slate-900) 0%, #3b0764 50%, var(--slate-900) 100%);
  position: relative;
}

.tongue-ink-wash::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
}

/* Chinese seal stamp */
.tongue-seal {
  background: linear-gradient(135deg, var(--tongue-terracotta) 0%, #A64D2E 100%);
  color: #F5E6D3;
  padding: 0.4rem 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  border: 2px solid rgba(255, 138, 101, 0.6);
  box-shadow: inset 0 0 15px rgba(0,0,0,0.4), 0 4px 25px rgba(198, 93, 59, 0.4);
  transform: rotate(-1.5deg);
  font-size: 0.75rem;
}

/* Mode toggle buttons */
.tongue-mode-toggle {
  display: flex;
  background: rgba(15, 23, 42, 0.8);
  border-radius: 0.5rem;
  padding: 0.25rem;
  border: 1px solid rgba(77, 255, 176, 0.2);
}

.tongue-mode-btn {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  background: transparent;
  color: var(--gray-400);
  border: none;
}

.tongue-mode-btn.active {
  background: linear-gradient(135deg, var(--tongue-jade) 0%, #1D4A3A 100%);
  color: white;
  box-shadow: 0 2px 10px rgba(77, 255, 176, 0.3);
}

.tongue-mode-btn:hover:not(.active) {
  background: rgba(77, 255, 176, 0.1);
  color: var(--tongue-jade-glow);
}

/* Patient selector dropdown */
.tongue-patient-select {
  background: linear-gradient(135deg, rgba(26, 31, 42, 0.95) 0%, rgba(15, 19, 24, 0.98) 100%);
  border: 1px solid rgba(77, 255, 176, 0.3);
  color: var(--gray-200);
  padding: 0.6rem 2.5rem 0.6rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234FFFB0'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  min-width: 200px;
}

.tongue-patient-select:focus {
  outline: none;
  border-color: var(--tongue-jade-glow);
  box-shadow: 0 0 0 2px rgba(77, 255, 176, 0.2);
}

/* Quality score indicator */
.tongue-quality-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.tongue-quality-excellent {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.5);
  color: var(--green-400);
}

.tongue-quality-good {
  background: rgba(234, 179, 8, 0.2);
  border: 1px solid rgba(234, 179, 8, 0.5);
  color: #FACC15;
}

.tongue-quality-poor {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: var(--red-400);
}

/* Camera container */
.tongue-camera-container {
  position: relative;
  background: #000;
  border-radius: 1rem;
  overflow: hidden;
  aspect-ratio: 4/3;
}

.tongue-camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

/* Face/Tongue guide overlay */
.tongue-guide-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tongue-face-frame {
  width: 70%;
  height: 75%;
  border: 3px dashed rgba(77, 255, 176, 0.5);
  border-radius: 50% 50% 45% 45%;
  position: relative;
  animation: tongue-guide-pulse 2s ease-in-out infinite;
}

@keyframes tongue-guide-pulse {
  0%, 100% { border-color: rgba(77, 255, 176, 0.5); }
  50% { border-color: rgba(77, 255, 176, 0.8); }
}

.tongue-mouth-zone {
  position: absolute;
  bottom: 18%;
  left: 50%;
  transform: translateX(-50%);
  width: 45%;
  height: 28%;
  border: 2px solid var(--tongue-jade-glow);
  border-radius: 0 0 50% 50%;
  background: rgba(77, 255, 176, 0.08);
}

.tongue-mouth-zone::before {
  content: '👅 Position tongue here';
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.7rem;
  color: var(--tongue-jade-glow);
  text-shadow: 0 0 10px rgba(0,0,0,0.9);
  font-weight: 600;
}

/* Color calibration card overlay */
.tongue-calibration-guide {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 60px;
  height: 40px;
  border: 2px dashed rgba(255, 255, 255, 0.5);
  border-radius: 4px;
  display: flex;
  flex-wrap: wrap;
  overflow: hidden;
  font-size: 6px;
  color: white;
  text-shadow: 0 1px 2px black;
}

.tongue-calibration-guide::after {
  content: 'Color Card';
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  white-space: nowrap;
}

.tongue-calibration-guide div {
  width: 33.33%;
  height: 50%;
}

/* Drop zone */
.tongue-drop-zone {
  border: 3px dashed rgba(77, 255, 176, 0.25);
  background: linear-gradient(135deg, rgba(45, 90, 74, 0.08) 0%, transparent 50%);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.tongue-drop-zone.dragover {
  border-color: var(--tongue-jade-glow);
  background: linear-gradient(135deg, rgba(45, 90, 74, 0.25) 0%, transparent 50%);
  box-shadow: 0 0 80px rgba(77, 255, 176, 0.15);
  transform: scale(1.01);
}

.tongue-drop-zone.has-image {
  border: 2px solid var(--tongue-jade);
  background: rgba(10, 14, 20, 0.9);
}

/* Capture mode tabs */
.tongue-capture-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.tongue-capture-tab {
  flex: 1;
  padding: 0.6rem;
  border-radius: 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(15, 23, 42, 0.5);
  color: var(--gray-400);
  border: 1px solid transparent;
  text-align: center;
}

.tongue-capture-tab.active {
  background: var(--tongue-jade);
  color: white;
  border-color: var(--tongue-jade-glow);
}

.tongue-capture-tab:hover:not(.active) {
  background: rgba(77, 255, 176, 0.1);
  border-color: rgba(77, 255, 176, 0.3);
}

/* Analysis cards */
.tongue-card {
  background: linear-gradient(145deg, rgba(26, 31, 42, 0.95) 0%, rgba(15, 19, 24, 0.98) 100%);
  border: 1px solid rgba(77, 255, 176, 0.15);
  border-radius: 1rem;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.tongue-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--tongue-jade-glow), transparent);
}

/* Sublingual vein indicator */
.tongue-vein-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15) 0%, rgba(124, 58, 237, 0.05) 100%);
  border: 1px solid rgba(124, 58, 237, 0.3);
}

.tongue-vein-bar {
  flex: 1;
  height: 8px;
  background: rgba(124, 58, 237, 0.2);
  border-radius: 4px;
  overflow: hidden;
}

.tongue-vein-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple-500), var(--violet-600));
  border-radius: 4px;
  transition: width 0.8s ease;
}

/* Spots visualization */
.tongue-spots-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.25rem;
}

.tongue-spot-zone {
  aspect-ratio: 1;
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  transition: all 0.3s ease;
}

.tongue-spot-none { background: rgba(34, 197, 94, 0.1); color: var(--green-400); }
.tongue-spot-few { background: rgba(234, 179, 8, 0.2); color: #FACC15; }
.tongue-spot-moderate { background: rgba(249, 115, 22, 0.2); color: var(--orange-400); }
.tongue-spot-many { background: rgba(239, 68, 68, 0.2); color: var(--red-400); }

/* Fissure map */
.tongue-fissure-map {
  position: relative;
  width: 100%;
  aspect-ratio: 1.5;
  background: linear-gradient(180deg, rgba(45, 90, 74, 0.1) 0%, rgba(15, 23, 42, 0.3) 100%);
  border-radius: 50% 50% 45% 45%;
  border: 1px solid rgba(77, 255, 176, 0.2);
}

.tongue-fissure-line {
  position: absolute;
  background: rgba(239, 68, 68, 0.6);
  border-radius: 1px;
}

.tongue-fissure-central {
  left: 50%;
  top: 20%;
  width: 2px;
  height: 50%;
  transform: translateX(-50%);
}

.tongue-fissure-horizontal {
  left: 20%;
  top: 40%;
  width: 60%;
  height: 2px;
}

.tongue-fissure-scattered {
  background: rgba(239, 68, 68, 0.4);
}

/* Chakra visualization */
.tongue-chakra-column {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tongue-chakra-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.tongue-chakra-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.tongue-chakra-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}

.tongue-chakra-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0.3;
}

.tongue-chakra-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.tongue-chakra-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s ease;
}

/* Constitution cards */
.tongue-constitution-card {
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, rgba(26, 31, 42, 0.8) 0%, rgba(15, 19, 24, 0.9) 100%);
  transition: all 0.3s ease;
  cursor: pointer;
}

.tongue-constitution-card:hover {
  border-color: var(--tongue-jade-glow);
  transform: translateY(-2px);
}

.tongue-constitution-card.primary {
  border-color: var(--tongue-gold);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(15, 19, 24, 0.9) 100%);
}

/* Emotional mapping */
.tongue-emotion-wheel {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto;
}

.tongue-emotion-segment {
  position: absolute;
  width: 50%;
  height: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.tongue-emotion-segment:hover {
  transform: scale(1.1);
}

.tongue-emotion-segment.active {
  filter: drop-shadow(0 0 10px currentColor);
}

/* Explainable AI panel */
.tongue-explain-panel {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(10, 14, 20, 0.98) 100%);
  border: 1px solid rgba(77, 255, 176, 0.2);
  border-radius: 0.75rem;
  overflow: hidden;
}

.tongue-explain-header {
  padding: 0.75rem 1rem;
  background: rgba(77, 255, 176, 0.1);
  border-bottom: 1px solid rgba(77, 255, 176, 0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tongue-explain-content {
  padding: 1rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.tongue-explain-content.open {
  max-height: 500px;
}

.tongue-explain-factor {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tongue-explain-factor:last-child {
  border-bottom: none;
}

.tongue-explain-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.tongue-explain-fill {
  height: 100%;
  border-radius: 3px;
}

/* Risk screening panel */
.tongue-risk-panel {
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, transparent 100%);
  border-radius: 0.75rem;
  padding: 1rem;
}

.tongue-risk-disclaimer {
  font-size: 0.65rem;
  color: var(--gray-400);
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 0.25rem;
  border-left: 2px solid var(--red-500);
}

.tongue-risk-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tongue-risk-low { color: var(--green-400); }
.tongue-risk-moderate { color: #FACC15; }
.tongue-risk-elevated { color: var(--orange-400); }
.tongue-risk-high { color: var(--red-400); }

/* Five Element badges */
.tongue-element {
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
  font-size: 0.65rem;
  font-weight: 600;
}

.tongue-element-wood { background: rgba(34, 197, 94, 0.2); color: var(--green-400); border: 1px solid rgba(34, 197, 94, 0.4); }
.tongue-element-fire { background: rgba(239, 68, 68, 0.2); color: var(--red-400); border: 1px solid rgba(239, 68, 68, 0.4); }
.tongue-element-earth { background: rgba(234, 179, 8, 0.2); color: #FACC15; border: 1px solid rgba(234, 179, 8, 0.4); }
.tongue-element-metal { background: rgba(148, 163, 184, 0.2); color: var(--slate-300); border: 1px solid rgba(148, 163, 184, 0.4); }
.tongue-element-water { background: rgba(59, 130, 246, 0.2); color: var(--blue-400); border: 1px solid rgba(59, 130, 246, 0.4); }

/* Herb pills */
.tongue-herb-pill {
  padding: 0.6rem 1rem;
  border-radius: 2rem;
  font-size: 0.8rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.tongue-herb-pill:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.tongue-herb-chief {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.35) 0%, rgba(212, 175, 55, 0.15) 100%);
  border: 1px solid rgba(212, 175, 55, 0.5);
  color: #F4CF67;
}

.tongue-herb-deputy {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.35) 0%, rgba(59, 130, 246, 0.15) 100%);
  border: 1px solid rgba(59, 130, 246, 0.5);
  color: var(--blue-400);
}

.tongue-herb-assistant {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.35) 0%, rgba(168, 85, 247, 0.15) 100%);
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #C084FC;
}

.tongue-herb-envoy {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.35) 0%, rgba(34, 197, 94, 0.15) 100%);
  border: 1px solid rgba(34, 197, 94, 0.5);
  color: var(--green-400);
}

/* Prose styling */
.tongue-prose {
  font-family: 'Georgia', 'Times New Roman', serif;
  line-height: 1.85;
  color: var(--gray-300);
}

.tongue-prose p {
  margin-bottom: 1rem;
  text-indent: 1.5rem;
}

.tongue-prose p:first-child {
  text-indent: 0;
}

.tongue-prose strong {
  color: var(--tongue-jade-glow);
  font-weight: 600;
}

.tongue-prose em {
  color: var(--amber-400);
  font-style: italic;
}

/* Severity indicators */
.tongue-severity-primary { 
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(239, 68, 68, 0.1) 100%);
  border-left: 3px solid var(--red-500);
}

.tongue-severity-secondary { 
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.25) 0%, rgba(251, 191, 36, 0.1) 100%);
  border-left: 3px solid var(--amber-400);
}

.tongue-severity-tertiary { 
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(59, 130, 246, 0.1) 100%);
  border-left: 3px solid var(--blue-500);
}

/* Potency bars */
.tongue-potency-bar {
  height: 10px;
  background: rgba(45, 90, 74, 0.2);
  border-radius: 5px;
  overflow: hidden;
}

.tongue-potency-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.tongue-potency-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: tongue-shimmer 2.5s ease-in-out infinite;
}

@keyframes tongue-shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Bagua spinner */
.tongue-bagua-spinner {
  animation: tongue-rotate 6s linear infinite;
}

@keyframes tongue-rotate {
  to { transform: rotate(360deg); }
}

/* Scrollbar */
.tongue-scroll::-webkit-scrollbar { width: 6px; }
.tongue-scroll::-webkit-scrollbar-track { background: rgba(15, 23, 42, 0.5); border-radius: 3px; }
.tongue-scroll::-webkit-scrollbar-thumb { background: var(--tongue-jade); border-radius: 3px; }
.tongue-scroll::-webkit-scrollbar-thumb:hover { background: var(--tongue-jade-glow); }

/* Modal overlay */
.tongue-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tongue-modal {
  background: linear-gradient(145deg, rgba(26, 31, 42, 0.98) 0%, rgba(15, 19, 24, 1) 100%);
  border: 1px solid rgba(77, 255, 176, 0.3);
  border-radius: 1rem;
  padding: 1.5rem;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  max-height: 90vh;
  overflow-y: auto;
}

.tongue-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(77, 255, 176, 0.2);
  border-radius: 0.5rem;
  color: var(--gray-200);
  font-size: 0.875rem;
}

.tongue-input:focus {
  outline: none;
  border-color: var(--tongue-jade-glow);
}

/* History timeline */
.tongue-history-item {
  background: linear-gradient(135deg, rgba(26, 31, 42, 0.8) 0%, rgba(15, 19, 24, 0.9) 100%);
  border: 1px solid rgba(77, 255, 176, 0.1);
  border-radius: 0.5rem;
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tongue-history-item:hover {
  border-color: var(--tongue-jade-glow);
}

.tongue-history-item.active {
  border-color: var(--tongue-jade-glow);
  box-shadow: 0 0 15px rgba(77, 255, 176, 0.2);
}

/* Comparison bars */
.tongue-comparison-bar {
  height: 8px;
  background: rgba(45, 90, 74, 0.2);
  border-radius: 4px;
  overflow: hidden;
}

.tongue-comparison-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
}

/* AO Scan integration indicator */
.tongue-ao-integration {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15) 0%, rgba(14, 165, 233, 0.05) 100%);
  border: 1px solid rgba(14, 165, 233, 0.3);
  border-radius: 0.5rem;
  font-size: 0.7rem;
  color: #38BDF8;
}

.tongue-ao-dot {
  width: 8px;
  height: 8px;
  background: #0EA5E9;
  border-radius: 50%;
  animation: tongue-ao-pulse 2s ease-in-out infinite;
}

@keyframes tongue-ao-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

/* Camera button */
.tongue-camera-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tongue-camera-btn-capture {
  background: linear-gradient(135deg, var(--red-500) 0%, var(--red-600) 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.tongue-camera-btn-capture:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.tongue-camera-btn-capture:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Timestamp badge */
.tongue-timestamp {
  font-size: 0.65rem;
  color: var(--gray-500);
  font-family: monospace;
}

/* Zone overlays */
.tongue-zone-overlay {
  position: absolute;
  border: 2px solid transparent;
  background: transparent;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  z-index: 10;
}

.tongue-zone-overlay:hover,
.tongue-zone-overlay.active {
  background: rgba(77, 255, 176, 0.12);
  border-color: var(--tongue-jade-glow);
  box-shadow: 0 0 25px rgba(77, 255, 176, 0.25);
}

.tongue-zone-overlay .zone-label {
  position: absolute;
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--tongue-jade-glow);
  text-shadow: 0 0 10px rgba(0,0,0,0.9);
  opacity: 0;
  transition: opacity 0.3s;
  white-space: nowrap;
}

.tongue-zone-overlay:hover .zone-label {
  opacity: 1;
}

/* Tabs */
.tongue-tab-group {
  display: flex;
  gap: 0.25rem;
  background: rgba(15, 23, 42, 0.5);
  padding: 0.25rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.tongue-tab {
  flex: 1;
  padding: 0.5rem;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
  color: var(--gray-400);
  border: none;
}

.tongue-tab.active {
  background: var(--tongue-jade);
  color: white;
}

.tongue-tab:hover:not(.active) {
  background: rgba(77, 255, 176, 0.1);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   ENERGETIC BODY v1.0 - Multidimensional Visualization System
   ═══════════════════════════════════════════════════════════════════════════════ */

:root {
  /* Chakra Colors */
  --eb-root: var(--red-500);
  --eb-sacral: var(--orange-500);
  --eb-solar: var(--yellow-500);
  --eb-heart: var(--green-500);
  --eb-throat: #0EA5E9;
  --eb-third-eye: var(--indigo-500);
  --eb-crown: var(--purple-500);
  
  /* Five Elements */
  --eb-wood: var(--green-500);
  --eb-fire: var(--red-500);
  --eb-earth: var(--yellow-500);
  --eb-metal: var(--slate-400);
  --eb-water: var(--blue-500);
  
  /* UI Chrome */
  --eb-void: #050510;
  --eb-panel: rgba(15, 20, 35, 0.85);
  --eb-glow-cyan: #00F0FF;
  --eb-glow-gold: #FFD700;
  --eb-glow-violet: var(--violet-500);
}

/* Main container with cosmic void background */
.eb-cosmic-void {
  background: 
    radial-gradient(ellipse at 30% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(0, 240, 255, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(255, 215, 0, 0.03) 0%, transparent 60%),
    linear-gradient(180deg, #050510 0%, #0a0a1a 50%, #050510 100%);
  position: relative;
  overflow: hidden;
}

/* Animated star field */
.eb-cosmic-void::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.3), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.2), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.4), transparent),
    radial-gradient(2px 2px at 130px 80px, rgba(255,255,255,0.2), transparent),
    radial-gradient(1px 1px at 160px 120px, rgba(255,255,255,0.3), transparent);
  background-size: 200px 150px;
  animation: eb-stars-drift 60s linear infinite;
  opacity: 0.5;
  pointer-events: none;
}

@keyframes eb-stars-drift {
  0% { transform: translateY(0); }
  100% { transform: translateY(-150px); }
}

/* Noise texture overlay */
.eb-cosmic-void::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.02;
  pointer-events: none;
}

/* 3D Canvas Container */
.eb-canvas-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 600px;
}

.eb-canvas-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Glassmorphic Panels */
.eb-glass-panel {
  background: var(--eb-panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.eb-glass-panel-glow {
  position: relative;
}

.eb-glass-panel-glow::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 17px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.3), transparent 50%, rgba(139, 92, 246, 0.3));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Layer Toggle Buttons */
.eb-layer-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--gray-400);
  font-size: 13px;
}

.eb-layer-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.eb-layer-toggle.active {
  background: rgba(0, 240, 255, 0.1);
  border-color: rgba(0, 240, 255, 0.4);
  color: #00F0FF;
}

.eb-layer-toggle .eb-toggle-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  transition: all 0.3s ease;
}

/* Chakra List in Panel */
.eb-chakra-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.eb-chakra-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.eb-chakra-item.selected {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.eb-chakra-orb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.eb-chakra-orb::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: inherit;
  filter: blur(6px);
  opacity: 0.5;
}

.eb-chakra-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.eb-chakra-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.eb-chakra-score {
  font-size: 12px;
  font-weight: 600;
  min-width: 24px;
  text-align: right;
}

/* Five Element Wheel */
.eb-element-wheel {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto;
}

.eb-element-sector {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all 0.3s ease;
  cursor: pointer;
  border: 2px solid transparent;
}

.eb-element-sector:hover {
  transform: scale(1.15);
  z-index: 10;
}

.eb-element-sector.imbalanced {
  animation: eb-element-pulse 1.5s ease-in-out infinite;
}

@keyframes eb-element-pulse {
  0%, 100% { box-shadow: 0 0 10px currentColor; }
  50% { box-shadow: 0 0 25px currentColor, 0 0 40px currentColor; }
}

/* Element positions (pentagon layout) */
.eb-element-fire { top: 0; left: 50%; transform: translateX(-50%); }
.eb-element-earth { top: 35%; right: 0; }
.eb-element-metal { bottom: 0; right: 15%; }
.eb-element-water { bottom: 0; left: 15%; }
.eb-element-wood { top: 35%; left: 0; }

/* Cycle lines */
.eb-element-cycles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.eb-element-cycles svg {
  width: 100%;
  height: 100%;
}

/* Blockage Score Display */
.eb-blockage-meter {
  position: relative;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.eb-blockage-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease, background 0.3s ease;
}

.eb-blockage-low { background: linear-gradient(90deg, var(--green-500), var(--green-400)); }
.eb-blockage-medium { background: linear-gradient(90deg, var(--yellow-500), #FACC15); }
.eb-blockage-high { background: linear-gradient(90deg, var(--orange-500), var(--red-500)); }
.eb-blockage-severe { background: linear-gradient(90deg, var(--red-500), var(--red-600)); }

/* Mind-Body Mismatch Indicator */
.eb-mismatch-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.eb-mismatch-ring::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--eb-glow-cyan);
  animation: eb-mismatch-spin 2s linear infinite;
}

@keyframes eb-mismatch-spin {
  100% { transform: rotate(360deg); }
}

/* Therapeutic Sequence Timeline */
.eb-sequence-step {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-left: 2px solid rgba(255, 255, 255, 0.1);
  margin-left: 12px;
  position: relative;
  transition: all 0.3s ease;
}

.eb-sequence-step::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 14px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--eb-panel);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.eb-sequence-step.active {
  border-left-color: var(--eb-glow-cyan);
}

.eb-sequence-step.active::before {
  background: var(--eb-glow-cyan);
  border-color: var(--eb-glow-cyan);
  box-shadow: 0 0 10px var(--eb-glow-cyan);
}

.eb-sequence-step.complete {
  border-left-color: var(--green-500);
  opacity: 0.7;
}

.eb-sequence-step.complete::before {
  background: var(--green-500);
  border-color: var(--green-500);
}

/* Seal/Badge Styling */
.eb-seal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(0, 240, 255, 0.1));
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--violet-300);
  text-transform: uppercase;
}

/* Status Indicators */
.eb-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: eb-status-pulse 2s ease-in-out infinite;
}

@keyframes eb-status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.eb-status-balanced { background: var(--green-500); box-shadow: 0 0 8px var(--green-500); }
.eb-status-warning { background: var(--yellow-500); box-shadow: 0 0 8px var(--yellow-500); }
.eb-status-critical { background: var(--red-500); box-shadow: 0 0 8px var(--red-500); }

/* Floating Info Tooltip */
.eb-tooltip {
  position: absolute;
  background: var(--eb-panel);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  max-width: 280px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 1000;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.eb-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Patient Selector */
.eb-patient-select {
  background: rgba(15, 20, 35, 0.9);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--gray-200);
  padding: 8px 36px 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2300F0FF'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  min-width: 200px;
  transition: all 0.3s ease;
}

.eb-patient-select:hover {
  border-color: rgba(0, 240, 255, 0.5);
}

.eb-patient-select:focus {
  outline: none;
  border-color: var(--eb-glow-cyan);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.15);
}

.eb-patient-select option {
  background: #0f1423;
  color: var(--gray-200);
}

/* Animation for body entrance */
@keyframes eb-body-materialize {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(30px);
    filter: blur(10px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

.eb-body-entrance {
  animation: eb-body-materialize 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Meridian path glow */
@keyframes eb-meridian-flow {
  0% { stroke-dashoffset: 100%; }
  100% { stroke-dashoffset: 0%; }
}

/* Sound toggle button */
.eb-sound-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--gray-500);
}

.eb-sound-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--gray-200);
}

.eb-sound-toggle.active {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.4);
  color: var(--violet-400);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .eb-side-panel {
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }
  
  .eb-side-panel.open {
    transform: translateX(0);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BACKDROP-FILTER: Now safe with multi-page architecture
   The monolithic 9000+ line DOM has been split into separate pages,
   so backdrop-filter can safely be used for glass morphism effects.
   ═══════════════════════════════════════════════════════════════════════════════ */

/* Sidebar and header glass effects */
.kairo-sidebar,
.kairo-header {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Modal glass effect */
.modal-content,
.kairo-modal {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Card subtle glass effect - keep this light to avoid GPU strain */
.kairo-card {
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
