/* Detail View Styles (Characters, World, etc.) */


/* En-tête de groupe dans la sidebar */
.character-group-header {
    padding: 8px 15px;
    background-color: var(--bg-secondary);
    /* ou une couleur légèrement plus foncée */
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color);
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
}

.character-group-header:first-child {
    margin-top: 0;
    border-top: none;
}

.character-group-header .count {
    background: rgba(0, 0, 0, 0.2);
    padding: 1px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
}

.detail-view {
    padding: 2rem 3rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    height: 100vh;
    overflow-y: auto;
    box-sizing: border-box;
}

/* Character Sheet Styles */
.character-sheet {
    padding: 1.5rem;
    height: 100%;
    overflow-y: auto;
}

/* Grille des sections - 2 colonnes sur desktop */
.character-sections-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* Section qui prend toute la largeur */
.character-section.full-width {
    grid-column: 1 / -1;
}

/* Responsive: 3 colonnes sur très grand écran */
@media (min-width: 1600px) {
    .character-sections-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Responsive: 4 colonnes sur écran ultra-large */
@media (min-width: 2200px) {
    .character-sections-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.character-sheet-header {
    display: flex;
    gap: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    position: relative;
}

.character-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-red) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 3px solid var(--bg-primary);
    box-shadow: 0 4px 12px var(--shadow);
}

.character-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.character-avatar:hover::after {
    content: '📷';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.character-header-info {
    flex: 1;
}

.character-header-info h2 {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.character-header-info .character-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
    list-style: disc;
    margin-left: 1.2rem;
}

.character-header-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}

.character-role-stars {
    display: flex;
    gap: 0.25rem;
}

.character-role-stars .star {
    font-size: 1.3rem;
    cursor: pointer;
    color: #ddd;
    transition: color 0.2s;
}

.character-role-stars .star.filled {
    color: var(--primary-color);
}

.character-role-stars .star:hover {
    color: var(--primary-hover);
}

.btn-write-beside {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-write-beside:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.character-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
}

.character-close-btn:hover {
    color: var(--accent-red);
}

.character-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.character-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    cursor: pointer;
    user-select: none;
}

.character-section-header:hover {
    background: var(--bg-tertiary);
}

.character-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent-red);
}

.character-section-title::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-color);
}

.character-section-toggle {
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.character-section.collapsed .character-section-toggle {
    transform: rotate(-90deg);
}

.character-section.collapsed .character-section-content {
    display: none;
}

.character-section-content {
    padding: 1rem;
}

.character-field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.character-field-row:last-child {
    margin-bottom: 0;
}

.character-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.character-field-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent-red);
}

.character-field input,
.character-field textarea,
.character-field select {
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.character-field input:focus,
.character-field textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.character-field textarea {
    resize: vertical;
    min-height: 60px;
}

.character-radio-group {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0;
    flex-wrap: wrap;
}

/* Responsive: 1 colonne sur tablette/mobile */
@media (max-width: 900px) {
    .character-sections-grid {
        grid-template-columns: 1fr;
    }

    .character-section.full-width {
        grid-column: 1;
    }
}

.character-radio-group label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.character-radio-group input[type="radio"] {
    accent-color: var(--primary-color);
}

/* Système de traits de caractère */
.selected-traits-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.75rem;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    background: rgba(212, 175, 55, 0.05);
    min-height: 50px;
    align-items: flex-start;
}

.selected-trait {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    background: var(--primary-color);
    color: white;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.trait-remove {
    cursor: pointer;
    opacity: 0.7;
    font-size: 0.9rem;
    line-height: 1;
    margin-left: 0.2rem;
}

.trait-remove:hover {
    opacity: 1;
}

.no-traits {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.85rem;
}

.traits-categories {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Sections principales de traits */
.trait-section {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-primary);
}

.trait-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-gold) 100%);
    cursor: pointer;
    user-select: none;
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trait-section-header:hover {
    filter: brightness(1.1);
}

.trait-section-icon {
    font-size: 1.1rem;
    margin-right: 0.5rem;
}

.trait-section-toggle {
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.trait-section.collapsed .trait-section-toggle {
    transform: rotate(-90deg);
}

.trait-section.collapsed .trait-section-content {
    display: none;
}

.trait-section-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
}

.trait-category {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-primary);
}

.trait-category-header {
    display: flex;
    align-items: center;
    padding: 0.4rem 0.6rem;
    background: var(--bg-tertiary);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.trait-category-icon {
    font-size: 0.9rem;
    margin-right: 0.3rem;
}

.trait-category-content {
    padding: 0.4rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.trait-option {
    padding: 0.2rem 0.45rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text-secondary);
}

.trait-option:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.trait-option.selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Tags input */
.character-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-primary);
    min-height: 42px;
    align-items: center;
}

