/* Component Catalog Layout - Development Only
 * Styles are loaded via stylesheet_link_tag :app in the layout
 * Propshaft's :app symbol automatically loads all CSS files from app/assets/stylesheets
 */

/* Catalog Layout */
.component-catalog {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  background: var(--color-background);
}

.component-catalog__sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: var(--spacing-xl) var(--spacing-lg);
}

.component-catalog__title {
  font-size: 1.75rem;
  font-weight: var(--font-bold);
  margin: 0 0 var(--spacing-xs) 0;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.component-catalog__subtitle {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  margin: 0 0 var(--spacing-xl) 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: var(--font-medium);
}

.component-catalog__search-container {
  position: relative;
  margin-bottom: var(--spacing-xl);
}

.component-catalog__search-icon {
  position: absolute;
  left: var(--spacing-md);
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
  pointer-events: none;
}

.component-catalog__search {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md) var(--spacing-sm) var(--spacing-3xl);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-background);
  color: var(--color-text);
  font-size: var(--text-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.component-catalog__search:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-surface);
}

.component-catalog__search::placeholder {
  color: var(--color-text-muted);
}

.component-catalog__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.component-catalog__nav-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--color-text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  transition: background-color 0.15s, color 0.15s;
}

.component-catalog__nav-link:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.component-catalog__nav-link:active,
.component-catalog__nav-link:focus {
  background: var(--color-primary-surface);
  color: var(--color-primary);
}

.component-catalog__nav-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.component-catalog__nav-link.dimmed {
  opacity: 0.3;
  pointer-events: none;
}

.component-catalog__theme-toggle {
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--color-border);
}

.component-catalog__content {
  padding: var(--spacing-2xl);
  max-width: 1200px;
  overflow-y: auto;
}

/* Catalog Section */
.catalog-section {
  margin-bottom: var(--spacing-3xl);
  padding-bottom: var(--spacing-2xl);
  border-bottom: 1px solid var(--color-border);
  scroll-margin-top: var(--spacing-xl);
}

.catalog-section:last-child {
  border-bottom: none;
}

.catalog-section__title {
  font-size: 2rem;
  font-weight: var(--font-bold);
  margin: 0 0 var(--spacing-sm) 0;
  color: var(--color-text);
}

.catalog-section__description {
  font-size: var(--text-base);
  color: var(--color-text-subtle);
  margin: 0 0 var(--spacing-xl) 0;
  line-height: var(--leading-relaxed);
}

/* Catalog Example Container */
.catalog-example {
  margin-bottom: var(--spacing-xl);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-surface);
}

.catalog-example__title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--color-text);
  margin: 0;
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--color-surface-raised);
  border-bottom: 1px solid var(--color-border);
}

.catalog-example__demo {
  padding: var(--spacing-xl);
  background: var(--color-background);
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-md);
  align-items: center;
  min-height: 100px;
}

.catalog-example__code {
  position: relative;
  padding: var(--spacing-md);
  background: var(--color-surface-elevated);
  border-top: 1px solid var(--color-border);
}

.catalog-example__code pre {
  margin: 0;
  padding-right: var(--spacing-3xl);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text);
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.catalog-example__code code {
  color: var(--color-text-muted);
}

/* Copy Button */
.catalog-example__copy-button {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-subtle);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: opacity 0.2s, background-color 0.2s, color 0.2s, border-color 0.2s;
  opacity: 0;
  z-index: 10;
}

.catalog-example__copy-button:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
  border-color: var(--color-primary);
}

.catalog-example__copy-button:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  opacity: 1;
}

.catalog-example__copy-button.copied {
  background: var(--color-success-surface);
  color: var(--color-success);
  border-color: var(--color-success);
}

.catalog-example__code:hover .catalog-example__copy-button,
.catalog-example__code:focus-within .catalog-example__copy-button {
  opacity: 1;
}

/* Demo-specific utilities */
.modal-demo {
  position: relative;
  display: block;
  max-width: 500px;
  width: 100%;
}

.catalog-grid-item {
  padding: var(--spacing-lg);
  text-align: center;
  font-weight: var(--font-medium);
}

/* Constrained width modifiers for catalog demos */
.form__group--constrained,
.card--constrained {
  max-width: 400px;
}

