/**
 * Team Security (tsecurity.de) — Brand Graphics & Web 2.0/Web 3.0 Design Tokens
 * 
 * Comprehensive CSS Design System for Bespoke Vector Iconography,
 * Tactile Reaction Pills, Threat Telemetry Badges, and Dual-Themed Glass Surfaces.
 * 
 * Supports Dark Mode (Default) & Light Mode (html[data-bs-theme="light"]).
 */

/* ==========================================================================
   1. Design System Tokens (Dark Mode — Cyber Midnight / SSoT)
   ========================================================================== */
:root,
:root[data-bs-theme="dark"],
html[data-theme="dark"] {
  /* Brand Neon Color Spectrum (Web 3.0 Cyber Threat Intel) */
  --tsec-neon-cyan: #00f0ff;
  --tsec-neon-blue: #3b82f6;
  --tsec-neon-crimson: #ff0055;
  --tsec-neon-emerald: #00ff9d;
  --tsec-neon-amber: #ffb703;
  --tsec-neon-purple: #a855f7;

  /* Surfaces & Glassmorphism */
  --tsec-surface-base: #070b14;
  --tsec-surface-card: #0b1329;
  --tsec-surface-glass: rgba(11, 19, 41, 0.75);
  --tsec-surface-glass-hover: rgba(14, 28, 58, 0.90);
  --tsec-surface-border: rgba(148, 163, 184, 0.22);
  --tsec-surface-border-active: rgba(0, 240, 255, 0.65);

  /* Typography & Contrasts */
  --tsec-text-primary: #f8fafc;
  --tsec-text-secondary: #94a3b8;
  --tsec-text-muted: #64748b;
  --tsec-text-cyan: #00f0ff;

  /* Shadows & Neon Blooms */
  --tsec-shadow-pill: 0 2px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  --tsec-shadow-glow-cyan: 0 0 16px rgba(0, 240, 255, 0.35);
  --tsec-shadow-glow-crimson: 0 0 16px rgba(255, 0, 85, 0.35);
  --tsec-shadow-glow-emerald: 0 0 16px rgba(0, 255, 157, 0.35);
  --tsec-shadow-glow-amber: 0 0 16px rgba(255, 183, 3, 0.35);
  --tsec-shadow-glow-purple: 0 0 16px rgba(168, 85, 247, 0.35);

  /* Icon Badge */
  --tsec-badge-bg: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(7, 11, 20, 0.95) 100%);
  --tsec-badge-border: rgba(0, 240, 255, 0.40);
  --tsec-badge-shadow: 0 0 25px rgba(0, 240, 255, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.20);
  --tsec-badge-bracket: var(--tsec-neon-cyan);

  /* Overlay Mesh */
  --tsec-hero-mesh-opacity: 0.38;
}

/* ==========================================================================
   2. Design System Tokens (Light Mode — Crisp High-Contrast)
   ========================================================================== */
:root[data-bs-theme="light"],
html.light,
body.light,
html[data-theme="light"],
html[data-bs-theme="light"] {
  /* Brand Neon Color Spectrum (Adjusted for 4.5:1+ WCAG Contrast) */
  --tsec-neon-cyan: #0891b2;
  --tsec-neon-blue: #2563eb;
  --tsec-neon-crimson: #dc2626;
  --tsec-neon-emerald: #059669;
  --tsec-neon-amber: #d97706;
  --tsec-neon-purple: #7c3aed;

  /* Surfaces & Glassmorphism */
  --tsec-surface-base: #f8fafc;
  --tsec-surface-card: #ffffff;
  --tsec-surface-glass: rgba(248, 250, 252, 0.88);
  --tsec-surface-glass-hover: #ffffff;
  --tsec-surface-border: rgba(100, 116, 139, 0.32);
  --tsec-surface-border-active: rgba(8, 145, 178, 0.70);

  /* Typography & Contrasts */
  --tsec-text-primary: #0f172a;
  --tsec-text-secondary: #334155;
  --tsec-text-muted: #64748b;
  --tsec-text-cyan: #0e7490;

  /* Shadows & Subtle Depth */
  --tsec-shadow-pill: 0 2px 6px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --tsec-shadow-glow-cyan: 0 4px 14px rgba(8, 145, 178, 0.22);
  --tsec-shadow-glow-crimson: 0 4px 14px rgba(220, 38, 38, 0.20);
  --tsec-shadow-glow-emerald: 0 4px 14px rgba(5, 150, 105, 0.20);
  --tsec-shadow-glow-amber: 0 4px 14px rgba(217, 119, 6, 0.20);
  --tsec-shadow-glow-purple: 0 4px 14px rgba(124, 58, 237, 0.20);

  /* Icon Badge */
  --tsec-badge-bg: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  --tsec-badge-border: rgba(8, 145, 178, 0.45);
  --tsec-badge-shadow: 0 4px 18px rgba(8, 145, 178, 0.16), inset 0 1px 0 #ffffff;
  --tsec-badge-bracket: #0891b2;

  /* Overlay Mesh */
  --tsec-hero-mesh-opacity: 0.18;
}

