@tailwind base;
@tailwind components;
@tailwind utilities;

/* Utility: Remove element from document flow completely */
.hidden {
    display: none !important;
}

/* Ensure loader covers properly when active */
#scan-loader {
    position: relative;
    width: 100%;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 50;
}

:root {
  --nesta-blue: #0000FF;      /* buttons, links */
  --nesta-navy: #0F294A;      /* text, headers */
  --nesta-green: #18A48C;     /* Sustainable Future */
  --nesta-pink: #F6A4B7;      /* Healthy Life */
  --nesta-yellow: #FDB633;    /* Fairer Start */
  --nesta-red: #EB003B;       /* errors */
  --nesta-silver: #F3F4F5;    /* light background */
  --nesta-white: #FFFFFF;
  --background: #F8F8FA;      /* main background */

  /* Scan module variables – default: Navy (Mini Radar) */
  --box-bg: #0F294A;
  --box-text: #FFFFFF;
  --box-muted: #94A3B8;
  --box-input-bg: rgba(255, 255, 255, 0.08);
  --box-input-border: rgba(255, 255, 255, 0.15);
  --btn-accent: #0000FF;
  --btn-text: #FFFFFF;
}

/* Deep Research – Violet */
body.theme-violet {
  --box-bg: #4C1D95;
  --box-text: #FFFFFF;
  --box-muted: #C4B5FD;
  --box-input-bg: rgba(255, 255, 255, 0.1);
  --box-input-border: rgba(255, 255, 255, 0.15);
  --btn-accent: #18A48C;
  --btn-text: #FFFFFF;
}

/* Regulatory Horizon – Aqua (light theme) */
body.theme-aqua {
  --box-bg: #CCFBF1;
  --box-text: #0F294A;
  --box-muted: #0F766E;
  --box-input-bg: rgba(255, 255, 255, 0.7);
  --box-input-border: rgba(15, 41, 74, 0.15);
  --btn-accent: #0F294A;
  --btn-text: #FFFFFF;
}

* {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* TYPOGRAPHY */
h1, h2, h3, .headline {
  font-family: 'Noto Serif', serif;
  font-weight: 700;
}

/* CORRECT RELATIVE PATHS */
/* usage: ../ means "go up one folder" (from css to static), then into fonts */

@font-face {
  font-family: 'Zosia';
  src: url('../fonts/Zosia-Display.woff2') format('woff2');
  font-weight: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Averta';
  src: url('../fonts/Averta-Regular.otf') format('opentype');
  font-weight: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Averta';
  src: url('../fonts/Averta-Semibold.otf') format('opentype');
  font-weight: bold;
  font-display: swap;
}

.tour-highlight {
  position: relative;
  z-index: 65;
  box-shadow: 0 0 0 4px var(--nesta-blue), 0 0 0 8px var(--nesta-red);
  border-radius: 0;  /* Sharp angles, no rounded corners */
}

body {
  background-color: #F8F8FA;
  color: #0F294A;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Scan module – the colored box */
.scan-module {
  background-color: var(--box-bg);
  color: var(--box-text);
  transition: background-color 0.6s cubic-bezier(0.25, 1, 0.5, 1),
              color 0.4s ease;
}

.scan-input {
  background-color: var(--box-input-bg);
  border-color: var(--box-input-border);
  color: var(--box-text);
}

.scan-input::placeholder {
  color: var(--box-muted);
}

.scan-input:focus {
  border-color: var(--btn-accent);
  outline: none; /* Relies on border-color for focus state */
}

/* ========================================
   Custom Select Dropdown Styling Fix
   ======================================== */

/* 1. Strip vanilla HTML look and inject a custom SVG arrow */
select.scan-input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 2.5rem; /* Prevent text overlapping the arrow */
  cursor: pointer;

  /* SVG chevron — uses currentColor so it adapts across themes */
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.25rem;
}

/* 2. Fix A11y contrast: force solid colours on <option> elements */
/* rgba() is not supported here — solid values are required */
select.scan-input option {
  color: #0F294A !important;        /* Nesta Navy text */
  background-color: #FFFFFF !important; /* Solid white background */
  font-weight: 600;
}

h1,
h2,
h3,
.brand-font {
  color: #0F294A;
  font-family: 'Noto Serif', serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Inside scan module, headings use module text colour */
.scan-module h1,
.scan-module h2,
.scan-module h3,
.scan-module .brand-font {
  color: var(--box-text);
}

/* Sharp, bold button design with Nesta shadow */
.btn-nesta {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 4px 0px 0px var(--nesta-navy);
  border-radius: 0;  /* Sharp angles */
  border: 3px solid var(--nesta-navy);  /* Bold 3px borders */
}

.btn-nesta:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px 0px var(--nesta-navy);
}

.btn-nesta:active {
  transform: translate(0px, 0px);
  box-shadow: 2px 2px 0px 0px var(--nesta-navy);
}

/* Nesta shadow utility class */
.nesta-shadow {
  box-shadow: 4px 4px 0px 0px var(--nesta-navy);
}

.nesta-shadow-lg {
  box-shadow: 6px 6px 0px 0px var(--nesta-navy);
}

.nav-button {
  @apply w-full flex items-center gap-4 px-4 lg:px-8 py-4 border-l-4 border-transparent transition-all;
}

.nav-button--active {
  @apply border-white bg-white/10;
}

/* Skeleton Loader */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.skeleton {
  animation: shimmer 2s infinite linear;
  background: linear-gradient(to right, #f1f5f9 4%, #e2e8f0 25%, #f1f5f9 36%);
  background-size: 1000px 100%;
}

/* Masonry Grid */
.masonry-grid {
  column-count: 1;
  column-gap: 1.5rem;
}

/* Terminal Log Colors */
.log-info {
  color: #cbd5e1;
}

.log-success {
  color: #18a48c;
  font-weight: bold;
}

.log-warning {
  color: #fdb633;
}

.log-error {
  color: #eb003b;
  font-weight: bold;
}

#console {
  background: #FFFFFF;
  border: 1px solid rgba(15, 41, 64, 0.1);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 41, 64, 0.08);
  font-family: 'Averta', var(--font-main);
  font-size: 12px;
}

