/* ============================================================
   PXC Broadband Availability Checker – Front-end Styles
   Minimal, clean, professional. No framework dependencies.
   ============================================================ */

:root {
  --pxc-primary:     #0057B8;
  --pxc-primary-dk:  #003d82;
  --pxc-success:     #007a4d;
  --pxc-warning:     #b45309;
  --pxc-danger:      #b91c1c;
  --pxc-muted:       #6b7280;
  --pxc-border:      #e5e7eb;
  --pxc-bg:          #f9fafb;
  --pxc-card-bg:     #ffffff;
  --pxc-radius:      10px;
  --pxc-shadow:      0 1px 4px rgba(0,0,0,.08);
  --pxc-shadow-lg:   0 4px 20px rgba(0,0,0,.12);
  --pxc-font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --pxc-fttp:        #2563eb;
  --pxc-sogea:       #7c3aed;
  --pxc-copper:      #92400e;
}

/* ── Container ───────────────────────────────────────────── */
.pxc-checker {
  font-family: var(--pxc-font);
  color: #111827;
  max-width: 900px;
  margin: 0 auto;
}

/* ── Header ──────────────────────────────────────────────── */
.pxc-checker__header {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
}

.pxc-checker__signal {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 1rem;
}
.pxc-checker__signal span {
  display: inline-block;
  width: 6px;
  background: var(--pxc-primary);
  border-radius: 3px;
  animation: pxc-pulse 1.4s ease-in-out infinite;
}
.pxc-checker__signal span:nth-child(1) { height: 8px;  animation-delay: 0s; }
.pxc-checker__signal span:nth-child(2) { height: 14px; animation-delay: .2s; }
.pxc-checker__signal span:nth-child(3) { height: 20px; animation-delay: .4s; }
.pxc-checker__signal span:nth-child(4) { height: 14px; animation-delay: .6s; }

@keyframes pxc-pulse {
  0%, 100% { opacity: .3; }
  50%       { opacity: 1; }
}

.pxc-checker__title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 .5rem;
  line-height: 1.2;
}

.pxc-checker__subtitle {
  color: var(--pxc-muted);
  font-size: .95rem;
  margin: 0;
}

/* ── Search bar ──────────────────────────────────────────── */
.pxc-checker__search {
  padding: 0 1rem 1.5rem;
}

.pxc-checker__input-wrap {
  display: flex;
  gap: .625rem;
  max-width: 520px;
  margin: 0 auto;
}

.pxc-checker__input {
  flex: 1;
  padding: .75rem 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: .05em;
  border: 2px solid var(--pxc-border);
  border-radius: var(--pxc-radius);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  background: var(--pxc-card-bg);
  text-transform: uppercase;
}
.pxc-checker__input:focus {
  border-color: var(--pxc-primary);
  box-shadow: 0 0 0 3px rgba(0,87,184,.15);
}

.pxc-checker__btn {
  padding: .75rem 1.5rem;
  background: var(--pxc-primary);
  color: #fff;
  border: none;
  border-radius: var(--pxc-radius);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
  display: flex;
  align-items: center;
  gap: .5rem;
  white-space: nowrap;
  min-width: 160px;
  justify-content: center;
}
.pxc-checker__btn:hover  { background: var(--pxc-primary-dk); }
.pxc-checker__btn:active { transform: scale(.98); }
.pxc-checker__btn:disabled { opacity: .6; cursor: not-allowed; }

.pxc-btn-spinner {
  display: none;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
}
.pxc-btn--loading .pxc-btn-text    { display: none; }
.pxc-btn--loading .pxc-btn-spinner {
  display: block;
  animation: pxc-spin .7s linear infinite;
}
@keyframes pxc-spin { to { transform: rotate(360deg); } }