/* ==========================================================================
   3. Base Emoticon & Micro-Icon Component (.tsec-emoticon)
   ========================================================================== */
.tsec-emoticon {
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
  transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.24s ease;
  user-select: none;
  pointer-events: none;
}

/* Sizing Modifiers */
.tsec-emoticon-xs { width: 16px; height: 16px; }
.tsec-emoticon-sm { width: 20px; height: 20px; }
.tsec-emoticon-md { width: 26px; height: 26px; }
.tsec-emoticon-lg { width: 36px; height: 36px; }
.tsec-emoticon-xl { width: 52px; height: 52px; }

/* Micro-interaction modifiers */
.tsec-emoticon--pulse {
  animation: tsec-neon-pulse 2.2s infinite ease-in-out;
}

.tsec-emoticon--spin-hover:hover {
  transform: rotate(360deg) scale(1.15);
}

/* ==========================================================================
   4. Tactile Web 2.0 / Web 3.0 Reaction Pills (.tsec-reaction-pill)
   ========================================================================== */
.tsec-reaction-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--tsec-surface-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--tsec-surface-border);
  border-radius: 9999px;
  padding: 0.25rem 0.68rem;
  font-family: var(--bs-font-monospace, monospace);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--tsec-text-primary);
  cursor: pointer;
  box-shadow: var(--tsec-shadow-pill);
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  touch-action: manipulation;
}

.tsec-reaction-pill:hover {
  color: var(--tsec-text-primary);
  border-color: var(--tsec-surface-border-active);
  background: var(--tsec-surface-glass-hover);
  transform: translateY(-2px);
  box-shadow: var(--tsec-shadow-glow-cyan);
}

.tsec-reaction-pill:hover .tsec-emoticon {
  transform: scale(1.18) rotate(-4deg);
  filter: drop-shadow(0 0 8px var(--tsec-neon-cyan));
}

.tsec-reaction-pill:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
}

.tsec-reaction-pill.is-active {
  border-color: var(--tsec-neon-cyan) !important;
  background: rgba(0, 240, 255, 0.16) !important;
  color: var(--tsec-text-cyan) !important;
  box-shadow: var(--tsec-shadow-glow-cyan) !important;
}

/* Color Variant Pills (Extensibility) */
.tsec-reaction-pill--crimson:hover,
.tsec-reaction-pill--crimson.is-active {
  border-color: var(--tsec-neon-crimson) !important;
  box-shadow: var(--tsec-shadow-glow-crimson) !important;
}

.tsec-reaction-pill--amber:hover,
.tsec-reaction-pill--amber.is-active {
  border-color: var(--tsec-neon-amber) !important;
  box-shadow: var(--tsec-shadow-glow-amber) !important;
}

.tsec-reaction-pill--emerald:hover,
.tsec-reaction-pill--emerald.is-active {
  border-color: var(--tsec-neon-emerald) !important;
  box-shadow: var(--tsec-shadow-glow-emerald) !important;
}

.tsec-reaction-pill--purple:hover,
.tsec-reaction-pill--purple.is-active {
  border-color: var(--tsec-neon-purple) !important;
  box-shadow: var(--tsec-shadow-glow-purple) !important;
}

.tsec-reaction-count {
  font-family: var(--bs-font-monospace, monospace);
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.9;
}

/* ==========================================================================
   5. Interactive Threat Pulse Badges (.tsec-pulse-btn)
   ========================================================================== */
.tsec-pulse-btn {
  position: relative;
  overflow: hidden;
  background: var(--tsec-surface-glass);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--tsec-surface-border);
  border-radius: 8px;
  transition: all 0.2s ease;
  box-shadow: var(--tsec-shadow-pill);
  color: var(--tsec-text-primary);
}

.tsec-pulse-btn:hover {
  transform: translateY(-1px);
  background: var(--tsec-surface-glass-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tsec-pulse-btn.is-active-high {
  border-color: var(--tsec-neon-crimson) !important;
  background: rgba(255, 0, 85, 0.15) !important;
  box-shadow: var(--tsec-shadow-glow-crimson) !important;
}

.tsec-pulse-btn.is-active-medium {
  border-color: var(--tsec-neon-amber) !important;
  background: rgba(255, 183, 3, 0.15) !important;
  box-shadow: var(--tsec-shadow-glow-amber) !important;
}

.tsec-pulse-btn.is-active-low {
  border-color: var(--tsec-neon-emerald) !important;
  background: rgba(0, 255, 157, 0.15) !important;
  box-shadow: var(--tsec-shadow-glow-emerald) !important;
}

.tsec-pulse-btn.is-active-tech {
  border-color: var(--tsec-neon-cyan) !important;
  background: rgba(0, 240, 255, 0.15) !important;
  box-shadow: var(--tsec-shadow-glow-cyan) !important;
}

/* ==========================================================================
   6. Category Hero Badge & Web 3.0 Cyber Corners (.ts-category-icon-badge)
   ========================================================================== */
.ts-category-icon-badge {
  position: relative;
  background: var(--tsec-badge-bg);
  border: 1px solid var(--tsec-badge-border);
  border-radius: 12px;
  box-shadow: var(--tsec-badge-shadow) !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ts-category-icon-badge:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 0 35px var(--tsec-neon-cyan), inset 0 1px 1px rgba(255, 255, 255, 0.35) !important;
}

/* Web 3.0 HUD Bracket Accents */
.ts-category-icon-badge::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--tsec-badge-bracket);
  border-left: 2px solid var(--tsec-badge-bracket);
  border-top-left-radius: 3px;
  pointer-events: none;
}