.character-tag {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    background: var(--bg-tertiary);
    border-radius: 12px;
    font-size: 0.85rem;
}

.character-tag-remove {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1;
}

.character-tag-remove:hover {
    color: var(--accent-red);
}

.character-tags-input {
    border: none !important;
    padding: 0.25rem !important;
    flex: 1;
    min-width: 120px;
    font-size: 0.9rem !important;
}

.character-tags-input:focus {
    outline: none;
}

/* Radar Chart */
.character-radar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
}

.character-radar-canvas {
    max-width: 350px;
    max-height: 350px;
}

.character-radar-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    width: 100%;
    max-width: 500px;
    margin-top: 1rem;
}

.radar-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.radar-control label {
    font-size: 0.85rem;
    min-width: 90px;
    color: var(--text-secondary);
}

.radar-control input[type="range"] {
    flex: 1;
    accent-color: var(--primary-color);
}

.radar-control .radar-value {
    font-size: 0.8rem;
    min-width: 24px;
    text-align: right;
    color: var(--text-muted);
}

/* Wealth slider */
.wealth-slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.wealth-slider {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, var(--bg-tertiary), var(--primary-color));
    border-radius: 4px;
    outline: none;
}

.wealth-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Character Evolution Timeline */
.character-evolution-timeline {
    margin-top: 2rem;
}

.evolution-periods-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.evolution-period-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    padding-bottom: 2rem;
}

/* Vertical line connecting stages */
.evolution-period-column::after {
    content: '';
    position: absolute;
    left: 17px;
    top: 40px;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-color) 0%, transparent 100%);
    opacity: 0.3;
    z-index: 0;
}

.period-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    color: var(--accent-red);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    background: rgba(212, 175, 55, 0.05);
    border-radius: 8px;
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.period-header i {
    width: 16px;
    height: 16px;
}

