/* Design Tokens - Rudraksh AI Premium Design System */

:root {
  /* Colors - Modern SaaS Palette (Desaturated for Serious Tone) */
  --primary-color: #e5383b; /* Red Accent */
  --secondary-color: #0288d1; /* Blue Accent */
  --accent-color: #e5383b;
  
  /* Light Mode Colors */
  --bg-color: #ffffff;
  --surface-color: #f8f9fa;
  --card-bg: #ffffff;
  --text-color: #2a2a2a;
  --heading-color: #2a2a2a;
  --text-secondary: #666666;
  --text-muted: #888888;
  --border-color: #eeeeee;
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.15);
  
  /* Spacing Scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  
  /* Typography Hierarchy */
  --font-main: 'Poppins', sans-serif;
  --font-mono: 'Fira Code', monospace;
  
  --h1-size: 3.5rem;
  --h2-size: 2.5rem;
  --h3-size: 1.75rem;
  --h4-size: 1.25rem;
  --body-size: 1rem;
  --small-size: 0.875rem;
  
  --lh-tight: 1.2;
  --lh-base: 1.6;
  --lh-relaxed: 1.8;
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.12);
  --shadow-neon: 0 0 20px rgba(254, 63, 64, 0.3);
  --shadow-premium: 0 30px 60px rgba(0, 0, 0, 0.25);
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Containers */
  --container-max-width: 1200px;
}

/* Dark Mode Overrides */
.dark-mode {
  --bg-color: #0b0e14;
  --surface-color: #161b22;
  --card-bg: #161b22;
  --text-color: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --border-color: #30363d;
  --glass-bg: rgba(11, 14, 20, 0.8);
  --glass-border: rgba(255, 255, 255, 0.05);
  --shadow-premium: 0 30px 60px rgba(0, 0, 0, 0.5);
}

/* Global Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-shadow: none !important; /* Force removal of all glows */
}

body {
  font-family: var(--font-main);
  line-height: var(--lh-base);
  color: var(--text-color);
  background-color: var(--bg-color);
  transition: background-color var(--transition-base), color var(--transition-base);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: var(--lh-tight);
  color: var(--text-color);
  margin-bottom: var(--space-md);
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Premium Component Foundations */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-lg);
  transition: var(--transition-base);
}

.premium-img {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-premium);
  border: 1px solid var(--glass-border);
  transition: var(--transition-slow);
}

.premium-img:hover {
  transform: scale(1.02);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.3);
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--secondary-color);
}

.section-padding {
  padding: var(--space-3xl) 0;
}

.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Utility Classes */
.text-glow-none { text-shadow: none !important; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

@media (max-width: 768px) {
  :root {
    --h1-size: 2.5rem;
    --h2-size: 2rem;
    --h3-size: 1.5rem;
  }
  
  .section-padding {
    padding: var(--space-2xl) 0;
  }
}

/* --- Diagram Utilities --- */
.technical-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-xl);
  font-family: var(--font-mono);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-top: var(--space-lg);
}

.diagram-node {
  padding: var(--space-md) var(--space-xl);
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: 600;
  color: var(--text-color) !important;
  position: relative;
  transition: var(--transition-base);
  z-index: 2;
}

.diagram-node:hover {
  transform: translateY(-2px);
  border-color: var(--primary-color);
  box-shadow: var(--shadow-md);
}

.diagram-node.active {
  border-color: var(--primary-color);
  background: rgba(229, 56, 59, 0.05); /* very light red */
}

.diagram-node.blue {
  border-color: var(--secondary-color);
  background: rgba(2, 136, 209, 0.05);
}

.diagram-row {
  display: flex;
  gap: var(--space-2xl);
  justify-content: center;
  position: relative;
}

.diagram-arrow {
  width: 2px;
  height: 40px;
  background: var(--border-color);
  position: relative;
  margin: 0 auto;
}
.diagram-arrow::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: -4px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--border-color) transparent transparent transparent;
}

.diagram-arrow.animated {
  overflow: hidden;
}
.diagram-arrow.animated::before {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary-color);
  animation: flowDown 1.5s infinite linear;
}

@keyframes flowDown {
  0% { top: -100%; }
  100% { top: 100%; }
}

.tech-data {
  font-family: var(--font-mono);
  font-size: var(--small-size);
  color: var(--text-muted);
}

