/* ========================================
 * Logo Display Configuration
 * ======================================== */
:root {
  --logo-max-width: 400px;  /* Adjust this value for testing different logo sizes */
  --logo-max-height: 150px;  /* Adjust this value for testing different logo sizes */
}

/* ========================================
 * Custom Prose/Typography Styles for Rich Text Content
 * Styles for displaying TinyMCE content in view mode
 * ======================================== */

/* Lists - CRITICAL: Override Tailwind's reset to show bullets and numbering */
.prose ul {
  list-style-type: disc !important;
  padding-left: 1.5rem !important;
  margin-bottom: 1rem !important;
}

.prose ol {
  list-style-type: decimal !important;
  padding-left: 1.5rem !important;
  margin-bottom: 1rem !important;
}

.prose li {
  margin-top: 0.5rem !important;
  margin-bottom: 0.5rem !important;
}

.prose ul ul,
.prose ol ul {
  list-style-type: disc !important;
  margin-top: 0.5rem !important;
  margin-bottom: 0.5rem !important;
}

.prose ul ol,
.prose ol ol {
  list-style-type: decimal !important;
  margin-top: 0.5rem !important;
  margin-bottom: 0.5rem !important;
}

/* Headings */
.prose h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  margin-top: 1.5rem;
}

.prose h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  margin-top: 1.25rem;
}

.prose h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  margin-top: 1rem;
}

.prose h4,
.prose h5,
.prose h6 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  margin-top: 0.75rem;
}

/* Paragraphs */
.prose p {
  margin-bottom: 1rem;
}

/* Links */
.prose a {
  color: #2563eb;
  text-decoration: underline;
}

.prose a:hover {
  color: #1d4ed8;
}

/* Dark mode link colors */
.dark .prose a {
  color: #60a5fa;
}

.dark .prose a:hover {
  color: #93c5fd;
}

/* Text formatting */
.prose strong {
  font-weight: 600;
}

.prose em {
  font-style: italic;
}

.prose u {
  text-decoration: underline;
}

/* Code */
.prose code {
  background-color: #f3f4f6;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-family: monospace;
}

.dark .prose code {
  background-color: #1f2937;
}

