/**
 * Stats Editor - Simplified & Modern Design
 * Clean, fast, intuitive
 */

/* ============================================
   Base Container
   ============================================ */
.stats-editor.simplified {
    background: var(--bg-primary, #0f0f17);
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

/* ============================================
   Header
   ============================================ */
.se-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--bg-secondary, #1a1a25);
    border-bottom: 1px solid var(--border-color, #2a2a3a);
    gap: 16px;
    flex-wrap: wrap;
}

.se-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.se-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.se-title-group h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary, #fff);
}

.se-id {
    font-size: 0.8rem;
    color: var(--text-muted, #666);
    font-family: 'Fira Code', monospace;
}

.se-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ============================================
   Buttons
   ============================================ */
.se-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
}

.se-btn i { font-size: 0.85em; }

.se-btn-primary {
    background: linear-gradient(135deg, #7c3aed, #6366f1);
    color: white;
}
.se-btn-primary:hover {
    background: linear-gradient(135deg, #8b5cf6, #818cf8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.se-btn-back {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary, #252530);
    color: var(--text-secondary, #aaa);
    border-radius: 10px;
    margin-right: 8px;
}
.se-btn-back:hover {
    background: var(--bg-hover, rgba(255,255,255,0.1));
    color: var(--text-primary, #fff);
}
.se-btn-back i {
    font-size: 1rem;
}

.se-btn-outline {
    background: transparent;
    border: 1px solid var(--border-color, #333);
    color: var(--text-secondary, #aaa);
}
.se-btn-outline:hover {
    border-color: var(--accent-color, #7c3aed);
    color: var(--accent-color, #7c3aed);
}

.se-btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}
.se-btn-danger:hover {
    background: #ef4444;
    color: white;
}

.se-btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary, #252530);
    color: var(--text-secondary, #888);
    border-radius: 8px;
}
.se-btn-icon:hover {
    background: var(--accent-color, #7c3aed);
    color: white;
}

.se-btn-sm {
    padding: 8px 14px;
    font-size: 0.85rem;
    background: var(--bg-tertiary, #252530);
    color: var(--text-primary, #fff);
    border: 1px solid var(--border-color, #333);
    margin-top: 10px;
}
.se-btn-sm:hover {
    background: var(--accent-color, #7c3aed);
    border-color: var(--accent-color, #7c3aed);
    color: white;
    transform: translateY(-1px);
}
.se-btn-sm i {
    margin-right: 4px;
}

.se-btn-x {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: var(--text-muted, #666);
    cursor: pointer;
    border-radius: 6px;
    font-size: 1.2rem;
    line-height: 1;
}
.se-btn-x:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* ============================================
   Body
   ============================================ */
.se-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

/* ============================================
   Presets (Quick Start)
   ============================================ */
.se-presets {
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--bg-secondary, #1a1a25);
    border-radius: 12px;
    border: 1px solid var(--border-color, #2a2a3a);
}

.se-presets-label {
    font-size: 0.8rem;
    color: var(--text-muted, #666);
    margin-bottom: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.se-presets-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.se-preset {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-tertiary, #252530);
    border: 1px solid var(--border-color, #333);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text-primary, #e0e0e0);
}
.se-preset:hover {
    border-color: var(--accent-color, #7c3aed);
    background: rgba(124, 58, 237, 0.1);
    transform: translateY(-2px);
}

.se-preset-icon {
    font-size: 1.1rem;
}

.se-preset-name {
    font-size: 0.85rem;
    font-weight: 500;
}

/* ============================================
   Form
   ============================================ */
.se-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.se-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.se-row-main {
    background: var(--bg-secondary, #1a1a25);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color, #2a2a3a);
}

.se-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 140px;
}

.se-field-grow { flex: 1; }
.se-field-full { flex: 1 1 100%; }
.se-field-small { width: 100px; flex: none; }
.se-field-toggle { justify-content: flex-end; }

.se-field label {
    font-size: 0.8rem;
    color: var(--text-muted, #888);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.se-field label small {
    font-weight: 400;
    opacity: 0.7;
}

/* Help Tooltip Icon */
.se-help {
    color: var(--text-muted, #666);
    cursor: help;
    font-size: 0.85em;
    transition: color 0.15s;
}
.se-help:hover {
    color: var(--accent-color, #7c3aed);
}
.se-help i {
    font-size: 0.9em;
}

/* ============================================
   Inputs
   ============================================ */
.se-input {
    padding: 10px 14px;
    background: var(--bg-tertiary, #252530);
    border: 1px solid var(--border-color, #333);
    border-radius: 8px;
    color: var(--text-primary, #e0e0e0);
    font-size: 0.9rem;
    transition: all 0.15s;
}

.se-input:focus {
    outline: none;
    border-color: var(--accent-color, #7c3aed);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.se-input::placeholder {
    color: var(--text-muted, #555);
}

.se-input-lg {
    font-size: 1rem;
    padding: 12px 16px;
}

.se-input-mono {
    font-family: 'Fira Code', monospace;
}

.se-select {
    padding: 10px 14px;
    background: var(--bg-tertiary, #252530);
    border: 1px solid var(--border-color, #333);
    border-radius: 8px;
    color: var(--text-primary, #e0e0e0);
    font-size: 0.9rem;
    cursor: pointer;
}

.se-hint {
    font-size: 0.75rem;
    color: var(--text-muted, #666);
}

/* ============================================
   Toggle Switch
   ============================================ */
.se-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.se-toggle input { display: none; }

.se-toggle-slider {
    width: 40px;
    height: 22px;
    background: var(--bg-tertiary, #333);
    border-radius: 11px;
    position: relative;
    transition: all 0.2s;
}

.se-toggle-slider::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: #666;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: all 0.2s;
}

.se-toggle input:checked + .se-toggle-slider {
    background: var(--accent-color, #7c3aed);
}

.se-toggle input:checked + .se-toggle-slider::after {
    transform: translateX(18px);
    background: white;
}

.se-toggle-label {
    font-size: 0.85rem;
    color: var(--text-secondary, #aaa);
}

/* ============================================
   Type Buttons
   ============================================ */
.se-type-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.se-type-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--bg-tertiary, #252530);
    border: 2px solid var(--border-color, #333);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text-primary, #e0e0e0);
}

.se-type-btn:hover {
    border-color: var(--text-muted, #555);
    transform: translateY(-1px);
}

.se-type-btn.active {
    border-color: var(--accent-color, #7c3aed);
    background: rgba(124, 58, 237, 0.15);
}

.se-type-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.se-type-name {
    font-weight: 500;
    font-size: 0.9rem;
}

/* ============================================
   Chips (Triggers)
   ============================================ */
.se-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.se-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-tertiary, #252530);
    border: 1px solid var(--border-color, #333);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.85rem;
    color: var(--text-secondary, #aaa);
}

.se-chip input { display: none; }

.se-chip:hover {
    border-color: var(--text-muted, #555);
}

.se-chip.active {
    background: rgba(124, 58, 237, 0.2);
    border-color: var(--accent-color, #7c3aed);
    color: var(--text-primary, #fff);
}

/* ============================================
   Button Group (Execution Point)
   ============================================ */
.se-btn-group {
    display: flex;
    gap: 0;
}

.se-btn-choice {
    flex: 1;
    padding: 10px 16px;
    background: var(--bg-tertiary, #252530);
    border: 1px solid var(--border-color, #333);
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--text-secondary, #aaa);
    font-size: 0.9rem;
    font-weight: 500;
}

.se-btn-choice:first-child {
    border-radius: 8px 0 0 8px;
}

.se-btn-choice:last-child {
    border-radius: 0 8px 8px 0;
    border-left: none;
}

.se-btn-choice small {
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.7;
}

.se-btn-choice:hover {
    background: var(--bg-secondary, #1e1e2e);
}

.se-btn-choice.active {
    background: rgba(124, 58, 237, 0.2);
    border-color: var(--accent-color, #7c3aed);
    color: var(--text-primary, #fff);
}

/* ============================================
   Formula Row
   ============================================ */
.se-formula-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.se-formula-row .se-input {
    flex: 1;
}

.se-formula-presets {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.se-formula-btn {
    padding: 8px 12px;
    background: var(--bg-tertiary, #252530);
    border: 1px solid var(--border-color, #333);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text-secondary, #aaa);
    transition: all 0.15s;
    white-space: nowrap;
}

.se-formula-btn:hover {
    border-color: var(--accent-color, #7c3aed);
    color: var(--accent-color, #7c3aed);
}

.se-formula-example {
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--bg-tertiary, #252530);
    border-radius: 6px;
    font-size: 0.8rem;
}

.se-formula-vars {
    color: var(--text-secondary, #888);
    font-style: italic;
}

.se-formula-example-calc {
    color: var(--text-primary, #eee);
}

.se-formula-example-calc strong {
    color: var(--success-color, #10b981);
}

.se-formula-reduction {
    color: var(--text-secondary, #888);
    font-size: 0.75rem;
}

/* ============================================
   Conditions & Skills Lists
   ============================================ */
.se-conditions,
.se-skills-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.se-condition-list,
.se-skills-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.se-condition-item,
.se-skill-item {
    display: flex;
    gap: 8px;
    align-items: center;
}

.se-condition-item .se-input,
.se-skill-item .se-input {
    flex: 1;
}

.se-condition-add {
    margin-top: 4px;
}

.se-condition-add .se-select {
    width: 100%;
    max-width: 300px;
}

/* ============================================
   Advanced Options (Collapsed)
   ============================================ */
.se-advanced {
    margin-top: 8px;
    background: var(--bg-secondary, #1a1a25);
    border-radius: 12px;
    border: 1px solid var(--border-color, #2a2a3a);
    overflow: hidden;
}

.se-advanced summary {
    padding: 14px 20px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted, #888);
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.se-advanced summary:hover {
    color: var(--text-secondary, #aaa);
}

.se-advanced summary::marker {
    display: none;
}

.se-advanced summary::-webkit-details-marker {
    display: none;
}

.se-advanced[open] summary {
    border-bottom: 1px solid var(--border-color, #2a2a3a);
}

.se-advanced-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ============================================
   Formatting Grid
   ============================================ */
.se-formatting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.se-format-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.se-format-label {
    width: 24px;
    height: 24px;
    background: var(--bg-tertiary, #333);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--text-muted, #666);
    flex-shrink: 0;
}

.se-format-item .se-input {
    flex: 1;
    font-size: 0.85rem;
    padding: 8px 12px;
}

/* ============================================
   File View (Stats List)
   ============================================ */
.stats-editor.file-view .se-body {
    padding: 20px 24px;
}

.se-search-bar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.se-search-bar .se-input {
    max-width: 400px;
}

.se-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.se-filter {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid var(--border-color, #333);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-muted, #888);
    transition: all 0.15s;
}

.se-filter:hover {
    border-color: var(--text-secondary, #666);
    color: var(--text-secondary, #aaa);
}

.se-filter.active {
    background: var(--accent-color, #7c3aed);
    border-color: var(--accent-color, #7c3aed);
    color: white;
}

/* ============================================
   Stats Grid (Cards)
   ============================================ */
.se-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.se-stat-card {
    background: var(--bg-secondary, #1a1a25);
    border-radius: 12px;
    border: 1px solid var(--border-color, #2a2a3a);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}

.se-stat-card:hover {
    border-color: var(--accent-color, #7c3aed);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.se-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-tertiary, #252530);
    border-bottom: 2px solid;
}

.se-card-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.se-card-type {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted, #888);
}

.se-card-disabled {
    margin-left: auto;
    font-size: 0.65rem;
    padding: 2px 6px;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border-radius: 4px;
    font-weight: 600;
}

.se-card-body {
    padding: 16px;
}

.se-card-body h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 6px 0;
    color: var(--text-primary, #fff);
}

.se-card-body code {
    font-size: 0.75rem;
    color: var(--text-muted, #666);
    font-family: 'Fira Code', monospace;
}

.se-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color, #2a2a3a);
    font-size: 0.8rem;
    color: var(--text-muted, #888);
}

.se-card-actions {
    display: flex;
    gap: 4px;
    position: relative;
    z-index: 100;
    pointer-events: auto !important;
}

.se-card-footer .se-btn-icon {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
    opacity: 1;
    transition: all 0.15s;
    border: none;
    background: transparent;
    color: var(--text-muted, #888);
    cursor: pointer !important;
    border-radius: 4px;
    position: relative;
    z-index: 101;
    pointer-events: auto !important;
}

.se-btn-edit,
.se-btn-delete {
    cursor: pointer !important;
    pointer-events: auto !important;
}

.se-card-footer .se-btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
}

.se-card-footer .se-btn-delete:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.se-card-footer .se-btn-edit:hover {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
}

.se-stat-card:hover .se-card-footer .se-btn-icon {
    opacity: 1;
}

/* ============================================
   Empty State
   ============================================ */
.se-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted, #666);
}

.se-empty i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.se-empty p {
    margin: 0;
    font-size: 1rem;
}

.se-empty-hint {
    font-size: 0.85rem;
    margin-top: 8px;
    opacity: 0.7;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .se-header {
        padding: 12px 16px;
    }

    .se-body {
        padding: 16px;
    }

    .se-row {
        flex-direction: column;
    }

    .se-field {
        width: 100%;
    }

    .se-field-small {
        width: 100%;
    }

    .se-type-buttons {
        flex-direction: column;
    }

    .se-type-btn {
        width: 100%;
    }

    .se-btn-group {
        flex-direction: column;
    }

    .se-btn-choice:first-child {
        border-radius: 8px 8px 0 0;
    }

    .se-btn-choice:last-child {
        border-radius: 0 0 8px 8px;
        border-left: 1px solid var(--border-color, #333);
        border-top: none;
    }

    .se-formula-row {
        flex-direction: column;
    }

    .se-stats-grid {
        grid-template-columns: 1fr;
    }

    .se-presets-grid {
        flex-direction: column;
    }

    .se-preset {
        width: 100%;
    }
}

/* ============================================
   Pack Tree - Stats.yml File Item
   Now inside pack folders per MythicMobs docs:
   /plugins/MythicMobs/Packs/YourPack/stats.yml
   ============================================ */
.file-item.root-file {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-item.root-file:hover {
    background: var(--bg-hover, rgba(255,255,255,0.05));
}

.file-item.root-file .stats-icon {
    color: #6366f1;
}

.file-item.root-file .file-name {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary, #fff);
}

.file-item.root-file .badge {
    background: var(--bg-tertiary, #2a2a3a);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    color: var(--text-muted, #888);
}

.file-item.root-file.advanced-only {
    position: relative;
}

.file-item.root-file.modified .file-name::after {
    content: ' •';
    color: #f59e0b;
}

/* Active state for stats.yml in pack tree */
.file-item.root-file.active,
.file-item.stats-file.active {
    background: rgba(99, 102, 241, 0.2) !important;
    border-left: 3px solid #6366f1;
    box-shadow: inset 0 0 12px rgba(99, 102, 241, 0.25);
}

.file-item.root-file.active .stats-icon,
.file-item.stats-file.active .stats-icon {
    color: #818cf8 !important;
    text-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
}

.file-item.root-file.active .file-name,
.file-item.stats-file.active .file-name {
    color: var(--text-primary, #fff) !important;
    font-weight: 600;
}

.file-item.root-file.active .badge,
.file-item.stats-file.active .badge {
    background: rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

/* ============================================
   Stats File Tree - Expandable Stats.yml
   ============================================ */

/* Stats container in pack tree */
.yaml-file-container.stats-container {
    margin-top: 8px;
}

.yaml-file-container.stats-container .yaml-file-header {
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.yaml-file-container.stats-container .yaml-file-header:hover {
    background: rgba(99, 102, 241, 0.1);
}

.yaml-file-container.stats-container .yaml-file-header.active {
    background: rgba(99, 102, 241, 0.15);
    border-left-color: #6366f1;
}

.yaml-file-container.stats-container .stats-icon {
    color: #6366f1;
}

/* Stat entry items */
.entry-item.stat-entry {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 28px;
    cursor: pointer;
    transition: background 0.15s;
    border-left: 2px solid transparent;
}

.entry-item.stat-entry:hover {
    background: rgba(99, 102, 241, 0.08);
}

.entry-item.stat-entry.active {
    background: rgba(99, 102, 241, 0.15);
    border-left-color: #6366f1;
}

.entry-item.stat-entry .stat-type-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
}

.entry-item.stat-entry .stat-display-name {
    font-size: 0.85rem;
    color: var(--text-primary, #fff);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entry-item.stat-entry .stat-internal-name {
    font-size: 0.7rem;
    font-family: 'Fira Code', monospace;
    color: var(--text-muted, #666);
    opacity: 0;
    transition: opacity 0.15s;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entry-item.stat-entry:hover .stat-internal-name {
    opacity: 1;
}

.entry-item.stat-entry .entry-status-dot {
    font-size: 0.6rem;
    margin-left: auto;
}

.entry-item.stat-entry .entry-status-dot.new {
    color: #10b981;
}

.entry-item.stat-entry .entry-status-dot.modified {
    color: #f59e0b;
}

.entry-item.stat-entry .favorite-star-btn {
    opacity: 0;
    transition: opacity 0.15s;
    padding: 2px 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted, #666);
}

.entry-item.stat-entry:hover .favorite-star-btn,
.entry-item.stat-entry .favorite-star-btn.favorited {
    opacity: 1;
}

.entry-item.stat-entry .favorite-star-btn.favorited {
    color: #fbbf24;
}

/* Empty stats hint */
.stats-entries .empty-entries-hint {
    padding: 12px 20px;
    color: var(--text-muted, #666);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-entries .empty-entries-hint i {
    color: #6366f1;
    opacity: 0.6;
}

/* ============================================
   Enhanced Stats Editor - New Elements
   ============================================ */

/* Label hints */
.se-label-hint {
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--text-muted, #888);
    margin-left: 4px;
}

/* Chips wrap for more triggers */
.se-chips-wrap {
    flex-wrap: wrap;
    gap: 6px;
}

/* Damage type row with dropdown */
.se-dmgtype-row {
    display: flex;
    gap: 8px;
}

.se-dmgtype-row .se-input {
    flex: 1;
}

.se-select-sm {
    padding: 6px 8px;
    font-size: 0.8rem;
    width: auto;
    min-width: 80px;
}

/* List editor (for ParentStats, TriggerStats) */
.se-list-editor {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.se-list-item {
    display: flex;
    gap: 8px;
    align-items: center;
}

.se-list-item .se-input {
    flex: 1;
}

.se-add-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.se-add-row .se-select {
    flex: 1;
}

/* Expanded formatting grid */
.se-formatting-expanded {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.se-formatting-expanded .se-format-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.se-formatting-expanded .se-format-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #888);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ShowInLore options */
.se-lore-options {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.se-toggle-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary, #aaa);
}

.se-toggle-inline input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #6366f1;
}

.se-toggle-inline span {
    user-select: none;
}

/* Reference sections */
.se-reference {
    margin-top: 16px;
    border: 1px solid var(--border-color, #2a2a3a);
    border-radius: 8px;
    overflow: hidden;
}

.se-reference summary {
    padding: 12px 16px;
    background: var(--bg-tertiary, #1e1e2e);
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary, #aaa);
}

.se-reference summary:hover {
    background: var(--bg-secondary, #252535);
    color: var(--text-primary, #fff);
}

.se-reference summary i {
    color: #6366f1;
}

.se-reference-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    padding: 12px;
    max-height: 250px;
    overflow-y: auto;
}

.se-ref-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg-secondary, #1a1a25);
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: default;
}

.se-ref-item:hover {
    background: var(--bg-tertiary, #252535);
}

.se-ref-icon {
    font-size: 1rem;
}

.se-ref-name {
    font-family: 'Fira Code', monospace;
    color: var(--text-secondary, #aaa);
}

.se-modifier-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.se-mod-item {
    padding: 10px 14px;
    background: var(--bg-secondary, #1a1a25);
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1.5;
    border-left: 3px solid #6366f1;
}

.se-mod-header {
    margin-bottom: 4px;
}

.se-mod-item strong {
    color: #6366f1;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
}

.se-mod-desc {
    color: var(--text-secondary, #aaa);
    margin-bottom: 6px;
}

.se-mod-example {
    margin-top: 4px;
}

.se-mod-item code {
    background: var(--bg-tertiary, #252535);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #a5b4fc;
    display: inline-block;
}

.se-mod-formula {
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary, #aaa);
    margin-top: 8px;
}

.se-mod-formula strong {
    color: var(--text-primary, #fff);
    display: block;
    margin-bottom: 8px;
}

.se-mod-calc {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
}

.se-mod-calc span {
    color: #a5b4fc;
}

.se-mod-calc strong {
    color: #10b981;
    display: inline;
    margin: 0;
}

.se-mod-formula > code {
    display: block;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    border-radius: 6px;
    color: #fcd34d;
    font-size: 0.8rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .se-formatting-expanded {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .se-reference-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .se-lore-options {
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .se-formatting-expanded {
        grid-template-columns: 1fr;
    }
    
    .se-dmgtype-row {
        flex-direction: column;
    }
    
    .se-add-row {
        flex-direction: column;
    }
}

