/* Zcatli Truth Lens - Brand & UI Styling */
/* Version: 5.1.5 - PRODUCTION READY */
/* SIMPLIFIED: 8 color categories for all 120+ pattern types */

:root {
  --z-gold: #d4af37;
  --z-gold-glow: rgba(212, 175, 55, 0.4);
  --z-bg: #0a0a0a;
  --z-card-bg: rgba(255, 255, 255, 0.03);
  --z-border: rgba(255, 255, 255, 0.1);
  --z-glass: blur(12px);
  --z-font: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* Highlighter colors - Maximum visibility */
  --z-highlight-ai: rgba(212, 175, 55, 0.4);
  --z-highlight-phishing: rgba(255, 99, 71, 0.4);
  --z-highlight-misinfo: rgba(255, 193, 7, 0.4);
  --z-highlight-scam: rgba(255, 99, 71, 0.4);
  --z-highlight-fraud: rgba(255, 99, 71, 0.4);
  --z-highlight-bias: rgba(100, 149, 237, 0.4);
  --z-highlight-manipulation: rgba(255, 140, 0, 0.4);
  --z-highlight-deepfake: rgba(147, 112, 219, 0.4);
  
  /* Enhanced glow effects */
  --z-glow-ai: 0 0 12px 3px rgba(212, 175, 55, 0.6);
  --z-glow-phishing: 0 0 12px 3px rgba(255, 99, 71, 0.6);
  --z-glow-misinfo: 0 0 12px 3px rgba(255, 193, 7, 0.6);
  --z-glow-scam: 0 0 12px 3px rgba(255, 99, 71, 0.6);
  --z-glow-fraud: 0 0 12px 3px rgba(255, 99, 71, 0.6);
  --z-glow-bias: 0 0 12px 3px rgba(100, 149, 237, 0.6);
  --z-glow-manipulation: 0 0 12px 3px rgba(255, 140, 0, 0.6);
  --z-glow-deepfake: 0 0 12px 3px rgba(147, 112, 219, 0.6);
}

/* Glassmorphism card style */
.glass-card {
  background: var(--z-card-bg);
  backdrop-filter: var(--z-glass);
  -webkit-backdrop-filter: var(--z-glass);
  border: 1px solid var(--z-border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
}

/* Individual finding / detection result item */
.finding-item {
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid #d4af37;
  margin-bottom: 8px;
  padding: 10px;
  border-radius: 4px;
  color: #fff !important;
  animation: slideIn 0.3s ease-out;
  cursor: pointer;
  transition: all 0.2s ease;
}

.finding-item:hover {
  transform: translateX(5px);
  background: rgba(212, 175, 55, 0.1);
  border-left-width: 5px;
}

/* =========================================== */
/* HIGHLIGHTER STYLES - JUST 8 COLOR CATEGORIES */
/* All 120+ pattern types map to these 8 colors */
/* =========================================== */

::highlight(zcatli-ai) {
  background-color: var(--z-highlight-ai);
  border-radius: 4px;
  box-shadow: var(--z-glow-ai), inset 0 0 4px rgba(212, 175, 55, 0.3);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  transition: all 0.2s ease;
  cursor: pointer;
}

::highlight(zcatli-phishing) {
  background-color: var(--z-highlight-phishing);
  border-radius: 4px;
  box-shadow: var(--z-glow-phishing), inset 0 0 4px rgba(255, 99, 71, 0.3);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  cursor: pointer;
}

::highlight(zcatli-misinfo) {
  background-color: var(--z-highlight-misinfo);
  border-radius: 4px;
  box-shadow: var(--z-glow-misinfo), inset 0 0 4px rgba(255, 193, 7, 0.3);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  cursor: pointer;
}

::highlight(zcatli-scam) {
  background-color: var(--z-highlight-scam);
  border-radius: 4px;
  box-shadow: var(--z-glow-scam), inset 0 0 4px rgba(255, 99, 71, 0.3);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  cursor: pointer;
}

::highlight(zcatli-fraud) {
  background-color: var(--z-highlight-fraud);
  border-radius: 4px;
  box-shadow: var(--z-glow-fraud), inset 0 0 4px rgba(255, 99, 71, 0.3);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  cursor: pointer;
}

::highlight(zcatli-bias) {
  background-color: var(--z-highlight-bias);
  border-radius: 4px;
  box-shadow: var(--z-glow-bias), inset 0 0 4px rgba(100, 149, 237, 0.3);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  cursor: pointer;
}

::highlight(zcatli-manipulation) {
  background-color: var(--z-highlight-manipulation);
  border-radius: 4px;
  box-shadow: var(--z-glow-manipulation), inset 0 0 4px rgba(255, 140, 0, 0.3);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  cursor: pointer;
}

::highlight(zcatli-deepfake) {
  background-color: var(--z-highlight-deepfake);
  border-radius: 4px;
  box-shadow: var(--z-glow-deepfake), inset 0 0 4px rgba(147, 112, 219, 0.3);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  cursor: pointer;
}

/* Hover effect for all highlights */
::highlight(zcatli-ai):hover,
::highlight(zcatli-phishing):hover,
::highlight(zcatli-misinfo):hover,
::highlight(zcatli-scam):hover,
::highlight(zcatli-fraud):hover,
::highlight(zcatli-bias):hover,
::highlight(zcatli-manipulation):hover,
::highlight(zcatli-deepfake):hover {
  background-color: rgba(255, 255, 255, 0.25) !important;
  box-shadow: 0 0 20px 6px currentColor !important;
}

/* EHFA status box */
#ehfa-box {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(10, 10, 10, 0.4));
  border: 1px solid var(--z-gold);
  box-shadow: 0 0 15px var(--z-gold-glow);
  animation: pulseGlow 3s infinite alternate;
  border-radius: 12px;
  padding: 15px;
}