.log-entry {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #F3F4F5;
  border-radius: 10px;
  border-left: 3px solid #00D2A2;
  color: #0F2940;
  padding: 0.5rem 0.75rem;
}

.log-entry-error {
  border-left-color: #F75E5E;
}

/* TOAST ANIMATIONS */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(10px);
  }
}

.toast-enter {
  animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.toast-exit {
  animation: fadeOut 0.3s ease-out forwards;
}

/* ACTIVITY METER (Visual Bar) */
.meter-container {
  height: 4px;
  background: #e2e8f0;
  width: 100%;
  margin-top: 4px;
  position: relative;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  background: #0000ff;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- 1. NESTA HARD-EDGE TOOLTIPS --- */
/* ========================================
   AI Confidence Score Tooltip
   ======================================== */

[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:hover::before,
[data-tooltip]:focus-visible::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 260px;
    padding: 0.5rem 0.75rem;
    background-color: #0F1932; /* Nesta Navy */
    color: #FFFFFF;
    font-size: 0.75rem;
    font-family: 'Averta', system-ui, sans-serif;
    font-weight: normal;
    line-height: 1.4;
    border-radius: 6px;
    margin-bottom: 8px;
    z-index: 100;
    white-space: normal;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

/* Arrow */
[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 15px;
    border-width: 5px;
    border-style: solid;
    border-color: #0F1932 transparent transparent transparent;
    margin-bottom: -2px;
    z-index: 100;
    pointer-events: none;
}

/* --- 2. STAGGERED ENTRY ANIMATION --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-enter {
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.animate-slide-in {
  animation: slideInUp 0.4s ease-out forwards;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-slide-down {
  animation: slideDown 0.3s ease-out forwards;
}

/* --- FEATURE #4: PULSE BADGE --- */
.pulse-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #eb003b;
  color: white;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 2px;
  z-index: 20;
  box-shadow: 0 2px 4px rgba(235, 0, 59, 0.3);
  pointer-events: none;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
  animation: ping 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
  75%,
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* --- FEATURE #5: FILTER CHIPS --- */
.filter-chip {
  background: transparent;
  border: 1px solid #0f294a;
  color: #0f294a;
  padding: 6px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 2px 2px 0px 0px rgba(15, 41, 74, 0.1);
}

.filter-chip:hover {
  transform: translateY(-1px);
  box-shadow: 3px 3px 0px 0px #0f294a;
}

.filter-chip.active {
  background: #0f294a;
  color: white;
  box-shadow: 3px 3px 0px 0px rgba(15, 41, 74, 0.3);
}

/* MODERN SIDEBAR NAVIGATION */
.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.nav-item.active#nav-radar {
  background: linear-gradient(90deg, rgba(0, 0, 255, 0.1) 0%, transparent 100%);
  border-left-color: #0000ff;
}

.nav-item.active#nav-radar .text-sm {
  color: #0000ff;
}

.nav-item.active#nav-research {
  background: linear-gradient(90deg, rgba(165, 94, 234, 0.1) 0%, transparent 100%);
  border-left-color: #a55eea;
}

