/* ─── WP File Converter ─────────────────────────────────────── */

.wfc-app {
  max-width: 720px;
  margin: 24px auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  color: #1d2327;
}

.wfc-app *,
.wfc-app *::before,
.wfc-app *::after {
  box-sizing: border-box;
}

/* ─── Sections ──────────────────────────────────────────────── */

.wfc-section {
  background: #fff;
  border: 1px solid #c3c4c7;
  border-radius: 8px;
  padding: 40px 32px;
  text-align: center;
}

.wfc-section-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 20px;
}

/* ─── Loading ───────────────────────────────────────────────── */

.wfc-loading-icon {
  color: #2271b1;
  margin-bottom: 16px;
  animation: wfc-spin 2s linear infinite;
}

@keyframes wfc-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.wfc-loading-text {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px;
}

.wfc-loading-bar {
  width: 100%;
  max-width: 400px;
  height: 8px;
  background: #f0f0f1;
  border-radius: 4px;
  margin: 0 auto 12px;
  overflow: hidden;
}

.wfc-loading-bar-fill {
  height: 100%;
  width: 0%;
  background: #2271b1;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.wfc-loading-detail {
  font-size: 13px;
  color: #646970;
  margin: 0;
}

@keyframes wfc-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ─── Upload / Dropzone ─────────────────────────────────────── */

.wfc-dropzone {
  border: 2px dashed #c3c4c7;
  border-radius: 8px;
  padding: 48px 32px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.wfc-dropzone:hover,
.wfc-dropzone.wfc-dragover {
  border-color: #2271b1;
  background: #f0f6fc;
}

.wfc-dropzone-icon {
  color: #a7aaad;
  margin-bottom: 12px;
  transition: color 0.2s;
}

.wfc-dropzone:hover .wfc-dropzone-icon,
.wfc-dropzone.wfc-dragover .wfc-dropzone-icon {
  color: #2271b1;
}

.wfc-dropzone-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
}

.wfc-dropzone-or {
  font-size: 13px;
  color: #646970;
  margin: 4px 0 12px;
}

.wfc-hint {
  font-size: 13px;
  color: #646970;
  margin: 12px 0 0;
}

/* ─── Buttons ───────────────────────────────────────────────── */

.wfc-app .wfc-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  border: 1px solid #c3c4c7;
  border-radius: 4px;
  background: #f6f7f7;
  color: #1d2327;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-decoration: none;
}

.wfc-app .wfc-btn:hover,
.wfc-app .wfc-btn:focus {
  background: #e7e8ea;
  border-color: #8c8f94;
  color: #000;
}

.wfc-app .wfc-btn-primary {
  background: #2271b1;
  border-color: #2271b1;
  color: #fff;
}

.wfc-app .wfc-btn-primary:hover,
.wfc-app .wfc-btn-primary:focus {
  background: #135e96;
  border-color: #135e96;
  color: #fff;
}

.wfc-app .wfc-btn-success {
  background: #00a32a;
  border-color: #00a32a;
  color: #fff;
}

.wfc-app .wfc-btn-success:hover,
.wfc-app .wfc-btn-success:focus {
  background: #008a20;
  border-color: #008a20;
  color: #fff;
}

.wfc-app .wfc-btn-secondary {
  background: transparent;
  border-color: #c3c4c7;
  color: #2271b1;
}

.wfc-app .wfc-btn-secondary:hover,
.wfc-app .wfc-btn-secondary:focus {
  background: #f0f6fc;
  border-color: #2271b1;
  color: #135e96;
}

.wfc-app .wfc-btn-danger {
  background: #d63638;
  border-color: #d63638;
  color: #fff;
}

.wfc-app .wfc-btn-danger:hover,
.wfc-app .wfc-btn-danger:focus {
  background: #b32d2e;
  border-color: #b32d2e;
  color: #fff;
}

.wfc-btn-large {
  padding: 12px 32px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 6px;
}

.wfc-btn-small {
  padding: 4px 12px;
  font-size: 13px;
}

/* ─── File Info Bar ─────────────────────────────────────────── */

.wfc-file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f0f6fc;
  border: 1px solid #c3c4c7;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 24px;
  text-align: left;
}

.wfc-file-info-icon {
  flex-shrink: 0;
  color: #2271b1;
}

.wfc-file-info-details {
  flex: 1;
  min-width: 0;
}