.pxc-checker__error {
  display: none;
  text-align: center;
  color: var(--pxc-danger);
  font-size: .875rem;
  margin-top: .75rem;
  padding: .5rem 1rem;
  background: #fef2f2;
  border-radius: 6px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* ── Advanced panel ──────────────────────────────────────── */
.pxc-checker__advanced {
  max-width: 520px;
  margin: 0 auto 1.5rem;
  padding: 0 1rem;
}
.pxc-checker__advanced-toggle {
  background: none;
  border: none;
  color: var(--pxc-primary);
  font-size: .85rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-decoration-style: dotted;
}
.pxc-checker__advanced-panel {
  margin-top: .75rem;
  padding: 1rem;
  background: var(--pxc-bg);
  border: 1px solid var(--pxc-border);
  border-radius: var(--pxc-radius);
}
.pxc-advanced-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .75rem;
}
.pxc-advanced-grid label {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--pxc-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.pxc-select, .pxc-input-sm {
  padding: .4rem .6rem;
  border: 1px solid var(--pxc-border);
  border-radius: 6px;
  font-size: .875rem;
  background: #fff;
  width: 100%;
}

/* ── Loading state ───────────────────────────────────────── */
.pxc-loading {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--pxc-muted);
}
.pxc-loading__dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 1rem;
}
.pxc-loading__dots span {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--pxc-primary);
  animation: pxc-bounce .8s ease-in-out infinite;
}
.pxc-loading__dots span:nth-child(2) { animation-delay: .15s; }
.pxc-loading__dots span:nth-child(3) { animation-delay: .3s; }
@keyframes pxc-bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

/* ── Results header ──────────────────────────────────────── */
.pxc-results-header {
  padding: .5rem 1rem 1rem;
  text-align: center;
}
.pxc-results-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 .25rem;
}
.pxc-address-label {
  color: var(--pxc-muted);
  font-size: .875rem;
  margin: 0;
}

/* ── Product cards ───────────────────────────────────────── */
.pxc-products-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0 1rem 1rem;
}