.nav-item.active#nav-research .text-sm {
  color: #a55eea;
}

.nav-item.active#nav-policy {
  background: linear-gradient(90deg, rgba(253, 182, 51, 0.1) 0%, transparent 100%);
  border-left-color: #fdb633;
}

.nav-item.active#nav-policy .text-sm {
  color: #fdb633;
}

.nav-item.active#nav-database {
  background: linear-gradient(90deg, rgba(24, 164, 140, 0.1) 0%, transparent 100%);
  border-left-color: #18a48c;
}

.nav-item.active#nav-database .text-sm {
  color: #18a48c;
}

.nav-item.active#nav-database .text-sm {
  color: #18a48c;
}

/* MODE TOGGLE STYLES */
.mode-toggle {
  background: var(--box-input-bg);
  border: 2px solid var(--box-input-border);
  color: var(--box-text);
  cursor: pointer;
  border-radius: 999px;
  transition: all 0.3s ease;
}

.mode-toggle:hover {
  border-color: var(--btn-accent);
  transform: translateY(-1px);
}

.mode-toggle.active {
  background: var(--btn-accent);
  color: var(--btn-text);
  border-color: var(--btn-accent);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

@media (min-width: 768px) {
  .masonry-grid {
    column-count: 2;
  }
}

@media (min-width: 1200px) {
  .masonry-grid {
    column-count: 3;
  }
}

.signal-card {
  overflow: visible !important;
  break-inside: avoid;
  margin-bottom: 1.5rem;
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
  box-shadow: 4px 4px 0px 0px #0f294a;
}

.signal-card.expandable {
  cursor: pointer;
}

.signal-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px 0px #0f294a;
  border-color: #0000ff;
}

/* Snippet preview - show 3 lines by default */
.snippet-content {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
  line-height: 1.6;
}

/* Expanded state - show full content */
.signal-card.expanded .snippet-content {
  -webkit-line-clamp: unset;
  display: block;
}

/* Expand indicator */
.expand-hint {
  text-align: center;
  font-size: 0.85em;
  color: #64748b;
  margin-top: 8px;
}

.signal-card.expanded .expand-hint {
  display: none;
}

/* Source list styling */
.source-list {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
  font-size: 0.9em;
}

.source-list strong {
  display: block;
  margin-bottom: 8px;
  color: #0f172a;
}

.source-list a {
  display: block;
  color: #0000ff;
  text-decoration: none;
  margin-bottom: 6px;
  padding-left: 16px;
  position: relative;
  word-break: break-word;
}

.source-list a::before {
  content: "→";
  position: absolute;
  left: 0;
}

.source-list a:hover {
  text-decoration: underline;
}

/* Rendered markdown inside snippet */
.snippet-content h1,
.snippet-content h2,
.snippet-content h3 {
  font-weight: 700;
  color: #0f294a;
  margin-top: 0.75em;
  margin-bottom: 0.25em;
}

.snippet-content h3 {
  font-size: 1em;
}

.snippet-content ul,
.snippet-content ol {
  padding-left: 1.25em;
  margin: 0.5em 0;
}

.snippet-content li {
  margin-bottom: 0.25em;
}

.snippet-content p {
  margin: 0.5em 0;
}


.tooltip {
  z-index: 9999;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 41, 74, 0.4);
  backdrop-filter: blur(4px);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -48%) scale(0.96);
  width: 90vw;
  max-width: 1000px;
  max-height: 85vh;
  overflow-y: auto;
  background: white;
  border-radius: 16px;
  z-index: 51;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-content.open {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}


.filter-btn,
#btn-view-grid,
#btn-view-network {
  border-radius: 999px;
  background: var(--nesta-silver);
  border: 1px solid rgba(15, 41, 64, 0.2);
  color: var(--nesta-navy);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 24px;
  transition: all 0.2s ease;
}

