/* Notion-style Editor.js Styles */

/* Editor Container */
[data-notion-editor] {
  padding: 20px;
  background-color: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  min-height: 350px;
  margin-bottom: 1.5rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  position: relative;
}

/* On focus state */
[data-notion-editor]:focus-within {
  border-color: #bfdbfe;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Editor Structure */
.codex-editor {
  position: relative;
  box-sizing: border-box;
  margin: 0;
  width: 100%;
}

.codex-editor__redactor {
  position: relative;
  padding-bottom: 120px !important;
}

/* Content Area */
.ce-block__content {
  max-width: 750px !important;
  margin: 0 auto;
  transition: background-color 100ms ease;
}

.ce-toolbar__content {
  max-width: 750px !important;
  margin: 0 auto;
}

/* Hover State for Blocks */
.ce-block:hover .ce-block__content {
  background-color: rgba(242, 242, 242, 0.4);
  border-radius: 3px;
}

/* Typography */
.ce-paragraph {
  font-size: 16px;
  line-height: 1.6;
  margin: 0.7em 0;
  color: #333;
}

.ce-paragraph[data-placeholder]:empty::before {
  color: #b1b1b1;
  font-style: italic;
}

/* Headers */
.ce-header {
  padding: 0.4em 0;
  margin: 0;
  line-height: 1.4;
  outline: none;
  font-weight: 600;
  color: #111;
}

h1.ce-header {
  font-size: 1.875em;
  margin-top: 1em;
}

h2.ce-header {
  font-size: 1.5em;
  margin-top: 0.83em;
}

h3.ce-header {
  font-size: 1.25em;
  margin-top: 0.67em;
}

/* Lists */
.cdx-list {
  margin: 0.7em 0;
  padding-left: 40px;
  outline: none;
}

.cdx-list__item {
  padding: 4px 0;
}

/* Checklist */
.cdx-checklist {
  margin: 0.7em 0;
}

.cdx-checklist__item {
  display: flex;
  align-items: flex-start;
  padding: 4px 0;
}

.cdx-checklist__item-checkbox {
  border: 1px solid #ddd;
  width: 16px;
  height: 16px;
  margin-right: 10px;
  margin-top: 3px;
  border-radius: 3px;
  cursor: pointer;
  position: relative;
}

.cdx-checklist__item-checkbox::after {
  content: '✓';
  position: absolute;
  top: -1px;
  left: 2px;
  font-size: 14px;
  color: #3b82f6;
}

.cdx-checklist__item-text {
  outline: none;
  flex-grow: 1;
}

.cdx-checklist__item--checked .cdx-checklist__item-checkbox {
  background: #ebf5ff;
  border-color: #bfdbfe;
}

.cdx-checklist__item--checked .cdx-checklist__item-text {
  color: #777;
  text-decoration: line-through;
}

/* Quote */
.cdx-quote {
  margin: 1em 0;
  padding: 10px 20px;
  border-left: 3px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 0 3px 3px 0;
}

.cdx-quote__text {
  font-style: italic;
  color: #374151;
}

.cdx-quote__caption {
  margin-top: 8px;
  color: #6b7280;
  font-size: 0.9em;
}

/* Image Tool */
.image-tool {
  margin: 1.5em 0;
}

.image-tool__image {
  border-radius: 6px;
  overflow: hidden;
  margin: 0 auto;
}

.image-tool__image-picture {
  max-width: 100%;
  vertical-align: bottom;
}

.image-tool__caption {
  margin-top: 10px;
  color: #6b7280;
  font-size: 0.9em;
  text-align: center;
}

.image-tool--withBackground .image-tool__image {
  background-color: #f9fafb;
  padding: 10px;
}

.image-tool--withBorder .image-tool__image {
  border: 1px solid #e5e7eb;
}

.image-tool--stretched .image-tool__image {
  max-width: 100%;
  width: 100%;
}

/* Warning Block */
.cdx-warning {
  position: relative;
  margin: 1em 0;
  padding: 15px 20px;
  border-radius: 6px;
  background: #fffbeb;
  border: 1px solid #fef3c7;
}

.cdx-warning__title {
  margin: 0 0 8px 0;
  font-weight: 600;
  color: #92400e;
}

.cdx-warning__message {
  color: #78350f;
}

/* Table */
.tc-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin: 1em 0;
}

.tc-table td {
  border: 1px solid #e5e7eb;
  padding: 10px;
  vertical-align: top;
}

.tc-table__wrap {
  overflow-x: auto;
  padding: 0;
  margin: 0;
}

.tc-table__cell {
  min-height: 1em;
}

/* Embed */
.embed-tool {
  margin: 1.5em 0;
}

.embed-tool__caption {
  margin-top: 10px;
  color: #6b7280;
  font-size: 0.9em;
  text-align: center;
}

.embed-tool__content iframe {
  width: 100%;
  border: 0;
}

/* Inline Code */
.inline-code {
  padding: 0.2em 0.4em;
  margin: 0 0.1em;
  background-color: #f1f1f1;
  color: #e01e5a;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.9em;
  border-radius: 3px;
  white-space: nowrap;
}

/* Toolbar */
.ce-toolbar__plus,
.ce-toolbar__settings-btn {
  color: #6b7280;
  background: #f8fafc;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 150ms ease;
}

.ce-toolbar__plus:hover,
.ce-toolbar__settings-btn:hover {
  background-color: #f0f9ff;
  color: #3b82f6;
}

.ce-toolbar__actions {
  top: 5px;
  right: -36px;
}

/* Inline Toolbar */
.ce-inline-toolbar {
  background: white;
  border: 1px solid #e5e7eb;
  box-shadow: 0 3px 15px -3px rgba(13, 20, 33, 0.13);
  border-radius: 6px;
  padding: 0 4px;
}

.ce-inline-toolbar__buttons,
.ce-conversion-toolbar__tools,
.ce-settings__button {
  font-size: 13px;
}

.ce-inline-toolbar__dropdown,
.ce-conversion-toolbar__label {
  font-size: 13px;
}

.ce-conversion-toolbar__label {
  color: #6b7280;
}

/* Block Tunes */
.ce-settings {
  background: white;
  border: 1px solid #e5e7eb;
  box-shadow: 0 3px 15px -3px rgba(13, 20, 33, 0.13);
  border-radius: 6px;
  padding: 6px;
}

.ce-settings__button {
  color: #6b7280;
  padding: 6px;
}

.ce-settings__button:hover {
  background-color: #f0f9ff;
  color: #3b82f6;
}

.ce-settings__button--active {
  color: #3b82f6;
}

/* Conversion Toolbar (Tool Selection) */
.ce-conversion-toolbar {
  background: white;
  border: 1px solid #e5e7eb;
  box-shadow: 0 3px 15px -3px rgba(13, 20, 33, 0.13);
  border-radius: 6px;
  padding: 6px;
}

.ce-conversion-tool {
  color: #6b7280;
  padding: 6px;
  border-radius: 4px;
}

.ce-conversion-tool:hover {
  background-color: #f0f9ff;
  color: #3b82f6;
}

.ce-conversion-tool--active {
  background-color: #e0f2fe;
  color: #3b82f6;
}

/* Mobile Responsiveness */
@media (max-width: 650px) {
  .ce-block__content,
  .ce-toolbar__content {
    max-width: calc(100% - 40px) !important;
  }
  
  .ce-toolbar__plus {
    margin-left: 5px !important;
  }
  
  .ce-toolbar__actions {
    right: 0 !important;
  }
  
  [data-notion-editor] {
    padding: 15px;
  }
}