/* --- Simulation UI --- */
.rakshak-console {
  background: #0b0e14;
  border: 1px solid #30363d;
  border-radius: var(--radius-lg);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
  color: #e6edf3;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  overflow: hidden;
  position: relative;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.console-header {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
  align-items: center;
}

.console-body {
  padding: 20px;
  min-height: 350px;
  position: relative;
}

/* Typing Effect */
.typing-cursor::after {
  content: '█';
  animation: blink 1s step-end infinite;
  color: var(--primary-color);
  margin-left: 5px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Log Entries */
.log-entry {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeUpIn 0.3s forwards;
  margin-bottom: 6px;
}
.log-entry.fast {
  animation: fadeUpIn 0.1s forwards;
}

@keyframes fadeUpIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.log-label { font-weight: bold; margin-right: 8px; }
.log-info { color: #2ea043; }
.log-plan { color: #e3b341; }
.log-delegate { color: #a5d6ff; }
.log-agent { color: #d2a8ff; }
.log-tool { color: #ff7b72; }
.log-warn { color: #ff9800; }

/* Status Indicators */
.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  background: rgba(255,255,255,0.1);
  margin-left: auto;
}
.status-active { background: rgba(229, 56, 59, 0.2); color: #ff7b72; border: 1px solid rgba(229, 56, 59, 0.4); }
.status-complete { background: rgba(46, 160, 67, 0.2); color: #7ee787; border: 1px solid rgba(46, 160, 67, 0.4); }

/* Final Report State */
.rakshak-console.report-state {
  background: var(--surface-color);
  border-color: var(--primary-color);
  color: var(--text-color);
  box-shadow: 0 0 30px rgba(229, 56, 59, 0.15);
}
.report-state .console-header {
  background: var(--primary-color);
  border-bottom: none;
  color: white;
}
.report-card {
  text-align: center;
  animation: fadeUpIn 0.5s forwards;
}
.report-score {
  font-size: 4rem;
  font-weight: 800;
  color: var(--primary-color);
  line-height: 1;
  margin: 20px 0;
}

/* Diagram Animations */
@keyframes pulseGlow {
  0% { box-shadow: 0 0 5px rgba(229, 56, 59, 0.1); border-color: rgba(229, 56, 59, 0.3); }
  50% { box-shadow: 0 0 20px rgba(229, 56, 59, 0.6); border-color: rgba(229, 56, 59, 0.8); }
  100% { box-shadow: 0 0 5px rgba(229, 56, 59, 0.1); border-color: rgba(229, 56, 59, 0.3); }
}

@keyframes slideArrow {
  0% { transform: translateX(0); opacity: 0.3; }
  50% { transform: translateX(5px); opacity: 1; }
  100% { transform: translateX(0); opacity: 0.3; }
}

.diagram-node.active {
  animation: pulseGlow 2.5s infinite ease-in-out;
}

.diagram-node.active.delay-1 {
  animation-delay: 0.5s;
}

.diagram-node.active.delay-2 {
  animation-delay: 1s;
}

.animated-arrow {
  animation: slideArrow 2s infinite ease-in-out;
  color: var(--primary-color) !important;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS FIXES
   ========================================================================== */
@media (max-width: 768px) {
  /* 1. Typography Scaling */
  h1 { font-size: 2.5rem !important; }
  h2 { font-size: 2rem !important; }
  h3 { font-size: 1.5rem !important; }
  
  /* 2. Padding Reductions for Custom Components */
  .glass-card, 
  .contact-form-wrapper, 
  .testimonial-card,
  .agent-box {
    padding: 20px !important;
  }
  
  /* 3. Section Padding Reductions */
  .section-padding, 
  .capability-section, 
  .contact-us.section, 
  .about-us.section, 
  .our-services.section,
  .our-portfolio.section {
    padding: 60px 0 !important;
  }
  
  /* 4. Fix Diagram Flex Layouts on Mobile */
  .technical-diagram {
    padding: 15px !important;
    display: flex;
    flex-direction: column !important;
    align-items: center;
    gap: 15px;
  }
  
  .diagram-row {
    flex-direction: column !important;
    gap: 15px;
    width: 100%;
  }

  .diagram-node {
    width: 100%;
    min-width: unset !important;
    margin-bottom: 0 !important;
  }
  
  /* Swap horizontal arrows to vertical arrows conceptually on mobile */
  .diagram-arrow {
    width: 2px !important;
    height: 30px !important;
    margin: 10px auto !important;
  }

  /* 5. Fix Execution Pipeline (Vertical) Scaling */
  .execution-pipeline {
    max-width: 100%;
  }
  
  .pipeline-step {
    padding: 15px !important;
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
  
  .pipeline-step .step-content {
    text-align: center;
  }

  /* 6. Form Inputs Constraints */
  form input, 
  form textarea, 
  form select, 
  .minimal-input {
    padding: 12px !important;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
  }
  
  /* 7. Console (ReAct Log) Restraints */
  .rakshak-console {
    font-size: 0.75rem !important;
    margin-top: 30px;
    width: 100%;
    box-sizing: border-box;
  }
  .console-body {
    padding: 15px !important;
    overflow-x: hidden;
  }
  .log-entry {
    word-break: break-word;
    white-space: pre-wrap !important;
  }
}

