/* 
  REDACT - AI Privacy Intelligence Platform
  High-Performance, Premium Typography & Spacing System
*/

:root {
  /* High-Contrast Professional Palette */
  --bg-primary: #080B14;
  --bg-secondary: #0F172A;
  --card-bg: rgba(255, 255, 255, 0.04);
  --border-color: rgba(255, 255, 255, 0.08);
  
  --lavender-light: #DDD6FE;
  --lavender: #C4B5FD;
  --accent: #A78BFA;
  
  --text-primary: #F8FAFC;
  --text-secondary: #E2E8F0; /* Brighter slate for body readability */
  --text-muted: #94A3B8; /* Brighter slate-gray for clear subtexts */
  
  --danger: #FB7185;
  --success: #A7F3D0;
  
  /* Fonts */
  --font-sans: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Safe Blurs - reduced for high FPS scrolling */
  --card-blur: 8px;
}

/* Base setups */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

body {
  background: radial-gradient(circle at 50% 0%, #131a30 0%, var(--bg-primary) 100%);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 17px; /* Increased overall font size for premium legibility */
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  display: flex;
  justify-content: center; /* Center layout block on ultra-wide screens */
}

/* Custom smooth scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(196, 181, 253, 0.25);
}

/* Background grid overlay (highly optimized) */
.grid-overlay {
  background-image: radial-gradient(rgba(255, 255, 255, 0.01) 1px, transparent 0);
  background-size: 32px 32px;
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* Sidebar navigation - Stable and static spacing */
.sidebar-wrapper {
  width: 290px;
  height: 100vh;
  position: sticky;
  top: 0;
  border-right: 1px solid var(--border-color);
  background: rgba(8, 11, 20, 0.85);
  backdrop-filter: blur(var(--card-blur));
  -webkit-backdrop-filter: blur(var(--card-blur));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.25rem 1.75rem;
  z-index: 30;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  color: var(--text-muted); /* Distinct inactive text */
  border-radius: 0.75rem;
  font-size: 16px; /* Increased for premium readability */
  font-weight: 600; /* Crisp hierarchy weight */
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.sidebar-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.sidebar-nav-item.active {
  background: rgba(196, 181, 253, 0.1);
  color: var(--lavender);
  border-color: rgba(196, 181, 253, 0.25);
}

/* Content Area - Premium Spacing */
.content-wrapper {
  flex: 1;
  padding: 2.5rem 3.5rem; /* Balanced padding */
  position: relative;
  z-index: 10;
  overflow-y: auto;
  max-width: 1440px;
  margin: 0 auto; /* Default centering for mobile/tablet when sidebar is hidden */
  width: 100%;
}

@media (min-width: 1025px) {
  .content-wrapper {
    margin: 0; /* Align flush to sidebar on desktop viewports */
  }
}

/* Glassmorphism card elements */
.glass-panel {
  background: var(--card-bg);
  backdrop-filter: blur(var(--card-blur));
  -webkit-backdrop-filter: blur(var(--card-blur));
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  padding: 2rem; /* Increased padding from 1rem to 2rem */
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px); /* Smooth hover elevation */
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

/* Headings scale matching Apple & Linear */
.hero-title {
  font-size: 42px; /* Increased hero title sizing for high-impact presence */
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.card-title {
  font-size: 22px; /* Increased card title sizing for clear boundaries */
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.body-main {
  font-size: 16px; /* Clean standard readability size */
  font-weight: 500; /* Increased weight for clearer dark-mode visibility */
  line-height: 1.65; /* Adjusted for better reading flow */
  color: var(--text-secondary);
}

.metadata-text {
  font-size: 13px; /* Increased concise metadata tag text */
  font-weight: 600; /* Distinct weight for clear data tags */
  font-family: var(--font-mono);
  letter-spacing: 0.04em; /* Pronounced tracking */
  color: var(--text-muted);
}

/* Premium Button controls */
.btn-premium {
  background: linear-gradient(135deg, var(--lavender) 0%, var(--accent) 100%);
  color: #080B14;
  font-weight: 700; /* Bold for clearer action visibility */
  font-size: 17px; /* Increased button text size */
  padding: 1.125rem 2rem; /* Larger premium button size */
  border-radius: 0.875rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  box-shadow: 0 4px 15px rgba(196, 181, 253, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
}

.btn-premium:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(196, 181, 253, 0.3);
}

.btn-premium:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Gauge SVG controls */
.gauge-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 220px;
  height: 220px;
}

.gauge-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.gauge-bg {
  fill: transparent;
  stroke: rgba(255, 255, 255, 0.03);
  stroke-width: 4px;
}

.gauge-progress {
  fill: transparent;
  stroke: var(--lavender);
  stroke-width: 5px;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease-in-out;
}

.gauge-progress.risk-high {
  stroke: var(--danger);
}

/* Elegant Shimmer animation layer for loading templates */
.shimmer {
  background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03) 75%);
  background-size: 200% 100%;
  animation: shimmerAnim 1.6s infinite linear;
}

@keyframes shimmerAnim {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Linear progress trackers */
.progress-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--lavender) 0%, var(--accent) 100%);
  width: 0%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dynamic Interactive Node Graph wrapper */
.node-graph-container {
  position: relative;
  width: 100%;
  height: 580px;
  overflow: hidden;
  border-radius: 1.25rem;
  background: #080B14;
  padding: 0 !important; /* Ensure canvas fits borders perfectly */
}

#node-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* OTP verification code inputs */
.otp-digit-box {
  width: 3.75rem;
  height: 4.25rem;
  background: rgba(8, 11, 20, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 0.875rem;
  color: var(--lavender);
  font-family: var(--font-mono);
  font-size: 1.75rem;
  text-align: center;
  outline: none;
  transition: all 0.2s ease;
}

.otp-digit-box:focus {
  border-color: var(--lavender);
  box-shadow: 0 0 10px rgba(196, 181, 253, 0.15);
}

/* AI Sentinel Workspace Layout */
.ai-workspace {
  display: flex;
  gap: 1.5rem;
  height: 620px;
  width: 100%;
  min-height: 0;
}

.ai-sidebar {
  width: 280px;
  border-right: 1px solid var(--border-color);
  padding-right: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
}

.chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
}

/* Custom premium ambient glow layer */
.glow-shape {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 181, 253, 0.04) 0%, transparent 70%);
  pointer-events: none;
  filter: blur(60px);
  z-index: 1;
}

