/* ============================================
   Steadpoint Brand Identity System
   ============================================ */
:root {
  /* Primary colours */
  --primary: #0A5555;
  --primary-light: #0D6E6E;
  --primary-dark: #063E3E;
  
  /* Accent colours */
  --accent: #FF6B47;
  --accent-light: #FF8A6B;
  --accent-dark: #E84E30;
  
  /* Secondary */
  --secondary: #FFB627;
  --secondary-light: #FFC857;
  --secondary-dark: #E8A317;
  
  /* Neutrals */
  --white: #FFFFFF;
  --off-white: #EFF1F4;
  --grey-50: #E5E9EE;
  --grey-100: #D8DEE6;
  --grey-200: #C2CAD4;
  --grey-400: #8B99AD;
  --grey-600: #5A6577;
  --grey-800: #323B4D;
  --grey-900: #1E2530;
  
  /* Semantic */
  --text-primary: #1E2530;
  --text-secondary: #5A6577;
  --text-muted: #8B99AD;
  --background: #FFFFFF;
  --background-alt: #EFF1F4;
  --border: #D8DEE6;
  
  /* Typography */
  --font-heading: 'Space Grotesk', 'Helvetica Neue', Helvetica, sans-serif;
  --font-body: 'DM Sans', 'Helvetica Neue', Helvetica, sans-serif;
  
  /* Spacing - 8px base */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  
  /* Border radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(30, 37, 48, 0.06);
  --shadow-md: 0 4px 16px rgba(30, 37, 48, 0.1);
  --shadow-lg: 0 8px 32px rgba(30, 37, 48, 0.12);
  
  /* Transitions */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Layout */
  --container-max: 1280px;
  --nav-height: 80px;
}

/* Base Overrides */
html {
  font-family: var(--font-body);
  color: var(--text-primary);
  background-color: var(--background);
  scroll-behavior: smooth;
}


h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 800; /* Standardized to extrabold */
  color: var(--grey-900);
  letter-spacing: -0.025em; /* tracking-tight */
}

h1 {
  font-size: 2.25rem; /* text-4xl */
  line-height: 2.5rem;
}

/* Page Subheadings */
h1 + p {
  font-size: 1.125rem; /* text-lg */
  line-height: 1.75rem;
  color: var(--grey-600);
  margin-top: 0.5rem;
}

/* Navigation Customization */
.nav-brand {
    font-family: var(--font-heading);
    color: var(--primary);
    font-weight: 700;
}

/* Button Variants from Style Guide */
.btn-steadpoint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.875rem 1.75rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  text-decoration: none;
}

.btn-steadpoint-primary {
  background-color: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}

.btn-steadpoint-primary:hover {
  background-color: var(--accent-dark);
  border-color: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-steadpoint-secondary {
  background-color: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-steadpoint-secondary:hover {
  background-color: var(--primary);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-steadpoint-teal {
  background-color: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.btn-premium {
  background-color: #4f46e5; /* indigo-600 */
  color: #ffffff !important;
  padding: 0.75rem 1.5rem; /* px-6 py-3 equivalent */
  border-radius: 1rem; /* rounded-2xl */
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.2), 0 4px 6px -2px rgba(79, 70, 229, 0.1);
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.btn-premium:hover {
  background-color: #4338ca; /* indigo-700 */
  transform: translateY(-2px);
  box-shadow: 0 20px 25px -5px rgba(79, 70, 229, 0.2), 0 10px 10px -5px rgba(79, 70, 229, 0.1);
}

.btn-premium-icon {
  width: 1.5rem;
  height: 1.5rem;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-premium:hover .btn-premium-icon {
  transform: scale(1.1);
}

/* Card Styles */
.card-steadpoint {
  background-color: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: var(--transition);
}

.card-steadpoint:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

/* Mockup Accents */
.accent-gradient {
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

/* Tailwind Overrides */
.text-primary-brand { color: var(--primary); }
.bg-primary-brand { background-color: var(--primary); }
.text-accent-brand { color: var(--accent); }
.bg-accent-brand { background-color: var(--accent); }

/* Navigation Customization */
.nav-glass {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

/* Chat Sidebar Styles */
#chat-sidebar::-webkit-scrollbar { width: 6px; }
#chat-sidebar::-webkit-scrollbar-thumb { background-color: #cbd5e1; border-radius: 3px; }
main { transition: padding-left 0.3s ease-in-out; }

/* Markdown Prose Styles */
.prose p { margin-bottom: 0.4em; }
.prose p:last-child { margin-bottom: 0; }
.prose pre { background-color: #1e293b; color: #f8fafc; padding: 1rem; border-radius: 0.5rem; overflow-x: auto; margin: 0.5rem 0; }
.prose code { font-family: monospace; background-color: rgba(0,0,0,0.05); padding: 0.2em 0.4em; border-radius: 0.25rem; font-size: 0.9em; }
.prose pre code { background-color: transparent; padding: 0; color: inherit; }
.prose ul { list-style-type: disc; padding-left: 1.5rem; margin-bottom: 0.4em; }
.prose ol { list-style-type: decimal; padding-left: 1.5rem; margin-bottom: 0.4em; }
.prose a { color: #0ea5e9; text-decoration: underline; }

/* Typing Indicator Animation */
.typing-indicator .dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: currentColor;
    border-radius: 50%;
    animation: typing 1s infinite;
}
.typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50% { transform: translateY(-4px); opacity: 1; }
}

/* Empty State Components */
.empty-state {
    padding: 6rem 1rem;
    text-align: center;
    background-color: var(--white);
    border-radius: 1.5rem;
    border: 2px dashed var(--grey-100);
}

.empty-state-icon-container {
    width: 6rem;
    height: 6rem;
    background-color: var(--off-white);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
    border: 1px solid var(--grey-50);
}

.empty-state-icon {
    width: 3rem;
    height: 3rem;
    color: var(--grey-200);
}

.empty-state-heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--grey-900);
    margin-bottom: 0.5rem;
}

.empty-state-text {
    color: var(--grey-600);
    max-width: 24rem;
    margin: 0.5rem auto 2rem auto;
    line-height: 1.6;
}

/* ============================================
   Context Modal & Hierarchy Styles
   ============================================ */
.context-hierarchy-item {
    position: relative;
    padding-left: 2.5rem;
    transition: all 0.3s ease;
}
.context-hierarchy-line {
    position: absolute;
    left: 0.75rem;
    top: -0.5rem;
    bottom: 0.5rem;
    width: 2px;
    background: linear-gradient(to bottom, #e2e8f0, #cbd5e1);
    z-index: 0;
}
.context-hierarchy-dot {
    position: absolute;
    left: 0.375rem;
    top: 0.5rem;
    width: 1rem;
    height: 1rem;
    border-radius: 9999px;
    background-color: white;
    border: 2px solid #cbd5e1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    z-index: 1;
    transition: all 0.3s ease;
}
.context-hierarchy-item.active .context-hierarchy-dot {
    border-color: #4f46e5;
    background-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}
.context-card {
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.5rem 0.875rem;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}
.context-hierarchy-item.active .context-card {
    border-color: #e0e7ff;
    background-color: #fefeff;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.context-details-box {
    background-color: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 0.75rem;
    padding: 0.5rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.8125rem;
    line-height: 1.3;
    white-space: pre-wrap;
    color: #475569;
    margin-top: 0.375rem;
}
.context-details-box.prose p,
.context-details-box.prose ul,
.context-details-box.prose ol {
    margin-bottom: 0.15em;
}

#context-modal p {
    margin: 0;
}
#context-modal .prose p {
    margin-bottom: 0.15em;
}