/* Navigation Section Headers */
.component-catalog__nav-section {
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-subtle);
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-md);
  padding: var(--spacing-xs) var(--spacing-md);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  border-bottom: 1px solid var(--color-border-subtle);
  padding-bottom: var(--spacing-sm);
}

.component-catalog__nav-section:first-child {
  margin-top: 0;
}

.component-catalog__section-icon {
  width: 16px;
  height: 16px;
  opacity: 0.6;
  color: var(--color-text-subtle);
}

.component-catalog__nav-indicator {
  font-size: 16px;
  opacity: 1;
  flex-shrink: 0;
  min-width: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Component Sections (replacing catalog-section) */
.component-section {
  margin-bottom: var(--spacing-2xl);
  padding-bottom: var(--spacing-2xl);
  border-bottom: 1px solid var(--color-border);
  scroll-margin-top: var(--spacing-xl);
}

.component-section:last-child {
  border-bottom: none;
}

.component-section.hidden,
.catalog-section.hidden {
  display: none;
}

.component-section__title {
  font-size: 2rem;
  font-weight: var(--font-bold);
  margin: 0 0 var(--spacing-sm) 0;
  color: var(--color-text);
}

.component-section__description {
  font-size: var(--text-base);
  color: var(--color-text-subtle);
  margin: 0 0 var(--spacing-xl) 0;
  line-height: var(--leading-relaxed);
}

/* Component Groups */
.component-group {
  margin-bottom: var(--spacing-2xl);
}

.component-group:last-child {
  margin-bottom: 0;
}

.component-group__title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--color-text);
  margin: 0 0 var(--spacing-xs) 0;
}

.component-group__description {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0 0 var(--spacing-lg) 0;
}

/* Component Examples */
.component-example {
  margin-top: var(--spacing-xl);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-surface);
}

.component-example__title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--color-text);
  margin: 0;
  padding: var(--spacing-md) var(--spacing-lg);
  background: var(--color-surface-raised);
  border-bottom: 1px solid var(--color-border);
}

.component-example__preview {
  padding: var(--spacing-xl);
  background: var(--color-background);
}

.component-example__code {
  position: relative;
  padding: var(--spacing-md);
  background: var(--color-surface-elevated);
  border-top: 1px solid var(--color-border);
}

.component-example__code pre {
  margin: 0;
  padding-right: var(--spacing-2xl);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-text);
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.component-example__code code {
  color: var(--color-text-muted);
}

.component-example__copy {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-subtle);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.component-example__copy:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
  border-color: var(--color-primary);
}

/* Color Grid */
.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--spacing-lg);
}

