/* Universal GUID Formatter — PDF Merger–style layout */

html.theme-neon:not([data-theme="dark"]) .ugf-scope {
  --tp-card: #ffffff !important;
  --tp-bg: #f0fdf4 !important;
  --tp-border: #d4f4dd !important;
  --tp-ink: #0f172a !important;
  --tp-ink-soft: #64748b !important;
}

/* ── Page layout (matches .pmg-fit.pmg-scope) ── */
.ugf-fit.ugf-scope {
  display: flex; flex-direction: column; gap: 14px;
  max-width: 1600px; margin: 0 auto;
  padding: 90px 4vw 60px;
}

/* ── Hero heading ── */
.ugf-hero { text-align: center; flex-shrink: 0; }
.ugf-hero h1 {
  font-size: 1.5rem !important; font-weight: 800 !important;
  color: var(--brand, #6366f1) !important;
  margin: 0 0 4px !important;
}
#ugfScope .ugf-hero p {
  font-size: .85rem !important; color: var(--txt-2, #64748b) !important;
  margin: 0 !important;
}

/* ── Card wrapper ── */
#ugfScope .ugf-card {
  max-width: 100% !important; width: 100%;
  padding: 24px 32px !important;
  background: var(--page-bg, #f8fafc) !important;
  border: 1px solid var(--border, #e2e8f0) !important;
  box-shadow: none !important;
  margin: 0 auto !important;
}

.hidden { display: none !important; }
.ugf-input-view { display: flex; flex-direction: column; }

.ugf-error {
  margin-top: 12px; padding: 10px 14px; border-radius: 10px;
  background: var(--page-bg, #f8fafc); border: 1px dashed var(--brand, #6366f1);
  color: var(--txt, #0f172a); font-size: .85rem;
}

/* ── Processing — same ring + step shape as PDF Merger / Data Transfer ── */
.ugf-processing { padding: 10px 0 4px; }
.ugf-ring-wrap { position: relative; width: 140px; height: 140px; margin: 0 auto 18px; }
.ugf-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ugf-ring-track { fill: none; stroke: var(--border, #e2e8f0); stroke-width: 8; }
.ugf-ring-fill {
  fill: none; stroke: var(--brand, #6366f1); stroke-width: 8;
  stroke-linecap: round; transition: stroke-dashoffset .2s ease;
  filter: drop-shadow(0 0 6px rgba(99,102,241,.45));
}
.ugf-ring-center {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--txt, #0f172a);
}
.ugf-ring-count { font-size: 2.1rem; line-height: 1; }
.ugf-ring-percent { font-size: 1.1rem; opacity: .7; margin-left: 2px; }

.ugf-process-steps { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 22px; }
.ugf-process-step {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: .72rem; font-weight: 700; color: var(--txt-2, #64748b);
  opacity: .55; transition: opacity .2s ease;
}
.ugf-process-icon {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface, #fff); border: 2px solid var(--border, #e2e8f0);
  color: var(--txt-2, #64748b); font-size: .9rem;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.ugf-process-line { width: 36px; height: 2px; background: var(--border, #e2e8f0); }
.ugf-process-step.ugf-step-active { opacity: 1; }
.ugf-process-step.ugf-step-active .ugf-process-icon {
  border-color: var(--brand, #6366f1); color: var(--brand, #6366f1);
  box-shadow: 0 0 0 4px rgba(99,102,241,.12);
  animation: ugfPulseStep 1.3s ease-in-out infinite;
}
.ugf-process-step.ugf-step-done { opacity: 1; }
.ugf-process-step.ugf-step-done .ugf-process-icon { border-color: #16a34a; color: #fff; background: #16a34a; }
@keyframes ugfPulseStep {
  0%, 100% { box-shadow: 0 0 0 4px rgba(99,102,241,.12); }
  50%      { box-shadow: 0 0 0 8px rgba(99,102,241,.04); }
}
@media (prefers-reduced-motion: reduce) {
  .ugf-process-step.ugf-step-active .ugf-process-icon { animation: none; }
}

.ugf-progress-text { font-size: .85rem; margin-top: 10px; color: var(--txt, #0f172a); font-weight: 600; text-align: center; }

.ugf-result-icon { text-align: center; font-size: 2.6rem; color: #16a34a; margin-bottom: 6px; }
.ugf-autosave { margin-top: 10px; text-align: center; font-size: .82rem; color: var(--txt-2, #64748b); }

/* ── Mode toggle — one small compact pill ── */
.ugf-mode-toggle {
  display: flex; gap: 4px; margin: 0 auto 18px; width: max-content;
  background: var(--surface, #fff); border: 1px solid var(--border, #e2e8f0);
  border-radius: 999px; padding: 4px;
}
.ugf-mode-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border: none; background: none; cursor: pointer;
  padding: 7px 16px; border-radius: 999px;
  font-weight: 700; font-size: .8rem; color: var(--txt-2, #64748b);
  transition: background .15s ease, color .15s ease;
}
.ugf-mode-btn:hover { color: var(--brand, #6366f1); }
.ugf-mode-btn.ugf-mode-active { background: var(--brand, #6366f1); color: #fff; }

.ugf-textarea {
  width: 100%; height: 320px; resize: vertical;
  border: 1px solid var(--border, #e2e8f0); border-radius: 10px;
  background: var(--surface, #fff); color: var(--txt, #0f172a);
  font-family: 'SFMono-Regular', Consolas, monospace; font-size: .82rem; line-height: 1.6;
  padding: 12px;
}
.ugf-textarea:focus { outline: none; border-color: var(--brand, #6366f1); }

/* ── Upload dropzone + file list ── */
.ugf-scope .ugf-dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 320px; padding: 26px 20px;
  border: 2px dashed var(--brand, #6366f1); border-radius: 14px;
  cursor: pointer; text-align: center; color: var(--txt, #0f172a);
  background: transparent; transition: border-color .2s ease, background .2s ease;
}
.ugf-scope .ugf-dropzone:hover,
.ugf-scope .ugf-dropzone.ugf-dragover {
  border-color: var(--brand-dark, #4338ca); background: rgba(99,102,241,.05);
}
.ugf-scope .ugf-dropzone i {
  color: var(--brand, #6366f1); font-size: 2.2rem;
  display: inline-block;
  animation: ugfIconFloat 2.4s ease-in-out infinite;
}
@keyframes ugfIconFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@media (prefers-reduced-motion: reduce) {
  .ugf-scope .ugf-dropzone i { animation: none; }
}
.ugf-drop-title { font-weight: 700; margin-top: 10px; font-size: .95rem; color: var(--txt, #0f172a); }
.ugf-drop-sub { font-size: .8rem; opacity: .65; margin-top: 4px; color: var(--txt-2, #64748b); }

.ugf-file-list-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 16px 0 8px; font-size: .82rem; color: var(--txt-2, #64748b); font-weight: 600;
}
.ugf-add-more { color: var(--brand, #6366f1); cursor: pointer; font-weight: 700; }
.ugf-add-more:hover { text-decoration: underline; }

.ugf-file-list { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow-y: auto; }
.ugf-file-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 8px;
  border-radius: 10px; background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
}
.ugf-chip-icon { color: var(--brand, #6366f1); font-size: 1rem; flex-shrink: 0; }
.ugf-chip-name { flex: 1; min-width: 0; font-weight: 600; font-size: .85rem; color: var(--txt, #0f172a); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ugf-chip-size { font-size: .76rem; color: var(--txt-2, #64748b); flex-shrink: 0; }
.ugf-chip-remove {
  width: 26px; height: 26px; flex-shrink: 0; border: none; border-radius: 50%;
  background: var(--red, #ef4444); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: .8rem;
  transition: background .15s ease, transform .15s ease;
}
.ugf-chip-remove:hover { background: #dc2626; transform: scale(1.08); }

/* ── Format / Case radio options (used inside the popups) ── */
.ugf-radio-item {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: .85rem; font-weight: 600; color: var(--txt, #0f172a);
  cursor: pointer; user-select: none; margin-bottom: 12px;
}
.ugf-radio-item:last-child { margin-bottom: 0; }
.ugf-radio-item code {
  font-family: 'SFMono-Regular', Consolas, monospace; font-size: .72rem;
  color: var(--txt-2, #64748b); background: var(--page-bg, #f8fafc);
  padding: 2px 6px; border-radius: 5px;
}
.ugf-radio-item input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.ugf-radio-box {
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--border, #e2e8f0);
  display: inline-block; position: relative;
  transition: border-color .15s ease;
}
.ugf-radio-item input[type="radio"]:checked + .ugf-radio-box {
  border-color: var(--brand, #6366f1);
}
.ugf-radio-item input[type="radio"]:checked + .ugf-radio-box::after {
  content: ''; position: absolute; inset: 3px; border-radius: 50%;
  background: var(--brand, #6366f1);
}

#ugfScope .controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 20px 0; }

#ugfScope #ugfFormatBtn,
#ugfScope #ugfDownloadBtn,
#ugfScope #ugfCopyBtn {
  background: linear-gradient(135deg, var(--brand, #6366f1), var(--brand-dark, #4338ca));
  border: none; padding: 13px 26px;
  font-weight: 700; font-size: .95rem; border-radius: 12px;
  box-shadow: 0 10px 24px rgba(99,102,241,.35);
  transition: transform .15s ease, box-shadow .15s ease;
}
#ugfScope #ugfFormatBtn:hover,
#ugfScope #ugfDownloadBtn:hover,
#ugfScope #ugfCopyBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(99,102,241,.45);
}
#ugfScope #ugfFormatBtn:active,
#ugfScope #ugfDownloadBtn:active,
#ugfScope #ugfCopyBtn:active { transform: translateY(0); }
#ugfScope .btn-warning,
#ugfScope .btn-danger { padding: 13px 26px; font-weight: 700; font-size: .95rem; border-radius: 12px; }

.ugf-summary {
  margin: 0 0 16px; font-size: .9rem; color: var(--txt, #0f172a); line-height: 1.6;
}
.ugf-summary .ugf-skip-line { color: var(--txt-2, #64748b); font-size: .8rem; margin-top: 4px; }

/* ── Upload-mode per-file results ── */
.ugf-file-results { list-style: none; margin: 0; padding: 0; }
.ugf-file-result {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 8px;
  border-radius: 10px; background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
}
.ugf-file-result-name { font-weight: 700; font-size: .85rem; color: var(--txt, #0f172a); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ugf-file-result-stat { font-size: .78rem; color: var(--txt-2, #64748b); }
.ugf-file-result-download {
  border: 1px solid var(--border, #e2e8f0); background: var(--page-bg, #f8fafc);
  border-radius: 8px; padding: 6px 12px; font-size: .76rem; font-weight: 700;
  cursor: pointer; color: var(--brand, #6366f1); flex-shrink: 0;
}
.ugf-file-result-download:hover { background: rgba(99,102,241,.1); }


/* ── Output Format / Letter Case popups — shown sequentially after Paste
   or Upload, instead of inline option cards. Same shape as every other
   settings modal on the site. ── */
.ugf-modal {
  position: fixed; inset: 0; z-index: 100001;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.ugf-modal.ugf-modal-open { display: flex; }
.ugf-modal-backdrop {
  position: absolute; inset: 0; background: rgba(15,23,42,.6);
  animation: ugfFadeIn .15s ease;
}
.ugf-modal-box {
  position: relative; z-index: 1;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  padding: 28px 30px;
  border-radius: 18px;
  max-width: 480px; width: 100%;
  max-height: 86vh; overflow-y: auto;
  animation: ugfPopIn .2s ease;
  box-shadow: 0 30px 60px rgba(0,0,0,.3);
}
.ugf-modal-box h3 {
  display: flex; align-items: center; gap: 8px;
  color: var(--txt, #0f172a); margin: 0 0 18px; padding-right: 36px;
}
.ugf-modal-box h3 i { color: var(--brand, #6366f1); }
.ugf-modal-box .ugf-radio-item { margin-bottom: 14px; }
.ugf-modal-box .controls { margin: 18px 0 0; justify-content: flex-end; }
.ugf-modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--page-bg, #f8fafc); color: var(--txt-2, #64748b); border: 1px solid var(--border, #e2e8f0);
  font-size: 1.1rem; line-height: 1; cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.ugf-modal-close:hover { background: var(--brand, #6366f1); color: #fff; border-color: var(--brand, #6366f1); }
@keyframes ugfFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes ugfPopIn {
  from { opacity: 0; transform: scale(.92); }
  to   { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .ugf-modal-backdrop, .ugf-modal-box { animation: none; }
}
