/* =================================================================
   DECK BUILDER - ADVANCED FEATURES STYLES
   Split from deck-builder.css for maintainability
   Contains: Story zone fuzzy match, sentence pool tense/focus,
             word-to-picture display, picture link modal,
             conflict resolution modals, spelling update modal,
             missing CSV modal, orphaned entries modal,
             language-specific image support
   ================================================================= */

/* =================================================================
   STORY ZONE - FUZZY MATCH PREVIEW & FORM SEQUENCE STYLES
   ================================================================= */

/* Preview Summary with Warnings */
.preview-summary .fuzzy-warning {
    color: var(--warning);
    margin-left: 12px;
    font-size: 13px;
}

.preview-summary .not-found-warning {
    color: var(--error);
    margin-left: 12px;
    font-size: 13px;
}

/* Form Sequence Preview */
.sz-preview-form-sequence {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    margin: 8px 0;
    font-size: 13px;
}

.sz-preview-form-sequence code {
    background: var(--bg-secondary);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 12px;
}

/* Fuzzy Matches Section */
.sz-fuzzy-matches-section {
    margin: 12px 0;
    padding: 12px;
    background: #FEF3C7;
    border: 1px solid var(--warning);
    border-radius: 8px;
}

.sz-fuzzy-matches-section h5 {
    margin: 0 0 8px 0;
    color: #B45309;
    font-size: 13px;
}

.sz-fuzzy-match-item {
    padding: 8px;
    margin: 6px 0;
    background: white;
    border-radius: 4px;
    font-size: 12px;
}