.color-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.color-card__swatch {
  height: 100px;
  width: 100%;
  flex-shrink: 0;
  /* Remove any default background that might interfere */
  background: none;
  /* Add a subtle inner border to help distinguish similar colors */
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

/* Background & Surface Color Swatches */
.color-card__swatch--background { background: var(--color-background); }
.color-card__swatch--surface { background: var(--color-surface); }
.color-card__swatch--surface-raised { background: var(--color-surface-raised); }
.color-card__swatch--surface-elevated { background: var(--color-surface-elevated); }
.color-card__swatch--surface-subtle { background: var(--color-surface-subtle); }
.color-card__swatch--surface-hover { background: var(--color-surface-hover); }

/* Border Color Swatches */
.color-card__swatch--border { background: var(--color-border); }
.color-card__swatch--border-light { background: var(--color-border-light); }
.color-card__swatch--border-hover { background: var(--color-border-hover); }
.color-card__swatch--border-subtle { background: var(--color-border-subtle); }

/* Text Color Swatches */
.color-card__swatch--text { background: var(--color-text); }
.color-card__swatch--text-emphasis { background: var(--color-text-emphasis); }
.color-card__swatch--text-muted { background: var(--color-text-muted); }
.color-card__swatch--text-subtle { background: var(--color-text-subtle); }

/* Status Color Swatches */
.color-card__swatch--primary { background: var(--color-primary); }
.color-card__swatch--primary-surface { background: var(--color-primary-surface); }
.color-card__swatch--success { background: var(--color-success); }
.color-card__swatch--success-surface { background: var(--color-success-surface); }
.color-card__swatch--error { background: var(--color-error); }
.color-card__swatch--error-surface { background: var(--color-error-surface); }
.color-card__swatch--warning { background: var(--color-warning); }
.color-card__swatch--warning-surface { background: var(--color-warning-surface); }

/* Gradient Swatches */
.color-card__swatch--gradient-persona { background: var(--gradient-persona); }
.color-card__swatch--gradient-memory { background: var(--gradient-memory); }
.color-card__swatch--gradient-context { background: var(--gradient-context); }
.color-card__swatch--gradient-stats { background: var(--gradient-stats); }
.color-card__swatch--gradient-status { background: var(--gradient-status); }

.color-card__info {
  padding: var(--spacing-md);
  background: var(--color-surface);
  flex: 1;
}

/* Typography Modifiers */
.typography-example__sample--xs { font-size: var(--text-xs); }
.typography-example__sample--sm { font-size: var(--text-sm); }
.typography-example__sample--base { font-size: var(--text-base); }
.typography-example__sample--lg { font-size: var(--text-lg); }
.typography-example__sample--xl { font-size: var(--text-xl); }
.typography-example__sample--2xl { font-size: var(--text-2xl); }

.typography-example__sample--normal { font-weight: var(--font-normal); }
.typography-example__sample--medium { font-weight: var(--font-medium); }
.typography-example__sample--semibold { font-weight: var(--font-semibold); }
.typography-example__sample--bold { font-weight: var(--font-bold); }

.typography-example__sample--leading-normal { line-height: var(--leading-normal); max-width: 500px; }
.typography-example__sample--leading-relaxed { line-height: var(--leading-relaxed); max-width: 500px; }
.typography-example__sample--leading-loose { line-height: var(--leading-loose); max-width: 500px; }

.typography-example__sample--font-sans { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; }
.typography-example__sample--font-mono { font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, Consolas, monospace; }

/* Spacing Visual Boxes */
.spacing-example__box--xs { width: var(--spacing-xs); height: 32px; background: var(--color-primary); }
.spacing-example__box--sm { width: var(--spacing-sm); height: 32px; background: var(--color-primary); }
.spacing-example__box--md { width: var(--spacing-md); height: 32px; background: var(--color-primary); }
.spacing-example__box--lg { width: var(--spacing-lg); height: 32px; background: var(--color-primary); }
.spacing-example__box--xl { width: var(--spacing-xl); height: 32px; background: var(--color-primary); }
.spacing-example__box--2xl { width: var(--spacing-2xl); height: 32px; background: var(--color-primary); }

/* Spacing Gap Demonstrations */
.spacing-gap-demo { display: flex; }
.spacing-gap-demo--sm { gap: var(--spacing-sm); }
.spacing-gap-demo--md { gap: var(--spacing-md); }
.spacing-gap-demo--lg { gap: var(--spacing-lg); }
.spacing-gap-demo--xl { gap: var(--spacing-xl); }

.spacing-gap-demo__box { width: 40px; height: 40px; background: var(--color-primary); }

/* Border Radius Visual Boxes */
.border-radius-box { width: 120px; height: 120px; background: var(--color-primary); }
.border-radius-box--sm { border-radius: var(--radius-sm); }
.border-radius-box--md { border-radius: var(--radius-md); }
.border-radius-box--lg { border-radius: var(--radius-lg); }
.border-radius-box--full { border-radius: var(--radius-full); }

/* Border Radius Comparison Container */
.border-radius-comparison { display: flex; gap: var(--spacing-lg); flex-wrap: wrap; align-items: flex-start; }

.color-card__name {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text);
  margin-bottom: var(--spacing-xs);
}

.color-card__var {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-primary);
  margin-bottom: var(--spacing-xs);
}

.color-card__value {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
}

