/* ── Change DPI Tool ── */

/* DPI Presets Card */
.dpi-presets-card {
    background: var(--card-bg, #1a1c2e);
    border: 1px solid var(--border-color, #303347);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}
.dpi-presets-card h5 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-color, #e0e0e0);
    display: flex;
    align-items: center;
    gap: 8px;
}
.dpi-presets-card h5 i {
    color: #5b8def;
    font-size: 1.1rem;
}

/* Preset Grid */
.dpi-presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}
.dpi-preset {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 14px 10px;
    border: 1.5px solid var(--border-color, #303347);
    border-radius: 10px;
    background: var(--bg-color, #12131f);
    color: var(--text-color, #e0e0e0);
    cursor: pointer;
    transition: border-color .2s, background .2s, transform .1s;
}
.dpi-preset:hover {
    border-color: #5b8def;
    background: rgba(91,141,239,.06);
}
.dpi-preset.active {
    border-color: #5b8def;
    background: rgba(91,141,239,.12);
    box-shadow: 0 0 0 2px rgba(91,141,239,.2);
    transform: scale(1.02);
}
.dpi-val {
    font-size: 1.3rem;
    font-weight: 700;
    color: #5b8def;
    line-height: 1.2;
}
.dpi-preset.active .dpi-val {
    color: #7da8ff;
}
.dpi-label {
    font-size: .75rem;
    color: var(--light-text, #888);
    text-align: center;
}

/* Custom DPI Row */
.dpi-custom-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color, #303347);
}
.dpi-custom-row label {
    font-size: .9rem;
    font-weight: 500;
    color: var(--text-color, #e0e0e0);
    white-space: nowrap;
}
.dpi-custom-row .form-control {
    max-width: 120px;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    background: var(--bg-color, #12131f);
    border: 1.5px solid var(--border-color, #303347);
    color: var(--text-color, #e0e0e0);
    border-radius: 8px;
    padding: 6px 10px;
}
.dpi-custom-row .form-control:focus {
    border-color: #5b8def;
    box-shadow: 0 0 0 2px rgba(91,141,239,.15);
    outline: none;
}
.dpi-unit {
    font-size: .85rem;
    color: var(--light-text, #888);
    font-weight: 500;
}

/* File List Card */
.file-list-card {
    background: var(--card-bg, #1a1c2e);
    border: 1px solid var(--border-color, #303347);
    border-radius: 12px;
    overflow: hidden;
}
.file-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color, #303347);
    flex-wrap: wrap;
    gap: 10px;
}
.file-list-header h5 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-color, #e0e0e0);
    display: flex;
    align-items: center;
    gap: 8px;
}
.file-list-header h5 i {
    color: #5b8def;
}
.file-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #5b8def;
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    padding: 0 6px;
}
.file-list-actions {
    display: flex;
    gap: 8px;
}

/* File List Body */
.file-list-body {
    max-height: 400px;
    overflow-y: auto;
    padding: 0;
}
.file-list-body::-webkit-scrollbar {
    width: 6px;
}
.file-list-body::-webkit-scrollbar-thumb {
    background: rgba(91,141,239,.3);
    border-radius: 3px;
}

/* Individual File Row */
.file-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color, #303347);
    transition: background .15s;
}
.file-row:last-child {
    border-bottom: none;
}
.file-row:hover {
    background: rgba(91,141,239,.04);
}
.file-thumb {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-color, #12131f);
    border: 1px solid var(--border-color, #303347);
}
.file-info {
    flex: 1;
    min-width: 0;
}
.file-name {
    font-size: .85rem;
    font-weight: 500;
    color: var(--text-color, #e0e0e0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.file-meta {
    font-size: .75rem;
    color: var(--light-text, #888);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.file-meta span {
    white-space: nowrap;
}
.file-dpi-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .72rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}
.file-dpi-badge.original {
    background: rgba(255,153,102,.12);
    color: #ff9966;
}
.file-dpi-badge.target {
    background: rgba(91,141,239,.12);
    color: #5b8def;
}
.file-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.file-actions .btn-sm {
    padding: 4px 10px;
    font-size: .78rem;
}
.file-remove-btn {
    background: none;
    border: none;
    color: var(--light-text, #888);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color .15s, background .15s;
    line-height: 1;
}
.file-remove-btn:hover {
    color: #e74c3c;
    background: rgba(231,76,60,.1);
}

/* File List Footer */
.file-list-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color, #303347);
    background: rgba(0,0,0,.12);
    flex-wrap: wrap;
    gap: 12px;
}
.file-summary {
    font-size: .85rem;
    color: var(--light-text, #888);
}
.download-actions {
    display: flex;
    gap: 8px;
}

/* Processing state */
.file-row.processing .file-name::after {
    content: ' — Processing…';
    color: #5b8def;
    font-weight: 400;
    font-size: .8rem;
}
.file-row.done .file-name::after {
    content: ' ✓';
    color: #2ecc71;
}

/* Close button positioning */
#btn-close {
    position: absolute;
    right: 20px;
    top: 10px;
    z-index: 10;
}

/* Responsive */
@media (max-width: 600px) {
    .dpi-presets-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .file-list-header {
        padding: 12px 14px;
    }
    .file-row {
        padding: 10px 14px;
    }
    .file-list-footer {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .download-actions {
        justify-content: center;
    }
    .file-meta {
        gap: 8px;
    }
    .file-dpi-badge {
        font-size: .68rem;
    }
}
