﻿/* RoosterJS Editor Styles */

.rooster-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    border: 1px solid var(--bs-border-color);
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    background-color: var(--bs-tertiary-bg);
}

.rooster-toolbar-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 4px 8px;
    border: 1px solid transparent;
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    color: var(--bs-body-color);
    transition: background-color 0.15s ease, border-color 0.15s ease;
    position: relative;
}

.rooster-toolbar-button:hover {
    background-color: var(--bs-secondary-bg);
    border-color: var(--bs-border-color);
}

.rooster-toolbar-button:active {
    background-color: var(--bs-secondary-bg);
}

.rooster-toolbar-button-active {
    background-color: var(--bs-secondary-bg);
    border-color: var(--bs-border-color);
}

.rooster-toolbar-button-active:hover {
    background-color: var(--bs-tertiary-bg);
}

/* Toolbar separator */
.rooster-toolbar-separator {
    width: 1px;
    height: 24px;
    background-color: var(--bs-border-color);
    margin: 0 4px;
}

/* Color indicator bar under font/highlight icons */
.rooster-color-indicator {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 3px;
    border-radius: 1px;
}

/* Color picker wrapper */
.rooster-toolbar-color-wrapper,
.rooster-toolbar-dropdown-wrapper {
    position: relative;
    display: inline-flex;
}

/* Color palette popup */
.rooster-color-palette {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1060;
    width: 220px;
    padding: 6px;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    flex-wrap: wrap;
    gap: 2px;
}

.rooster-color-palette.rooster-palette-open {
    display: flex;
}

.rooster-color-swatch {
    width: 20px;
    height: 20px;
    border: 1px solid var(--bs-border-color);
    border-radius: 2px;
    cursor: pointer;
    padding: 0;
    transition: transform 0.1s ease, border-color 0.1s ease;
}

.rooster-color-swatch:hover {
    transform: scale(1.2);
    border-color: #666;
    z-index: 1;
}

/* Heading dropdown */
.rooster-heading-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1060;
    min-width: 180px;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 4px 0;
}

.rooster-heading-dropdown.rooster-dropdown-open {
    display: block;
}

.rooster-heading-option {
    display: block;
    width: 100%;
    padding: 4px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    color: var(--bs-body-color);
}

.rooster-heading-option:hover {
    background-color: var(--bs-tertiary-bg);
}

.rooster-heading-option h1,
.rooster-heading-option h2,
.rooster-heading-option h3,
.rooster-heading-option h4,
.rooster-heading-option h5,
.rooster-heading-option h6,
.rooster-heading-option div {
    margin: 0;
    padding: 0;
    font-weight: inherit;
}

.rooster-heading-option h1 { font-size: 1.6em; font-weight: bold; }
.rooster-heading-option h2 { font-size: 1.4em; font-weight: bold; }
.rooster-heading-option h3 { font-size: 1.2em; font-weight: bold; }
.rooster-heading-option h4 { font-size: 1.1em; font-weight: bold; }
.rooster-heading-option h5 { font-size: 1em; font-weight: bold; }
.rooster-heading-option h6 { font-size: 0.9em; font-weight: bold; }
.rooster-heading-option div { font-size: 1em; }

/* Editor content area */
.editor-content {
    border: 1px solid var(--bs-border-color);
    border-radius: 0 0 4px 4px;
    padding: 10px 12px;
    min-height: 150px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--bs-body-color);
    background-color: var(--bs-body-bg);
    overflow-y: auto;
}

.editor-content:focus {
    outline: none;
}

/* Read-only editor — no toolbar, so add top border radius */
.editor-content[contenteditable="false"] {
    border-radius: 4px;
    background-color: var(--bs-secondary-bg);
    cursor: default;
}

/* Placeholder styling */
.editor-content.rooster-empty::before {
    content: attr(data-placeholder);
    color: var(--bs-secondary-color);
    pointer-events: none;
    position: absolute;
}

.editor-content {
    position: relative;
}

/* Basic content styling inside the editor */
.editor-content a {
    color: var(--bs-link-color);
    text-decoration: underline;
}

.editor-content img {
    max-width: 100%;
    height: auto;
}

.editor-content ul,
.editor-content ol {
    padding-left: 24px;
    margin: 8px 0;
}

/* Ordered list nesting: 1. → a. → i. → 1. → ... (matches Azure DevOps) */
.editor-content ol {
    list-style-type: decimal;
}

.editor-content ol ol {
    list-style-type: lower-alpha;
}

.editor-content ol ol ol {
    list-style-type: lower-roman;
}

.editor-content ol ol ol ol {
    list-style-type: decimal;
}

.editor-content ol ol ol ol ol {
    list-style-type: lower-alpha;
}

.editor-content ol ol ol ol ol ol {
    list-style-type: lower-roman;
}

/* Unordered list nesting: disc → circle → square → disc → ... (matches Azure DevOps) */
.editor-content ul {
    list-style-type: disc;
}

.editor-content ul ul {
    list-style-type: circle;
}

.editor-content ul ul ul {
    list-style-type: square;
}

.editor-content ul ul ul ul {
    list-style-type: disc;
}

.editor-content ul ul ul ul ul {
    list-style-type: circle;
}

.editor-content ul ul ul ul ul ul {
    list-style-type: square;
}

/* Nested sub-lists within LIs should not have extra top/bottom margin */
.editor-content li > ul,
.editor-content li > ol {
    margin: 0;
}

.editor-content li {
    margin: 2px 0;
}

/* Strip background colors from pasted content (e.g. from Azure DevOps) */
.editor-content *,
.comment-body * {
    background-color: transparent !important;
}

/* --- Global nested list styles for read-only / comment rendering --- */
.comment-body ol { list-style-type: decimal; }
.comment-body ol ol { list-style-type: lower-alpha; }
.comment-body ol ol ol { list-style-type: lower-roman; }
.comment-body ul { list-style-type: disc; }
.comment-body ul ul { list-style-type: circle; }
.comment-body ul ul ul { list-style-type: square; }