@media (max-width: 768px) {
  .ai-workspace {
    flex-direction: column;
    height: auto;
  }
  .ai-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding-right: 0;
    padding-bottom: 1.25rem;
    height: auto;
    max-height: 200px;
  }
  .chat-container {
    height: 500px;
  }
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.chat-bubble {
  max-width: 75%;
  padding: 1.125rem 1.375rem;
  border-radius: 1.25rem;
  font-size: 16px; /* Increased to match main body text */
  line-height: 1.65;
}

.chat-bubble.user {
  background: rgba(196, 181, 253, 0.08);
  border: 1px solid rgba(196, 181, 253, 0.12);
  align-self: flex-end;
  border-bottom-right-radius: 0.25rem;
}

.chat-bubble.ai {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  align-self: flex-start;
  border-bottom-left-radius: 0.25rem;
}

/* Mobile Navigation Toggle styling */
.mobile-nav-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 64px;
  background: rgba(8, 11, 20, 0.95);
  backdrop-filter: blur(var(--card-blur));
  border-top: 1px solid var(--border-color);
  justify-content: space-around;
  align-items: center;
  z-index: 50;
}

.mobile-nav-item {
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px; /* Increased to be highly legible on small screens */
  text-decoration: none;
  font-weight: 600; /* Increased weight for mobile scanning */
}

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

/* Mobile overrides */
@media (max-width: 1024px) {
  .sidebar-wrapper {
    display: none;
  }
  .mobile-nav-bar {
    display: flex;
  }
  body {
    padding-bottom: 64px;
  }
  .content-wrapper {
    padding: 2rem 1.5rem;
  }
}

/* ==========================================
     GLOBAL SMOOTH THEME TRANSITIONS
     ========================================== */
body, aside, main, header, nav, .glass-panel, a, button, span, h1, h2, h3, h4, p, svg, circle, img, input {
  transition: background 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}

/* ==========================================
     LIGHT MODE VARIANT (LAVENDER THEMED)
     ========================================== */
