/* Hitty Custom Rich Text Editor Styles */
.hitty-editor-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    border: 2px solid var(--city-grey-contour, #dbe2e8);
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 12px;
    box-sizing: border-box;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.hitty-editor-wrapper:focus-within {
    border-color: #00b1ff;
    box-shadow: 0 0 0 3px rgba(0, 177, 255, 0.18);
}

/* Dark mode support */
.black .hitty-editor-wrapper,
html.black .hitty-editor-wrapper,
body.black .hitty-editor-wrapper {
    background: #23272d;
    border-color: #383e48;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.black .hitty-editor-wrapper:focus-within,
html.black .hitty-editor-wrapper:focus-within,
body.black .hitty-editor-wrapper:focus-within {
    border-color: #00b1ff;
    box-shadow: 0 0 0 3px rgba(0, 177, 255, 0.25);
}

/* Toolbar */
.hitty-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: var(--city-grey, #f4f6f9);
    border-bottom: 1px solid var(--city-grey-contour, #e2e8f0);
    user-select: none;
}

.black .hitty-editor-toolbar,
html.black .hitty-editor-toolbar,
body.black .hitty-editor-toolbar {
    background: #1a1d22;
    border-bottom-color: #31363f;
}

.hitty-editor-btn-group {
    display: flex;
    align-items: center;
    gap: 2px;
    padding-right: 6px;
    margin-right: 4px;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.black .hitty-editor-btn-group,
html.black .hitty-editor-btn-group,
body.black .hitty-editor-btn-group {
    border-right-color: rgba(255, 255, 255, 0.12);
}

.hitty-editor-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 5px;
    color: #4b5563;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.black .hitty-editor-btn,
html.black .hitty-editor-btn,
body.black .hitty-editor-btn {
    color: #cbd5e1;
}

.hitty-editor-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #0f172a;
}

.black .hitty-editor-btn:hover,
html.black .hitty-editor-btn:hover,
body.black .hitty-editor-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

.hitty-editor-btn.active {
    background: #00b1ff;
    color: #ffffff;
}

.hitty-editor-btn svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
}

.hitty-editor-select {
    height: 26px;
    padding: 2px 6px;
    font-size: 12px;
    border: 1px solid #d1d5db;
    border-radius: 5px;
    background: #ffffff;
    color: #374151;
    cursor: pointer;
    outline: none;
}

.black .hitty-editor-select,
html.black .hitty-editor-select,
body.black .hitty-editor-select {
    background: #2a2e35;
    border-color: #444c56;
    color: #eee;
}

/* Content Editable Area */
.hitty-editor-content {
    min-height: 200px;
    max-height: 520px;
    padding: 14px 16px;
    outline: none;
    overflow-y: auto;
    font-family: 'Ubuntu X', habbofont, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #1e293b;
    background: #ffffff;
    cursor: text;
    box-sizing: border-box;
    display: block;
    width: 100%;
}

.forumPostWriteBoxEditor .hitty-editor-content {
    min-height: 110px;
}

.black .hitty-editor-content,
html.black .hitty-editor-content,
body.black .hitty-editor-content {
    background: #23272d;
    color: #f1f5f9;
}

.hitty-editor-content[data-placeholder]:empty:before {
    content: attr(data-placeholder);
    color: #94a3b8;
    pointer-events: none;
    display: block;
}

.black .hitty-editor-content[data-placeholder]:empty:before,
html.black .hitty-editor-content[data-placeholder]:empty:before,
body.black .hitty-editor-content[data-placeholder]:empty:before {
    color: #64748b;
}

.hitty-editor-content p {
    margin: 0 0 8px 0;
}

.hitty-editor-content p:last-child {
    margin-bottom: 0;
}

.hitty-editor-content h1,
.hitty-editor-content h2,
.hitty-editor-content h3 {
    margin: 10px 0 5px 0;
    font-weight: 700;
}

.hitty-editor-content h1 { font-size: 20px; }
.hitty-editor-content h2 { font-size: 17px; }
.hitty-editor-content h3 { font-size: 15px; }

.hitty-editor-content ul,
.hitty-editor-content ol {
    margin: 4px 0 8px 20px;
    padding: 0;
}

.hitty-editor-content blockquote {
    margin: 8px 0;
    padding: 6px 12px;
    border-left: 4px solid #00b1ff;
    background: rgba(0, 177, 255, 0.06);
    border-radius: 0 6px 6px 0;
    color: #475569;
    font-style: italic;
}

.black .hitty-editor-content blockquote,
html.black .hitty-editor-content blockquote,
body.black .hitty-editor-content blockquote {
    background: rgba(0, 177, 255, 0.12);
    color: #cbd5e1;
}

.hitty-editor-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 6px 0;
    display: inline-block;
}

.hitty-editor-content a {
    color: #00b1ff;
    text-decoration: underline;
}

/* Modal for Link / Image insertion */
.hitty-editor-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999999;
}

.hitty-editor-modal {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
    padding: 20px;
    box-sizing: border-box;
}

.black .hitty-editor-modal,
html.black .hitty-editor-modal,
body.black .hitty-editor-modal {
    background: #252525;
    color: #fff;
}

.hitty-editor-modal-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
}

.hitty-editor-modal-input {
    width: 100%;
    padding: 9px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    margin-bottom: 15px;
    box-sizing: border-box;
}

.black .hitty-editor-modal-input,
html.black .hitty-editor-modal-input,
body.black .hitty-editor-modal-input {
    background: #1e1e1e;
    border-color: #444;
    color: #fff;
}

.hitty-editor-modal-input:focus {
    border-color: #00b1ff;
}

.hitty-editor-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.hitty-editor-modal-btn {
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.hitty-editor-modal-btn-cancel {
    background: #e5e7eb;
    color: #374151;
}

.black .hitty-editor-modal-btn-cancel,
html.black .hitty-editor-modal-btn-cancel,
body.black .hitty-editor-modal-btn-cancel {
    background: #3a3a3a;
    color: #eee;
}

.hitty-editor-modal-btn-confirm {
    background: #00b1ff;
    color: #ffffff;
}

/* Fix double box in forum post write */
.forumPostWriteEditor {
    height: auto !important;
    background: transparent !important;
    border: none !important;
    overflow: visible !important;
}

.forumPostWriteBoxEditor .mytextarea {
    width: 100%;
}