/**
 * Стили для визуального редактора Wiki статей в CRM
 */

/* Модальное окно */
.wiki-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.wiki-modal {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wiki-visual-editor-modal {
    max-width: 1400px;
}

.wiki-block-editor-modal {
    max-width: 800px;
}

.wiki-modal-header {
    padding: 24px;
    border-bottom: 2px solid #000000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
}

.wiki-modal-header h2,
.wiki-modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #000000;
}

.wiki-modal-close {
    background: transparent;
    border: 2px solid #000000;
    border-radius: 0;
    width: 40px;
    height: 40px;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #000000;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wiki-modal-close:hover {
    background: #000000;
    color: #ffffff;
}

.wiki-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.wiki-modal-footer {
    padding: 20px 24px;
    border-top: 2px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f9f9f9;
}

/* Панель инструментов редактора */
.wiki-visual-editor-toolbar {
    padding: 16px;
    background: #f5f5f5;
    border-bottom: 2px solid #000000;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.wiki-add-block-btn {
    padding: 10px 20px;
    background: #ffffff;
    border: 2px solid #000000;
    border-radius: 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: #000000;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wiki-add-block-btn:hover {
    background: #000000;
    color: #ffffff;
}

/* Контент редактора */
.wiki-visual-editor-content {
    padding: 24px;
    min-height: 400px;
    background: #f5f5f5;
}

/* Блоки контента */
.wiki-block-editable {
    margin-bottom: 24px;
    padding: 20px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.wiki-block-editable:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 2px dashed #000000;
}

.wiki-block-editable::before {
    content: '✏️ Редактировать';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s;
    background: #000000;
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
}

.wiki-block-editable:hover::before {
    opacity: 1;
}

/* Блок инфобокса */
.wiki-block-infobox {
    border: 2px solid #e0e0e0;
}

.wiki-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #000000;
}

.wiki-block-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #000000;
}

.wiki-block-edit-btn {
    padding: 6px 12px;
    background: transparent;
    border: 2px solid #000000;
    border-radius: 0;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    color: #000000;
    transition: all 0.2s;
}

.wiki-block-edit-btn:hover {
    background: #000000;
    color: #ffffff;
}

.wiki-infobox-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wiki-infobox-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

.wiki-infobox-row:last-child {
    border-bottom: none;
}

.wiki-infobox-label {
    font-weight: 600;
    color: #000000;
    min-width: 150px;
    margin-right: 16px;
}

.wiki-infobox-value {
    flex: 1;
    color: #333333;
}

/* Блок текста */
.wiki-block-text {
    line-height: 1.8;
    color: #000000;
}

/* Редактор инфобокса */
.wiki-infobox-editor {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.wiki-infobox-editor label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-weight: 600;
    color: #000000;
}

.wiki-infobox-title-input {
    padding: 12px;
    border: 2px solid #000000;
    border-radius: 0;
    font-size: 16px;
    font-family: inherit;
}

.wiki-infobox-rows {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wiki-infobox-rows h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 700;
    color: #000000;
}

.wiki-infobox-editor-row {
    display: grid;
    grid-template-columns: 200px 1fr auto;
    gap: 12px;
    align-items: start;
    padding: 16px;
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
}

.wiki-infobox-label-input,
.wiki-infobox-value-input {
    padding: 10px;
    border: 2px solid #000000;
    border-radius: 0;
    font-size: 14px;
    font-family: inherit;
}

.wiki-infobox-value-input {
    min-height: 60px;
    resize: vertical;
}

.wiki-infobox-remove-row {
    padding: 10px;
    background: #ff0000;
    color: #ffffff;
    border: none;
    border-radius: 0;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.wiki-infobox-remove-row:hover {
    background: #cc0000;
}

.wiki-infobox-add-row {
    padding: 12px 24px;
    background: #ffffff;
    border: 2px solid #000000;
    border-radius: 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: #000000;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    align-self: flex-start;
}

.wiki-infobox-add-row:hover {
    background: #000000;
    color: #ffffff;
}

/* Редактор текста */
.wiki-text-editor {
    width: 100%;
    min-height: 300px;
    padding: 16px;
    border: 2px solid #000000;
    border-radius: 0;
    font-size: 16px;
    font-family: inherit;
    line-height: 1.8;
    resize: vertical;
}

/* Кнопки */
.button {
    padding: 10px 20px;
    border: 2px solid #000000;
    border-radius: 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    display: inline-block;
}

.button-primary {
    background: #000000;
    color: #ffffff;
}

.button-primary:hover {
    background: #333333;
    color: #ffffff;
}

.button-secondary {
    background: #ffffff;
    color: #000000;
}

.button-secondary:hover {
    background: #f0f0f0;
}

/* Адаптивность */
@media (max-width: 768px) {
    .wiki-modal {
        max-width: 100%;
        margin: 10px;
    }

    .wiki-infobox-editor-row {
        grid-template-columns: 1fr;
    }

    .wiki-infobox-remove-row {
        justify-self: start;
    }
}

