/* ===================================
   CorpDev Wiki - Premium Light Theme
   =================================== */

/* Match main site background - dark radial gradient */
body {
  background: radial-gradient(ellipse at top, rgb(45, 45, 72), #121119 100%) !important;
  background-attachment: fixed !important;
  min-height: 100vh;
}

/* Override main container background */
.pt-24.min-h-screen {
  background: transparent !important;
}

/* Override card styling for light theme */
.wiki-content.card {
  background: #f9fafb !important;
  border: 1px solid rgba(229, 231, 235, 0.5) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
}

aside .card {
  background: rgba(30, 30, 45, 0.8) !important;
  backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(124, 58, 237, 0.2) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
}

/* Sidebar container - dark glass effect */
aside .card {
  background: rgba(30, 30, 45, 0.8) !important;
  backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(124, 58, 237, 0.2) !important;
  border-radius: 16px !important;
  padding: 1.5rem !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
}

aside .card h3 {
  color: #ffffff !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  margin-bottom: 1.25rem !important;
  letter-spacing: -0.01em;
}

/* ===================================
   Base Prose Styling
   =================================== */

.wiki-content .prose {
  color: #374151;
  line-height: 1.5;
  font-size: 1.0625rem;
  max-width: none;
  padding: 0;
}

/* Remove prose-invert styling */
.prose-invert {
  filter: none !important;
}

/* ===================================
   Typography
   =================================== */

/* Headings */
.wiki-content .prose h1,
.wiki-content .prose h2,
.wiki-content .prose h3,
.wiki-content .prose h4,
.wiki-content .prose h5,
.wiki-content .prose h6 {
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #111827;
  font-family: 'Manrope', system-ui, -apple-system, sans-serif;
}

.wiki-content .prose h1 {
  font-size: 1.875rem;
  margin-top: 0;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #7c3aed 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  line-height: 1.2;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #f3f4f6;
}

.wiki-content .prose h2 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  color: #111827;
  border-bottom: 2px solid #e5e7eb;
  position: relative;
}

.wiki-content .prose h2::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, #7c3aed, #3b82f6);
}

.wiki-content .prose h3 {
  font-size: 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: #7c3aed;
  font-weight: 700;
}

.wiki-content .prose h4 {
  font-size: 1.125rem;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  color: #6b21a8;
  font-weight: 600;
}

/* Paragraphs */
.wiki-content .prose p {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  line-height: 1.6;
  color: #4b5563;
}

.wiki-content .prose > p:first-of-type {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: #374151;
  margin-bottom: 1rem;
  font-weight: 400;
}

/* Links */
.wiki-content .prose a {
  color: #7c3aed;
  text-decoration: none;
  transition: all 0.2s;
  position: relative;
  font-weight: 500;
  border-bottom: 1px solid rgba(124, 58, 237, 0.2);
}

.wiki-content .prose a:hover {
  color: #6d28d9;
  border-bottom-color: #7c3aed;
}

/* Strong & Emphasis */
.wiki-content .prose strong {
  color: #111827;
  font-weight: 600;
}

.wiki-content .prose em {
  font-style: italic;
  color: #6b7280;
}

/* ===================================
   Code Blocks
   =================================== */

.wiki-content .prose code {
  color: #7c3aed;
  background: #f3f4f6;
  padding: 0.2em 0.5em;
  border-radius: 0.375em;
  font-size: 0.9em;
  font-family: 'Monaco', 'Courier New', monospace;
  border: 1px solid #e5e7eb;
  font-weight: 500;
}

.wiki-content .prose pre {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 1.5em;
  overflow-x: auto;
  margin: 2em 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.wiki-content .prose pre code {
  background: transparent;
  padding: 0;
  color: #e2e8f0;
  font-size: 0.875em;
  border: none;
  font-weight: 400;
}

/* ===================================
   Lists
   =================================== */

.wiki-content .prose ul,
.wiki-content .prose ol {
  margin-top: 0.75em;
  margin-bottom: 0.75em;
  padding-left: 0;
  list-style: none;
}

.wiki-content .prose ul li,
.wiki-content .prose ol li {
  margin-top: 0.25em;
  margin-bottom: 0.25em;
  padding-left: 2em;
  position: relative;
  color: #4b5563;
  line-height: 1.5;
}

.wiki-content .prose ul li::before {
  content: "▸";
  position: absolute;
  left: 0.5em;
  color: #7c3aed;
  font-weight: bold;
  font-size: 1.2em;
}

.wiki-content .prose ol {
  counter-reset: list-counter;
}

.wiki-content .prose ol li {
  counter-increment: list-counter;
}

.wiki-content .prose ol li::before {
  content: counter(list-counter) ".";
  position: absolute;
  left: 0.5em;
  color: #7c3aed;
  font-weight: 600;
  min-width: 1.5em;
}

/* ===================================
   Blockquotes
   =================================== */

.wiki-content .prose blockquote {
  border-left: 4px solid #7c3aed;
  padding: 1.5em 1.5em 1.5em 2em;
  margin: 2.5em 0;
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.05), transparent);
  border-radius: 0 12px 12px 0;
  font-style: italic;
  color: #4b5563;
  position: relative;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.08);
}