/* Typography Scale */
.typography-scale {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.typography-example {
  padding: var(--spacing-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.typography-example__sample {
  color: var(--color-text);
  margin-bottom: var(--spacing-sm);
}

.typography-example__info {
  display: flex;
  gap: var(--spacing-md);
  align-items: baseline;
}

.typography-example__var {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-primary);
}

.typography-example__value {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
}

/* Spacing Scale */
.spacing-scale {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.spacing-example {
  display: flex;
  align-items: center;
  gap: var(--spacing-lg);
  padding: var(--spacing-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.spacing-example__visual {
  flex-shrink: 0;
}

.spacing-example__box {
  border-radius: var(--radius-sm);
}

.spacing-example__info {
  display: flex;
  gap: var(--spacing-md);
  align-items: baseline;
}

.spacing-example__var {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-primary);
}

.spacing-example__value {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
}

/* Spacing Usage Examples */
.spacing-usage {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--spacing-lg);
}

.spacing-usage__item {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  align-items: flex-start;
}

.spacing-usage__item code {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Spacing Patterns */
.spacing-patterns {
  display: grid;
  gap: var(--spacing-lg);
}

.spacing-pattern {
  padding: var(--spacing-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.spacing-pattern__name {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text);
  margin-bottom: var(--spacing-xs);
}

.spacing-pattern code {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-primary);
  margin-bottom: var(--spacing-md);
}

.spacing-pattern__visual {
  margin-top: var(--spacing-sm);
}

/* Shadow Scale */
.shadow-scale {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2xl);
}

.shadow-example {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.shadow-example__box {
  display: inline-block;
}

.shadow-example__info {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.shadow-example__var {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-primary);
}

.shadow-example__value {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.shadow-example__usage {
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
}

/* Shadow Colors */
.shadow-colors {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--spacing-lg);
}

.shadow-color {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.shadow-color__sample {
  color: var(--color-text);
}

.shadow-color code {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-primary);
}

.shadow-color__value {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
}

/* Shadow Comparison */
.shadow-comparison {
  padding: var(--spacing-xl);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.shadow-comparison__item {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.shadow-comparison__label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text);
}

/* Shadow Examples */
.shadow-examples {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-xl);
}

.shadow-practical-example {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.shadow-practical-example__label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text);
}

/* Border Scale */
.border-scale {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--spacing-xl);
}

.border-example {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  align-items: center;
}

.border-example__visual {
  width: 100%;
  display: flex;
  justify-content: center;
}

.border-example__info {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.border-example__var {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-primary);
}

.border-example__value {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.border-example__usage {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
}

/* Border Styles */
.border-styles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--spacing-lg);
}

.border-style-example {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.border-style-example code {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Border Examples */
.border-examples {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-xl);
}

.border-practical-example {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.border-practical-example__label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text);
}

/* Border Combinations */
.border-combinations {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--spacing-xl);
}

.border-combination {
  display: flex;
}

/* Responsive Layout */
@media (max-width: 1024px) {
  .component-catalog {
    grid-template-columns: 1fr;
  }

  .component-catalog__sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .component-catalog__nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .component-catalog__content {
    padding: var(--spacing-xl);
  }

  .color-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .border-scale {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .component-catalog__content {
    padding: var(--spacing-lg);
  }

  .component-section {
    margin-bottom: var(--spacing-2xl);
  }

  .catalog-example__demo {
    padding: var(--spacing-lg);
  }

  .color-grid {
    grid-template-columns: 1fr;
  }

  .spacing-usage,
  .border-scale,
  .shadow-examples,
  .border-examples,
  .border-combinations {
    grid-template-columns: 1fr;
  }
}

/* No Results Message */
.catalog-no-results {
  padding: var(--spacing-3xl);
  text-align: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-xl);
}

.catalog-no-results p {
  margin: 0 0 var(--spacing-lg) 0;
  color: var(--color-text-subtle);
  font-size: var(--text-lg);
}