.filter-btn:hover,
#btn-view-grid:hover,
#btn-view-network:hover {
  background: var(--nesta-white);
  border-color: rgba(15, 41, 64, 0.35);
}

.filter-btn.active,
#btn-view-grid.bg-white,
#btn-view-network.bg-white {
  background: var(--nesta-navy);
  color: var(--nesta-blue);
  border: none;
}

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

.modern-toast {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  max-width: 360px;
  width: calc(100% - 3rem);
  background: var(--nesta-navy);
  color: var(--nesta-white);
  border-left: 4px solid var(--nesta-blue);
  box-shadow: 0 18px 40px rgba(15, 41, 64, 0.35);
  padding: 0.875rem 1rem;
  border-radius: 0.5rem;
  z-index: 70;
  animation: toastSlideUp 220ms ease-out;
}

.modern-toast.error {
  border-left-color: var(--nesta-red);
}

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

.radar-loader {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 2px solid rgba(0, 210, 162, 0.2);
  border-top: 2px solid #00D2A2;
  animation: spin 1s linear infinite;
  margin: 1rem auto;
}

/* ===== ENHANCED CARD ANIMATIONS ===== */

/* Card entrance with staggered delay */
.signal-card {
  animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--card-index, 0) * 0.05s);
  opacity: 0;
}

.signal-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(15, 41, 74, 0.1);
  border-color: var(--nesta-blue);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.signal-card:active {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}

.card-hover {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(15, 41, 74, 0.1);
}

/* ===== HOVER PREVIEW (QUICK LOOK) ===== */
.hover-preview {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  background: white;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 10;
  max-width: min(100%, 400px);
}

article:hover .hover-preview {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

/* ===== SLIDE UP FADE ANIMATION ===== */
@keyframes slideUpFade {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}

.animate-slide-up {
  animation: slideUpFade 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

/* ===== SLIDE-OVER DETAIL PANEL ===== */
.detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 480px;
  max-width: 90vw;
  background: white;
  box-shadow: -8px 0 24px rgba(15, 41, 74, 0.15);
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 60;
  overflow-y: auto;
}

.detail-panel.open {
  transform: translateX(0);
}

.detail-panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 41, 74, 0.4);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 59;
}

.detail-panel-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* ===== SYNTHESIS CARD STYLES ===== */
.synthesis-card {
  background: linear-gradient(135deg, var(--nesta-blue) 0%, var(--nesta-navy) 100%);
  border: none;
  border-radius: 12px;
  color: white;
  box-shadow: 0 8px 32px rgba(0, 0, 255, 0.2);
  animation: slideInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.synthesis-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 48px rgba(0, 0, 255, 0.3);
}

/* Typewriter effect for synthesis text */
@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.typewriter-text {
  overflow: hidden;
  white-space: nowrap;
  animation: typewriter 2s steps(60, end) forwards;
}

/* ===== MISSION BADGE PILLS ===== */
.mission-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 2px solid currentColor;
  transition: all 0.2s ease;
}

.mission-badge-green {
  background: rgba(24, 164, 140, 0.1);
  color: var(--nesta-green);
  border-color: var(--nesta-green);
}

.mission-badge-pink {
  background: rgba(246, 164, 183, 0.1);
  color: var(--nesta-pink);
  border-color: var(--nesta-pink);
}

.mission-badge-yellow {
  background: rgba(253, 182, 51, 0.1);
  color: var(--nesta-yellow);
  border-color: var(--nesta-yellow);
}

/* ===== ACTION FOOTER ICONS ===== */
.action-footer {
  display: flex;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 2px solid #e2e8f0;
  background: white;
  color: var(--nesta-navy);
  transition: all 0.2s ease;
  cursor: pointer;
}

.action-btn:hover {
  border-color: var(--nesta-blue);
  background: rgba(0, 0, 255, 0.05);
  transform: translateY(-2px);
}

.action-btn:active {
  transform: translateY(0);
}

/* ===== MOBILE BOTTOM NAV ===== */
@media (max-width: 768px) {
  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-around;
    padding: 0.75rem 0;
    z-index: 50;
    box-shadow: 0 -4px 12px rgba(15, 41, 74, 0.1);
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
  }

  .mobile-nav-item.active {
    color: var(--nesta-blue);
  }

  .mobile-nav-item:active {
    transform: scale(0.95);
  }
}