.btn-add-evolution {
    margin-left: auto;
    background: var(--primary-color);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-add-evolution:hover {
    transform: scale(1.1) rotate(90deg);
    background: var(--accent-gold);
}

.period-stages {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.evolution-stage-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.evolution-stage-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    background: var(--bg-tertiary);
}

.evolution-stage-card.is-initial {
    border-left: 4px solid var(--primary-color);
}

.stage-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.scene-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.scene-icon {
    color: var(--text-muted);
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

.scene-select-mini {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    width: 100%;
    cursor: pointer;
    outline: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.scene-select-mini option {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.btn-delete-stage {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 2px;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s;
}

.btn-delete-stage:hover {
    color: var(--accent-red);
    opacity: 1;
    transform: scale(1.1);
}

.initial-badge {
    font-size: 0.6rem;
    text-transform: uppercase;
    color: var(--primary-color);
    font-weight: 800;
    background: rgba(212, 175, 55, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.stage-textarea {
    width: 100%;
    min-height: 80px;
    background: transparent;
    border: none;
    resize: vertical;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
    font-family: inherit;
    padding: 0;
}

.stage-textarea:focus {
    outline: none;
}

/* Glassmorphism effect for stage cards */
[data-theme="dark"] .evolution-stage-card {
    background: rgba(45, 45, 60, 0.6);
    backdrop-filter: blur(8px);
    border-color: rgba(212, 175, 55, 0.1);
}

[data-theme="dark"] .evolution-stage-card:hover {
    background: rgba(55, 55, 75, 0.8);
    border-color: rgba(212, 175, 55, 0.3);
}

/* Responsive evolution container */
@media (max-width: 1200px) {
    .evolution-periods-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .evolution-period-column::after {
        display: none;
    }
}

/* Inventory items */
.inventory-item {
    background: var(--bg-secondary);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
    position: relative;
}

.inventory-item-delete {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1rem;
}

.inventory-item-delete:hover {
    color: var(--accent-red);
}

.inventory-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px dashed var(--border-color);
    border-radius: 20px;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: all 0.2s;
    margin-top: 1rem;
}

.inventory-add-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Side-by-side mode */
.editor-split-mode {
    display: flex;
    height: 100%;
}

.editor-split-mode .editor-main {
    flex: 1;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
}

.editor-split-mode .character-sheet-panel {
    width: 450px;
    overflow-y: auto;
    background: var(--bg-primary);
}

.character-sheet-panel .character-sheet {
    padding: 1rem;
}

.character-sheet-panel .character-sheet-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}

.character-sheet-panel .character-avatar {
    width: 80px;
    height: 80px;
    font-size: 2rem;
}

.character-sheet-panel .character-header-info h2 {
    font-size: 1.3rem;
}

/* ==========================================
           SPLIT VIEW SYSTEM
           ========================================== */

.split-view-container {
    display: flex;
    height: 100%;
    width: 100%;
    position: relative;
}

.split-view-container.vertical {
    flex-direction: column;
}

.split-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 250px;
    min-height: 200px;
}

.split-panel-left {
    flex: 6;
}

.split-panel-right {
    flex: 4;
}

.split-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    min-height: 40px;
}

.split-panel-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.split-panel-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.split-panel-btn {
    background: none;
    border: none;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 4px;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.split-panel-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.split-panel-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Active panel indicator */
.split-panel.active {
    box-shadow: inset 0 0 0 2px var(--primary-color);
}

.split-panel.active .split-panel-header {
    background: var(--primary-color);
    color: white;
}

.split-panel.active .split-panel-header .split-panel-title {
    color: white;
}

.split-panel.active .split-panel-btn {
    color: rgba(255, 255, 255, 0.8);
}

.split-panel.active .split-panel-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.split-panel-indicator {
    font-size: 8px;
    color: var(--text-muted);
    opacity: 0.3;
}

.split-panel-indicator.active {
    color: white;
    opacity: 1;
}

.split-panel-header {
    cursor: pointer;
    transition: background 0.2s;
}

.split-panel-header:hover {
    background: var(--bg-tertiary);
}

.split-panel.active .split-panel-header:hover {
    background: var(--primary-color-dark, var(--primary-color));
    filter: brightness(0.9);
}

/* View option in selector */
.split-view-option:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* Resizer */
.split-resizer {
    flex-shrink: 0;
    background: var(--border-color);
    transition: background 0.2s;
    position: relative;
}

.split-resizer:hover,
.split-resizer.dragging {
    background: var(--primary-color);
}

.split-resizer.horizontal {
    width: 5px;
    cursor: col-resize;
}

.split-resizer.vertical {
    height: 5px;
    cursor: row-resize;
}

.split-resizer::after {
    content: '';
    position: absolute;
    background: var(--text-muted);
    border-radius: 2px;
    opacity: 0.5;
}

.split-resizer.horizontal::after {
    width: 3px;
    height: 30px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.split-resizer.vertical::after {
    width: 30px;
    height: 3px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Split View Selector Dropdown */
.split-selector {
    position: relative;
}

.split-selector-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.split-selector-btn:hover {
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.split-selector-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    min-width: 200px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px var(--shadow);
    z-index: 100;
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.split-selector-dropdown.open {
    display: block;
}

.split-selector-group {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.split-selector-group:last-child {
    border-bottom: none;
}

.split-selector-group-title {
    padding: 0.25rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.split-selector-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.15s;
}

.split-selector-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.split-selector-item.active {
    background: var(--bg-tertiary);
    color: var(--primary-color);
    font-weight: 500;
}

/* Split Mode Toggle Button in Header */
.split-mode-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.split-mode-toggle:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.split-mode-toggle.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Responsive */
@media (max-width: 900px) {
    .split-view-container {
        flex-direction: column !important;
    }

    .split-resizer.horizontal {
        width: 100%;
        height: 5px;
        cursor: row-resize;
    }

    .split-resizer.horizontal::after {
        width: 30px;
        height: 3px;
    }

    .split-panel {
        min-width: unset;
        min-height: 150px;
    }

    .split-panel-left,
    .split-panel-right {
        flex: 1;
    }
}

/* Character sheet adjustments in split view */
.split-panel .character-sheet {
    padding: 1rem;
    height: auto;
}

.split-panel .character-sheet-header {
    padding: 1rem;
}

.split-panel .character-avatar {
    width: 80px;
    height: 80px;
    font-size: 2rem;
}

@media (max-width: 900px) {
    .character-sheet {
        padding: 1rem;
    }

    .character-sheet-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .character-header-actions {
        align-items: center;
    }

    .character-field-row {
        grid-template-columns: 1fr;
    }

    .character-timeline {
        grid-template-columns: 1fr;
    }

    .character-radar-controls {
        grid-template-columns: 1fr;
    }
}

.detail-header {
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 4px;
    margin-bottom: 2rem;
    border-left: 4px solid var(--accent-red);
}

.detail-title {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-family: 'Noto Serif JP', serif;
}

.detail-section {
    background: var(--bg-secondary);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.detail-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.detail-field {
    margin-bottom: 1.25rem;
}

.detail-field:last-child {
    margin-bottom: 0;
}

.detail-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.modal-button-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.modal-button-group .btn {
    flex: 1;
    min-width: 180px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 6px;
    border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Better scrollbar for editor workspace */
.editor-workspace::-webkit-scrollbar-thumb {
    background: var(--accent-gold);
    border: 2px solid var(--bg-primary);
}

.editor-workspace::-webkit-scrollbar-thumb:hover {
    background: var(--accent-red);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chapter-group {
    animation: fadeIn 0.3s ease forwards;
}

/* ==========================================
           AMÉLIORATIONS VISUELLES - OPT 1
           ========================================== */

/* Badge de statut amélioré */
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.2rem;
    flex-shrink: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.status-badge:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.status-draft {
    background-color: var(--status-draft-color) !important;
}

.status-draft::after {
    content: "";
}

.status-progress {
    background-color: var(--status-progress-color) !important;
}

.status-progress::after {
    content: "";
}

.status-complete {
    background-color: var(--status-complete-color) !important;
}

.status-complete::after {
    content: "\2713";
    color: var(--bg-primary);
    font-size: 7px;
    font-weight: 900;
    line-height: 1;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-review {
    background-color: var(--status-review-color) !important;
}

.status-review::after {
    content: "";
}

/* Menu contextuel de statut */
.status-menu {
    position: fixed;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    min-width: 140px;
    padding: 0.5rem 0;
    display: none;
}

.status-menu.visible {
    display: block;
}

.status-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: background 0.2s;
}

.status-menu-item:hover {
    background: var(--bg-secondary);
}

.status-menu-item.active {
    background: var(--bg-tertiary);
    font-weight: 600;
}

.status-menu-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
}

.status-menu-dot.draft {
    background: var(--status-draft-color);
}

.status-menu-dot.progress {
    background: var(--status-progress-color);
}

.status-menu-dot.complete {
    background: var(--status-complete-color);
}

.status-menu-dot.review {
    background: var(--status-review-color);
}

/* Barre de progression globale */
.project-progress-bar {
    padding: 0.15rem 0.75rem;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.15rem;
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.progress-track {
    height: 3px;
    background: var(--bg-tertiary);
    border-radius: 1.5px;
    overflow: hidden;
    display: flex;
}

.progress-segment {
    height: 100%;
    transition: width 0.3s ease;
}

.progress-segment.complete {
    background: var(--status-complete-color);
}

.progress-segment.review {
    background: var(--status-review-color);
}

.progress-segment.progress {
    background: var(--status-progress-color);
}

.progress-segment.draft {
    background: var(--status-draft-color);
}

/* Filtres de statut */
.status-filters {
    display: flex;
    padding: 0.2rem 0.75rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.status-filter-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.15rem 0;
    border: 1px solid var(--border-color);
    border-right: none;
    background: var(--bg-primary);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
}

.status-filter-btn:first-child {
    border-radius: 4px 0 0 4px;
}

.status-filter-btn:last-child {
    border-radius: 0 4px 4px 0;
    border-right: 1px solid var(--border-color);
}

.status-filter-btn [data-i18n] {
    display: none;
}

.status-filter-btn:hover {
    border-color: var(--text-muted);
}

.status-filter-btn.active {
    border-color: currentColor;
    font-weight: 600;
}

.status-filter-btn.draft.active {
    background: rgba(255, 107, 107, 0.1);
    color: #e55a5a;
    border-color: rgba(255, 107, 107, 0.3);
    border-right-color: var(--border-color);
}

.status-filter-btn.progress.active {
    background: rgba(255, 217, 61, 0.1);
    color: #c9a82e;
    border-color: rgba(255, 217, 61, 0.3);
    border-right-color: var(--border-color);
}

.status-filter-btn.complete.active {
    background: rgba(81, 207, 102, 0.1);
    color: #3db854;
    border-color: rgba(81, 207, 102, 0.3);
    border-right-color: var(--border-color);
}

.status-filter-btn.review.active {
    background: rgba(74, 158, 255, 0.1);
    color: #3a8ae6;
    border-color: rgba(74, 158, 255, 0.3);
    border-right-color: var(--border-color);
}

.status-filter-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    position: relative;
}

.status-filter-dot.draft {
    background: var(--status-draft-color);
}

.status-filter-dot.progress {
    background: var(--status-progress-color);
}

.status-filter-dot.complete {
    background: var(--status-complete-color);
}

.status-filter-dot.review {
    background: var(--status-review-color);
}

.status-filter-count {
    font-weight: 600;
}

/* Scènes filtrées (cachées) */
.scene-item.filtered-out {
    display: none !important;
}

.chapter-group.filtered-out {
    display: none !important;
}

.act-group.filtered-out {
    display: none !important;
}

/* Compteur de mots */
.word-count-badge {
    font-size: 0.6rem;
    color: var(--text-muted);
    font-family: 'Source Code Pro', monospace;
    padding: 0.05rem 0.25rem;
    background: transparent;
    border-radius: 2px;
    white-space: nowrap;
    font-weight: 600;
    margin-left: auto;
    opacity: 0.6;
}

/* Numérotation automatique */
.auto-number {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
    font-weight: 700;
    min-width: 28px;
    text-align: right;
    margin-right: 0.2rem;
    flex-shrink: 0;
}

.delete-btn {
    opacity: 0;
    margin-left: auto;
    transition: opacity 0.2s ease;
    padding: 0 0.2rem !important;
    min-width: auto !important;
    width: 18px !important;
    height: 18px !important;
    font-size: 0.8rem !important;
}

.act-header:hover .delete-btn,
.chapter-header:hover .delete-btn,
.scene-item:hover .delete-btn {
    opacity: 1;
}

.scene-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Drag and Drop */
.draggable {
    cursor: move;
}

.draggable:active {
    cursor: grabbing;
}

.drag-over {
    background: rgba(212, 175, 55, 0.2);
    border-left: 3px solid var(--accent-gold);
}

.dragging {
    opacity: 0.5;
    background: var(--bg-accent);
    color: var(--bg-primary);
}

.drag-handle {
    cursor: grab;
    padding: 0 0.2rem;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chapter-header:hover .drag-handle,
.scene-item:hover .drag-handle,
.act-header:hover .drag-handle {
    opacity: 1;
}

.drag-handle:active {
    cursor: grabbing;
}

/* Inline Editing */
.editing-input {
    background: var(--bg-primary);
    border: 2px solid var(--accent-gold);
    padding: 0.15rem 0.3rem;
    font-family: 'Crimson Pro', serif;
    font-size: inherit;
    font-weight: inherit;
    color: var(--text-primary);
    border-radius: 2px;
    outline: none;
    width: 100%;
}

.chapter-title,
.scene-item>div>span:not(.drag-handle) {
    cursor: text;
}

.chapter-title:hover,
.scene-item>div>span:not(.drag-handle):hover {
    background: rgba(212, 175, 55, 0.1);
    padding: 0.15rem 0.3rem;
    margin: -0.15rem -0.3rem;
    border-radius: 2px;
}

.edit-hint {
    font-size: 0.6rem;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.2s ease;
    font-style: italic;
    margin-left: 0.25rem;
}

.chapter-header:hover .edit-hint,
.scene-item:hover .edit-hint {
    opacity: 1;
}

/* Rich Text Editor Toolbar - defined above in main structure */

.toolbar-group {
    display: flex;
    gap: 4px;
    padding-right: 12px;
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
}

.toolbar-group:last-child {
    border-right: none;
}

.toolbar-btn {
    padding: 0;
    min-width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    font-family: 'Crimson Pro', serif;
    font-size: 16px;
    font-weight: 400;
    transition: all 0.15s ease;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toolbar-btn:hover {
    background: var(--bg-secondary);
}

.toolbar-btn.active {
    background: var(--primary-color);
    color: white;
}

.toolbar-btn[data-format="bold"] {
    font-weight: 700;
}

.toolbar-btn[data-format="italic"] {
    font-style: italic;
}

.toolbar-btn[data-format="underline"] {
    text-decoration: underline;
}

/* Bouton annotations avec badge */
.annotations-toolbar-btn {
    position: relative;
}

.annotations-toolbar-btn.has-annotations::after {
    content: attr(data-count);
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--accent-red);
    color: white;
    font-size: 10px;
    font-weight: 600;
    min-width: 14px;
    height: 14px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
}

.annotations-toolbar-btn.panel-open {
    background: var(--primary-color);
    color: white;
}

/* Select dans le toolbar */
select.toolbar-btn {
    min-width: 100px;
    padding: 0 32px 0 12px;
    font-size: 14px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23666' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-color: transparent;
}

select.toolbar-btn:hover {
    background-color: var(--bg-secondary);
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23666' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* Color Picker Dropdown */
.color-picker-wrapper {
    position: relative;
    display: inline-block;
}


/* Font Size Selector */
.font-size-selector {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    font-family: 'Crimson Pro', serif;
    font-size: 0.9rem;
    border-radius: 2px;
    min-width: 70px;
}

.font-size-selector:hover {
    background: var(--accent-gold);
    color: var(--bg-primary);
    border-color: var(--accent-gold);
}

/* Font Family Selector */
.font-family-selector {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.9rem;
    border-radius: 2px;
    min-width: 150px;
}

.font-family-selector:hover {
    background: var(--accent-gold);
    color: var(--bg-primary);
    border-color: var(--accent-gold);
}

/* Toolbar separator */
.toolbar-separator {
    width: 1px;
    height: 30px;
    background: var(--border-color);
    margin: 0 0.25rem;
}

/* Rich Text Editor Content */
.editor-textarea[contenteditable="true"] {
    outline: none;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.editor-textarea[contenteditable="true"]:empty:before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    font-style: italic;
    pointer-events: none;
}

.editor-textarea strong,
.editor-textarea b {
    font-weight: 700;
}

.editor-textarea em,
.editor-textarea i {
    font-style: italic;
}

.editor-textarea u {
    text-decoration: underline;
}

.editor-textarea h1 {
    font-size: 2em;
    font-weight: 700;
    margin: 1em 0 0.5em;
    font-family: 'Noto Serif JP', serif;
}

.editor-textarea h2 {
    font-size: 1.5em;
    font-weight: 600;
    margin: 1em 0 0.5em;
    font-family: 'Noto Serif JP', serif;
}

.editor-textarea h3 {
    font-size: 1.25em;
    font-weight: 600;
    margin: 1em 0 0.5em;
}

.editor-textarea blockquote {
    border-left: 4px solid var(--accent-gold);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--text-secondary);
}

.editor-textarea ul,
.editor-textarea ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.editor-textarea li {
    margin: 0.5rem 0;
}

.editor-textarea hr {
    border: none;
    border-top: 2px solid var(--border-color);
    margin: 2rem 0;
}

/* Text alignment */
.editor-textarea [style*="text-align: left"] {
    text-align: left;
}

.editor-textarea [style*="text-align: center"] {
    text-align: center;
}

.editor-textarea [style*="text-align: right"] {
    text-align: right;
}

.editor-textarea [style*="text-align: justify"] {
    text-align: justify;
}

/* Strikethrough */
.editor-textarea s,
.editor-textarea strike {
    text-decoration: line-through;
}

/* Superscript and subscript */
.editor-textarea sup {
    vertical-align: super;
    font-size: 0.75em;
}

.editor-textarea sub {
    vertical-align: sub;
    font-size: 0.75em;
}

/* Timeline Styles */
.timeline-container {
    position: relative;
    padding: 1rem 0 1rem 2.5rem;
}

.timeline-line {
    position: absolute;
    left: 0.75rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-event {
    position: relative;
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timeline-event::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 1rem;
    width: 10px;
    height: 10px;
    background: var(--accent-red);
    border: 2px solid var(--bg-primary);
    border-radius: 50%;
    z-index: 2;
}

.timeline-event:hover {
    border-color: var(--accent-gold);
    box-shadow: 0 2px 8px var(--shadow);
}

.timeline-event.active {
    border-color: var(--accent-red);
    background: var(--bg-secondary);
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--accent-gold);
    font-weight: 600;
    margin-bottom: 0.4rem;
    font-family: 'Source Code Pro', monospace;
}

.timeline-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.timeline-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
}

.timeline-meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.timeline-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Notes Styles */
.note-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.note-card:hover {
    border-color: var(--accent-gold);
    box-shadow: 0 2px 8px var(--shadow);
}

.note-card.active {
    border-color: var(--accent-red);
    background: var(--bg-secondary);
}

.note-category-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    background: var(--accent-gold);
    color: var(--bg-primary);
    border-radius: 2px;
    margin-bottom: 0.5rem;
    font-family: 'Source Code Pro', monospace;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.note-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.note-preview {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.note-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.note-tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    color: var(--text-muted);
}

.note-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    font-family: 'Source Code Pro', monospace;
}

/* Note Medias */
.note-medias-container {
    margin-top: 0.5rem;
}

.note-medias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.note-media-item {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-secondary);
    transition: all 0.2s;
}

.note-media-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.note-media-image {
    cursor: pointer;
}

.note-media-image img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.note-media-overlay {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.note-media-title {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.note-media-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.note-media-delete:hover {
    background: var(--accent-red);
    color: white;
}

.note-media-url {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    cursor: pointer;
}

.note-media-url-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.note-media-url-info {
    flex: 1;
    min-width: 0;
}

.note-media-domain {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.note-media-audio {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
}

.note-media-audio-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.note-media-audio-info {
    flex: 1;
    min-width: 0;
}

.note-media-youtube {
    cursor: pointer;
}

.note-media-youtube-thumb {
    position: relative;
    width: 100%;
    height: 120px;
    overflow: hidden;
}

.note-media-youtube-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.note-media-youtube-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 0, 0, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    transition: transform 0.2s;
}

.note-media-youtube:hover .note-media-youtube-play {
    transform: translate(-50%, -50%) scale(1.1);
}

/* Treeview media icon */
.treeview-media-icon {
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

/* Statistics Styles */
.stat-box {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Noto Serif JP', serif;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gold);
    transition: width 0.3s ease;
}

.goal-input {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Codex Styles */
.codex-card {
    background: var(--bg-primary);
    border-left: 4px solid var(--accent-gold);
    border-right: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    border-radius: 0 4px 4px 0;
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.codex-card:hover {
    border-left-color: var(--accent-red);
    box-shadow: 0 2px 8px var(--shadow);
}

/* Version Styles */
.version-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.version-card:hover {
    border-color: var(--accent-gold);
    box-shadow: 0 2px 8px var(--shadow);
}

.version-timestamp {
    font-size: 0.85rem;
    color: var(--accent-gold);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-family: 'Source Code Pro', monospace;
}

.version-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.version-stats {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* References and Links Styles */
.references-section {
    margin-bottom: 1.5rem;
}

.references-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.reference-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reference-item:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--accent-gold);
}

.reference-link {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--accent-gold);
    color: var(--bg-primary);
    border-radius: 2px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    margin: 0.25rem;
}

.reference-link:hover {
    background: var(--accent-red);
}

.tag-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tag-option {
    padding: 0.4rem 0.8rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 2px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.tag-option:hover {
    border-color: var(--accent-gold);
}

.tag-option.selected {
    background: var(--accent-gold);
    color: var(--bg-primary);
    border-color: var(--accent-gold);
}

.link-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: rgba(212, 175, 55, 0.2);
    border: 1px solid var(--accent-gold);
    border-radius: 2px;
    font-size: 0.75rem;
    color: var(--text-primary);
    margin: 0.25rem 0.25rem 0.25rem 0;
    cursor: pointer;
}

.link-badge:hover {
    background: rgba(212, 175, 55, 0.3);
}

.link-badge-remove {
    cursor: pointer;
    color: var(--accent-red);
    font-weight: bold;
    margin-left: 0.25rem;
}

.link-badge-remove:hover {
    color: #8b2a1f;
}

.quick-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

/* Projects Management Styles */
.project-card {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.project-card:hover {
    border-color: var(--accent-gold);
    box-shadow: 0 2px 8px var(--shadow);
}

.project-card.active {
    border-color: var(--accent-red);
    background: var(--bg-secondary);
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
}

.project-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Noto Serif JP', serif;
}

.project-card-genre {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: var(--accent-gold);
    color: var(--bg-primary);
    border-radius: 2px;
    font-weight: 600;
}

.project-card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.project-card-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: 'Source Code Pro', monospace;
}

.project-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}




/* REVISION MODE STYLES */
.highlight-yellow {
    background: var(--highlight-yellow);
}

.highlight-green {
    background: var(--highlight-green);
}

.highlight-blue {
    background: var(--highlight-blue);
}

.highlight-red {
    background: var(--highlight-red);
}

.highlight-purple {
    background: var(--highlight-purple);
}

.revision-toolbar {
    display: flex;
    gap: 0.5rem;
    padding: 1rem 3rem;
    border-bottom: 2px solid var(--accent-red);
    background: var(--bg-secondary);
    flex-wrap: wrap;
    align-items: center;
}

.revision-badge {
    padding: 0.5rem 1rem;
    background: var(--accent-red);
    color: var(--bg-primary);
    border-radius: 4px;
    font-weight: 600;
    margin-right: 1rem;
}

.highlight-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    cursor: pointer;
    font-size: 0.85rem;
    border-radius: 2px;
    transition: all 0.2s;
}

.highlight-btn.active {
    border-width: 2px;
    font-weight: 600;
}

.highlight-btn.yellow {
    background: var(--highlight-yellow);
}

.highlight-btn.green {
    background: var(--highlight-green);
}

.highlight-btn.blue {
    background: var(--highlight-blue);
}

.highlight-btn.red {
    background: var(--highlight-red);
}

.highlight-btn.purple {
    background: var(--highlight-purple);
}

.annotations-panel {
    background: var(--bg-secondary);
    border-left: 2px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 250px;
    width: 280px;
    height: 100%;
    z-index: 10;
}

.annotations-panel.hidden {
    display: none;
    min-width: 0;
    width: 0;
}

.annotations-panel.visible {
    display: flex;
}

.annotations-panel-spacer {
    display: none;
    /* Plus besoin du spacer */
}

.annotations-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.annotations-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.annotations-panel-close {
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-muted);
    transition: color 0.2s;
    padding: 0.5rem;
    line-height: 1;
}

.annotations-panel-close:hover {
    color: var(--accent-red);
}

.annotation-card {
    background: var(--bg-primary);
    border-left: 4px solid var(--accent-gold);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.annotation-card:hover {
    transform: translateX(-4px);
}

.annotation-card.todo {
    border-left-color: var(--accent-red);
}

.annotation-card.note {
    border-left-color: #4CAF50;
}

.annotation-card.question {
    border-left-color: #2196F3;
}

.annotation-type {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 2px;
    text-transform: uppercase;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.annotation-type.comment {
    background: var(--accent-gold);
    color: white;
}

.annotation-type.todo {
    background: var(--accent-red);
    color: white;
}

.annotation-type.note {
    background: #4CAF50;
    color: white;
}

.annotation-type.question {
    background: #2196F3;
    color: white;
}

.annotation-content {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.annotation-context {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 2px;
    margin-bottom: 0.5rem;
}

/* Marqueurs d'annotation dans le texte */
.annotation-marker {
    padding: 2px 0;
    border-radius: 2px;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.annotation-marker:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.annotation-marker.comment {
    background: rgba(255, 235, 59, 0.3);
    border-bottom: 2px solid #FBC02D;
}

.annotation-marker.question {
    background: rgba(33, 150, 243, 0.3);
    border-bottom: 2px solid #1976D2;
}

.annotation-marker.todo {
    background: rgba(244, 67, 54, 0.3);
    border-bottom: 2px solid #D32F2F;
}

.annotation-marker.completed {
    background: rgba(128, 128, 128, 0.2) !important;
    border-bottom: 1px dashed #777 !important;
    text-decoration: line-through;
    opacity: 0.8;
}

.annotation-marker.note {
    background: rgba(76, 175, 80, 0.3);
    border-bottom: 2px solid #4CAF50;
}

/* Boutons de suppression sur les cartes */
.btn-delete-card:hover {
    background: rgba(244, 67, 54, 0.1) !important;
    color: var(--accent-red) !important;
}

.annotation-popup {
    position: fixed;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    z-index: 10001;
    width: 90%;
    max-width: 550px;
    display: none;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -45%);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
}

[data-theme="dark"] .annotation-popup {
    background: rgba(30, 30, 40, 0.85);
    border-color: rgba(212, 175, 55, 0.3);
}

.annotation-popup.visible {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%);
}

.annotation-popup h3 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-family: 'Crimson Pro', serif;
    letter-spacing: -0.01em;
}

.annotation-type-selector {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: 12px;
}

.annotation-type-btn {
    flex: 1;
    padding: 0.75rem 0.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    color: var(--text-muted);
}

.annotation-type-btn i {
    width: 18px;
    height: 18px;
}

.annotation-type-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

[data-theme="dark"] .annotation-type-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.annotation-type-btn.active {
    background: var(--bg-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

.annotation-type-btn.comment.active {
    color: #FBC02D;
}

.annotation-type-btn.todo.active {
    color: var(--accent-red);
}

.annotation-type-btn.note.active {
    color: #4CAF50;
}

.annotation-type-btn.question.active {
    color: #2196F3;
}

.annotation-popup textarea {
    width: 100%;
    min-height: 160px;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

.annotation-popup textarea:focus {
    border-color: var(--accent-gold);
}

.annotation-popup .modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.annotation-popup .btn {
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
}


.btn-info-circle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-info-circle:hover {
    background: var(--bg-tertiary);
    color: var(--accent-gold);
}

.annotation-guide {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    animation: slideDown 0.3s ease-out;
}

.annotation-guide.hidden {
    display: none;
}

.guide-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.guide-tag {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    min-width: 90px;
    text-align: center;
}

.guide-tag.comment {
    background: rgba(251, 192, 45, 0.2);
    color: #FBC02D;
}

.guide-tag.todo {
    background: rgba(244, 67, 54, 0.2);
    color: var(--accent-red);
}

.guide-tag.note {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.guide-tag.question {
    background: rgba(33, 150, 243, 0.2);
    color: #2196F3;
}

.guide-item p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.todo-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: 4px;
    display: flex;
    gap: 0.75rem;
    cursor: pointer;
}

.todo-item:hover {
    border-color: var(--accent-gold);
}

.todo-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.todo-text {
    flex: 1;
}

.todo-text.done {
    text-decoration: line-through;
    color: var(--text-muted);
}

.scene-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    background: var(--accent-red);
    color: white;
    border-radius: 2px;
    margin-left: 0.5rem;
}