.light-mode {
  --bg-primary: #F3F0FF; /* Soft pastel lavender white background */
  --bg-secondary: #EBE5FF; /* Soft lavender slate */
  --card-bg: rgba(255, 255, 255, 0.95); /* Solid white glass for maximum card readability */
  --border-color: rgba(109, 40, 217, 0.16); /* More defined pastel purple border */
  
  --lavender-light: #3B0764; /* Deeper purple for high contrast headers */
  --lavender: #6D28D9; /* Vibrant purple */
  --accent: #7C3AED; /* Accent violet */
  
  --text-primary: #0F092A; /* Deep indigo-black for clear text */
  --text-secondary: #1E1B4B; /* Dark indigo for highly readable description texts */
  --text-muted: #475569; /* Slate 600 for clear subtexts */
  
  --danger: #DC2626; /* Solid red */
  --success: #059669; /* Solid green */
}

.light-mode body {
  background: radial-gradient(circle at 50% 0%, #FAF5FF 0%, #E2DDFF 100%);
}

.light-mode .sidebar-wrapper {
  background: #FDFBFF;
  border-right-color: rgba(109, 40, 217, 0.15);
}

.light-mode .sidebar-nav-item.active {
  background: rgba(109, 40, 217, 0.08);
  color: #6D28D9;
  border-color: rgba(109, 40, 217, 0.2);
}

.light-mode .mobile-nav-bar {
  background: #FDFBFF;
  border-top-color: rgba(109, 40, 217, 0.15);
}

.light-mode .glass-panel {
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.light-mode .glass-panel:hover {
  border-color: rgba(109, 40, 217, 0.35);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.1);
}

.light-mode .gauge-bg {
  stroke: rgba(109, 40, 217, 0.08);
}

.light-mode .shimmer {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.4) 25%, rgba(109, 40, 217, 0.06) 50%, rgba(255, 255, 255, 0.4) 75%);
  background-size: 200% 100%;
}

.light-mode .grid-overlay {
  background-image: radial-gradient(rgba(109, 40, 217, 0.06) 1px, transparent 0);
}

.light-mode input {
  background-color: #FFFFFF;
  color: #0F092A !important;
  border-color: rgba(109, 40, 217, 0.2);
}

.light-mode .chat-bubble.ai {
  background: #FFFFFF;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.03);
}

.light-mode .chat-bubble.user {
  background: rgba(109, 40, 217, 0.08);
  color: #1E1B4B;
}

/* ==========================================
     LIGHT MODE CONTRAST OVERRIDES
     ========================================== */
.light-mode .text-lavender {
  color: #6D28D9 !important;
}

.light-mode .text-[#C4B5FD] {
  color: #6D28D9 !important;
}

.light-mode .text-rose-400 {
  color: #E11D48 !important;
}

.light-mode .text-rose-500 {
  color: #BE123C !important;
}

.light-mode .text-emerald-400 {
  color: #047857 !important;
}

.light-mode .text-emerald {
  color: #047857 !important;
}

.light-mode .text-amber-400 {
  color: #B45309 !important;
}

/* Override all common text-slate colors dynamically to ensure excellent text contrast */
.light-mode .text-slate-100,
.light-mode .text-slate-200 {
  color: #0F092A !important;
}

.light-mode .text-slate-300,
.light-mode .text-slate-400 {
  color: #1E1B4B !important;
}

.light-mode .text-slate-500 {
  color: #475569 !important;
}

.light-mode .text-slate-600 {
  color: #334155 !important;
}

/* Adjust dark background blocks to light glass elements */
.light-mode .bg-slate-900\/60 {
  background-color: rgba(109, 40, 217, 0.05) !important;
}

/* Dynamic background opacity overrides */
.light-mode .bg-emerald-500\/10 {
  background-color: rgba(5, 150, 105, 0.1) !important;
}

.light-mode .border-emerald-500\/20 {
  border-color: rgba(5, 150, 105, 0.25) !important;
}

.light-mode .bg-amber-500\/10 {
  background-color: rgba(217, 119, 6, 0.1) !important;
}

.light-mode .border-amber-500\/20 {
  border-color: rgba(217, 119, 6, 0.25) !important;
}

/* Transform dark dividers and borders into defined light lavender lines */
.light-mode .border-white\/5,
.light-mode .border-white\/10 {
  border-color: rgba(109, 40, 217, 0.12) !important;
}

.light-mode .bg-white\/5 {
  background-color: rgba(109, 40, 217, 0.05) !important;
}

