/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/*
 *= require_self
 */

/* Tailwind v4 Theme Configuration */
@layer theme {
  :root {
    --color-background: 0 0% 100%;
    --color-foreground: 240 10% 3.9%;
    --color-card: 0 0% 100%;
    --color-card-foreground: 240 10% 3.9%;
    --color-popover: 0 0% 100%;
    --color-popover-foreground: 240 10% 3.9%;
    --color-primary: 240 5.9% 10%;
    --color-primary-foreground: 0 0% 98%;
    --color-secondary: 240 4.8% 95.9%;
    --color-secondary-foreground: 240 5.9% 10%;
    --color-muted: 240 4.8% 95.9%;
    --color-muted-foreground: 240 3.8% 46.1%;
    --color-accent: 240 4.8% 95.9%;
    --color-accent-foreground: 240 5.9% 10%;
    --color-destructive: 0 84.2% 60.2%;
    --color-destructive-foreground: 0 0% 98%;
    --color-border: 240 5.9% 90%;
    --color-input: 240 5.9% 90%;
    --color-ring: 240 5% 64.9%;
    --color-radius: 0.5rem;
    --color-success: 132 95.3% 33.3%;
    --color-success-foreground: 109 55% 28%;
    --color-info: 223 78% 42%;
    --color-info-foreground: 225 100% 50%;
    --color-attention: 45 90% 45%;
    --color-attention-foreground: 60 98.4% 48.8%;
  }

  .dark {
    --color-background: 240 10% 3.9%;
    --color-foreground: 0 0% 98%;
    --color-card: 240 10% 3.9%;
    --color-card-foreground: 0 0% 98%;
    --color-popover: 240 10% 3.9%;
    --color-popover-foreground: 0 0% 98%;
    --color-primary: 0 0% 98%;
    --color-primary-foreground: 240 5.9% 10%;
    --color-secondary: 240 3.7% 15.9%;
    --color-secondary-foreground: 0 0% 98%;
    --color-muted: 240 3.7% 15.9%;
    --color-muted-foreground: 240 5% 64.9%;
    --color-accent: 240 3.7% 15.9%;
    --color-accent-foreground: 0 0% 98%;
    --color-destructive: 0 62.8% 30.6%;
    --color-destructive-foreground: 0 85.7% 97.3%;
    --color-border: 240 3.7% 15.9%;
    --color-input: 240 3.7% 15.9%;
    --color-ring: 240 4.9% 83.9%;
    --color-radius: 0.5rem;
    --color-success: 109 55% 28%;
    --color-success-foreground: 109 55% 28%;
    --color-attention: 45 90% 45%;
    --color-attention-foreground: 60 98.4% 48.8%;
  }
}

/* Custom utility classes for shadcn compatibility */
.bg-background { background-color: hsl(var(--color-background)); }
.bg-background\/40 { background-color: hsl(var(--color-background) / 0.4); }
.bg-background\/60 { background-color: hsl(var(--color-background) / 0.6); }
.bg-foreground { background-color: hsl(var(--color-foreground)); }
.bg-card { background-color: hsl(var(--color-card)); }
.bg-card-foreground { background-color: hsl(var(--color-card-foreground)); }
.bg-popover { background-color: hsl(var(--color-popover)); }
.bg-popover-foreground { background-color: hsl(var(--color-popover-foreground)); }
.bg-primary { background-color: hsl(var(--color-primary)); }
.bg-primary\/10 { background-color: hsl(var(--color-primary) / 0.1); }
.bg-primary\/90 { background-color: hsl(var(--color-primary) / 0.9); }
.bg-primary-foreground { background-color: hsl(var(--color-primary-foreground)); }
.bg-secondary { background-color: hsl(var(--color-secondary)); }
.bg-secondary-foreground { background-color: hsl(var(--color-secondary-foreground)); }
.bg-muted { background-color: hsl(var(--color-muted)); }
.bg-muted\/80 { background-color: hsl(var(--color-muted) / 0.8); }
.bg-muted-foreground { background-color: hsl(var(--color-muted-foreground)); }
.bg-accent { background-color: hsl(var(--color-accent)); }
.bg-accent\/50 { background-color: hsl(var(--color-accent) / 0.5); }
.bg-accent\/80 { background-color: hsl(var(--color-accent) / 0.8); }
.bg-accent-foreground { background-color: hsl(var(--color-accent-foreground)); }
.bg-destructive { background-color: hsl(var(--color-destructive)); }
.bg-destructive\/10 { background-color: hsl(var(--color-destructive) / 0.1); }
.bg-destructive\/90 { background-color: hsl(var(--color-destructive) / 0.9); }
.bg-destructive-foreground { background-color: hsl(var(--color-destructive-foreground)); }
.bg-border { background-color: hsl(var(--color-border)); }
.bg-input { background-color: hsl(var(--color-input)); }
.bg-ring { background-color: hsl(var(--color-ring)); }

