/* --- Page structure --- */
.extractor--tool {
  min-height: 760px;
}

.extractor .hero {
  background:
    radial-gradient(900px 360px at 15% -25%, rgba(147, 197, 253, 0.30), transparent),
    radial-gradient(820px 320px at 85% -10%, rgba(59, 130, 246, 0.24), transparent),
    linear-gradient(140deg, #0b1f4d 0%, #0f2f73 55%, #133f96 100%);
  border: 1px solid rgba(191, 219, 254, 0.26);
  border-radius: 14px;
  padding: 22px;
  margin-top: 18px;
  min-height: 180px;
  box-shadow: 0 20px 50px rgba(11, 31, 77, 0.30);
}
.extractor .hero h1 {
  margin: 0 0 10px;
  font-size: clamp(22px, 4vw, 38px);
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}
.extractor .hero p {
  margin: 0;
  color: #dbeafe;
  max-width: 880px;
}

.extractor-box {
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(191, 219, 254, 0.55);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  gap: 10px;
  backdrop-filter: blur(6px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.25);
  transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}
.extractor-box:focus-within {
  border-color: rgba(125, 211, 252, 0.95);
  box-shadow: 0 0 0 3px rgba(125, 211, 252, 0.22), 0 18px 34px rgba(15, 23, 42, 0.30);
  transform: translateY(-1px);
}

.extractor-how {
  margin-top: 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.extractor-how h2 {
  margin: 0 0 12px;
  font-size: 20px;
}
.how-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.how-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}
.how-card h3 {
  margin: 8px 0 6px;
  font-size: 15px;
}
.how-card p {
  margin: 0;
  font-size: 13px;
  color: #475467;
  line-height: 1.6;
}
.how-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--brand);
}
.extract-input {
  flex: 1;
  padding: 14px 16px;
  border: 1px solid rgba(191, 219, 254, 0.48);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.99);
  color: #0f172a;
  font-size: 16px;
  font-weight: 600;
  font: inherit;
}
.extract-input::placeholder { color: #64748b; }
.extract-input:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.30);
}
.extractor-box .btn--primary {
  background: linear-gradient(135deg, #38bdf8 0%, #2563eb 100%);
  border: 1px solid rgba(191, 219, 254, 0.35);
  color: #fff;
  font-weight: 700;
  min-width: 170px;
  padding: 0 18px;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}
.extractor-box .btn--primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.extractor-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  margin-top: 16px;
}