/* Keyframe animations */
@keyframes slideIn {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  0% {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 5px var(--z-gold-glow);
  }
  to {
    box-shadow: 0 0 25px var(--z-gold-glow);
  }
}

/* Gold-themed button */
.z-btn-gold {
  background: var(--z-gold);
  color: #000;
  border: none;
  border-radius: 8px;
  font-weight: 900;
  padding: 10px 20px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.z-btn-gold:hover {
  filter: brightness(1.2);
  box-shadow: 0 0 20px var(--z-gold);
}

/* Highlighter control buttons */
.z-btn-highlight {
  background: transparent;
  border: 1px solid var(--z-gold);
  color: var(--z-gold);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.z-btn-highlight:hover {
  background: var(--z-gold);
  color: #000;
}

.z-btn-highlight.active {
  background: var(--z-gold);
  color: #000;
}

/* Custom gold scrollbar */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
  background: var(--z-gold);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #e5c158;
}

/* Tooltip for highlighted text */
.zcatli-tooltip {
  position: absolute;
  background: rgba(10, 10, 10, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--z-gold);
  border-radius: 8px;
  padding: 10px 14px;
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  max-width: 320px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8);
  z-index: 2147483647;
  pointer-events: none;
  animation: fadeIn 0.2s ease;
  font-family: var(--z-font);
}

@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: translateY(8px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

/* Highlighter legend */
.zcatli-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 15px 0;
  padding: 15px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  backdrop-filter: blur(4px);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #fff;
}

.legend-color {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  box-shadow: 0 0 10px currentColor;
}

.legend-color.ai { 
  background: var(--z-highlight-ai); 
  box-shadow: 0 0 12px var(--z-gold); 
}

.legend-color.phishing { 
  background: var(--z-highlight-phishing); 
  box-shadow: 0 0 12px #ff6347; 
}

.legend-color.misinfo { 
  background: var(--z-highlight-misinfo); 
  box-shadow: 0 0 12px #ffc107; 
}

.legend-color.scam { 
  background: var(--z-highlight-scam); 
  box-shadow: 0 0 12px #ff6347; 
}

.legend-color.fraud { 
  background: var(--z-highlight-fraud); 
  box-shadow: 0 0 12px #ff6347; 
}

.legend-color.bias { 
  background: var(--z-highlight-bias); 
  box-shadow: 0 0 12px #6495ed; 
}

.legend-color.manipulation { 
  background: var(--z-highlight-manipulation); 
  box-shadow: 0 0 12px #ff8c00; 
}

.legend-color.deepfake { 
  background: var(--z-highlight-deepfake); 
  box-shadow: 0 0 12px #9370db; 
}

/* Fallback for browsers without Custom Highlight API */
.zcatli-fallback-highlight {
  background-color: rgba(212, 175, 55, 0.35) !important;
  border-radius: 3px !important;
  box-shadow: 0 0 6px 2px rgba(212, 175, 55, 0.5) !important;
  color: inherit !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.zcatli-fallback-highlight:hover {
  background-color: rgba(212, 175, 55, 0.6) !important;
  box-shadow: 0 0 12px 4px rgba(212, 175, 55, 0.8) !important;
}