.wiki-content .prose blockquote::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 15px;
  font-size: 4em;
  color: rgba(124, 58, 237, 0.15);
  font-family: Georgia, serif;
  line-height: 1;
}

.wiki-content .prose blockquote p {
  color: #374151;
}

/* ===================================
   Tables
   =================================== */

.wiki-content .prose table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 2.5em 0;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  background: white;
}

.wiki-content .prose thead {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

.wiki-content .prose th {
  padding: 1em 1.25em;
  text-align: left;
  font-weight: 600;
  color: #ffffff;
  border-bottom: 2px solid #6d28d9;
  text-transform: uppercase;
  font-size: 0.8125rem;
  letter-spacing: 0.05em;
}

.wiki-content .prose td {
  padding: 1em 1.25em;
  border-bottom: 1px solid #f3f4f6;
  color: #4b5563;
  background: white;
}

.wiki-content .prose tbody tr {
  transition: background 0.2s;
}

.wiki-content .prose tbody tr:hover {
  background: #f9fafb;
}

.wiki-content .prose tbody tr:last-child td {
  border-bottom: none;
}

/* ===================================
   Images
   =================================== */

.wiki-content .prose img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 2.5em 0;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* ===================================
   Horizontal Rule
   =================================== */

.wiki-content .prose hr {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.3), transparent);
  margin: 3em 0;
}

/* ===================================
   Info Boxes & Callouts
   =================================== */

.info-box {
  padding: 1.5em;
  border-radius: 12px;
  margin: 2.5em 0;
  border-left: 4px solid;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.info-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.03;
  pointer-events: none;
}

.info-box.note {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.03));
  border-color: #3b82f6;
}

.info-box.note::before {
  background: radial-gradient(circle at top left, #3b82f6, transparent);
}

.info-box.note h4 {
  color: #1e40af !important;
}

.info-box.tip {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.03));
  border-color: #22c55e;
}

.info-box.tip::before {
  background: radial-gradient(circle at top left, #22c55e, transparent);
}

.info-box.tip h4 {
  color: #15803d !important;
}

.info-box.warning {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.08), rgba(249, 115, 22, 0.03));
  border-color: #f97316;
}

.info-box.warning::before {
  background: radial-gradient(circle at top left, #f97316, transparent);
}

.info-box.warning h4 {
  color: #c2410c !important;
}

.info-box.important {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(124, 58, 237, 0.03));
  border-color: #7c3aed;
}

.info-box.important::before {
  background: radial-gradient(circle at top left, #7c3aed, transparent);
}

.info-box.important h4 {
  color: #6d28d9 !important;
}

.info-box h4 {
  margin-top: 0 !important;
  margin-bottom: 0.75em !important;
  font-size: 1.1em !important;
  font-weight: 600;
}

.info-box p {
  color: #4b5563;
  margin: 0.5em 0;
}

/* Key Takeaways Box */
.key-takeaways {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(59, 130, 246, 0.08));
  border: 2px solid rgba(124, 58, 237, 0.2);
  border-radius: 16px;
  padding: 2em;
  margin: 3em 0;
  box-shadow: 0 8px 16px rgba(124, 58, 237, 0.1);
}

.key-takeaways h3 {
  margin-top: 0 !important;
  color: #7c3aed !important;
  font-size: 1.5em !important;
  font-weight: 700 !important;
}

.key-takeaways p,
.key-takeaways li {
  color: #374151 !important;
}

/* Stats/Numbers Highlight */
.stat-highlight {
  display: inline-block;
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: white;
  padding: 0.25em 0.75em;
  border-radius: 6px;
  font-weight: 600;
  margin: 0 0.25em;
  box-shadow: 0 2px 4px rgba(124, 58, 237, 0.2);
}

