/* Custom styles for TinyMCE Editor */

/* Editor container styling */
.tox-tinymce {
  border-radius: 0.5rem !important;
  border-color: #e5e7eb !important; /* gray-300 */
  overflow: hidden;
}

/* Editor focused state */
.tox-tinymce.focused {
  border-color: var(--primary-color, #4f46e5) !important; /* primary color */
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2) !important; /* primary color with opacity */
}

/* Toolbar styling */
.tox .tox-toolbar,
.tox .tox-toolbar__overflow,
.tox .tox-toolbar__primary {
  background-color: #f9fafb !important; /* gray-50 */
}

/* Menu items */
.tox .tox-mbtn {
  color: #374151 !important; /* gray-700 */
}

.tox .tox-mbtn:hover:not(:disabled):not(.tox-mbtn--active) {
  background-color: #f3f4f6 !important; /* gray-100 */
}

/* Buttons */
.tox .tox-tbtn {
  color: #374151 !important; /* gray-700 */
}

.tox .tox-tbtn:hover {
  background-color: #f3f4f6 !important; /* gray-100 */
}

.tox .tox-tbtn--enabled, 
.tox .tox-tbtn--enabled:hover {
  background-color: #e5e7eb !important; /* gray-200 */
}

/* Content area */
.tox .tox-edit-area__iframe {
  background-color: #ffffff !important;
}

/* Dropdown styling */
.tox .tox-collection--list .tox-collection__item--active {
  background-color: var(--primary-color, #4f46e5) !important; /* primary color */
}

.tox .tox-collection--list .tox-collection__item--active .tox-collection__item-label {
  color: #ffffff !important;
}

/* Adjusting the height for mobile screens */
@media (max-width: 640px) {
  .tox-tinymce {
    height: 300px !important;
  }
}

/* Override default prose styles for editor content */
.tox-tinymce-aux .tox-toolbar__overflow,
.tox-tinymce .tox-edit-area {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Styles for the content within the editor */
.mce-content-body {
  font-size: 0.875rem !important;
  line-height: 1.5 !important;
  color: #111827 !important; /* gray-900 */
}

.mce-content-body p {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
}

.mce-content-body h1,
.mce-content-body h2,
.mce-content-body h3,
.mce-content-body h4,
.mce-content-body h5,
.mce-content-body h6 {
  font-weight: 600;
  color: #111827; /* gray-900 */
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
}

.mce-content-body h1 {
  font-size: 1.5rem;
  line-height: 2rem;
}

.mce-content-body h2 {
  font-size: 1.25rem;
  line-height: 1.75rem;
}

.mce-content-body h3 {
  font-size: 1.125rem;
  line-height: 1.5rem;
}

.mce-content-body ul,
.mce-content-body ol {
  padding-left: 1.5rem;
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
}

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

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

.mce-content-body li {
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}

.mce-content-body a {
  color: var(--primary-color, #4f46e5);
  text-decoration: underline;
}

.mce-content-body blockquote {
  border-left: 4px solid #e5e7eb; /* gray-200 */
  padding-left: 1rem;
  font-style: italic;
  color: #4b5563; /* gray-600 */
  margin-left: 0;
  margin-right: 0;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.mce-content-body img {
  max-width: 100%;
  height: auto;
  border-radius: 0.375rem;
}

.mce-content-body table {
  border-collapse: collapse;
  width: 100%;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.mce-content-body table th,
.mce-content-body table td {
  border: 1px solid #e5e7eb; /* gray-200 */
  padding: 0.5rem;
}

.mce-content-body table th {
  background-color: #f9fafb; /* gray-50 */
  font-weight: 600;
}

.mce-content-body pre {
  background-color: #f3f4f6; /* gray-100 */
  border-radius: 0.375rem;
  padding: 1rem;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.875rem;
  line-height: 1.5;
}

.mce-content-body code {
  background-color: #f3f4f6; /* gray-100 */
  border-radius: 0.25rem;
  padding: 0.125rem 0.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.875rem;
}