.wfc-file-name {
  display: block;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wfc-file-size {
  display: block;
  font-size: 13px;
  color: #646970;
}

/* ─── Action Cards ──────────────────────────────────────────── */

.wfc-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.wfc-action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 16px;
  background: #fff;
  border: 2px solid #dcdcde;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.1s;
  text-align: center;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.wfc-action-card svg {
  color: #646970;
  transition: color 0.2s;
}

.wfc-action-card strong {
  font-size: 14px;
  display: block;
}

.wfc-action-card span {
  font-size: 12px;
  color: #646970;
  line-height: 1.4;
}

.wfc-action-card:hover {
  border-color: #2271b1;
  background: #f0f6fc;
  color: #1d2327;
}

.wfc-action-card:hover svg {
  color: #2271b1;
}

.wfc-action-card:hover span {
  color: #3c434a;
}

.wfc-action-card.wfc-active {
  border-color: #2271b1;
  background: #f0f6fc;
  color: #1d2327;
  transform: scale(1.02);
}

.wfc-action-card.wfc-active svg {
  color: #2271b1;
}

.wfc-action-card.wfc-active span {
  color: #3c434a;
}

/* ─── Sub-options ───────────────────────────────────────────── */

.wfc-suboptions {
  text-align: left;
  background: #f6f7f7;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.wfc-suboptions-label {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 12px;
}

.wfc-radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wfc-radio {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.wfc-radio:hover {
  border-color: #2271b1;
  background: #f0f6fc;
}

.wfc-radio input[type="radio"] {
  margin-top: 3px;
  accent-color: #2271b1;
}

.wfc-radio-label {
  display: flex;
  flex-direction: column;
}

.wfc-radio-label strong {
  font-size: 14px;
  line-height: 1.4;
}

.wfc-radio-label em {
  font-style: normal;
  font-size: 12px;
  color: #646970;
  line-height: 1.4;
}

/* ─── Progress ──────────────────────────────────────────────── */

.wfc-processing-note {
  font-size: 13px;
  color: #646970;
  margin: -12px 0 20px;
}

.wfc-engine-badge {
  display: inline-block;
  font-size: 12px;
  color: #1d2327;
  background: #f0f0f1;
  border: 1px solid #dcdcde;
  border-radius: 12px;
  padding: 3px 10px;
  margin: -10px 0 18px;
}

.wfc-engine-badge.wfc-engine-mt {
  background: #eaf5ea;
  border-color: #b6d8b6;
  color: #0a4a0a;
}

.wfc-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.wfc-progress-bar {
  flex: 1;
  height: 12px;
  background: #f0f0f1;
  border-radius: 6px;
  overflow: hidden;
}

.wfc-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2271b1, #3582c4);
  border-radius: 6px;
  transition: width 0.4s ease;
}

.wfc-progress-text {
  font-size: 14px;
  font-weight: 600;
  min-width: 40px;
  text-align: right;
  color: #2271b1;
}

.wfc-log {
  max-height: 160px;
  overflow-y: auto;
  background: #1d2327;
  color: #c3c4c7;
  border-radius: 6px;
  padding: 12px 16px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 11px;
  line-height: 1.6;
  text-align: left;
}

.wfc-log-line {
  white-space: pre-wrap;
  word-break: break-all;
}

.wfc-cancel-wrap {
  margin-top: 16px;
}

/* ─── Result ────────────────────────────────────────────────── */

.wfc-result-icon {
  margin-bottom: 8px;
}

.wfc-result-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 20px 0 28px;
  flex-wrap: wrap;
}

.wfc-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 20px;
  background: #f6f7f7;
  border-radius: 6px;
  min-width: 120px;
}

.wfc-stat-label {
  font-size: 12px;
  color: #646970;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.wfc-stat-value {
  font-size: 18px;
  font-weight: 700;
}

.wfc-stat-arrow {
  font-size: 20px;
  color: #a7aaad;
}

.wfc-stat-saved {
  background: #edfaef;
}

.wfc-stat-saved .wfc-stat-value {
  color: #00a32a;
}

.wfc-result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── Error ─────────────────────────────────────────────────── */

.wfc-error-icon {
  margin-bottom: 8px;
}

.wfc-error-message {
  font-size: 14px;
  color: #646970;
  margin: 0 0 20px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* ─── Responsive ────────────────────────────────────────────── */

@media (max-width: 600px) {
  .wfc-section {
    padding: 28px 20px;
  }

  .wfc-actions {
    grid-template-columns: 1fr;
  }

  .wfc-file-info {
    flex-wrap: wrap;
  }

  .wfc-result-stats {
    flex-direction: column;
    gap: 8px;
  }

  .wfc-stat-arrow {
    transform: rotate(90deg);
  }

  .wfc-result-actions {
    flex-direction: column;
  }

  .wfc-result-actions .wfc-btn {
    justify-content: center;
  }
}

/* ─── WP Admin overrides ────────────────────────────────────── */

.wrap .wfc-app {
  margin-top: 16px;
}
