/*
  PDF Metadata Remover — additions layered on top of merge-tool.css's shared
  chrome (processing overlay, error modal, settings panel, toolbar) and
  bates-tool.css's shared components (accordion). No Files/Pages toggle —
  this tool is document-level, not page-level, so the content area is a
  single expandable Files list.
*/

/* ---------- Success variant of the shared error-modal icon (used for
   non-error confirmations like "Scan Complete" — app.css only defines the
   red error styling by default) ---------- */

.error-modal-icon.is-success {
    color: #16a34a !important;
}

/* ---------- Empty studio state ---------- */

.meta-editor-empty-state {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow: auto;
}

.meta-empty-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    max-width: 520px;
    min-height: 240px;
    padding: 2rem 1.25rem;
    border: 2px dashed var(--color-border-strong, var(--color-border));
    border-radius: 16px;
    background: var(--color-surface);
    cursor: pointer;
    text-align: center;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.meta-empty-dropzone:hover,
.meta-empty-dropzone.is-dragover {
    border-color: var(--color-primary);
    background: var(--color-surface-soft);
}

.meta-empty-dropzone h4 {
    margin: 0.5rem 0 0.1rem;
    font-weight: 700;
    color: var(--color-text);
}

.meta-empty-dropzone p {
    margin: 0;
    font-size: var(--font-size-sm);
}

/* ---------- File list (replaces the shared grid — one row per file) ---------- */

#fileListContainer {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.meta-file-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.25rem;
}

.meta-file-card {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface);
    overflow: hidden;
}

.meta-file-card.is-selected {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
}

.meta-file-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    cursor: pointer;
}

.meta-file-row .meta-file-select {
    flex-shrink: 0;
}

.meta-file-row .meta-file-icon {
    flex-shrink: 0;
    color: #2563eb;
    font-size: 1.4rem;
}

.meta-file-row .meta-file-info {
    flex: 1 1 auto;
    min-width: 0;
}

.meta-file-row .meta-file-name {
    font-weight: 600;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.meta-file-row .meta-file-sub {
    font-size: 0.68rem;
    color: var(--color-muted);
}

.meta-file-row .meta-file-badge {
    flex-shrink: 0;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    white-space: nowrap;
}

.meta-file-row .meta-file-badge.badge-warn { background: #fef3c7; color: #92400e; }
.meta-file-row .meta-file-badge.badge-danger { background: #fee2e2; color: #b91c1c; }
.meta-file-row .meta-file-badge.badge-clean { background: #dcfce7; color: #15803d; }

.meta-file-row .meta-expand-chevron {
    flex-shrink: 0;
    transition: transform var(--transition-fast, 0.15s);
    color: var(--color-muted);
}

.meta-file-card.is-expanded .meta-expand-chevron {
    transform: rotate(180deg);
}

.meta-file-remove-btn {
    flex-shrink: 0;
    border: none;
    background: none;
    color: var(--color-danger, #dc2626);
    padding: 4px;
    line-height: 1;
}

/* ---------- Expanded before/after metadata table ---------- */

.meta-file-details {
    border-top: 1px solid var(--color-border);
    background: var(--color-surface-soft);
    padding: 0.75rem 0.85rem;
    display: none;
}

.meta-file-card.is-expanded .meta-file-details {
    display: block;
}

.meta-file-details .meta-scan-hint {
    font-size: 0.8rem;
    color: var(--color-muted);
}

.meta-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.76rem;
}

.meta-detail-table th {
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-size: 0.62rem;
    color: var(--color-muted);
    padding: 4px 6px;
    border-bottom: 1px solid var(--color-border);
}

.meta-detail-table td {
    padding: 5px 6px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

.meta-detail-table tr:last-child td {
    border-bottom: none;
}

.meta-detail-table .meta-field-name {
    font-weight: 600;
    white-space: nowrap;
}

.meta-detail-table .meta-field-value {
    color: var(--color-muted);
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.meta-detail-table .meta-will-remove {
    color: var(--color-danger, #dc2626);
    font-weight: 600;
    font-size: 0.68rem;
    white-space: nowrap;
}

.meta-detail-table .meta-will-keep {
    color: #16a34a;
    font-weight: 600;
    font-size: 0.68rem;
    white-space: nowrap;
}

.meta-detail-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--color-muted);
    margin: 0.6rem 0 0.2rem;
}

.meta-detail-section-label:first-child {
    margin-top: 0;
}

/* ---------- Custom properties list (settings panel) ---------- */

.meta-custom-keys-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    max-height: 180px;
    overflow-y: auto;
}

.meta-custom-key-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.76rem;
}

/* ---------- Misc ---------- */

#fieldCountBadge {
    white-space: nowrap;
}
