/* =============================================================
   Payment Tool Comparator — ptc-style.css
   All rules scoped to #ptc-app to avoid theme collisions.
   ============================================================= */

/* ── Custom properties ─────────────────────────────────────── */
#ptc-app {
  --ptc-primary:        #1e6091;
  --ptc-primary-light:  #4a90c2;
  --ptc-accent:         #f4a261;
  --ptc-bg:             #f5f7fa;
  --ptc-card:           #ffffff;
  --ptc-text:           #2c3e50;
  --ptc-muted:          #6c757d;
  --ptc-border:         #e1e5ea;
  --ptc-green:          #2a9d8f;
  --ptc-red:            #e76f51;
  --ptc-gold:           #f4a261;
  --ptc-radius:         10px;
  --ptc-shadow:         0 2px 8px rgba(0,0,0,0.07);

  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ptc-text);
  line-height: 1.5;
  font-size: 16px;
}

#ptc-app *, #ptc-app *::before, #ptc-app *::after {
  box-sizing: inherit;
}

/* ── Header ─────────────────────────────────────────────────── */
.ptc-header {
  background: linear-gradient(135deg, var(--ptc-primary), var(--ptc-primary-light));
  color: #fff;
  padding: 28px 24px;
  text-align: center;
  border-radius: var(--ptc-radius) var(--ptc-radius) 0 0;
}
.ptc-header__title { margin: 0 0 8px; font-size: 24px; font-weight: 700; color: #fff; }
.ptc-header__sub   { margin: 0; opacity: 0.9;  color: #fff; }

/* ── Loading spinner ─────────────────────────────────────────── */
.ptc-spinner-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--ptc-bg);
  padding: 80px 24px;
  min-height: 300px;
  text-align: center;
}
.ptc-spinner {
  width: 52px;
  height: 52px;
  border: 5px solid var(--ptc-border);
  border-top-color: var(--ptc-primary);
  border-radius: 50%;
  animation: ptc-spin 0.85s linear infinite;
  margin-bottom: 20px;
}
@keyframes ptc-spin { to { transform: rotate(360deg); } }
.ptc-spinner__msg {
  font-size: 18px;
  font-weight: 600;
  color: var(--ptc-text);
  margin: 0 0 8px;
}
.ptc-spinner__sub {
  font-size: 18px;
  color: var(--ptc-muted);
  max-width: 460px;
  margin: 0 auto;
}

/* ── Layout ─────────────────────────────────────────────────── */
.ptc-body { background: var(--ptc-bg); }
.ptc-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 24px;
  padding: 24px 16px;
  max-width: 1400px;
  margin: 0 auto;
}
@media (max-width: 900px) {
  .ptc-layout { grid-template-columns: 1fr; }
  .ptc-filters { position: static!important; }
}

/* ── Filters sidebar ─────────────────────────────────────────── */
.ptc-filters {
  background: var(--ptc-card);
  border-radius: var(--ptc-radius);
  padding: 20px;
  box-shadow: var(--ptc-shadow);
  height: fit-content;
  position: sticky;
  top: 16px;
}
.ptc-filters__title {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 700;
  color: var(--ptc-primary);
  border-bottom: 2px solid var(--ptc-primary);
  padding-bottom: 8px;
}
.ptc-filter-group { margin-bottom: 18px; }
.ptc-filter-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 16px;
  line-height: 1.2em!important;
  color: var(--ptc-text);
}
#ptc-app .ptc-filter-group select,
#ptc-app .ptc-filter-group input[type="number"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--ptc-border);
  border-radius: 6px;
  font-size: 16px;
  color: var(--ptc-text);
  background: #fff;
}
.ptc-checkbox-list label {
  display: flex;
  align-items: center;
  font-weight: 400;
  margin-bottom: 5px;
  font-size: 14px;
  cursor: pointer;
  color: var(--ptc-text);
}
.ptc-checkbox-list input[type="checkbox"] { margin-right: 7px; }

