/* Modern TipTap Editor Styles */
.tiptap-editor-wrapper {
    border-radius: 0.75rem;
    overflow: visible;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    position: relative;
}

.simple-editor-menubar {
    align-items: center;
    background: #1a1b26;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.75rem 0.75rem 0 0;
    display: flex;
    flex-wrap: wrap;
    flex: 0 0 auto;
    padding: 0.5rem;
    gap: 0.125rem;
    min-height: 2.5rem;
}

.simple-editor-menubar .menu-item {
    background: transparent;
    border: 0;
    border-radius: 0.375rem;
    color: #9ca3af;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    height: 2rem;
    padding: 0 0.5rem;
    min-width: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.simple-editor-menubar .menu-item svg {
    width: 1.125rem;
    height: 1.125rem;
}

.simple-editor-menubar .menu-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.simple-editor-menubar .menu-item.is-active {
    background-color: #5b21b6;
    color: #fff;
}

.simple-editor-menubar .menu-item.is-active:hover {
    background-color: #6d28d9;
}

.simple-editor-menubar .menu-item.is-disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.simple-editor-menubar .menu-item.is-disabled:hover {
    background-color: transparent;
    color: #9ca3af;
}

.simple-editor-menubar .separator {
    background-color: rgba(255, 255, 255, 0.08);
    height: 1.5rem;
    margin: 0 0.25rem;
    width: 1px;
}

.ProseMirror {
    min-height: 400px;
    padding: 1.5rem;
    outline: none;
    background: transparent;
    flex: 1 1 auto;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 1rem;
    line-height: 1.5;
}

/* Dark theme for light mode */
.dark .tiptap-editor-wrapper {
    background: #1a1b26;
}

.dark .simple-editor-menubar {
    background: #1a1b26;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.dark .ProseMirror {
    background: #0f1014;
    color: #e5e7eb;
}

.ProseMirror p.is-editor-empty:first-child::before {
    color: #adb5bd;
    content: attr(data-placeholder);
    float: left;
    height: 0;
    pointer-events: none;
}

/* Prose styling */
.ProseMirror h1 {
    font-size: 1.875rem;
    font-weight: bold;
    line-height: 2.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.ProseMirror h1:first-child {
    margin-top: 0;
}

.ProseMirror h2 {
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 2rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.ProseMirror h2:first-child {
    margin-top: 0;
}

.ProseMirror p {
    margin-bottom: 1rem;
}

.ProseMirror ul, .ProseMirror ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.ProseMirror li {
    margin-bottom: 0.25rem;
}

.ProseMirror blockquote {
    border-left: 4px solid #e5e7eb;
    padding-left: 1rem;
    margin-left: 0;
    margin-right: 0;
    font-style: italic;
    margin-bottom: 1rem;
}

.ProseMirror hr {
    border: none;
    height: 2px;
    background-color: #e5e7eb;
    margin: 2rem 0;
}

.ProseMirror code {
    background-color: #f3f4f6;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.dark .ProseMirror code {
    background-color: #374151;
}

/* Placeholder node style */
.ProseMirror .placeholder-node {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 3px 8px;
    border-radius: 6px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.85em;
    font-weight: 500;
    display: inline-block;
    user-select: none;
    cursor: default;
    margin: 0 2px;
    vertical-align: middle;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dark .ProseMirror .placeholder-node {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

/* Dropdown styles */
.dropdown-container {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-width: auto;
}

.dropdown-toggle span {
    font-size: 0.875rem;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 1000;
    min-width: 250px;
    background: #1a1b26;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.375rem;
    padding: 0.5rem;
    display: none;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    max-height: 300px;
    overflow-y: auto;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem;
    background: transparent;
    border: none;
    border-radius: 0.25rem;
    color: #e5e7eb;
    text-align: left;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.dropdown-item.is-active {
    background: #5b21b6;
    color: #fff;
}

.dropdown-item svg {
    width: 1.125rem;
    height: 1.125rem;
}

/* Placeholder dropdown styles */
.placeholder-item {
    width: 100%;
}

.placeholder-label {
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #e5e7eb;
}

.placeholder-code {
    font-size: 0.75rem;
    color: #9ca3af;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: rgba(99, 102, 241, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

.dropdown-item.is-active .placeholder-code {
    color: #e5e7eb;
    background: rgba(99, 102, 241, 0.2);
}

/* Placeholder button style */
.placeholder-button {
    background: #5b21b6;
    color: #fff;
}

.placeholder-button:hover {
    background: #6d28d9;
}

/* Task list styles */
.ProseMirror ul[data-type="taskList"] {
    list-style: none;
    padding: 0;
}

.ProseMirror ul[data-type="taskList"] li {
    display: flex;
    align-items: flex-start;
}

.ProseMirror ul[data-type="taskList"] li > label {
    flex: 0 0 auto;
    margin-right: 0.5rem;
    user-select: none;
}

.ProseMirror ul[data-type="taskList"] li > label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: #667eea;
}

.ProseMirror ul[data-type="taskList"] li > div {
    flex: 1 1 auto;
}

/* Ensure buttons in editor are visible */
.ProseMirror button {
    background: #667eea !important;
    color: white !important;
    padding: 0.5rem 1rem !important;
    border-radius: 0.375rem !important;
    border: none !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.ProseMirror button:hover {
    background: #764ba2 !important;
}

/* Ensure checkboxes are visible */
.ProseMirror input[type="checkbox"] {
    width: 1rem !important;
    height: 1rem !important;
    accent-color: #667eea !important;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    cursor: pointer !important;
}