/*
 * 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
 *= require actiontext
 */

/* 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 */
}

/* Mention Pill Styling - Clean inline mentions like Basecamp */
.mention-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem 0.125rem 0.25rem;
  background-color: hsl(var(--color-muted) / 0.6);
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  vertical-align: baseline;
  white-space: nowrap;
  cursor: default;
  user-select: all;
}

.mention-pill:hover {
  background-color: hsl(var(--color-muted) / 0.8);
}

.mention-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
  background-color: #d97706; /* Default amber color */
}

.mention-avatar.mention-avatar-amber {
  background-color: #d97706;
}

.mention-avatar.mention-avatar-blue {
  background-color: #2563eb;
}

.mention-avatar.mention-avatar-green {
  background-color: #16a34a;
}

.mention-avatar.mention-avatar-purple {
  background-color: #9333ea;
}

.mention-avatar.mention-avatar-pink {
  background-color: #db2777;
}

.mention-avatar.mention-avatar-indigo {
  background-color: #4f46e5;
}

.mention-avatar.mention-avatar-teal {
  background-color: #0d9488;
}

.mention-avatar.mention-avatar-orange {
  background-color: #ea580c;
}

.mention-name {
  color: hsl(var(--color-foreground));
}

/* Hide the default Trix attachment UI for mentions */
trix-editor .attachment[data-trix-content-type="application/vnd.atlas.mention+html"] {
  display: inline;
  padding: 0;
  margin: 0;
}

trix-editor .attachment[data-trix-content-type="application/vnd.atlas.mention+html"] .attachment__caption {
  display: none !important;
}

trix-editor .attachment[data-trix-content-type="application/vnd.atlas.mention+html"] .attachment__toolbar {
  display: none !important;
}

trix-editor .attachment[data-trix-content-type="application/vnd.atlas.mention+html"] figure {
  display: inline;
  margin: 0;
  padding: 0;
}

/* Rendered mention in .trix-content (when displaying comments) */
.trix-content .attachment[data-trix-content-type="application/vnd.atlas.mention+html"],
.trix-content action-text-attachment[content-type="application/vnd.atlas.mention+html"] {
  display: inline;
  padding: 0;
  margin: 0;
}

.trix-content .attachment[data-trix-content-type="application/vnd.atlas.mention+html"] .attachment__caption,
.trix-content action-text-attachment[content-type="application/vnd.atlas.mention+html"] .attachment__caption {
  display: none !important;
}

/* Ensure mention pills display properly when rendered */
.prose .mention-pill,
.trix-content .mention-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem 0.125rem 0.25rem;
  background-color: hsl(var(--color-muted) / 0.8);
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  vertical-align: baseline;
  white-space: nowrap;
}

.prose .mention-avatar,
.trix-content .mention-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
  background-color: #d97706; /* Default amber color */
}

.prose .mention-avatar.mention-avatar-amber,
.trix-content .mention-avatar.mention-avatar-amber {
  background-color: #d97706;
}

.prose .mention-avatar.mention-avatar-blue,
.trix-content .mention-avatar.mention-avatar-blue {
  background-color: #2563eb;
}

.prose .mention-avatar.mention-avatar-green,
.trix-content .mention-avatar.mention-avatar-green {
  background-color: #16a34a;
}

.prose .mention-avatar.mention-avatar-purple,
.trix-content .mention-avatar.mention-avatar-purple {
  background-color: #9333ea;
}

.prose .mention-avatar.mention-avatar-pink,
.trix-content .mention-avatar.mention-avatar-pink {
  background-color: #db2777;
}

.prose .mention-avatar.mention-avatar-indigo,
.trix-content .mention-avatar.mention-avatar-indigo {
  background-color: #4f46e5;
}

.prose .mention-avatar.mention-avatar-teal,
.trix-content .mention-avatar.mention-avatar-teal {
  background-color: #0d9488;
}

.prose .mention-avatar.mention-avatar-orange,
.trix-content .mention-avatar.mention-avatar-orange {
  background-color: #ea580c;
}