.sz-fuzzy-match-item .fuzzy-input {
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.sz-fuzzy-match-item .fuzzy-matched {
    color: var(--text-primary);
}

.sz-fuzzy-match-item .similarity {
    color: var(--warning);
    font-weight: 600;
}

/* Sentence Match Status Icons */
.sz-preview-sentence .status {
    min-width: 20px;
    text-align: center;
}

.sz-preview-sentence.exact-match .status i {
    color: var(--success);
}

.sz-preview-sentence.fuzzy-match .status i {
    color: var(--warning);
}

.sz-preview-sentence.not-found .status i {
    color: var(--error);
}

.sz-preview-sentence.not-found {
    opacity: 0.6;
    text-decoration: line-through;
}

.sz-preview-sentence.verified-match .status i {
    color: var(--success);
}

.sz-preview-sentence.number-match .status i {
    color: var(--primary);
}

.sz-preview-sentence.needs-resolution {
    background: #FEF3C7;
    border: 1px solid var(--warning);
}

.sz-preview-sentence.needs-resolution .status i {
    color: var(--warning);
}

.sz-preview-sentence .sentence-num {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 3px;
}

.sz-preview-sentence .sentence-num.mismatch {
    background: #FEF3C7;
    color: var(--warning);
}

.sz-preview-sentence .sentence-num.missing {
    background: #FEE2E2;
    color: var(--error);
}

.sz-preview-sentence .resolution-reason {
    width: 100%;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
    padding-left: 25px;
}

.sz-preview-sentence .sz-resolve-sentence {
    margin-left: 8px;
}

/* Resolution count in header */
.resolution-count {
    color: var(--warning);
    font-size: 12px;
    margin-left: 8px;
}

/* Text Mismatches Section */
.sz-mismatches-section {
    margin: 12px 0;
    padding: 12px;
    background: #FEE2E2;
    border: 1px solid var(--error);
    border-radius: 8px;
}

.sz-mismatches-section h5 {
    margin: 0 0 8px 0;
    color: #DC2626;
    font-size: 13px;
}

.sz-mismatch-item {
    padding: 8px;
    margin: 6px 0;
    background: white;
    border-radius: 4px;
    font-size: 12px;
}

.mismatch-row {
    padding: 4px 0;
}

.mismatch-row .label {
    font-weight: 600;
    margin-right: 6px;
}

.mismatch-row.csv-row {
    color: var(--text-secondary);
}

.mismatch-row.db-row {
    color: var(--text-primary);
}

.mismatch-row .similarity {
    color: var(--warning);
    font-weight: 600;
    margin-left: 8px;
}

/* Preview Summary Badges */
.preview-summary .resolution-warning {
    color: var(--warning);
    margin-left: 12px;
}

.preview-summary .mismatch-warning {
    color: var(--error);
    margin-left: 12px;
}

/* Resolution Modal */
.sz-resolution-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.sz-resolution-content {
    background: var(--bg-primary);
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.sz-resolution-content .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.sz-resolution-content .modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.sz-resolution-content .modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.sz-resolution-content .modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Resolution Context */
.resolution-context {
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.resolution-context p {
    margin: 4px 0;
    font-size: 13px;
}

/* Resolution Options */
.resolution-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.resolution-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.resolution-option:hover {
    background: var(--bg-tertiary);
}

.resolution-option input[type="radio"] {
    margin-top: 3px;
}

.resolution-option label {
    flex: 1;
    cursor: pointer;
}

.resolution-option label strong {
    display: block;
    margin-bottom: 4px;
}

.resolution-option .option-detail {
    font-size: 12px;
    color: var(--text-secondary);
}

.resolution-option .option-note {
    font-size: 11px;
    color: var(--success);
    margin-top: 4px;
}

/* Resolution Picker */
.resolution-picker {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.resolution-picker input {
    margin-bottom: 10px;
}

.resolution-sentences-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.resolution-sentence-option {
    display: flex;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.resolution-sentence-option:last-child {
    border-bottom: none;
}

.resolution-sentence-option:hover {
    background: var(--bg-secondary);
}

.resolution-sentence-option.selected {
    background: var(--primary-light);
    border-color: var(--primary);
}

.resolution-sentence-option .sentence-num {
    font-weight: 600;
    color: var(--primary);
    min-width: 50px;
}

.resolution-sentence-option .sentence-text {
    flex: 1;
    color: var(--text-primary);
}

.resolution-picker .no-results {
    padding: 16px;
    text-align: center;
    color: var(--text-secondary);
}

/* Forms Preview in Settings Modal */
.sz-forms-preview {
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-primary);
    min-height: 40px;
}

/* Form hint code blocks */
.form-hint code {
    background: var(--bg-tertiary);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 11px;
    font-family: monospace;
}

/* Seed Badge */
.seed-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 11px;
    cursor: help;
}

.seed-badge:hover {
    background: var(--primary);
    color: white;
}

/* =================================================================
   SENTENCE POOL - TENSE & FOCUS FIELDS
   ================================================================= */

/* Form row for side-by-side inputs */
.form-row {
    display: flex;
    gap: 16px;
}

.form-group.half {
    flex: 1;
}

/* Sentence tense/focus badges */
.sp-sentence-tense,
.sp-sentence-focus {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
    white-space: nowrap;
}

.sp-sentence-tense {
    background: rgba(156, 39, 176, 0.15);
    color: #9C27B0;
}

.sp-sentence-focus {
    background: rgba(255, 152, 0, 0.15);
    color: #F57C00;
}

/* Preview tense/focus columns */
.preview-tense,
.preview-focus {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 80px;
}

/* =================================================================
   SECTION LANGUAGE SELECTORS
   ================================================================= */

.section-language-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-bottom: 16px;
}

.section-language-selector label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.section-language-selector label i {
    color: var(--primary);
}

.section-language-selector select {
    flex: 1;
    max-width: 200px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
}

.section-language-selector select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* =================================================================
   SENTENCE POOL - WORD-TO-PICTURE DISPLAY
   ================================================================= */

.sp-sentence-audio-controls {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.sp-sentence-audio-controls .btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sp-record-btn {
    background: #EF4444;
    color: white;
}

.sp-record-btn:hover {
    background: #DC2626;
    transform: scale(1.1);
}

.sp-play-btn {
    background: var(--primary);
    color: white;
}

.sp-play-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

/* Sentence Pool - Bubble Layout with Vertical Word Cells */
/* Matches Story Zone word-picture layout pattern */
.sp-bubble-layout {
    position: relative;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
}

/* Container for all word cells - uses flex-wrap for natural row breaking */
/* Matches Story Zone .sz-word-picture-pairs */
.sp-word-cells-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 4px;
    align-items: flex-start;
}

/* Each word-cell is a vertical stack: bubble -> connector -> picture */
/* Matches Story Zone .sz-word-picture-pair */
.sp-word-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 68px; /* Ensures card can fit centered below small words */
    gap: 4px;
}

/* Vertical connector line between bubble and picture */
.sp-cell-connector {
    width: 2px;
    height: 10px;
    background: var(--primary);
    opacity: 0.4;
}

.sp-cell-connector.duplicate {
    background: var(--border-color);
    opacity: 0.3;
    height: 6px;
}

/* Legacy support for old bubbles-row structure */
.sp-bubbles-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
    align-items: center;
    z-index: 2;
}