.pxc-product {
  background: var(--pxc-card-bg);
  border: 1px solid var(--pxc-border);
  border-radius: var(--pxc-radius);
  box-shadow: var(--pxc-shadow);
  overflow: hidden;
  transition: box-shadow .2s;
}
.pxc-product--available { border-left: 4px solid var(--pxc-success); }
.pxc-product--unavailable { border-left: 4px solid #d1d5db; opacity: .75; }
.pxc-product:hover { box-shadow: var(--pxc-shadow-lg); }

.pxc-product__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.pxc-product__title {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.pxc-product__supplier-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.pxc-product__name {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  font-family: 'Courier New', monospace;
}

.pxc-product__meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .2rem;
  flex-wrap: wrap;
}

.pxc-supplier-label {
  font-size: .8rem;
  color: var(--pxc-muted);
}

/* Availability pill */
.pxc-avail-pill {
  padding: .35rem .9rem;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
}
.pxc-avail-pill--yes { background: #d1fae5; color: #065f46; }
.pxc-avail-pill--no  { background: #f3f4f6; color: #6b7280; }

/* Technology badges */
.pxc-badge {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 600;
}
.pxc-badge--fttp   { background: #dbeafe; color: var(--pxc-fttp); }
.pxc-badge--sogea  { background: #ede9fe; color: var(--pxc-sogea); }
.pxc-badge--copper { background: #fef3c7; color: var(--pxc-copper); }
.pxc-badge--other  { background: #f3f4f6; color: #6b7280; }

/* ── Speeds table ────────────────────────────────────────── */
.pxc-speeds {
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--pxc-border);
}
.pxc-speeds__title {
  font-size: .875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--pxc-muted);
  margin: 1rem 0 .75rem;
}
.pxc-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.pxc-speeds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
  min-width: 480px;
}
.pxc-speeds-table th {
  text-align: left;
  padding: .5rem .75rem;
  background: var(--pxc-bg);
  border-bottom: 2px solid var(--pxc-border);
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
}
.pxc-speeds-table td {
  padding: .6rem .75rem;
  border-bottom: 1px solid var(--pxc-border);
  color: #1f2937;
}
.pxc-speeds-table tr:last-child td { border-bottom: none; }
.pxc-speed-tier { font-family: monospace; font-weight: 700; }
.pxc-min-speed  { color: var(--pxc-success); font-weight: 600; }
.pxc-min-col    { color: var(--pxc-success); }
.pxc-speeds__note {
  font-size: .75rem;
  color: var(--pxc-muted);
  margin: .5rem 0 0;
}

/* ── Order journeys ──────────────────────────────────────── */
.pxc-journeys {
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--pxc-border);
}
.pxc-journeys__title {
  font-size: .875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--pxc-muted);
  margin: 1rem 0 .75rem;
}
.pxc-journey {
  padding: .75rem 1rem;
  border-radius: 7px;
  border: 1px solid var(--pxc-border);
  margin-bottom: .5rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.pxc-journey--available   { background: #f0fdf4; border-color: #bbf7d0; }
.pxc-journey--unavailable { background: var(--pxc-bg); opacity: .7; }

.pxc-journey__header {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.pxc-journey__name {
  font-weight: 700;
  font-size: .9rem;
  color: #0f172a;
}
.pxc-journey__desc {
  font-size: .8rem;
  color: var(--pxc-muted);
  margin: 0;
}

/* Availability status badges */
.pxc-status {
  font-size: .75rem;
  font-weight: 700;
  padding: .15rem .5rem;
  border-radius: 4px;
}
.pxc-status--yes      { background: #d1fae5; color: #065f46; }
.pxc-status--no       { background: #fee2e2; color: #991b1b; }
.pxc-status--possible { background: #fef3c7; color: #92400e; }
.pxc-status--waiting  { background: #e0e7ff; color: #3730a3; }

.pxc-appt { font-size: .8rem; }
.pxc-appt--required    { color: #b45309; }
.pxc-appt--recommended { color: #0369a1; }
.pxc-appt--none        { color: var(--pxc-success); }

.pxc-install-type,
.pxc-earliest,
.pxc-no-avail-code {
  font-size: .78rem;
  color: var(--pxc-muted);
}

/* ── Existing infrastructure ─────────────────────────────── */
.pxc-existing {
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--pxc-border);
}
.pxc-existing__title {
  font-size: .875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--pxc-muted);
  margin: 1rem 0 .5rem;
}
.pxc-existing-item {
  font-size: .85rem;
  padding: .35rem 0;
  border-bottom: 1px dashed var(--pxc-border);
  color: #374151;
}
.pxc-existing-item:last-child { border-bottom: none; }
.pxc-line-status {
  padding: .1rem .4rem;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 600;
}
.pxc-line-status--working { background: #d1fae5; color: #065f46; }
.pxc-line-status--stopped { background: #fef3c7; color: #92400e; }

/* ── Unavailable / no results sections ───────────────────── */
.pxc-unavailable-section {
  margin: 0 1rem 1rem;
}
.pxc-unavailable-section > summary {
  cursor: pointer;
  font-size: .875rem;
  color: var(--pxc-muted);
  padding: .5rem 0;
  user-select: none;
}

.pxc-no-results {
  text-align: center;
  padding: 3rem 1rem;
}
.pxc-no-results__icon { font-size: 3rem; margin-bottom: 1rem; }
.pxc-no-results h3    { color: #374151; }
.pxc-no-results p     { color: var(--pxc-muted); font-size: .9rem; }

/* ── Raw JSON ─────────────────────────────────────────────── */
.pxc-raw-section {
  margin: 1rem;
  border: 1px dashed var(--pxc-border);
  border-radius: var(--pxc-radius);
}
.pxc-raw-section summary {
  cursor: pointer;
  padding: .75rem 1rem;
  font-size: .8rem;
  color: var(--pxc-muted);
}
.pxc-raw-json {
  max-height: 400px;
  overflow: auto;
  padding: 1rem;
  font-size: .75rem;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 0 0 var(--pxc-radius) var(--pxc-radius);
  margin: 0;
  white-space: pre;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 540px) {
  .pxc-checker__input-wrap { flex-direction: column; }
  .pxc-checker__btn        { width: 100%; }
  .pxc-product__header     { flex-direction: column; align-items: flex-start; }
  .pxc-checker__title      { font-size: 1.35rem; }
}
