/* Numbered Paragraphs Plugin Styles */

/* Numbered paragraph container */
p[data-num] {
    display: flex !important;
    align-items: flex-start !important;
    margin: 0 !important;
    padding: 4px 0 !important;
    line-height: 1.5 !important;
    position: relative !important;
}

/* Remove margins from consecutive numbered paragraphs */
p[data-num] + p[data-num] {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Indentation is handled by JavaScript to avoid conflicts */

/* Number label styling */
p[data-num] .num-label {
    width: auto !important;
    min-width: 0 !important;
    text-align: left !important;
    margin-right: 0.4em !important;
    cursor: pointer !important;
    color: #3182ce !important;
    font-weight: 600 !important;
    user-select: none !important;
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
    flex-basis: auto !important;
    position: relative !important;
    transition: color 0.2s ease !important;
}

/* Clickable indicator - removed for cleaner appearance */
/* Clicking the number itself is the interaction method */
p[data-num] .num-label::after {
    display: none !important;
}

/* Hover effects */
p[data-num] .num-label:hover {
    color: #2c5aa0 !important;
}

/* Hover effect for ::after removed - indicator is hidden */

/* Text content styling */
/* Text content styling - use class selector to avoid matching num-label */
p[data-num] .mas-numbered-content {
    flex: 1 1 auto !important;
    outline: none !important;
    min-height: 1.5em !important;
}

/* Ensure num-label doesn't grow */
p[data-num] .num-label {
    flex: 0 0 auto !important;
}

/* Level controller styling */
.numbered-para-controller {
    position: absolute !important;
    background: white !important;
    border: 1px solid #ccc !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    padding: 0 !important;
    z-index: 10000 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    min-width: 280px !important;
    max-width: 320px !important;
    overflow: hidden !important;
    max-height: 400px !important;
    overflow-y: auto !important;
}

.numbered-para-controller button {
    padding: 6px 12px !important;
    border: none !important;
    border-bottom: 1px solid #e0e0e0 !important;
    background: white !important;
    cursor: pointer !important;
    border-radius: 0 !important;
    font-size: 12px !important;
    text-align: left !important;
    transition: background-color 0.2s !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.numbered-para-controller button.level-btn {
    font-size: 13px !important;
    padding: 8px 12px !important;
}

.numbered-para-controller button.format-btn {
    font-size: 11px !important;
    padding: 6px 12px !important;
    line-height: 1.3 !important;
}

.numbered-para-controller button:last-child {
    border-bottom: none !important;
}

.numbered-para-controller button:hover {
    background: #f5f5f5 !important;
}

.numbered-para-controller button:active {
    background: #e8e8e8 !important;
}

/* Dark mode support */
.dark-mode p[data-num] .num-label {
    color: #90cdf4 !important;
}

/* Dark mode ::after removed - indicator is hidden */

.dark-mode p[data-num] .num-label:hover {
    color: #63b3ed !important;
}

/* Dark mode hover ::after removed - indicator is hidden */

.dark-mode .numbered-para-controller {
    background: #2d3748 !important;
    border-color: #4a5568 !important;
}

.dark-mode .numbered-para-controller button {
    background: #2d3748 !important;
    border-bottom-color: #4a5568 !important;
    color: #f1f5f9 !important;
}

.dark-mode .numbered-para-controller button:hover {
    background: #4a5568 !important;
}

.dark-mode .numbered-para-controller button:active {
    background: #5a6570 !important;
}

/* Controller styling for numbered paragraphs */
.se-controller-numbered-para .se-btn {
    min-width: 40px !important;
    padding: 4px 8px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
}

/* Format menu styling */
.se-format-menu {
    background: white !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    z-index: 10000 !important;
    overflow: hidden !important;
}

.se-format-menu-item {
    display: block !important;
    width: 100% !important;
    padding: 8px 12px !important;
    border: none !important;
    background: white !important;
    text-align: left !important;
    cursor: pointer !important;
    font-size: 12px !important;
    border-bottom: 1px solid #eee !important;
    transition: background-color 0.2s !important;
}

.se-format-menu-item:last-child {
    border-bottom: none !important;
}

.se-format-menu-item:hover {
    background: #f5f5f5 !important;
}

/* Dark mode support for new elements */
.dark-mode .se-format-menu {
    background: #2d3748 !important;
    border-color: #4a5568 !important;
}

.dark-mode .se-format-menu-item {
    background: #2d3748 !important;
    color: #f1f5f9 !important;
    border-bottom-color: #4a5568 !important;
}

.dark-mode .se-format-menu-item:hover {
    background: #4a5568 !important;
}

/* Auto-detect controller styling */
.numbered-para-auto-detect-controller {
    background: white !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    padding: 0 !important;
    z-index: 999999 !important;
    display: block !important;
    font-size: 12px !important;
    min-width: 180px !important;
    overflow: hidden !important;
}

.se-btn-auto-detect {
    display: block !important;
    width: 100% !important;
    padding: 8px 12px !important;
    border: none !important;
    background: white !important;
    text-align: left !important;
    cursor: pointer !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    transition: background-color 0.2s !important;
}

.se-btn-auto-detect:hover {
    background: #f5f5f5 !important;
}

.se-btn-auto-detect:not(:last-child) {
    border-bottom: 1px solid #e0e0e0 !important;
}

/* Dark mode support for auto-detect controller */
.dark-mode .numbered-para-auto-detect-controller {
    background: #2d3748 !important;
    border-color: #4a5568 !important;
}

.dark-mode .se-btn-auto-detect {
    background: #2d3748 !important;
    color: #f1f5f9 !important;
}

.dark-mode .se-btn-auto-detect:hover {
    background: #4a5568 !important;
}

.dark-mode .se-btn-auto-detect:not(:last-child) {
    border-bottom-color: #4a5568 !important;
}