/* TipTap Editor Styles for LucyHR */
.tiptap-editor-wrapper {
    border-radius: 0.5rem;
    overflow: visible;
    border: 1px solid #e5e7eb;
    position: relative;
    background: #fff;
}

.simple-editor-menubar {
    align-items: center;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 0.5rem 0.5rem 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: #6b7280;
    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: #e5e7eb;
    color: #111827;
}

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

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

.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: #6b7280;
}

.simple-editor-menubar .separator {
    background-color: #e5e7eb;
    height: 1.5rem;
    margin: 0 0.25rem;
    width: 1px;
}

.ProseMirror {
    outline: none;
    background: #fff;
    flex: 1 1 auto;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    line-height: 1.6;
    color: #111827;
}

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

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

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

.ProseMirror h2 {
    font-size: 1.25rem;
    font-weight: bold;
    line-height: 1.75rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

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

.ProseMirror h3 {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.5rem;
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
}

.ProseMirror h4 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
}

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

.ProseMirror p:last-child {
    margin-bottom: 0;
}

.ProseMirror ul, .ProseMirror ol {
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
    margin-top: 0.25rem;
}

.ProseMirror ul {
    list-style-type: disc;
}

.ProseMirror ol {
    list-style-type: decimal;
}

.ProseMirror li {
    margin-bottom: 0.125rem;
    display: list-item;
}

.ProseMirror li p {
    margin-bottom: 0;
}

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

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

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

.ProseMirror a {
    color: #3b82f6;
    text-decoration: underline;
}

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

/* 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: 200px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 0.25rem;
    display: none;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 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: #374151;
    text-align: left;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s;
}

.dropdown-item:hover {
    background: #f3f4f6;
}

.dropdown-item.is-active {
    background: #3b82f6;
    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.125rem;
    color: #374151;
}

.dropdown-item:hover .placeholder-label,
.dropdown-item.is-active .placeholder-label {
    color: inherit;
}

.placeholder-code {
    font-size: 0.75rem;
    color: #6b7280;
    font-family: ui-monospace, monospace;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

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

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

.placeholder-button:hover {
    background: #2563eb;
}

/* 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: #3b82f6;
}

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