.prose .mention-name,
.trix-content .mention-name {
  color: hsl(var(--color-foreground));
  font-weight: 600;
}

/* Mention dropdown styling */
.mention-dropdown {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* ========================================
   Trix Editor - Clean Basecamp-like Styling
   ======================================== */

/* Base toolbar styling */
trix-toolbar {
  background: transparent;
  border: none;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid hsl(var(--color-border));
}

trix-toolbar .trix-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-start;
  align-items: center;
}

/* Button groups - clean separated style */
trix-toolbar .trix-button-group {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  background: transparent;
  border: none;
  border-radius: 0;
  margin: 0;
  padding: 0;
}

trix-toolbar .trix-button-group:not(:first-child) {
  margin-left: 0;
  padding-left: 0.75rem;
  border-left: 1px solid hsl(var(--color-border));
}

/* Individual buttons */
trix-toolbar .trix-button {
  background: transparent;
  border: none;
  border-radius: 0.375rem;
  padding: 0.5rem;
  color: hsl(var(--color-muted-foreground));
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

trix-toolbar .trix-button:not(:first-child) {
  border-left: none;
}

trix-toolbar .trix-button:hover {
  background: hsl(var(--color-muted));
  color: hsl(var(--color-foreground));
}

trix-toolbar .trix-button.trix-active {
  background: hsl(var(--color-primary) / 0.15);
  color: hsl(var(--color-primary));
}

/* Icon buttons - larger touch targets */
trix-toolbar .trix-button--icon {
  width: 2.25rem;
  height: 2.25rem;
  max-width: none;
}

trix-toolbar .trix-button--icon::before {
  opacity: 0.7;
  background-size: 18px 18px;
}

trix-toolbar .trix-button--icon:hover::before {
  opacity: 1;
}

trix-toolbar .trix-button--icon.trix-active::before {
  opacity: 1;
}

/* Dark mode icon inversion */
.dark trix-toolbar .trix-button--icon::before {
  filter: invert(1);
}

/* Hide button group spacer */
trix-toolbar .trix-button-group-spacer {
  display: none;
}

/* Link dialog */
trix-toolbar .trix-dialog {
  position: relative;
  background: hsl(var(--color-card));
  border: 1px solid hsl(var(--color-border));
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
  padding: 1rem;
  margin-top: 0.5rem;
}

trix-toolbar .trix-input--dialog {
  flex: 1;
  background: hsl(var(--color-background));
  border: 1px solid hsl(var(--color-border));
  border-radius: 0.5rem;
  color: hsl(var(--color-foreground));
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
}

trix-toolbar .trix-input--dialog:focus {
  outline: none;
  border-color: hsl(var(--color-primary));
  box-shadow: 0 0 0 3px hsl(var(--color-primary) / 0.1);
}

trix-toolbar .trix-input--dialog::placeholder {
  color: hsl(var(--color-muted-foreground));
}

trix-toolbar .trix-button--dialog {
  background: hsl(var(--color-primary));
  color: hsl(var(--color-primary-foreground));
  border: none;
  border-radius: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

trix-toolbar .trix-button--dialog:hover {
  background: hsl(var(--color-primary) / 0.9);
}

trix-toolbar .trix-dialog__link-fields {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

trix-toolbar .trix-dialog__link-fields .trix-button-group {
  border: none;
  background: none;
  margin: 0;
  padding: 0;
}

/* Editor area */
trix-editor {
  background: hsl(var(--color-card));
  border: none;
  border-radius: 0;
  color: hsl(var(--color-foreground));
  padding: 1rem;
  min-height: 80px;
}

trix-editor:focus {
  outline: none;
  box-shadow: none;
}

trix-editor[placeholder]:empty::before {
  color: hsl(var(--color-muted-foreground));
}

/* Lists in editor */
trix-editor ul,
trix-editor ol {
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}

trix-editor li {
  margin: 0.25rem 0;
}

/* Blockquote */
trix-editor blockquote {
  border-left: 3px solid hsl(var(--color-primary));
  padding-left: 1rem;
  margin: 0.5rem 0;
  color: hsl(var(--color-muted-foreground));
  font-style: italic;
}

/* Code blocks */
trix-editor pre {
  background: hsl(var(--color-muted));
  border-radius: 0.375rem;
  padding: 0.75rem 1rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  overflow-x: auto;
}

/* Links in editor */
trix-editor a {
  color: hsl(var(--color-primary));
  text-decoration: underline;
}

/* Button group spacer - hide on small screens */
trix-toolbar .trix-button-group-spacer {
  display: none;
}

/* Comment editor wrapper - Clean Basecamp style */
.comment-editor-wrapper {
  background: hsl(var(--color-card));
  overflow: hidden;
  max-width: 100%;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  position: relative;
}

.comment-editor-wrapper trix-toolbar {
  background: hsl(var(--color-muted) / 0.3);
  border-bottom: 1px solid hsl(var(--color-border));
  padding: 0;
  border-radius: 0.75rem 0.75rem 0 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.comment-editor-wrapper trix-toolbar .trix-button-row {
  gap: 0.75rem;
  flex-wrap: nowrap !important;
  min-width: max-content;
  padding: 0.625rem 1rem;
  display: flex;
  box-sizing: border-box;
}

.comment-editor-wrapper trix-toolbar .trix-button-group:not(:first-child) {
  padding-left: 0.75rem;
}

/* Smaller buttons on mobile for better fit */
.comment-editor-wrapper trix-toolbar .trix-button--icon {
  width: 1.75rem;
  height: 1.75rem;
}

.comment-editor-wrapper trix-toolbar .trix-button--icon::before {
  background-size: 14px 14px;
}

@media (min-width: 768px) {
  .comment-editor-wrapper trix-toolbar .trix-button-row {
    gap: 1rem;
  }

  .comment-editor-wrapper trix-toolbar .trix-button-group:not(:first-child) {
    padding-left: 1rem;
  }

  .comment-editor-wrapper trix-toolbar .trix-button--icon {
    width: 2.25rem;
    height: 2.25rem;
  }

  .comment-editor-wrapper trix-toolbar .trix-button--icon::before {
    background-size: 18px 18px;
  }
}

.comment-editor-wrapper trix-editor {
  background: transparent;
  border: none;
  border-radius: 0 0 0.75rem 0.75rem;
  min-height: 100px;
  padding: 1rem 1.25rem;
  max-width: 100%;
  width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.comment-editor-wrapper trix-editor:focus {
  outline: none;
  box-shadow: none;
}

/* Attachments in editor */
.comment-editor-wrapper trix-editor .attachment--preview {
  margin: 0.5rem 0;
}

.comment-editor-wrapper trix-editor .attachment--preview img {
  max-height: 300px;
  border-radius: 0.5rem;
}

/* Trix content display styling (for rendered comments) */
.trix-content ul,
.trix-content ol {
  padding-left: 1.5rem;
  margin: 0.5rem 0;
}

.trix-content ul {
  list-style-type: disc;
}

.trix-content ol {
  list-style-type: decimal;
}

.trix-content li {
  margin: 0.25rem 0;
  margin-left: 0;
}

.trix-content blockquote {
  border-left: 3px solid hsl(var(--color-primary));
  padding-left: 1rem;
  margin: 0.5rem 0;
  color: hsl(var(--color-muted-foreground));
  font-style: italic;
}

.trix-content pre {
  background: hsl(var(--color-muted));
  border-radius: 0.375rem;
  padding: 0.75rem 1rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  overflow-x: auto;
  color: hsl(var(--color-foreground));
}

.trix-content a {
  color: hsl(var(--color-primary));
  text-decoration: underline;
}

.trix-content a:hover {
  color: hsl(var(--color-primary) / 0.8);
}

.trix-content strong {
  font-weight: 600;
}

.trix-content em {
  font-style: italic;
}

.trix-content del {
  text-decoration: line-through;
}

.trix-content h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
}

.trix-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 0.5rem 0;
}

/* Swiper Photo Gallery Custom Styles */
.swiper-button-prev,
.swiper-button-next {
  /* Hide default Swiper navigation arrows since we use custom heroicons */
  display: none !important;
}

/* Override Swiper's default button styles for our custom buttons */
[data-photo-gallery-target="prevButton"],
[data-photo-gallery-target="nextButton"] {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ensure modal appears above everything else */
[data-photo-gallery-target="modal"] {
  z-index: 9999;
}

/* Fix Swiper slide height and centering */
[data-photo-gallery-target="swiper"] .swiper-slide {
  height: 100vh !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Ensure images are properly contained and centered */
[data-photo-gallery-target="swiper"] .swiper-slide img {
  display: block;
  margin: auto;
}

/* Card form rich text editor - larger height */
.card-form .comment-editor-wrapper trix-editor {
  min-height: 200px;
  padding: 1.25rem 1.5rem;
}

/* ========================================
   Inline Editable - Simple underline style
   ======================================== */

/* Editable text - show simple underline on hover */
.inline-editable {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.inline-editable:hover {
  text-decoration-color: currentColor;
}

.inline-editable:focus {
  outline: none;
}

/* Editable container for click-to-edit sections */
.inline-editable-container {
  position: relative;
}

.inline-editable-container:hover .inline-edit-trigger {
  opacity: 1;
}

/* Edit trigger (pencil icon) - appears on hover */
.inline-edit-trigger {
  opacity: 0;
  transition: opacity 0.15s ease;
  cursor: pointer;
  color: hsl(var(--color-muted-foreground));
}

.inline-edit-trigger:hover {
  color: hsl(var(--color-foreground));
}

/* Notes/description editable area - left border indicator on hover */
.inline-editable-notes {
  cursor: pointer;
  border-left: 2px solid transparent;
  padding-left: 0.75rem;
  margin-left: -0.75rem;
}

.inline-editable-notes:hover {
  border-left-color: hsl(var(--color-foreground));
}

/* Empty notes placeholder */
.inline-editable-notes-empty {
  color: hsl(var(--color-muted-foreground));
  font-style: italic;
  padding: 0.75rem;
  text-align: center;
  border: 1px dashed hsl(var(--color-border));
  border-radius: 0.375rem;
  cursor: pointer;
}

.inline-editable-notes-empty:hover {
  border-color: hsl(var(--color-muted-foreground));
}

/* Inline edit form wrapper */
.inline-edit-form {
  width: 100%;
}

.inline-edit-form input[type="text"] {
  width: 100%;
  background: hsl(var(--color-background));
  border: 2px solid hsl(var(--color-primary));
  border-radius: 0.5rem;
  color: hsl(var(--color-foreground));
  padding: 0.5rem 0.75rem;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

.inline-edit-form input[type="text"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px hsl(var(--color-primary) / 0.15);
}

/* Inline edit title - matches h1 styling */
.inline-edit-form .inline-edit-title-input {
  font-size: 1.875rem;
  line-height: 2.25rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
}

/* Inline edit buttons */
.inline-edit-buttons {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.inline-edit-buttons .btn-save {
  background: hsl(var(--color-primary));
  color: hsl(var(--color-primary-foreground));
  border: none;
  border-radius: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.inline-edit-buttons .btn-save:hover {
  background: hsl(var(--color-primary) / 0.9);
}

.inline-edit-buttons .btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.inline-edit-buttons .btn-cancel {
  background: transparent;
  color: hsl(var(--color-muted-foreground));
  border: 1px solid hsl(var(--color-border));
  border-radius: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.inline-edit-buttons .btn-cancel:hover {
  background: hsl(var(--color-muted));
  color: hsl(var(--color-foreground));
}

/* Card comment border */
.card-comment-border {
  border-bottom: 1px solid #f2f2f2;
}

.card-comment-border:last-child {
  border-bottom: none;
}

/* Timeline item border */
.timeline-item-border {
  border-bottom: 1px solid hsl(var(--color-border));
}

.timeline-item-border:last-child {
  border-bottom: none;
}

/* ========================================
   Team Card Animations
   ======================================== */

/* Fade in animation for new elements */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.25s ease-out forwards;
}

/* Chevron rotation for expand/collapse */
.rotate-180 {
  transform: rotate(180deg);
}