/* ===================================
   Sidebar Navigation
   =================================== */

.wiki-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.wiki-sidebar li {
  margin: 0;
}

.wiki-sidebar a {
  display: block;
  padding: 0.625em 1em;
  color: #d1d5db;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s;
  font-size: 0.9375rem;
  border: 1px solid transparent;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.wiki-sidebar a:hover {
  background: rgba(124, 58, 237, 0.15);
  color: #a78bfa;
  transform: translateX(2px);
  border-color: rgba(124, 58, 237, 0.3);
}

.wiki-sidebar a.active {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(59, 130, 246, 0.1));
  color: #7c3aed;
  font-weight: 600;
  border-color: rgba(124, 58, 237, 0.2);
  box-shadow: 0 2px 4px rgba(124, 58, 237, 0.1);
}

.wiki-sidebar .section-title {
  font-weight: 700;
  color: #ffffff;
  margin-top: 1.5em;
  margin-bottom: 0.75em;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-left: 0.75em;
  border-left: 3px solid #7c3aed;
}

.wiki-sidebar .section-title:first-child {
  margin-top: 0;
}

/* Search Box */
.wiki-search {
  margin-bottom: 1.5em;
  position: relative;
}

.wiki-search input {
  width: 100%;
  padding: 0.875em 1em 0.875em 2.75em;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 10px;
  color: #ffffff;
  font-size: 0.9375rem;
  transition: all 0.3s;
  font-weight: 400;
}

.wiki-search input:focus {
  outline: none;
  border-color: #7c3aed;
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.wiki-search input::placeholder {
  color: #9ca3af;
}


/* ===================================
   Breadcrumbs
   =================================== */

.wiki-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5em;
  flex-wrap: wrap;
  padding: 0.5em 0;
  border-bottom: 1px solid #f3f4f6;
  margin-bottom: 1rem;
}

.wiki-breadcrumbs a {
  color: #7c3aed;
  text-decoration: none;
  transition: color 0.2s;
  font-weight: 500;
  font-size: 0.875rem;
}

.wiki-breadcrumbs a:hover {
  color: #6d28d9;
}

.wiki-breadcrumbs .separator {
  color: #d1d5db;
}

.wiki-breadcrumbs span:not(.separator) {
  color: #6b7280;
  font-size: 0.875rem;
}

/* ===================================
   Table of Contents
   =================================== */

.toc {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.05), rgba(59, 130, 246, 0.05));
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: 12px;
  padding: 1.5em;
  margin: 2em 0;
}

.toc-title {
  font-weight: 600;
  color: #111827;
  margin-bottom: 1em;
  font-size: 1.1em;
}

.toc ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.toc ul ul {
  padding-left: 1.5em;
  margin-top: 0.5em;
}

.toc li {
  margin: 0.5em 0;
}

.toc a {
  color: #7c3aed;
  text-decoration: none;
  font-size: 0.9em;
  transition: color 0.2s;
  font-weight: 500;
}

.toc a:hover {
  color: #6d28d9;
  text-decoration: underline;
}

/* ===================================
   References
   =================================== */

.references {
  margin-top: 4em;
  padding-top: 2em;
  border-top: 2px solid #f3f4f6;
}

.references-title {
  font-weight: 700;
  color: #111827;
  margin-bottom: 1.5em;
  font-size: 1.5em;
}

.references ol {
  list-style-position: outside;
  padding-left: 2em;
}

.references li {
  margin: 1em 0;
  font-size: 0.9375rem;
  color: #6b7280;
  line-height: 1.6;
}

.references a {
  color: #7c3aed;
  word-break: break-all;
}

/* ===================================
   Footer & Pagination
   =================================== */

.wiki-content article > .mt-12 {
  background: #f9fafb;
  padding: 1.5rem;
  border-radius: 12px;
  margin-top: 3rem !important;
  border: 1px solid #e5e7eb;
}

.wiki-content article > .mt-12 p {
  color: #6b7280 !important;
  font-size: 0.875rem !important;
}

.wiki-content article > .mt-12 a {
  color: #7c3aed !important;
  font-weight: 600 !important;
  border: none !important;
}

