/* Tiptap Editor Styles - полная версия */

/* Обертка редактора */
.tiptap-editor-wrapper {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.tiptap-editor-wrapper:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Панель инструментов */
.tiptap-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 12px 12px 0 0;
}

.tiptap-toolbar button {
    padding: 0.4rem 0.7rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s ease;
    color: #334155;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-width: 32px;
    justify-content: center;
}

.tiptap-toolbar button:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #0f172a;
    transform: translateY(-1px);
}

.tiptap-toolbar button:active {
    transform: translateY(0);
}

.tiptap-toolbar button.is-active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* Выпадающий список шрифтов */
.tiptap-toolbar .font-family-select {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: white;
    font-size: 0.8rem;
    color: #334155;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.tiptap-toolbar .font-family-select:hover,
.tiptap-toolbar .font-family-select:focus {
    border-color: #3b82f6;
    outline: none;
}

.tiptap-toolbar .separator {
    width: 1px;
    height: 24px;
    background: #cbd5e1;
    margin: 0 0.25rem;
}

/* Специальные стили для кнопок со значками */
.tiptap-toolbar button i, 
.tiptap-toolbar button em, 
.tiptap-toolbar button strong {
    pointer-events: none;
}

/* Область редактора для краткого описания */
.tiptap-editor-content {
    padding: 1rem;
    min-height: 200px;
    background: #ffffff;
    outline: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #1e293b;
    font-size: 0.9375rem;
    overflow-y: auto;
    border-radius: 0 0 12px 12px;
    cursor: text;
    border: 1px solid #e2e8f0;
    border-top: none;
}

.tiptap-editor-content:focus {
    outline: none;
    border-color: #3b82f6;
}

/* Область редактора для полного описания */
.tiptap-editor {
    padding: 1rem;
    min-height: 350px;
    background: #ffffff;
    outline: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #1e293b;
    font-size: 0.9375rem;
    overflow-y: auto;
    border-radius: 0 0 12px 12px;
    cursor: text;
    border: 1px solid #e2e8f0;
    border-top: none;
}

.tiptap-editor:focus {
    outline: none;
    border-color: #3b82f6;
}

/* Специальные стили для #full-description-editor */
#full-description-editor {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 1rem;
    min-height: 350px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1e293b;
}

#full-description-editor:focus {
    outline: none;
    border-color: #3b82f6;
}

/* Placeholder для пустого редактора */
.tiptap-editor-content:empty:before,
.tiptap-editor:empty:before,
#full-description-editor:empty:before {
    content: attr(data-placeholder);
    color: #94a3b8;
    font-style: normal;
}

.tiptap-editor-content p:first-child:empty:before,
.tiptap-editor p:first-child:empty:before {
    content: attr(data-placeholder);
    color: #94a3b8;
}

/* Стили ProseMirror (если используется Tiptap) */
.ProseMirror {
    outline: none;
}

.ProseMirror:focus {
    outline: none;
}

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

/* === ТИПОГРАФИЯ внутри редактора === */
.tiptap-editor-content h1,
.tiptap-editor h1,
#full-description-editor h1,
.ProseMirror h1 {
    font-size: 1.875rem;
    margin: 1rem 0 0.5rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.tiptap-editor-content h2,
.tiptap-editor h2,
#full-description-editor h2,
.ProseMirror h2 {
    font-size: 1.5rem;
    margin: 0.875rem 0 0.5rem;
    font-weight: 600;
    line-height: 1.3;
}

.tiptap-editor-content h3,
.tiptap-editor h3,
#full-description-editor h3,
.ProseMirror h3 {
    font-size: 1.25rem;
    margin: 0.75rem 0 0.5rem;
    font-weight: 600;
}

.tiptap-editor-content p,
.tiptap-editor p,
#full-description-editor p,
.ProseMirror p {
    margin: 0.75rem 0;
}

.tiptap-editor-content ul,
.tiptap-editor-content ol,
.tiptap-editor ul,
.tiptap-editor ol,
#full-description-editor ul,
#full-description-editor ol,
.ProseMirror ul,
.ProseMirror ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.tiptap-editor-content li,
.tiptap-editor li,
#full-description-editor li,
.ProseMirror li {
    margin: 0.25rem 0;
}

.tiptap-editor-content blockquote,
.tiptap-editor blockquote,
#full-description-editor blockquote,
.ProseMirror blockquote {
    border-left: 3px solid #3b82f6;
    padding: 0.25rem 0 0.25rem 1rem;
    margin: 1rem 0;
    color: #475569;
    font-style: italic;
    background: #f8fafc;
    border-radius: 0 8px 8px 0;
}

.tiptap-editor-content pre,
.tiptap-editor pre,
#full-description-editor pre,
.ProseMirror pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Courier New', 'Fira Code', monospace;
    font-size: 0.8125rem;
    line-height: 1.5;
    margin: 1rem 0;
}

