/* --- СТИЛІ ДЛЯ РЕДАКТОРА TIPTAP --- */
.tiptap-wrapper {
    display: flex;
    flex-direction: column;
}

/* Панель інструментів (Тулбар) */
.tiptap-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    flex-wrap: wrap;
}
.tiptap-toolbar button {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-secondary, #A09E9E);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.tiptap-toolbar button:hover,
.tiptap-toolbar button.is-active {
    color: var(--text-main, #fff);
    background: rgba(255, 255, 255, 0.15);
}
.tiptap-toolbar button svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}
.tiptap-toolbar .toolbar-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 4px;
}
.tiptap-toolbar .btn-spoiler {
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Саме поле вводу тексту */
.tiptap-editor-container {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    min-height: 120px;
    padding: 16px;
    color: var(--text-main, #fff);
    cursor: text;
    font-size: 16px;
    line-height: 1.5;
    transition: all 0.3s ease;
}
.tiptap-editor-container:focus-within {
    border-color: var(--accent, #FFBF00);
    background: rgba(0, 0, 0, 0.25);
}
.tiptap-editor-container .ProseMirror {
    outline: none;
    min-height: 100px;
}

/* Плейсхолдер ("Текст повідомлення...") */
.tiptap-editor-container .ProseMirror p.is-editor-empty:first-child::before {
    content: attr(data-placeholder);
    float: left;
    color: rgba(255, 255, 255, 0.35);
    pointer-events: none;
    height: 0;
}

/* ==========================================================================
   УЗГОДЖЕНІ СТИЛІ: ДЛЯ РЕДАКТОРА ТА ДЛЯ ОПУБЛІКОВАНИХ ВІДПОВІДЕЙ
   ========================================================================== */

/* Абзаци */
.tiptap-editor-container .ProseMirror p,
.guestbook .answer p {
    margin: 0 0 10px 0;
}

/* Посилання */
.tiptap-editor-container .ProseMirror a,
.guestbook .answer a {
    color: var(--accent, #FFBF00);
    text-decoration: underline;
}

/* Цитати (Blockquote) */
.tiptap-editor-container .ProseMirror blockquote,
.guestbook .answer blockquote {
    border-left: 3px solid var(--accent, #FFBF00);
    padding-left: 14px;
    margin-left: 0;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    background: rgba(255, 255, 255, 0.05); /* Легкий фон для виділення цитати */
    padding-top: 8px;
    padding-bottom: 8px;
    border-radius: 0 4px 4px 0;
}

/* Жирний текст */
.tiptap-editor-container .ProseMirror strong,
.tiptap-editor-container .ProseMirror b,
.guestbook .answer strong,
.guestbook .answer b {
    font-weight: 700 !important;
}

/* Курсив */
.tiptap-editor-container .ProseMirror em,
.tiptap-editor-container .ProseMirror i,
.guestbook .answer em,
.guestbook .answer i {
    font-style: italic !important;
}

/* Підкреслений текст */
.tiptap-editor-container .ProseMirror u,
.guestbook .answer u {
    text-decoration: underline !important;
}

/* Списки */
.tiptap-editor-container .ProseMirror ul,
.guestbook .answer ul {
    list-style-type: disc !important;
    padding-left: 24px !important;
    margin-bottom: 12px;
}
.tiptap-editor-container .ProseMirror ol,
.guestbook .answer ol {
    list-style-type: decimal !important;
    padding-left: 24px !important;
    margin-bottom: 12px;
}
.tiptap-editor-container .ProseMirror li p,
.guestbook .answer li p {
    margin-bottom: 4px; /* Менший відступ між пунктами списку */
}

/* Зображення та Відео */
.tiptap-editor-container .ProseMirror img,
.tiptap-editor-container .ProseMirror iframe,
.guestbook .answer img,
.guestbook .answer iframe {
    max-width: 100%;
    border-radius: 8px;
    margin: 12px 0;
}

/* Адаптивність спеціально для YouTube в опублікованому вигляді */
.guestbook .answer iframe {
    width: 100% !important;
    aspect-ratio: 16 / 9;
    height: auto !important;
    border: none;
}

/* ==========================================================================
   СПОЙЛЕРИ
   ========================================================================== */

/* 1. СПОЙЛЕР В РЕЖИМІ РЕДАГУВАННЯ (має бути читабельним) */
.tiptap-editor-container .editor-spoiler {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-main, #fff);
    border: 1px dashed rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    padding: 2px 6px;
    cursor: text;
}

/* 2. СПОЙЛЕР В ОПУБЛІКОВАНОМУ ПОСТІ (прихований) */
.guestbook .answer .editor-spoiler {
    background-color: rgba(255, 255, 255, 0.15);
    color: transparent;
    border-radius: 4px;
    padding: 2px 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}
.guestbook .answer .editor-spoiler:hover,
.guestbook .answer .editor-spoiler:active {
    background-color: rgba(0, 0, 0, 0.3);
    color: var(--text-main, #fff);
}
.guestbook .answer p{
    margin: 8px 0;
}

/* Like button active state */
.guestbook .btn-like.active {
    color: #FFBF00 !important;
}