.ts-category-icon-badge::after {
  content: "";
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-bottom: 2px solid var(--tsec-badge-bracket);
  border-right: 2px solid var(--tsec-badge-bracket);
  border-bottom-right-radius: 3px;
  pointer-events: none;
}

/* Web 3.0 Perspective Hero Matrix Overlay */
.ts-category-hero-grid {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  pointer-events: none;
  opacity: var(--tsec-hero-mesh-opacity);
  mix-blend-mode: screen;
}

/* ==========================================================================
   7. Glass Panels & Cards (Extensibility Utilities)
   ========================================================================== */
.tsec-glass-card {
  background: var(--tsec-surface-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--tsec-surface-border);
  border-radius: 12px;
  box-shadow: var(--tsec-shadow-pill);
}

.tsec-glass-panel {
  background: var(--tsec-surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--tsec-surface-border);
}

/* Glow Utilities */
.tsec-glow-cyan    { box-shadow: var(--tsec-shadow-glow-cyan) !important; }
.tsec-glow-crimson { box-shadow: var(--tsec-shadow-glow-crimson) !important; }
.tsec-glow-emerald { box-shadow: var(--tsec-shadow-glow-emerald) !important; }
.tsec-glow-amber   { box-shadow: var(--tsec-shadow-glow-amber) !important; }
.tsec-glow-purple  { box-shadow: var(--tsec-shadow-glow-purple) !important; }

/* ==========================================================================
   8. Threat Spectrum Badges & Triage Sorting Hierarchy (WoW-Prinzip)
   ========================================================================== */
.tsec-spectrum-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-family: var(--bs-font-monospace, monospace);
  font-size: 0.70rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.tsec-spectrum-severity {
  background: rgba(255, 0, 85, 0.14);
  border-color: rgba(255, 0, 85, 0.40);
  color: var(--tsec-neon-crimson);
}

.tsec-spectrum-defense {
  background: rgba(0, 255, 157, 0.14);
  border-color: rgba(0, 255, 157, 0.40);
  color: var(--tsec-neon-emerald);
}

.tsec-spectrum-intel {
  background: rgba(0, 240, 255, 0.14);
  border-color: rgba(0, 240, 255, 0.40);
  color: var(--tsec-neon-cyan);
}

.tsec-spectrum-technical {
  background: rgba(255, 183, 3, 0.14);
  border-color: rgba(255, 183, 3, 0.40);
  color: var(--tsec-neon-amber);
}

.tsec-spectrum-governance {
  background: rgba(168, 85, 247, 0.14);
  border-color: rgba(168, 85, 247, 0.40);
  color: var(--tsec-neon-purple);
}

/* Specific Pill Variants for Expanded Emoticon Spectrum */
.tsec-reaction-pill--quarantine:hover,
.tsec-reaction-pill--quarantine.is-active {
  border-color: #f59e0b !important;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.45) !important;
}

.tsec-reaction-pill--zero-trust:hover,
.tsec-reaction-pill--zero-trust.is-active {
  border-color: #0d9488 !important;
  box-shadow: 0 0 14px rgba(13, 148, 136, 0.45) !important;
}

.tsec-reaction-pill--crypto:hover,
.tsec-reaction-pill--crypto.is-active {
  border-color: #a855f7 !important;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.45) !important;
}

.tsec-reaction-pill--anomaly:hover,
.tsec-reaction-pill--anomaly.is-active {
  border-color: #c084fc !important;
  box-shadow: 0 0 14px rgba(192, 132, 252, 0.45) !important;
}

/* ==========================================================================
   9. Keyframe Animations & Accessibility (WCAG 2.2 / Prefers-Reduced-Motion)
   ========================================================================== */
@keyframes tsec-neon-pulse {
  0%, 100% {
    filter: drop-shadow(0 0 4px rgba(0, 240, 255, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 12px rgba(0, 240, 255, 0.8));
  }
}

.tsec-pulse-active {
  animation: tsec-neon-pulse 2.2s infinite ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
  .tsec-emoticon,
  .tsec-reaction-pill,
  .ts-category-icon-badge,
  .tsec-pulse-btn {
    transition: none !important;
  }
  .tsec-pulse-active,
  .tsec-emoticon--pulse {
    animation: none !important;
  }
}