/* ===== TOAST NOTIFICATION STACK ===== */
.toast-stack {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 100;
  pointer-events: none;
}

.toast-notification {
  min-width: 320px;
  padding: 1rem 1.25rem;
  background: white;
  border-left: 4px solid var(--nesta-blue);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 41, 74, 0.15);
  animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: all;
}

.toast-notification.success {
  border-left-color: var(--nesta-green);
}

.toast-notification.error {
  border-left-color: var(--nesta-red);
}

.toast-notification.warning {
  border-left-color: var(--nesta-yellow);
}

/* ===== SVG SPARKLINE STYLES ===== */
.sparkline-container {
  width: 100%;
  height: 40px;
  margin-top: 0.5rem;
}

.sparkline-path {
  fill: none;
  stroke: var(--nesta-blue);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sparkline-area {
  fill: url(#sparklineGradient);
  opacity: 0.2;
}

/* ===== EMPTY STATE ANIMATION ===== */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.empty-state-icon {
  animation: float 3s ease-in-out infinite;
}

/* ===== LOADING SKELETON WITH SHIMMER ===== */
.skeleton-card {
  background: #f1f5f9;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.skeleton-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0,
    rgba(255, 255, 255, 0.3) 20%,
    rgba(255, 255, 255, 0.5) 60%,
    rgba(255, 255, 255, 0)
  );
  animation: shimmer 2s infinite;
}

/* ===== ROUNDED CORNERS MIX ===== */
.rounded-nesta {
  border-radius: 12px;
}

.rounded-sharp {
  border-radius: 0;
}

/* ===== UTILITY CLASSES ===== */
.shadow-hard {
  box-shadow: 4px 4px 0px 0px rgba(15, 41, 74, 0.15);
}

.shadow-hard-lg {
  box-shadow: 6px 6px 0px 0px rgba(15, 41, 74, 0.2);
}

.transition-smooth {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.transition-bounce {
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ===== THEME CHIPS ===== */
.theme-chips-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  animation: fadeInUp 0.5s ease-out;
}

.theme-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 8px 16px;
  background: white;
  border: 2px solid var(--nesta-blue);
  border-radius: 20px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--nesta-blue);
}

.theme-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 255, 0.2);
  background: rgba(0, 0, 255, 0.05);
}

.theme-chip.active {
  background: var(--nesta-blue);
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 255, 0.3);
}

.theme-chip:active {
  transform: translateY(0);
}

/* ===== VIEW TOGGLE ===== */
.view-toggle {
  display: flex;
  gap: 0.5rem;
  padding: 4px;
  background: #F3F4F5;
  border-radius: 8px;
  width: fit-content;
}

.view-toggle button {
  padding: 8px 20px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.875rem;
  color: #64748B;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-toggle button:hover {
  color: var(--nesta-navy);
}

.view-toggle button.active {
  background: white;
  color: var(--nesta-blue);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ===== HORIZON MATRIX ===== */
#matrixContainer {
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(15, 41, 74, 0.1);
  min-height: 600px;
  animation: fadeInUp 0.5s ease-out;
}

#matrixContainer.hidden {
  display: none;
}

#horizonCanvas {
  max-width: 100%;
  height: 600px;
}

.matrix-legend {
  display: flex;
  justify-content: space-around;
  margin-top: 1rem;
  padding: 1rem;
  background: #F8F8FA;
  border-radius: 8px;
}

.matrix-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--nesta-navy);
}

.matrix-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--nesta-navy);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .theme-chips-container {
    gap: 0.5rem;
  }
  
  .theme-chip {
    padding: 6px 12px;
    font-size: 0.75rem;
  }
  
  #horizonCanvas {
    height: 400px;
  }
  
  .view-toggle {
    width: 100%;
  }
  
  .view-toggle button {
    flex: 1;
  }
}

/* Card Summary Expandable Text */

.card-summary {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease-in-out;
}

.card-summary.expanded {
    display: block;
    -webkit-line-clamp: unset;
}

.show-more-btn {
    background: none;
    border: none;
    color: var(--btn-accent, #0000FF);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-top: 0.25rem;
    text-decoration: underline;
    display: inline-block;
}

.show-more-btn:hover {
    color: #0F1932;
}

.summary-tooltip-icon {
    display: none !important;
}