/* Dark Mode Enhancements */
[data-theme="dark"] .component-catalog__nav-link {
  color: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .component-catalog__nav-link:hover {
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .component-catalog__nav-section {
  color: rgba(255, 255, 255, 0.5);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .component-catalog__search {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--color-text);
}

[data-theme="dark"] .component-catalog__search:focus {
  border-color: var(--color-primary);
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .component-catalog__search::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .catalog-section__title,
[data-theme="dark"] .component-section__title {
  color: var(--color-text);
}

[data-theme="dark"] .catalog-example {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .catalog-example__title,
[data-theme="dark"] .component-example__title {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .catalog-example__code code,
[data-theme="dark"] .component-example__code code {
  color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .catalog-example__code pre,
[data-theme="dark"] .component-example__code pre {
  color: rgba(255, 255, 255, 0.95);
}

/* Ensure all informational text is visible in dark mode */
[data-theme="dark"] .color-card__var,
[data-theme="dark"] .typography-example__var,
[data-theme="dark"] .spacing-example__var,
[data-theme="dark"] .shadow-example__var,
[data-theme="dark"] .border-example__var {
  color: var(--color-primary);
}

[data-theme="dark"] .color-card__value,
[data-theme="dark"] .typography-example__value,
[data-theme="dark"] .spacing-example__value,
[data-theme="dark"] .shadow-example__value,
[data-theme="dark"] .shadow-color__value,
[data-theme="dark"] .border-example__value {
  color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .spacing-usage__item code {
  color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .spacing-pattern code,
[data-theme="dark"] .shadow-color code,
[data-theme="dark"] .border-style-example code {
  color: var(--color-primary);
}

[data-theme="dark"] .color-card__name,
[data-theme="dark"] .component-group__title,
[data-theme="dark"] .shadow-comparison__label,
[data-theme="dark"] .shadow-practical-example__label,
[data-theme="dark"] .border-practical-example__label {
  color: var(--color-text);
}

/* Shadow example box styling */
.shadow-example__box {
  background: var(--color-surface);
  padding: var(--spacing-xl);
  border-radius: var(--radius-md);
}

.shadow-example__box--sm {
  box-shadow: var(--shadow-sm);
}

.shadow-example__box--md {
  box-shadow: var(--shadow-md);
}

.shadow-example__box--lg {
  box-shadow: var(--shadow-lg);
}

.shadow-example__box-title {
  color: var(--color-text);
  font-weight: var(--font-medium);
}

.shadow-example__box-description {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-top: var(--spacing-xs);
}

/* Shadow color sample styling */
.shadow-color__sample {
  background: var(--color-surface);
  padding: var(--spacing-lg);
  border-radius: var(--radius-md);
  color: var(--color-text);
}

.shadow-color__sample--standard {
  box-shadow: 0 4px 8px var(--shadow-color);
}

.shadow-color__sample--strong {
  box-shadow: 0 4px 8px var(--shadow-color-strong);
}

/* Shadow comparison boxes */
.shadow-comparison__boxes {
  display: flex;
  gap: var(--spacing-lg);
  align-items: center;
}

.shadow-comparison__box {
  background: var(--color-surface);
  padding: var(--spacing-lg);
  border-radius: var(--radius-md);
  color: var(--color-text);
}

.shadow-comparison__box--sm {
  box-shadow: var(--shadow-sm);
}

.shadow-comparison__box--md {
  box-shadow: var(--shadow-md);
}

.shadow-comparison__box--lg {
  box-shadow: var(--shadow-lg);
}

/* Shadow practical example items */
.shadow-practical-example__item {
  background: var(--color-surface);
  padding: var(--spacing-lg);
  border-radius: var(--radius-md);
  color: var(--color-text);
}

.shadow-practical-example__item--sm {
  box-shadow: var(--shadow-sm);
}

.shadow-practical-example__item--md {
  box-shadow: var(--shadow-md);
  max-width: 300px;
}

.shadow-practical-example__item--lg {
  box-shadow: var(--shadow-lg);
  min-width: 200px;
}

.shadow-practical-example__button {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.shadow-practical-example__dropdown {
  background: var(--color-surface-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
}

.shadow-practical-example__menu-item {
  padding: var(--spacing-sm) var(--spacing-md);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}

.shadow-practical-example__menu-item:last-child {
  border-bottom: none;
}

.shadow-practical-example__title {
  color: var(--color-text);
  margin-bottom: var(--spacing-sm);
}

.shadow-practical-example__text {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* Shadow usage example containers */
.shadow-usage__container {
  display: flex;
  gap: var(--spacing-xl);
  flex-wrap: wrap;
}

.shadow-usage__card {
  background: var(--color-surface);
  padding: var(--spacing-lg);
  border-radius: var(--radius-md);
}

.shadow-usage__card--sm {
  box-shadow: var(--shadow-sm);
}

.shadow-usage__card--md {
  box-shadow: var(--shadow-md);
}

.shadow-usage__card--lg {
  box-shadow: var(--shadow-lg);
}

.shadow-usage__card-title {
  color: var(--color-text);
  font-weight: var(--font-medium);
  margin-bottom: var(--spacing-xs);
}

.shadow-usage__card-text {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* Spacing usage examples */
.spacing-usage__box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  display: inline-block;
}

.spacing-usage__box--sm {
  padding: var(--spacing-sm);
}

.spacing-usage__box--md {
  padding: var(--spacing-md);
}

.spacing-usage__box--lg {
  padding: var(--spacing-lg);
}

.spacing-usage__box--xl {
  padding: var(--spacing-xl);
}

.spacing-usage__content {
  background: var(--color-primary-surface);
  padding: 2px 4px;
  color: var(--color-text);
}

/* Spacing pattern examples */
.spacing-pattern__button {
  padding: var(--spacing-sm) var(--spacing-lg);
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
}

.spacing-pattern__card {
  padding: var(--spacing-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
}

.spacing-pattern__section {
  margin-bottom: var(--spacing-2xl);
  color: var(--color-text-muted);
}

.spacing-pattern__form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  max-width: 300px;
}

.spacing-pattern__input {
  padding: var(--spacing-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
}

/* Spacing usage example card */
.spacing-usage-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
}

.spacing-usage-card__title {
  color: var(--color-text);
  margin-bottom: var(--spacing-md);
}

.spacing-usage-card__items {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.spacing-usage-card__item {
  padding: var(--spacing-sm);
  background: var(--color-surface-raised);
  border-radius: var(--radius-sm);
}

.spacing-usage-card__item-text {
  color: var(--color-text-muted);
}

/* Border style examples */
.border-style-box {
  padding: var(--spacing-lg);
  border-radius: var(--radius-sm);
  color: var(--color-text);
}

.border-style-box--standard {
  border: 1px solid var(--color-border);
}

.border-style-box--emphasized {
  border: 2px solid var(--color-primary);
}

.border-style-box--subtle {
  border: 1px solid var(--color-border-subtle);
}

.border-style-box--top {
  border-top: 1px solid var(--color-border);
}

/* Border practical examples */
.border-practical__button {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-sm);
}

.border-practical__input {
  padding: var(--spacing-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  width: 250px;
}

.border-practical__card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  max-width: 300px;
}

.border-practical__card-title {
  color: var(--color-text);
  margin-bottom: var(--spacing-sm);
}

.border-practical__card-text {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.border-practical__badge {
  background: var(--color-success-surface);
  color: var(--color-success);
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  display: inline-block;
}

.border-practical__avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--gradient-persona);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: var(--font-semibold);
}

.border-practical__divider {
  width: 100%;
  max-width: 300px;
}

.border-practical__divider-section {
  padding: var(--spacing-md);
  color: var(--color-text);
}

.border-practical__divider-line {
  border-top: 1px solid var(--color-border);
}

/* Border combinations */
.border-combo {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
}

.border-combo--sm {
  box-shadow: var(--shadow-sm);
}

.border-combo--md {
  box-shadow: var(--shadow-md);
}

.border-combo--emphasized {
  border: 2px solid var(--color-primary);
}

.border-combo__title {
  color: var(--color-text);
  font-weight: var(--font-medium);
}

.border-combo__text {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-top: var(--spacing-xs);
}

/* Border usage examples */
.border-usage__box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: var(--spacing-md);
  color: var(--color-text);
}

.border-usage__box--sm {
  border-radius: var(--radius-sm);
}

.border-usage__box--md {
  border-radius: var(--radius-md);
}

.border-usage__box--lg {
  border-radius: var(--radius-lg);
}

.border-usage__pill {
  background: var(--color-primary);
  color: white;
  border-radius: var(--radius-full);
  padding: var(--spacing-sm) var(--spacing-lg);
}

/* Fix icon visibility in dark mode */
[data-theme="dark"] .component-catalog__section-icon {
  fill: var(--color-text-muted);
  color: var(--color-text-muted);
}

[data-theme="dark"] .component-catalog__search-icon {
  fill: var(--color-text-muted);
  color: var(--color-text-muted);
}

/* ===================================================================
   Common reusable utility classes for component catalog examples
   =================================================================== */

/* Flex containers with different gap sizes */
.preview-flex {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.preview-flex--sm {
  gap: var(--spacing-sm);
}

.preview-flex--lg {
  gap: var(--spacing-lg);
  align-items: center;
}

.preview-flex--column {
  flex-direction: column;
}

/* Preview wrapper containers */
.preview-wrapper {
  background: var(--color-surface);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  max-width: 240px;
}

.preview-wrapper--lg {
  padding: var(--spacing-lg);
  max-width: 600px;
}

.preview-wrapper--full {
  max-width: none;
}

.preview-wrapper--bordered {
  border: 1px solid var(--color-border);
}

/* Label/Description text */
.preview-label {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--spacing-sm);
}

.preview-label--xs {
  margin-bottom: var(--spacing-xs);
}

.preview-title {
  color: var(--color-text);
  margin: 0 0 var(--spacing-sm) 0;
  font-weight: var(--font-medium);
}

.preview-text {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

/* Badge spacing utilities */
.badge-spacing {
  margin-left: var(--spacing-xs);
}

.badge-spacing--auto {
  margin-left: auto;
}

/* Code examples */
.preview-code {
  display: block;
  background: var(--color-surface-elevated);
  padding: var(--spacing-sm);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
}

/* Interactive state examples */
.state-examples {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.state-example {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

/* Message attachment placeholder */
.message-attachment-placeholder {
  width: 200px;
  height: 120px;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}

/* Conversation container */
.conversation-container {
  background: var(--color-background);
  padding: var(--spacing-lg);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

/* Colors usage example */
.colors-usage-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
}

.colors-usage-card__title {
  color: var(--color-text);
  margin-bottom: var(--spacing-sm);
}

.colors-usage-card__text {
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-md);
}

.colors-usage-card__button {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-sm);
}

/* Typography usage example */
.typography-usage-container {
  max-width: 600px;
}

.typography-usage__heading {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--color-text);
  margin-bottom: var(--spacing-sm);
}

.typography-usage__subheading {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--color-text);
  margin-bottom: var(--spacing-sm);
}

.typography-usage__body {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text-muted);
  margin-bottom: var(--spacing-md);
}

.typography-usage__small {
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
}

/* Status indicator examples */
.status-combined-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  max-width: 600px;
}

.status-combined-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: var(--spacing-md);
}

.status-combined-meta {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* Tabs examples */
.tabs-context-container {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.tabs-context-nav {
  border-bottom: 1px solid var(--color-border);
}

.tabs-context-content {
  padding: var(--spacing-lg);
}

.tabs-context-item {
  color: var(--color-text);
  margin-bottom: var(--spacing-sm);
}

/* Navigation examples */
.nav-preview-wrapper {
  background: var(--color-surface);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  max-width: 240px;
}

.nav-full-example {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  max-width: 240px;
}

.nav-full-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--color-border);
}

.nav-full-logo {
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--color-text);
}

.nav-full-menu {
  padding: var(--spacing-md);
}

.nav-section-divider {
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--color-border);
}

/* Stimulus examples */
.stimulus-preview-basic {
  background: var(--color-surface);
  padding: var(--spacing-lg);
  border-radius: var(--radius-md);
}

.stimulus-preview-title {
  color: var(--color-text);
  margin-bottom: var(--spacing-sm);
  font-weight: var(--font-medium);
}

.stimulus-preview-interactive {
  background: var(--color-surface-elevated);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  position: relative;
}

.stimulus-best-practices {
  background: var(--color-surface);
  padding: var(--spacing-lg);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.stimulus-best-practices ul {
  color: var(--color-text);
  line-height: var(--leading-relaxed);
  padding-left: var(--spacing-xl);
}

.stimulus-best-practices li {
  margin-bottom: var(--spacing-sm);
}

/* Component example meta information */
.component-example__meta {
  margin-top: var(--spacing-md);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--color-border);
}

.component-example__meta h4 {
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  margin: 0 0 var(--spacing-xs) 0;
}

.component-example__meta ul {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  padding-left: var(--spacing-xl);
  margin: 0;
}

.component-example__meta li {
  margin-bottom: var(--spacing-xs);
}

.component-example__meta li:last-child {
  margin-bottom: 0;
}

.component-example__meta code {
  font-family: var(--font-mono);
  color: var(--color-primary);
}

.component-example__meta strong {
  color: var(--color-text);
  font-weight: var(--font-medium);
}