.tiptap-editor-content code,
.tiptap-editor code,
#full-description-editor code,
.ProseMirror code {
    background: #f1f5f9;
    color: #db2777;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.875em;
}

.tiptap-editor-content pre code,
.tiptap-editor pre code,
#full-description-editor pre code,
.ProseMirror pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.tiptap-editor-content img,
.tiptap-editor img,
#full-description-editor img,
.ProseMirror img {
    max-width: 100%;
    height: auto;
    margin: 0.75rem 0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tiptap-editor-content a,
.tiptap-editor a,
#full-description-editor a,
.ProseMirror a {
    color: #3b82f6;
    text-decoration: underline;
    cursor: pointer;
}

.tiptap-editor-content a:hover,
.tiptap-editor a:hover,
#full-description-editor a:hover,
.ProseMirror a:hover {
    color: #2563eb;
}

.tiptap-editor-content hr,
.tiptap-editor hr,
#full-description-editor hr,
.ProseMirror hr {
    margin: 1.5rem 0;
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, #cbd5e1, transparent);
}

/* Таблицы */
.tiptap-editor-content table,
.tiptap-editor table,
#full-description-editor table,
.ProseMirror table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
    font-size: 0.875rem;
}

.tiptap-editor-content th,
.tiptap-editor-content td,
.tiptap-editor th,
.tiptap-editor td,
#full-description-editor th,
#full-description-editor td,
.ProseMirror th,
.ProseMirror td {
    border: 1px solid #cbd5e1;
    padding: 0.5rem 0.75rem;
    text-align: left;
    vertical-align: top;
}

.tiptap-editor-content th,
.tiptap-editor th,
#full-description-editor th,
.ProseMirror th {
    background: #f1f5f9;
    font-weight: 600;
}

/* Выделение текста */
.tiptap-editor-content mark,
.tiptap-editor mark,
#full-description-editor mark,
.ProseMirror mark {
    background: #fef08a;
    padding: 0 0.125rem;
    border-radius: 3px;
}

/* Списки задач */
.tiptap-editor-content ul[data-type="taskList"],
.tiptap-editor ul[data-type="taskList"],
#full-description-editor ul[data-type="taskList"],
.ProseMirror ul[data-type="taskList"] {
    list-style: none;
    padding-left: 0;
}

.tiptap-editor-content ul[data-type="taskList"] li,
.tiptap-editor ul[data-type="taskList"] li,
#full-description-editor ul[data-type="taskList"] li,
.ProseMirror ul[data-type="taskList"] li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tiptap-editor-content ul[data-type="taskList"] li input,
.tiptap-editor ul[data-type="taskList"] li input,
#full-description-editor ul[data-type="taskList"] li input,
.ProseMirror ul[data-type="taskList"] li input {
    margin: 0;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .tiptap-toolbar button {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .tiptap-editor-content,
    .tiptap-editor,
    #full-description-editor {
        padding: 0.75rem;
        min-height: 250px;
    }
    
    .tiptap-editor-content h1,
    .tiptap-editor h1,
    #full-description-editor h1,
    .ProseMirror h1 {
        font-size: 1.5rem;
    }
    
    .tiptap-editor-content h2,
    .tiptap-editor h2,
    #full-description-editor h2,
    .ProseMirror h2 {
        font-size: 1.25rem;
    }
    
    .tiptap-editor-content h3,
    .tiptap-editor h3,
    #full-description-editor h3,
    .ProseMirror h3 {
        font-size: 1.125rem;
    }
}

/* Стили для выбора шрифта и размера */
.tiptap-toolbar .font-family-select,
.tiptap-toolbar .font-size-select {
    height: 30px;
    padding: 0 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    font-size: 13px;
    color: #2d3748;
    cursor: pointer;
    min-width: 70px;
}

.tiptap-toolbar .font-family-select:hover,
.tiptap-toolbar .font-size-select:hover {
    border-color: #3b82f6;
}

.tiptap-toolbar .font-family-select:focus,
.tiptap-toolbar .font-size-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Стили для вложенных файлов */
.file-attachment {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}

.file-attachment:hover {
    background: #e2e8f0;
    text-decoration: none;
    color: #2563eb;
}

/* Кнопки в тулбаре */
.tiptap-toolbar button.is-active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* Адаптив для мобильных */
@media (max-width: 768px) {
    .tiptap-toolbar {
        gap: 2px;
        padding: 6px 8px;
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    
    .tiptap-toolbar button {
        padding: 3px 6px;
        font-size: 12px;
        min-width: 24px;
        height: 26px;
    }
    
    .tiptap-toolbar .font-family-select,
    .tiptap-toolbar .font-size-select {
        height: 26px;
        font-size: 12px;
        padding: 0 4px;
        min-width: 50px;
    }
}
 