.ptc-slider-row { display: flex; align-items: center; gap: 8px; }
.ptc-slider-row input[type="range"] { flex: 1; }
.ptc-slider-display {
  min-width: 56px;
  text-align: right;
  font-weight: 600;
  color: var(--ptc-primary);
  font-size: 16px;
}
.ptc-filter-helper {
  font-size: 15px;
  line-height: 1.2em;
  color: var(--ptc-muted);
  margin-top: 4px;
  font-style: italic;
}
.ptc-reset-btn {
  width: 100%;
  padding: 10px;
  background: var(--ptc-accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.2s;
}
.ptc-reset-btn:hover { background: #e0874a; }

/* ── Toolbar ─────────────────────────────────────────────────── */
.ptc-main { min-width: 0; }
.ptc-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.ptc-count { color: var(--ptc-muted); font-size: 18px; }
.ptc-sort-wrap { display: flex; align-items: center; gap: 6px; }
.ptc-sort-wrap label { font-size: 18px; }
#ptc-app .ptc-sort-wrap select {
  padding: 8px 10px;
  border: 1px solid var(--ptc-border);
  border-radius: 6px;
  font-size: 18px;
  background: #fff;
}

/* ── Card grid ───────────────────────────────────────────────── */
.ptc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.ptc-card {
  background: var(--ptc-card);
  border: 2px solid var(--ptc-border);
  border-radius: var(--ptc-radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.ptc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.1);
}
.ptc-card.ptc-selected {
  border-color: var(--ptc-primary);
  background: #f0f7fc;
}

/* Logo area */
.ptc-card__logo-wrap {
  height: 54px;
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}
.ptc-card__logo {
  max-height: 48px;
  max-width: 130px;
  width: auto;
  object-fit: contain;
  cursor: pointer;
  display: block;
}
.ptc-card__logo-placeholder {
  width: 44px;
  height: 44px;
  background: var(--ptc-primary);
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 22px;
  line-height: 44px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

/* Tool name link */
.ptc-card__name {
  display: block;
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  color: var(--ptc-primary);
  text-decoration: none;
  cursor: pointer;
  line-height: 1.3;
}
.ptc-card__name:hover { text-decoration: underline; color: var(--ptc-primary); }

/* Type badge */
.ptc-type-badge {
  display: inline-block;
  background: var(--ptc-primary-light);
  color: #fff;
  font-size: 15px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 10px;
  font-weight: 600;
  line-height: 1.6;
}

/* Quick stats */
.ptc-quick-stats {
  font-size: 15px;
  color: var(--ptc-muted);
  margin-bottom: 12px;
  flex: 1;
}
.ptc-quick-stats div { margin: 3px 0; }
.ptc-quick-stats strong { color: var(--ptc-text); }

/* Compare checkbox */
.ptc-compare-toggle {
  display: flex;
  align-items: center;
  font-size: 16px;
  text-transform: uppercase;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  margin-top: auto;
  color: var(--ptc-text);
}
.ptc-compare-toggle input[type="checkbox"] {
  margin-right: 6px;
  transform: scale(1.1);
}

/* No results message */
.ptc-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 50px 20px;
  color: var(--ptc-muted);
  font-size: 18px;
}

/* ── Comparison tray ─────────────────────────────────────────── */
.ptc-tray {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.13);
  padding: 14px 20px;
  display: none;
  align-items: center;
  justify-content: space-between;
  z-index: 8000;
  flex-wrap: wrap;
  gap: 10px;
}
.ptc-tray.ptc-show { display: flex; }
.ptc-tray__left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--ptc-text); }
.ptc-tray__pills { display: flex; gap: 8px; flex-wrap: wrap; }
.ptc-pill {
  background: var(--ptc-bg);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ptc-text);
}
.ptc-pill__x { cursor: pointer; color: var(--ptc-red); font-weight: 700; line-height: 1; }
.ptc-pill__x:hover { opacity: 0.7; }
.ptc-compare-btn {
  background: var(--ptc-primary);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.ptc-compare-btn:disabled { background: #aac4d6; cursor: not-allowed; }
.ptc-compare-btn:not(:disabled):hover { background: #174d75; }

/* ── Modal overlays ──────────────────────────────────────────── */
.ptc-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.58);
  z-index: 9000;
  overflow-y: auto;
  padding: 30px 16px;
}
.ptc-overlay.ptc-show { display: block; }

.ptc-modal {
  background: #fff;
  max-width: 1100px;
  margin: 0 auto;
  border-radius: 12px;
  padding: 28px;
  position: relative;
  color: var(--ptc-text);
  font-size: 18px;
}
.ptc-modal--detail { max-width: 680px; }

.ptc-modal__close {
  position: absolute;
  top: 10px; right: 14px;
  background: none;
  border: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: var(--ptc-muted);
  padding: 0 4px;
}
.ptc-modal__close:hover { color: var(--ptc-text); }
.ptc-modal__title { margin: 0 0 4px; color: var(--ptc-primary); font-size: 28px; font-weight: 700; }

/* ── Comparison table ────────────────────────────────────────── */
.ptc-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 18px;
  margin-top: 12px;
}
.ptc-compare-table th,
.ptc-compare-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--ptc-border);
  vertical-align: top;
}
.ptc-compare-table .ptc-row-label {
  background: #fafbfc;
  font-weight: 600;
  color: var(--ptc-primary);
  width: 155px;
  white-space: nowrap;
}
.ptc-compare-table .ptc-col-header {
  background: #f0f7fc;
  font-size: 18px;
  font-weight: 700;
  color: var(--ptc-primary);
  text-align: center;
  min-width: 160px;
}
.ptc-col-header img {
  display: block;
  margin: 0 auto 6px;
  max-height: 32px;
  max-width: 100px;
  object-fit: contain;
}
.ptc-compare-table td { color: var(--ptc-text); }
@media (max-width: 700px) {
  .ptc-compare-table { font-size: 18px; }
  .ptc-compare-table th, .ptc-compare-table td { padding: 8px; }
  .ptc-compare-table .ptc-row-label { white-space: normal; width: auto; }
}