.text-foreground { color: hsl(var(--color-foreground)); }
.text-foreground\/70 { color: hsl(var(--color-foreground) / 0.7); }
.text-card-foreground { color: hsl(var(--color-card-foreground)); }
.text-popover-foreground { color: hsl(var(--color-popover-foreground)); }
.text-primary { color: hsl(var(--color-primary)); }
.text-primary-foreground { color: hsl(var(--color-primary-foreground)); }
.text-secondary { color: hsl(var(--color-secondary)); }
.text-secondary-foreground { color: hsl(var(--color-secondary-foreground)); }
.text-muted { color: hsl(var(--color-muted)); }
.text-muted-foreground { color: hsl(var(--color-muted-foreground)); }
.text-accent { color: hsl(var(--color-accent)); }
.text-accent-foreground { color: hsl(var(--color-accent-foreground)); }
.text-destructive { color: hsl(var(--color-destructive)); }
.text-destructive-foreground { color: hsl(var(--color-destructive-foreground)); }
.text-border { color: hsl(var(--color-border)); }
.text-input { color: hsl(var(--color-input)); }
.text-ring { color: hsl(var(--color-ring)); }

.border-border { border-color: hsl(var(--color-border)); }
.border-border\/30 { border-color: hsl(var(--color-border) / 0.3); }
.border-border\/40 { border-color: hsl(var(--color-border) / 0.4); }
.border-input { border-color: hsl(var(--color-input)); }
.border-primary { border-color: hsl(var(--color-primary)); }
.border-primary\/30 { border-color: hsl(var(--color-primary) / 0.3); }
.border-muted { border-color: hsl(var(--color-muted)); }
.border-accent { border-color: hsl(var(--color-accent)); }
.border-destructive { border-color: hsl(var(--color-destructive)); }

.ring-ring { --tw-ring-color: hsl(var(--color-ring)); }
.ring-primary { --tw-ring-color: hsl(var(--color-primary)); }
.ring-primary\/20 { --tw-ring-color: hsl(var(--color-primary) / 0.2); }
.ring-offset-background { --tw-ring-offset-color: hsl(var(--color-background)); }
.ring-offset-white { --tw-ring-offset-color: hsl(var(--color-background)); }

.hover\:bg-primary\/80:hover { background-color: hsl(var(--color-primary) / 0.8); }
.hover\:bg-primary\/90:hover { background-color: hsl(var(--color-primary) / 0.9); }
.hover\:bg-secondary\/80:hover { background-color: hsl(var(--color-secondary) / 0.8); }
.hover\:bg-accent:hover { background-color: hsl(var(--color-accent)); }
.hover\:bg-accent\/50:hover { background-color: hsl(var(--color-accent) / 0.5); }
.hover\:bg-accent\/80:hover { background-color: hsl(var(--color-accent) / 0.8); }
.hover\:bg-muted\/80:hover { background-color: hsl(var(--color-muted) / 0.8); }
.hover\:bg-destructive\/90:hover { background-color: hsl(var(--color-destructive) / 0.9); }

.hover\:text-foreground:hover { color: hsl(var(--color-foreground)); }
.hover\:text-accent-foreground:hover { color: hsl(var(--color-accent-foreground)); }
.hover\:text-primary:hover { color: hsl(var(--color-primary)); }

.hover\:border-border:hover { border-color: hsl(var(--color-border)); }

.focus-visible\:ring-ring:focus-visible { --tw-ring-color: hsl(var(--color-ring)); }
.focus-visible\:ring-primary:focus-visible { --tw-ring-color: hsl(var(--color-primary)); }
.focus-visible\:border-muted:focus-visible { border-color: hsl(var(--color-muted)); }

.placeholder\:text-muted-foreground::placeholder { color: hsl(var(--color-muted-foreground)); }

/* Test CSS classes for comparing with Tailwind arbitrary values */
.css-test-width {
  width: 200px;
}