.wiki-content article > .mt-12 a:hover {
  color: #6d28d9 !important;
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 1024px) {
  .wiki-sidebar {
    position: static;
    margin-bottom: 2em;
  }

  .wiki-content .prose h1 {
    font-size: 2.25rem;
  }

  .wiki-content .prose h2 {
    font-size: 1.75rem;
  }

  .wiki-content .prose h3 {
    font-size: 1.375rem;
  }

  aside .card {
    padding: 1.25rem !important;
  }
}

@media (max-width: 768px) {
  .wiki-content .prose h1 {
    font-size: 2rem;
  }

  .wiki-content .prose h2 {
    font-size: 1.5rem;
  }

  .wiki-content .prose > p:first-of-type {
    font-size: 1.0625rem;
  }

  .info-box {
    padding: 1.25em;
  }

  .key-takeaways {
    padding: 1.5em;
  }

  .wiki-content.card {
    padding: 1.5rem !important;
  }
}

/* ===================================
   Mobile Menu Toggle
   =================================== */

.wiki-sidebar-toggle {
  display: none;
  width: 100%;
  padding: 1em;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(59, 130, 246, 0.1));
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 10px;
  color: #7c3aed;
  font-weight: 600;
  margin-bottom: 1.5em;
  cursor: pointer;
  transition: all 0.2s;
}

.wiki-sidebar-toggle:hover {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(59, 130, 246, 0.15));
}

@media (max-width: 1024px) {
  .wiki-sidebar-toggle {
    display: block;
  }

  .wiki-sidebar-content {
    display: none;
  }

  .wiki-sidebar-content.open {
    display: block;
  }
}

/* ===================================
   Animations & Effects
   =================================== */

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

.wiki-content article {
  animation: fadeInUp 0.6s ease-out;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Selection color */
::selection {
  background: rgba(124, 58, 237, 0.2);
  color: #111827;
}

::-moz-selection {
  background: rgba(124, 58, 237, 0.2);
  color: #111827;
}

/* ===================================
   Enhanced Visual Elements
   =================================== */

/* Inline HTML styled cards and boxes */
.wiki-content div[style*="background: linear-gradient"] {
  border-radius: 12px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

/* Grid layouts */
.wiki-content div[style*="display: grid"] {
  gap: 1.5rem !important;
}

/* Timeline elements */
.wiki-content div[style*="border-left"] {
  border-radius: 0 8px 8px 0 !important;
}

/* ===================================
   Table of Contents (TOC)
   =================================== */

.wiki-toc {
  position: fixed;
  right: 2rem;
  top: 7rem;
  width: 240px;
  max-height: calc(100vh - 10rem);
  overflow-y: auto;
  z-index: 10;
  display: none; /* Hidden on mobile by default */
}

/* Show TOC on larger screens */
@media (min-width: 1280px) {
  .wiki-toc {
    display: block;
  }
}

.wiki-toc-sticky {
  background: rgba(30, 30, 45, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.wiki-toc-header {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a1a1aa;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.wiki-toc-nav {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.wiki-toc-nav a {
  display: block;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #d4d4d8;
  text-decoration: none;
  padding: 0.375rem 0.5rem;
  border-radius: 6px;
  transition: all 0.15s ease;
  border-left: 2px solid transparent;
  margin-left: 0.25rem;
}

.wiki-toc-nav a:hover {
  color: #ffffff;
  background: rgba(124, 58, 237, 0.1);
  border-left-color: rgba(124, 58, 237, 0.5);
}

.wiki-toc-nav a.active {
  color: #ffffff;
  background: rgba(124, 58, 237, 0.15);
  border-left-color: #7c3aed;
  font-weight: 600;
}

/* Indentation for different heading levels */
.wiki-toc-nav a[data-level="2"] {
  padding-left: 0.5rem;
}

.wiki-toc-nav a[data-level="3"] {
  padding-left: 1.25rem;
  font-size: 0.75rem;
  color: #a1a1aa;
}

.wiki-toc-nav a[data-level="4"] {
  padding-left: 2rem;
  font-size: 0.75rem;
  color: #a1a1aa;
}

/* Custom scrollbar for TOC */
.wiki-toc::-webkit-scrollbar {
  width: 4px;
}

.wiki-toc::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
}

.wiki-toc::-webkit-scrollbar-thumb {
  background: rgba(124, 58, 237, 0.3);
  border-radius: 2px;
}

.wiki-toc::-webkit-scrollbar-thumb:hover {
  background: rgba(124, 58, 237, 0.5);
}

/* Adjust main content margin when TOC is visible */
@media (min-width: 1280px) {
  .wiki-main-content {
    margin-right: 280px;
  }
}