/* ── Detail modal content ────────────────────────────────────── */
.ptc-detail__hero {
  display: flex;
  align-items: left;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--ptc-border);
}
.ptc-detail__logo {
  max-height: 64px;
  max-width: 190px!important;
  object-fit: contain;
  flex-shrink: 0;
}
.ptc-detail__logo-placeholder {
  width: 60px; height: 60px;
  background: var(--ptc-primary);
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 22px;
  line-height: 60px;
  text-align: center;
  flex-shrink: 0;
  user-select: none;
}
.ptc-detail__name {
  margin: 0 0 6px;
  font-size: 22px;
  color: var(--ptc-primary);
  font-weight: 700;
}

/* Online info block */
.ptc-detail__online {
  background: #f8fafc;
  border-left: 3px solid var(--ptc-primary-light);
  border-radius: 0 6px 6px 0;
  padding: 16px;
  margin-bottom: 20px;
}
.ptc-detail__description {
  margin: 0 0 12px;
  line-height: 1.65;
  font-size: 18px;
  color: var(--ptc-text);
}
.ptc-detail__stars {
  font-size: 22px;
  color: var(--ptc-gold);
  letter-spacing: 1px;
  line-height: 1.4;
}
.ptc-detail__score-line {
  font-size: 18px;
  color: var(--ptc-muted);
  margin: 2px 0 8px;
}
.ptc-detail__review-summary {
  font-size: 18px;
  color: var(--ptc-muted);
  font-style: italic;
  margin: 0 0 12px;
}
.ptc-detail__website a {
  color: var(--ptc-primary-light);
  font-weight: 600;
  text-decoration: none;
  font-size: 18px;
}
.ptc-detail__website a:hover { text-decoration: underline; }

/* Detail field rows */
.ptc-detail__field {
  display: grid;
  grid-template-columns: 178px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--ptc-border);
  font-size: 18px;
}
.ptc-detail__field:last-child { border-bottom: none; }
.ptc-detail__field-label { font-weight: 600; color: var(--ptc-text); }
.ptc-detail__field-value { color: var(--ptc-muted); }

/* Error/notice */
.ptc-error-msg {
  background: #fff3cd;
  border: 1px solid #f0ad4e;
  border-radius: 6px;
  padding: 14px 18px;
  color: var(--ptc-text);
  font-size: 18px;
  line-height: 1.5;
}