.css-test-height {
  height: 150px;
}

.css-test-padding {
  padding: 25px;
}

.css-test-margin {
  margin: 18px;
}

.css-test-radius {
  border-radius: 12px;
}

.css-test-color {
  background-color: #8B5CF6;
}

/* Additional CSS classes for complete styling */
.css-test-width-32 {
  width: 8rem; /* 128px */
}

.css-test-height-20 {
  height: 5rem; /* 80px */
}

.css-test-padding-16 {
  padding: 1rem; /* 16px */
}

.css-test-bg-blue {
  background-color: #3B82F6; /* blue-500 */
}

.css-test-bg-green {
  background-color: #10B981; /* green-500 */
}

.css-test-bg-purple {
  background-color: #8B5CF6; /* purple-500 */
}

.css-test-bg-orange {
  background-color: #F59E0B; /* orange-500 */
}

.css-test-bg-red {
  background-color: #EF4444; /* red-500 */
}

.css-test-rounded {
  border-radius: 0.5rem; /* 8px - rounded-lg */
}

.css-test-flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.css-test-text-white {
  color: white;
}

.css-test-font-medium {
  font-weight: 500;
}

/* Editor.js Custom Styling */
.codex-editor {
  font-family: inherit;
}

.codex-editor .ce-block__content {
  max-width: none;
}

.codex-editor .ce-toolbar__content {
  max-width: none;
}

.codex-editor .ce-paragraph {
  line-height: 1.6;
  margin-bottom: 1rem;
}

.codex-editor .ce-header {
  font-weight: 600;
  margin-bottom: 1rem;
  margin-top: 1.5rem;
}

.codex-editor .ce-header:first-child {
  margin-top: 0;
}

/* Header level styles - Editor.js generates h1, h2, etc. with ce-header class */
.codex-editor h1.ce-header {
  font-size: 2rem;
  line-height: 2.5rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 1.5rem;
}

.codex-editor h2.ce-header {
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.codex-editor h3.ce-header {
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
}

.codex-editor h4.ce-header {
  font-size: 1.125rem;
  line-height: 1.5rem;
  font-weight: 600;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.codex-editor h5.ce-header {
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 600;
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
}

.codex-editor h6.ce-header {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.codex-editor .ce-quote {
  border-left: 4px solid hsl(var(--color-primary));
  padding-left: 1rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: hsl(var(--color-muted-foreground));
}

.codex-editor .ce-warning {
  background: hsl(var(--color-attention) / 0.1);
  border: 1px solid hsl(var(--color-attention) / 0.3);
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 1rem 0;
}

.codex-editor .ce-code {
  background: hsl(var(--color-muted));
  border-radius: 0.375rem;
  padding: 1rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  margin: 1rem 0;
}

.codex-editor .ce-list {
  margin: 1rem 0;
}

.codex-editor .ce-list__item {
  margin-bottom: 0.5rem;
}

.codex-editor .ce-delimiter {
  text-align: center;
  margin: 2rem 0;
}

.codex-editor .ce-delimiter::before {
  content: '***';
  font-size: 2rem;
  color: hsl(var(--color-muted-foreground));
}

.codex-editor .ce-table {
  margin: 1.5rem 0;
  border-collapse: collapse;
  width: 100%;
}

.codex-editor .ce-table th,
.codex-editor .ce-table td {
  border: 1px solid hsl(var(--color-border));
  padding: 0.75rem;
  text-align: left;
}

.codex-editor .ce-table th {
  background: hsl(var(--color-muted));
  font-weight: 600;
}

.codex-editor .ce-link {
  color: hsl(var(--color-primary));
  text-decoration: underline;
}

.codex-editor .ce-link:hover {
  color: hsl(var(--color-primary) / 0.8);
}

.codex-editor .ce-image {
  margin: 1.5rem 0;
  text-align: center;
}

.codex-editor .ce-image img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

.codex-editor .ce-raw {
  background: hsl(var(--color-muted));
  border-radius: 0.375rem;
  padding: 1rem;
  margin: 1rem 0;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  white-space: pre-wrap;
}

/* Scrollbar utilities */
.scrollbar-hide {
  -ms-overflow-style: none;  /* Internet Explorer 10+ */
  scrollbar-width: none;  /* Firefox */
}
.scrollbar-hide::-webkit-scrollbar {
  display: none;  /* Safari and Chrome */
}