.sp-word-bubble {
    position: relative;
    min-width: 60px;
    max-width: 150px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 2px solid var(--primary);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    justify-content: center;
    box-sizing: border-box;
}

.sp-word-bubble:hover {
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
    border-color: var(--primary-dark, #4a47a3);
    transform: translateY(-2px);
}

.sp-word-bubble.function-word {
    background: var(--bg-tertiary);
    border-style: dashed;
    border-color: var(--border-color);
    color: var(--text-secondary);
    font-style: italic;
}

.sp-word-bubble.function-word:hover {
    border-color: var(--text-secondary);
}

.sp-word-bubble.has-card {
    background: #DCFCE7;
    border-color: #22C55E;
    border-style: solid;
}

.sp-word-bubble.fuzzy-match {
    background: #FEF3C7;
    border-color: #F59E0B;
    border-style: solid;
}

.sp-word-bubble.fuzzy-match:hover {
    background: #FDE68A;
    border-color: #D97706;
}

.sp-word-bubble.needs-resolution {
    border-color: var(--warning, #f59e0b);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.sp-bubble-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sp-word-bubble .fuzzy-indicator {
    font-size: 11px;
    color: #F59E0B;
    margin-left: 2px;
}

.sp-bubble-warning {
    position: absolute;
    top: -6px;
    right: -6px;
    font-size: 12px;
}

/* Bubble Action Buttons */
.sp-bubble-actions {
    position: absolute;
    top: -10px;
    right: -10px;
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}

.sp-word-bubble:hover .sp-bubble-actions {
    opacity: 1;
}

.sp-bubble-actions button {
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    transition: all 0.15s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.sp-bubble-edit-btn {
    background: var(--primary);
    color: white;
}

.sp-bubble-edit-btn:hover {
    background: var(--primary-dark, #4a47a3);
    transform: scale(1.1);
}

.sp-bubble-link-btn {
    background: var(--success, #22c55e);
    color: white;
}

.sp-bubble-link-btn:hover {
    background: #16a34a;
    transform: scale(1.1);
}

.sp-bubble-delete-btn {
    background: var(--error, #e53935);
    color: white;
}

.sp-bubble-delete-btn:hover {
    background: #c62828;
    transform: scale(1.1);
}

/* SVG Connection Lines */
.sp-connection-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.sp-connection-line {
    stroke: var(--primary);
    stroke-width: 2;
    stroke-opacity: 0.4;
    transition: stroke-opacity 0.2s;
}

/* Pictures Row */
.sp-pictures-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 8px 0;
    align-items: flex-start;
    z-index: 2;
}

/* Picture slot - sized to match Story Zone */
.sp-picture-slot {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-tertiary);
    flex-shrink: 0;
    position: relative;
}

/* Empty slots for duplicate cards or function words */
.sp-picture-slot.empty {
    height: 60px;
    visibility: hidden;
}

.sp-picture-slot.function-word {
    height: 16px; /* Smaller space for function words with no card */
    background: transparent;
}

/* Card container within picture slot */
.sp-slot-card {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid var(--primary);
    background: var(--bg-secondary);
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.sp-slot-card:hover {
    border-color: var(--primary-dark, #4a47a3);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.sp-slot-card img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.sp-multi-link-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: var(--primary);
    color: white;
    font-size: 10px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.sp-no-words {
    color: var(--text-muted);
    font-size: 13px;
    padding: 8px 0;
}

.sp-no-pictures {
    color: var(--text-muted);
    font-size: 12px;
    font-style: italic;
    padding: 8px;
}

/* Legacy support */
.sp-words-section {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-light);
}

.sp-word-bubbles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.sp-word-pictures {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sp-picture-card {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border);
    background: var(--bg-secondary);
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.sp-picture-card:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

.sp-picture-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sp-picture-card .card-number {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 10px;
    text-align: center;
    padding: 2px;
}

/* =================================================================
   SENTENCE POOL - PICTURE LINK MODAL
   ================================================================= */

.sp-picture-link-modal .modal-content {
    max-width: 600px;
    max-height: 85vh;
}

.sp-picture-link-modal .modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Current Link Section */
.sp-current-link {
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.sp-current-link h4 {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.sp-current-picture {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sp-current-picture img {
    width: 50px;
    height: 65px;
    object-fit: contain;
    border-radius: 6px;
    border: 2px solid var(--primary);
    background: white;
}

.sp-current-picture span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Quick Link Section */
.sp-quick-link-section {
    background: var(--bg-secondary);
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid var(--warning, #f59e0b);
}

.sp-quick-link-section h4 {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.sp-quick-link-section h4 i {
    color: var(--warning, #f59e0b);
    margin-right: 6px;
}

.sp-quick-link-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sp-quick-link-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.sp-quick-link-option:hover {
    border-color: var(--primary);
    background: var(--primary-light, rgba(79, 70, 229, 0.05));
}

.sp-quick-link-option img {
    width: 40px;
    height: 52px;
    object-fit: contain;
    border-radius: 4px;
    background: white;
}

.sp-quick-link-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sp-quick-link-word {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.sp-quick-link-card {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Search Section */
.sp-search-section h4 {
    margin: 0 0 12px 0;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.sp-search-section h4 i {
    margin-right: 6px;
}

.sp-search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.sp-search-bar input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
}

.sp-search-bar input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

/* Pic Grid */
.sp-pic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}

.sp-pic-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.sp-pic-option:hover {
    border-color: var(--primary);
    background: var(--primary-light, rgba(79, 70, 229, 0.05));
}

.sp-pic-option img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 4px;
    margin-bottom: 4px;
    background: white;
}

.sp-pic-option .no-image {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 4px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.sp-pic-option .card-word {
    font-weight: 500;
    font-size: 0.8rem;
    text-align: center;
}

.sp-pic-option .card-english {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-align: center;
}

.sp-pic-grid .no-results,
.sp-pic-grid .hint-text {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
}

/* Remove Link Section */
.sp-remove-link-section {
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

.sp-remove-link-section .btn-outline-danger {
    width: 100%;
    padding: 10px;
    border: 2px solid var(--error, #e53935);
    background: transparent;
    color: var(--error, #e53935);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.sp-remove-link-section .btn-outline-danger:hover {
    background: var(--error, #e53935);
    color: white;
}

.sp-remove-link-section .btn-outline-danger.hidden {
    display: none;
}

/* Legacy card grid styles */
.sp-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding: 4px;
}

.sp-card-option {
    border: 2px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-primary);
}

.sp-card-option:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sp-no-card-option {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.sp-no-card-option:hover {
    border-color: #EF4444;
    background: #FEF2F2;
    color: #EF4444;
}

.sp-no-card-option i {
    display: block;
    font-size: 24px;
    margin-bottom: 8px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sp-sentence-audio-controls {
        align-self: flex-end;
    }

    .sp-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .sp-bubbles-row {
        gap: 6px;
    }

    .sp-word-bubble {
        padding: 4px 8px;
        font-size: 12px;
    }

    .sp-slot-card {
        width: 40px;
        height: 40px;
    }
}

/* =================================================================
   RESCAN CONFLICT RESOLUTION MODAL
   ================================================================= */

.rescan-conflict-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.rescan-conflict-content {
    background: var(--bg-primary);
    border-radius: 16px;
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.rescan-conflict-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border-radius: 16px 16px 0 0;
}

.rescan-conflict-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #92400E;
    display: flex;
    align-items: center;
    gap: 12px;
}

.rescan-conflict-header h2 i {
    color: #F59E0B;
    font-size: 24px;
}

.rescan-conflict-header .close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #92400E;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: opacity 0.2s;
}

.rescan-conflict-header .close-btn:hover {
    opacity: 0.7;
}

.rescan-conflict-summary {
    display: flex;
    gap: 16px;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.rescan-conflict-summary .summary-stat {
    flex: 1;
    text-align: center;
    padding: 12px;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.rescan-conflict-summary .stat-number {
    display: block;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.rescan-conflict-summary .stat-number.conflict {
    color: #F59E0B;
}

.rescan-conflict-summary .stat-number.new {
    color: #22C55E;
}

.rescan-conflict-summary .stat-number.unchanged {
    color: var(--text-secondary);
}

.rescan-conflict-summary .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rescan-conflict-filter {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
}

.rescan-conflict-filter .filter-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rescan-conflict-filter .filter-controls label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.rescan-conflict-filter .filter-controls label i {
    margin-right: 6px;
    color: var(--primary);
}

.rescan-conflict-filter .field-filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    min-width: 160px;
    cursor: pointer;
}

.rescan-conflict-filter .field-filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.rescan-conflict-filter .filter-count {
    font-size: 13px;
    color: var(--text-secondary);
}

.rescan-conflict-filter .filter-count .visible-count {
    font-weight: 600;
    color: var(--primary);
}

.rescan-conflict-actions-global {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
}

.rescan-conflict-actions-global .btn {
    flex: 1;
    padding: 10px 16px;
    font-size: 14px;
}

.rescan-conflict-actions-global .keep-all-btn {
    background: #E0F2FE;
    color: #0369A1;
    border: 1px solid #7DD3FC;
}

.rescan-conflict-actions-global .keep-all-btn:hover {
    background: #BAE6FD;
}

.rescan-conflict-actions-global .overwrite-all-btn {
    background: #FEE2E2;
    color: #DC2626;
    border: 1px solid #FCA5A5;
}

.rescan-conflict-actions-global .overwrite-all-btn:hover {
    background: #FECACA;
}

.rescan-conflict-actions-global .filter-action-hint {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    align-self: center;
}

.rescan-conflict-body .conflict-table tbody tr.hidden-by-filter {
    display: none;
}

.rescan-conflict-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.rescan-conflict-body .conflict-table {
    width: 100%;
    border-collapse: collapse;
}

.rescan-conflict-body .conflict-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.rescan-conflict-body .conflict-table th {
    background: var(--bg-tertiary);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
}

.rescan-conflict-body .conflict-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    font-size: 14px;
}

.rescan-conflict-body .conflict-table tr:hover {
    background: var(--bg-secondary);
}

.rescan-conflict-body .card-info {
    min-width: 180px;
}

.rescan-conflict-body .card-word {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.rescan-conflict-body .card-meta {
    display: block;
    font-size: 11px;
    color: var(--text-tertiary);
}

.rescan-conflict-body .asset-icon {
    color: var(--primary);
    margin-left: 6px;
    font-size: 12px;
}

.rescan-conflict-body .field-name {
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 100px;
}

.rescan-conflict-body .manifest-value {
    background: #ECFDF5;
    color: #047857;
    padding: 8px 12px;
    border-radius: 6px;
    max-width: 200px;
    word-wrap: break-word;
}

.rescan-conflict-body .manifest-value em {
    color: #6B7280;
    font-style: italic;
}

.rescan-conflict-body .csv-value {
    background: #FEF2F2;
    color: #B91C1C;
    padding: 8px 12px;
    border-radius: 6px;
    max-width: 200px;
    word-wrap: break-word;
}

.rescan-conflict-body .csv-value em {
    color: #6B7280;
    font-style: italic;
}

.rescan-conflict-body .action-cell {
    min-width: 130px;
}

.rescan-conflict-body .resolution-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
}

.rescan-conflict-body .resolution-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.rescan-conflict-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg-secondary);
    border-radius: 0 0 16px 16px;
}

.rescan-conflict-footer .btn {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
}

.rescan-conflict-footer .cancel-btn {
    background: var(--bg-primary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.rescan-conflict-footer .cancel-btn:hover {
    background: var(--bg-tertiary);
}

.rescan-conflict-footer .apply-btn {
    background: var(--primary);
    color: white;
    border: none;
}

.rescan-conflict-footer .apply-btn:hover {
    background: var(--primary-dark);
}

/* Responsive adjustments for conflict modal */
@media (max-width: 768px) {
    .rescan-conflict-content {
        max-width: 100%;
        max-height: 95vh;
        border-radius: 12px;
    }

    .rescan-conflict-summary {
        flex-direction: column;
        gap: 8px;
    }

    .rescan-conflict-actions-global {
        flex-direction: column;
    }

    .rescan-conflict-body .conflict-table {
        font-size: 12px;
    }

    .rescan-conflict-body .conflict-table th,
    .rescan-conflict-body .conflict-table td {
        padding: 8px 10px;
    }

    .rescan-conflict-body .manifest-value,
    .rescan-conflict-body .csv-value {
        max-width: 120px;
        padding: 6px 8px;
        font-size: 12px;
    }

    .rescan-conflict-footer {
        flex-direction: column-reverse;
    }

    .rescan-conflict-footer .btn {
        width: 100%;
    }
}

/* =================================================================
   WORD SPELLING UPDATE MODAL STYLES
   ================================================================= */

.word-spelling-modal .modal-content {
    max-width: 800px;
}

.word-spelling-modal .modal-content.modal-xl {
    max-width: 1000px;
}

.word-spelling-modal .spelling-update-header {
    background: linear-gradient(135deg, #EDE9FE 0%, #DDD6FE 100%);
    border-bottom: 2px solid #8B5CF6;
}

.word-spelling-modal .spelling-update-header h2 {
    color: #5B21B6;
}

.word-spelling-modal .spelling-update-header h2 i {
    color: #8B5CF6;
    margin-right: 8px;
}

.spelling-update-intro {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.spelling-update-intro p {
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.spelling-update-intro .update-hint {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 0;
}

.spelling-update-intro .update-hint i {
    color: #F59E0B;
    margin-right: 6px;
}

.spelling-summary-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.spelling-summary-bar .summary-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
}

.spelling-summary-bar .summary-stat i {
    font-size: 20px;
    color: var(--primary);
    margin-bottom: 6px;
}

.spelling-summary-bar .summary-stat span {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.spelling-summary-bar .summary-stat label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-top: 4px;
}

.word-changes-container {
    max-height: 400px;
    overflow-y: auto;
}

.word-change-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.word-change-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
    border-bottom: 1px solid var(--border-color);
}

.word-change-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
}

.word-change-title .card-badge {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.word-change-title .old-word {
    color: var(--error);
    text-decoration: line-through;
    font-weight: 500;
}

.word-change-title .fa-arrow-right {
    color: var(--text-secondary);
    font-size: 12px;
}

.word-change-title .new-word {
    color: var(--success);
    font-weight: 600;
}

.word-change-count .location-count {
    background: var(--primary-light);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.word-change-count .no-locations {
    color: var(--text-secondary);
    font-size: 12px;
    font-style: italic;
}

.word-change-locations {
    padding: 12px 16px;
}

.locations-section-header {
    margin-bottom: 12px;
}

.select-all-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
}

.select-all-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.location-group {
    margin-bottom: 16px;
}

.location-group:last-child {
    margin-bottom: 0;
}

.location-group h5 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

.location-group h5 i {
    margin-right: 6px;
    color: var(--primary);
}

.location-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.location-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.location-item:hover {
    background: var(--bg-hover);
}

.location-item input[type="checkbox"] {
    margin-top: 2px;
    width: 14px;
    height: 14px;
    cursor: pointer;
    flex-shrink: 0;
}

.location-item .location-path {
    flex: 1;
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.4;
}

.location-item .location-word {
    font-size: 12px;
    color: var(--primary);
    font-weight: 500;
    flex-shrink: 0;
}

.spelling-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.spelling-footer .btn-lg {
    padding: 12px 24px;
}

/* Dark mode adjustments */
[data-theme="dark"] .word-spelling-modal .spelling-update-header {
    background: linear-gradient(135deg, #312E81 0%, #3730A3 100%);
    border-bottom-color: #6366F1;
}

[data-theme="dark"] .word-spelling-modal .spelling-update-header h2 {
    color: #E0E7FF;
}

[data-theme="dark"] .word-change-header {
    background: linear-gradient(135deg, #1E293B 0%, #334155 100%);
}

[data-theme="dark"] .word-change-card {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .location-item {
    background: var(--bg-tertiary);
}

[data-theme="dark"] .location-item:hover {
    background: var(--bg-hover);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .word-spelling-modal .modal-content.modal-xl {
        max-width: 100%;
        max-height: 95vh;
    }

    .spelling-summary-bar {
        flex-direction: column;
        gap: 8px;
    }

    .word-change-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .spelling-footer {
        flex-direction: column-reverse;
    }

    .spelling-footer .btn {
        width: 100%;
    }
}

/* =================================================================
   MISSING CSV FILES MODAL
   ================================================================= */

.missing-csv-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.missing-csv-content {
    background: var(--bg-primary);
    border-radius: 12px;
    max-width: 700px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.missing-csv-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    color: white;
}

.missing-csv-header h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.missing-csv-header p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

.missing-csv-header .warning-text {
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    font-weight: 500;
}

.missing-csv-list {
    padding: 16px 24px;
    overflow-y: auto;
    flex: 1;
}

.missing-csv-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 12px;
    border: 2px dashed var(--warning);
    flex-wrap: wrap;
    gap: 12px;
}

.missing-csv-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.missing-csv-info .language-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.missing-csv-info .expected-path {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: monospace;
}

.missing-csv-info .existing-count {
    font-size: 12px;
    color: var(--success);
    font-weight: 500;
}

.missing-csv-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.missing-csv-actions .csv-status {
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
}

.missing-csv-server-browser {
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.missing-csv-server-browser h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: var(--text-primary);
}

.csv-search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
}

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

.csv-file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.csv-file-item:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.csv-file-item .file-name {
    flex: 1;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.csv-file-item .file-size {
    font-size: 11px;
    opacity: 0.7;
}

.missing-csv-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: var(--bg-secondary);
    flex-wrap: wrap;
}

.missing-csv-footer .footer-note {
    font-size: 13px;
    color: var(--text-secondary);
}

.missing-csv-footer .footer-buttons {
    display: flex;
    gap: 12px;
}

/* =================================================================
   ORPHANED ENTRIES MODAL
   ================================================================= */

.orphaned-entries-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.orphaned-entries-content {
    background: var(--bg-primary);
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.orphaned-entries-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: #1f2937;
}

.orphaned-entries-header h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.orphaned-entries-header p {
    margin: 0;
    font-size: 14px;
}

.orphaned-entries-header .warning-text {
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.orphaned-actions-bar {
    padding: 12px 24px;
    background: var(--bg-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.orphaned-actions-bar label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

.orphaned-count {
    font-size: 14px;
    color: var(--text-secondary);
}

.orphaned-entries-list {
    padding: 16px 24px;
    overflow-y: auto;
    flex: 1;
}

.orphaned-language-group {
    margin-bottom: 20px;
}

.orphaned-language-group h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.orphaned-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.orphaned-table th,
.orphaned-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.orphaned-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

.orphaned-table tr:hover td {
    background: var(--bg-hover);
}

.orphaned-table td i {
    color: var(--primary);
    margin-right: 6px;
}

.orphaned-entries-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: var(--bg-secondary);
    flex-wrap: wrap;
}

.orphaned-entries-footer .footer-note {
    font-size: 13px;
    color: var(--text-secondary);
}

.orphaned-entries-footer .footer-buttons {
    display: flex;
    gap: 12px;
}

/* Dark mode adjustments for new modals */
[data-theme="dark"] .missing-csv-header {
    background: linear-gradient(135deg, #991b1b 0%, #b91c1c 100%);
}

[data-theme="dark"] .orphaned-entries-header {
    background: linear-gradient(135deg, #b45309 0%, #d97706 100%);
    color: #fef3c7;
}

[data-theme="dark"] .orphaned-entries-header .warning-text {
    background: rgba(0, 0, 0, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .missing-csv-content,
    .orphaned-entries-content {
        max-height: 95vh;
    }

    .missing-csv-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .missing-csv-footer,
    .orphaned-entries-footer {
        flex-direction: column;
    }

    .missing-csv-footer .footer-buttons,
    .orphaned-entries-footer .footer-buttons {
        width: 100%;
        flex-direction: column;
    }

    .missing-csv-footer .btn,
    .orphaned-entries-footer .btn {
        width: 100%;
    }

    .orphaned-table {
        font-size: 12px;
    }

    .orphaned-table th,
    .orphaned-table td {
        padding: 8px 6px;
    }
}

/* =================================================================
   LANGUAGE-SPECIFIC IMAGE SUPPORT
   ================================================================= */

/* Upload type selector */
.upload-type-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.upload-type-option {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-type-option:hover {
    border-color: var(--primary);
}

.upload-type-option input[type="radio"] {
    margin-top: 4px;
}

.upload-type-option input[type="radio"]:checked + .option-content {
    color: var(--primary);
}

.upload-type-option:has(input:checked) {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

.option-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.option-content i {
    font-size: 20px;
    margin-bottom: 4px;
}

.option-content strong {
    font-size: 14px;
    font-weight: 600;
}

.option-content small {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Language-specific badge indicator */
.file-badge.lang-specific {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.format-icon.lang-specific {
    background: var(--primary);
    color: white;
}

/* Linked files sections in modal */
.linked-files-section {
    margin-bottom: 12px;
}

.linked-files-section:last-child {
    margin-bottom: 0;
}

.linked-files-section .section-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.linked-files-section .section-label i {
    color: var(--primary);
}

.linked-file-item.lang-specific {
    background: rgba(79, 70, 229, 0.1);
    border-left: 3px solid var(--primary);
}

.linked-file-item.lang-specific .format-badge {
    background: var(--primary);
    color: white;
}

/* Dark mode adjustments */
[data-theme="dark"] .upload-type-option {
    background: var(--bg-secondary);
}

[data-theme="dark"] .upload-type-option:has(input:checked) {
    background: rgba(79, 70, 229, 0.15);
}

[data-theme="dark"] .linked-file-item.lang-specific {
    background: rgba(79, 70, 229, 0.2);
}