/* --- Sidebar --- */
.extractor-sidebar .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  position: sticky;
  top: 80px;
}
.panel__title { margin: 4px 0 10px; font-size: 18px; font-weight: 700; }
.group { margin-bottom: 14px; }
.label { display:block; font-size:12px; color:#475467; margin-bottom:6px; }
.input {
  width: 100%; padding: 10px 12px; border:1px solid var(--line);
  border-radius: 10px; background:#fff;
}
.input--sm { padding: 8px 10px; font-size: 12px; }
.check { display:flex; gap:10px; align-items:center; margin:8px 0; font-size:14px; }
.check.small { font-size: 12px; }
.row-inline { display: flex; gap: 8px; flex-wrap: wrap; }
.row-inline .input { flex: 1; min-width: 120px; }
.row-inline .btn { flex: 1; }

.type-filters { display:flex; flex-wrap:wrap; gap:8px; }
.type-chip {
  padding:6px 10px; border-radius:999px; border:1px solid var(--line);
  background:#fff; cursor:pointer; font-weight:700; font-size:12px;
}
.type-chip.active { background: var(--brand); color:#fff; border-color:transparent; }

.stack { display:flex; flex-direction:column; gap:8px; }
.btn--wide { width:100%; padding:12px 14px; font-size:15px; font-weight:600; }
.btn--blue { background:#2563eb; color:#fff; border-color:transparent; }
.btn--green{ background:#16a34a; color:#fff; border-color:transparent; }
.btn--dark { background:#0f172a; color:#fff; border-color:transparent; }
.btn--ghost { background:#fff; border:1px solid var(--line); color:#111827; }
.btn--ghost:hover { background:#f8fafc; }
.extractor-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  font-size: 13px;
  margin: 8px 0 10px;
}
.extractor-error.is-ok {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}
.credit-cost {
  font-weight: 700;
  margin-left: 6px;
  opacity: 0.85;
  font-size: 11px;
}

/* --- Results --- */
.result-meta { margin: 6px 0 10px; }
.result-list { display:flex; flex-direction:column; gap:10px; }

.result-item {
  display:grid;
  grid-template-columns: 40px 72px 1fr auto;
  align-items:center;
  gap:12px;
  background: var(--panel);
  border:1px solid var(--line);
  border-radius:12px;
  padding:10px;
  transition: box-shadow .15s, border-color .15s;
}

.extractor-seo {
  line-height: 1.7;
}
.extractor-seo h2 {
  margin-top: 26px;
}
.extractor-seo h3 {
  margin-top: 18px;
  margin-bottom: 8px;
}
.extractor-faq details {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
  margin-bottom: 10px;
}
.extractor-faq summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}
.extractor-faq summary::-webkit-details-marker {
  display: none;
}
.extractor-faq p {
  margin: 10px 0 0;
}
.extractor-examples {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.extractor-examples article {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}
.extractor-examples h4 {
  margin: 0 0 8px;
}
.extractor-examples p {
  margin: 0;
  font-size: 13px;
  color: #475467;
}
.result-item:hover { border-color:#dbe2f0; box-shadow: 0 8px 18px rgba(15,23,42,0.06); }
.thumb {
  width:72px; height:72px; border-radius:10px;
  object-fit:cover; border:1px solid #f1f3f8;
}
.meta { display:flex; flex-direction:column; gap:6px; }
.meta .name { font-weight:700; font-size:14px; word-break:break-all; }
.meta .badges { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.badge {
  font-size:11px; padding:4px 8px; border-radius:999px;
  border:1px solid var(--line); background:#fff;
}
.badge.type { font-weight:800; }
.actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.btn--sm {
  padding:8px 10px; border-radius:10px;
  border:1px solid var(--line); background:#fff;
  font-weight:700; cursor:pointer;
}
.btn--primary { background: var(--brand); color:#fff; border-color:transparent; box-shadow:0 10px 30px var(--ring); }

/* --- Responsive design --- */
@media (max-width: 980px) {
  .extractor-grid { grid-template-columns: 1fr; }
  .extractor-sidebar .panel {
    position: relative;
    top: auto;
    margin-bottom: 18px;
  }
}

@media (max-width: 768px) {
  .extractor--tool {
    min-height: 560px;
  }
  .extractor .hero {
    padding: 14px;
    text-align: center;
  }
  .extractor-box {
    flex-direction: column;
    padding: 10px;
  }
  .extractor-box .btn {
    width: 100%;
  }
  .extractor-sidebar {
    order: 2;
  }
  .extractor-results {
    order: 1;
  }
  .how-grid {
    grid-template-columns: 1fr;
  }
  .extractor-examples {
    grid-template-columns: 1fr;
  }
  .result-item {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 10px;
    padding: 12px;
  }
  .thumb {
    width: 100%;
    height: auto;
    max-width: 240px;
    margin: 0 auto;
  }
  .meta { align-items: center; }
  .meta .name { font-size: 13px; }
  .actions {
    justify-content: center;
  }
  .btn--sm {
    padding:10px 12px;
    font-size:14px;
  }
}

@media (max-width: 480px) {
  .extractor .hero h1 { font-size: 22px; }
  .extractor .hero p { font-size: 14px; }
  .meta .name { font-size: 12px; }
  .btn--wide { font-size:14px; }
  .btn--sm { width:100%; }
}
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.page-info { font-size: 12px; color: var(--muted); }
.page-btn {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.page-btn:hover {
  background: var(--brand);
  color: #fff;
}
.page-btn.active {
  background: var(--brand);
  color: #fff;
  border-color: transparent;
}
.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.tip-box {
  margin-top: 18px;
  background: #f6f8ff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  color: #333;
  font-size: 14px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.04);
  transition: background .3s, transform .3s;
}
.tip-box:hover {
  background: #eef1ff;
  transform: translateY(-2px);
}
.tip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.tip-title {
  margin: 0;
  font-weight: 700;
  color: var(--brand);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.next-tip-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--brand);
  font-size: 18px;
  line-height: 1;
  padding: 2px 4px;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.next-tip-btn:hover {
  transform: rotate(90deg);
}
#eduTipExtractor {
  margin: 0;
  color: #475467;
  line-height: 1.55;
}
.tip-progress {
  margin-top: 8px;
  width: 100%;
  height: 4px;
  background: #e5e7f0;
  border-radius: 999px;
  overflow: hidden;
}
.tip-progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
  transition: width 10s linear;
}
.fade-in {
  animation: fadeIn .6s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