.prose pre {
  background-color: #f3f4f6;
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.dark .prose pre {
  background-color: #1f2937;
}

.prose pre code {
  background-color: transparent;
  padding: 0;
}

/* Blockquotes */
.prose blockquote {
  border-left: 4px solid #d1d5db;
  padding-left: 1rem;
  font-style: italic;
  margin-bottom: 1rem;
}

.dark .prose blockquote {
  border-left-color: #4b5563;
}

/* Tables */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.prose th {
  background-color: #f3f4f6;
  font-weight: 600;
  text-align: left;
  padding: 0.5rem 1rem;
  border: 1px solid #d1d5db;
}

.dark .prose th {
  background-color: #1f2937;
  border-color: #4b5563;
}

.prose td {
  padding: 0.5rem 1rem;
  border: 1px solid #d1d5db;
}

.dark .prose td {
  border-color: #4b5563;
}

/* Horizontal rule */
.prose hr {
  border-color: #d1d5db;
  margin: 1.5rem 0;
}

.dark .prose hr {
  border-color: #4b5563;
}

/* Prose size variants */
.prose-sm ul,
.prose-sm ol {
  padding-left: 1.25rem !important;
}

.prose-sm li {
  margin-top: 0.25rem !important;
  margin-bottom: 0.25rem !important;
}

/* ========================================
 * Collapsible Sidebar Styles
 * ======================================== */

/* Hide text content when sidebar is collapsed */
[data-sidebar-collapsed="true"] [data-sidebar-text] {
  opacity: 0;
  width: 0 !important; /* Force width to prevent any expansion */
  max-width: 0 !important;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.2s ease-in-out !important; /* Only transition opacity, not width */
  pointer-events: none; /* Prevent interaction with hidden text */
}

[data-sidebar-collapsed="false"] [data-sidebar-text] {
  opacity: 1;
  width: auto;
  transition: opacity 0.2s ease-in-out 0.1s, width 0.3s ease-in-out;
}

/* Center icons when collapsed */
[data-sidebar-collapsed="true"] nav a,
[data-sidebar-collapsed="true"] nav button,
[data-sidebar-collapsed="true"] div a,
[data-sidebar-collapsed="true"] button[id$="-toggle"] {
  justify-content: center;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Tooltip styles for collapsed sidebar */
[data-sidebar-collapsed="true"] [data-sidebar-tooltip]::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background-color: #1f2937;
  color: #ffffff;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease-in-out;
  z-index: 50;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  /* Ensure tooltip doesn't affect layout */
  margin: 0;
  border: 0;
  width: auto;
  height: auto;
}

/* Dark mode tooltip */
.dark [data-sidebar-collapsed="true"] [data-sidebar-tooltip]::after {
  background-color: #374151;
  color: #f9fafb;
}

/* Show tooltip on hover when collapsed */
[data-sidebar-collapsed="true"] [data-sidebar-tooltip]:hover::after {
  opacity: 1;
}

/* Tooltip arrow */
[data-sidebar-collapsed="true"] [data-sidebar-tooltip]::before {
  content: '';
  position: absolute;
  left: calc(100% + 6px);
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: #1f2937;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
  z-index: 51;
}

.dark [data-sidebar-collapsed="true"] [data-sidebar-tooltip]::before {
  border-right-color: #374151;
}

[data-sidebar-collapsed="true"] [data-sidebar-tooltip]:hover::before {
  opacity: 1;
}

/* Hide section headers when collapsed */
[data-sidebar-collapsed="true"] button[id$="-toggle"] span[data-sidebar-text] {
  display: none;
}

/* Ensure icons remain visible */
[data-sidebar-collapsed="true"] svg,
[data-sidebar-collapsed="true"] img {
  flex-shrink: 0;
}

/* Adjust padding for collapsed state - apply to all sidebar headers */
[data-sidebar-collapsed="true"] div[id$="-sidebar-header"] {
  padding-left: 1rem;
  padding-right: 1rem;
}

[data-sidebar-collapsed="true"] nav,
[data-sidebar-collapsed="true"] div[class*="border-t"] {
  padding-left: 1rem;
  padding-right: 1rem;
}

[data-sidebar-collapsed="true"] button[id$="-toggle"] {
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Force sidebar width when collapsed - use !important to override Tailwind */
@media (min-width: 1024px) {
  /* Apply to all sidebars with collapsible functionality */
  aside[data-sidebar-collapsed="true"] {
    width: 4rem !important; /* 64px = 4rem */
    min-width: 4rem !important;
    max-width: 4rem !important;
    overflow: hidden !important; /* Prevent any content from causing expansion */
  }
  
  aside[data-sidebar-collapsed="false"] {
    width: 16rem !important; /* 256px = 16rem */
    min-width: 16rem !important;
    max-width: 16rem !important;
  }
}

/* Prevent layout shifts when clicking links in collapsed sidebar */
[data-sidebar-collapsed="true"] nav a,
[data-sidebar-collapsed="true"] div a {
  position: relative;
  overflow: visible; /* Allow tooltips to show */
  /* Lock the link width to prevent expansion */
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  flex-shrink: 0;
}

/* Prevent any width/opacity transitions on links when collapsed */
[data-sidebar-collapsed="true"] nav a,
[data-sidebar-collapsed="true"] div a {
  transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out !important;
  /* Explicitly disable width/opacity transitions on links to prevent flicker */
}

/* Ensure links don't expand when clicked or focused */
[data-sidebar-collapsed="true"] nav a:active,
[data-sidebar-collapsed="true"] nav a:focus,
[data-sidebar-collapsed="true"] nav a:hover,
[data-sidebar-collapsed="true"] div a:active,
[data-sidebar-collapsed="true"] div a:focus,
[data-sidebar-collapsed="true"] div a:hover {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  flex: 0 0 auto !important;
}

/* Prevent gap from causing expansion */
[data-sidebar-collapsed="true"] nav a,
[data-sidebar-collapsed="true"] div a {
  gap: 0 !important;
}






body.legal-modal-open { overflow: hidden; }
