/* PcRichTextEditor global styles - needed because JS-created elements
   are outside Blazor CSS isolation scope */

.pc-variable-dropdown-container {
    position: relative;
    float: right;
}

.pc-variable-btn {
    background-color: #d4a843 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 4px 12px !important;
    cursor: pointer;
    font-size: 12px !important;
    font-weight: 600;
    white-space: nowrap;
    height: 28px;
    width: auto !important;
}

.pc-variable-btn:hover {
    background-color: #c49a3a !important;
}

.pc-variable-menu {
    position: fixed;
    z-index: 10000;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 200px;
    max-height: 250px;
    overflow-y: auto;
}

.pc-variable-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
}

.pc-variable-menu-item:hover {
    background-color: #f0f0f0;
}

/* Ensure Quill editor formatting renders correctly (MudBlazor CSS can reset these) */
.ql-editor strong,
.ql-editor b {
    font-weight: 700 !important;
}

.ql-editor em,
.ql-editor i {
    font-style: italic !important;
}

.ql-editor u {
    text-decoration: underline !important;
}

/* Quill's snow.css uses ::before counters and sets list-style-type: none on every
   .ql-editor ol > li / ul > li (specificity 0,1,2). We restore native markers by
   re-asserting list-style-type on the li directly with !important — same selector
   target as snow.css so we win on cascade order without needing ::before content. */
.ql-editor ol,
.ql-editor ol > li {
    list-style-type: decimal !important;
}

.ql-editor ul,
.ql-editor ul > li {
    list-style-type: disc !important;
}

.ql-editor ol,
.ql-editor ul {
    padding-left: 24px !important;
}

.ql-editor li {
    display: list-item !important;
}

/* Suppress snow.css's ::before bullet/counter so we don't end up with double
   markers (one native + one pseudo-element). */
.ql-editor ol > li::before,
.ql-editor ul > li::before {
    content: none !important;
}

/* Image toolbar - floating controls for inline images */
.pc-image-toolbar {
    position: fixed;
    z-index: 10000;
    display: flex;
    gap: 8px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 6px 10px;
    align-items: center;
}

.pc-image-toolbar-group {
    display: flex;
    gap: 4px;
    align-items: center;
}

.pc-image-toolbar-label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    margin-right: 2px;
}

.pc-image-toolbar-btn {
    border: 1px solid #d0d0d0;
    background: #f5f5f5;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    color: #333;
    line-height: 1.2;
}

.pc-image-toolbar-btn:hover {
    background: #e8e8e8;
    border-color: #bbb;
}

.pc-image-toolbar-btn.active {
    background: #d4a843;
    color: #ffffff;
    border-color: #c49a3a;
}

/* ---- Custom tool popovers ---- */
.pc-custom-popover {
    position: fixed;
    z-index: 10000;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 12px;
    min-width: 280px;
}

.pc-custom-popover-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
}

.pc-custom-popover-label {
    font-size: 11px;
    font-weight: 600;
    color: #555;
    margin-bottom: 3px;
}

.pc-custom-popover-input,
.pc-custom-popover-select,
.pc-custom-popover-textarea {
    font-size: 13px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    padding: 5px 8px;
    outline: none;
    font-family: inherit;
    resize: vertical;
}

.pc-custom-popover-input:focus,
.pc-custom-popover-select:focus,
.pc-custom-popover-textarea:focus {
    border-color: #158ebe;
}

.pc-custom-popover-hint {
    font-size: 11px;
    color: #888;
    margin-bottom: 6px;
}

.pc-custom-popover-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.pc-custom-popover-save {
    background: #d4a843;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.pc-custom-popover-save:hover {
    background: #c49a3a;
}

.pc-custom-popover-delete {
    background: #f8c8c8;
    color: #e6575a;
    border: 1px solid #e6575a;
    border-radius: 4px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.pc-custom-popover-delete:hover {
    background: #f0b0b0;
}

/* ---- Editor preview: InfoCard ---- */
.ql-editor .pc-info-card {
    border-radius: 4px;
    padding: 10px 14px;
    margin: 8px 0;
    display: block;
    cursor: pointer;
}

.ql-editor .pc-info-card--information {
    background-color: #cceef3;
    color: #158ebe;
    border: 1px solid #158ebe;
}

.ql-editor .pc-info-card--warning {
    background-color: #ffefbf;
    color: #bb8838;
    border: 1px solid #bb8838;
}

.ql-editor .pc-info-card--danger {
    background-color: #f8c8c8;
    color: #e6575a;
    border: 1px solid #e6575a;
}

.ql-editor .pc-info-card--success {
    background-color: #dbf1d7;
    color: #1e9b6e;
    border: 1px solid #1e9b6e;
}

.ql-editor .pc-info-card__title {
    display: block;
    font-weight: 700;
    margin-bottom: 4px;
}

.ql-editor .pc-info-card__body {
    font-size: 14px;
}

/* ---- Editor preview: CTA Button ---- */
.ql-editor .pc-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 6px 30px;
    background-color: var(--pc-secondary, #d4a843);
    color: #01211b;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    user-select: none;
}

/* ---- Editor preview: YouTube embed ---- */
.ql-editor .pc-youtube-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    margin: 8px 0;
    cursor: pointer;
    background: #000;
}

.ql-editor .pc-youtube-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    pointer-events: none;
}

.pc-variable-chip {
    display: inline-block;
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #d4a843;
    border-radius: 12px;
    padding: 1px 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: default;
    user-select: none;
    vertical-align: baseline;
    line-height: 1.4;
}
