/* ED NG Widget - minimal clean UI (no framework) */

/* --- Root, wrap, card --- */
.edng-root {
  width: 100%;
  box-sizing: border-box;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: #0f172a;
}

.edng-wrap {
  min-height: 300px;
  display: flex;
  align-items: start;
  justify-content: center;
  background: #fff;
  padding: 16px;
}

.edng-card {
  width: 100%;
  max-width: 900px;
}

/* --- Hero (titoli, sottotitolo) --- */
.edng-hero h1 {
  margin: 0 0 8px 0;
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 800;
  display: none !important;
}

.edng-hero p {
  margin: 0 0 18px 0;
  color: #64748b;
  font-size: 16px;
  display: none !important;
}

/* --- Box, textarea --- */
.edng-box {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.04);
  padding: 10px;
}

.edng-textarea {
  width: 100%;
  min-height: 110px;
  border: 0;
  outline: 0;
  resize: none;
  font-size: 15px;
  padding: 8px;
  background: transparent;
  color: #0f172a;
}

.edng-textarea::placeholder {
  color: #94a3b8;
}

/* --- Pulsanti, topbar, row --- */
.edng-btn {
  width: 100%;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 15px;
  text-transform: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #0f172a;
  color: #fff;
  transition: transform 0.04s ease, background 0.15s ease;
}

.edng-btn:hover {
  background: #A4FBC4 !important;
  text-transform: none !important;
}

.edng-btn:active {
  transform: translateY(1px);
  text-transform: none !important;
}

.edng-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  text-transform: none !important;
}

.edng-row {
  margin-top: 12px;
}

.edng-topbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.edng-muted {
  color: #64748b;
}

/* --- Tab e panel (Risultati, Cronologia, Preferiti) --- */
.edng-tabs {
  margin-top: 18px;
  border-bottom: 0px solid #e2e8f0 !important;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.edng-tab {
  border: 1px solid #e2e8f0;
  border-bottom: 0;
  background: #f8fafc;
  color: #0f172a;
  border-radius: 12px 12px 0 0;
  padding: 10px 12px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.04em;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
}

.edng-tab[aria-selected="true"] {
  background: #fff;
  border-color: #e2e8f0;
}

/* --- Mobile: nascondi testo tab cronologia/preferiti --- */
@media (max-width: 480px) {
  .edng-tab--icon-only-mobile .edng-tab-label {
    display: none;
  }
}

.edng-panel {
  border: 1px solid #e2e8f0;
  border-top: 0;
  border-radius: 0 12px 12px 12px;
  background: #fff;
  padding: 14px;
}

/* --- Pills (filtri TLD, cancella filtri) --- */
.edng-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.edng-pill {
  border: 0;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-weight: 700;
  font-size: 12px;
  text-transform: none !important;
}

.edng-pill.is-active {
  background: #0f172a;
  color: #fff;
  text-transform: none !important;
}

.edng-pill.is-clear {
  background: #ef4444 !important;
  color: #fff !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-transform: none !important;
}

.edng-pill.is-clear:hover {
  background: #dc2626;
}

.edng-pill.is-clear-history {
  background: #ef4444 !important;
  color: #fff !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.edng-pill.is-clear-history:hover {
  background: #dc2626 !important;
}

/* --- Lista risultati (item, head, nome, cuore, chevron) --- */
.edng-list {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.edng-item {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}

.edng-item-head {
  background: #fff;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.edng-item-head:hover {
  background: rgba(241, 245, 249, 0.6);
}

.edng-name {
  font-size: 18px;
  font-weight: 900;
  margin: 0;
  line-height: 1.15;
}

.edng-sub {
  margin: 2px 0 0 0;
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.edng-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.edng-heart {
  width: 36px;
  height: 36px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.edng-heart.is-on {
  border-color: rgba(15, 23, 42, 0.35);
  background: #0f172a;
  color: #fff;
}

.edng-chevron {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.edng-chevron.is-open {
  transform: rotate(180deg);
}

/* --- Accordion domini (domain, prezzo, acquista, badge premium) --- */
.edng-accordion {
  background: rgba(241, 245, 249, 0.6);
  border-top: 1px solid #e2e8f0;
  padding: 12px;
}

.edng-domain {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.edng-domain+.edng-domain {
  margin-top: 10px;
}

.edng-domain-left {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
  flex: 1;
}

.edng-domain-name {
  font-weight: 600 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.edng-price {
  font-weight: 600 !important;
}

.edng-buy {
  border: 0;
  border-radius: 10px;
  background: #0f172a;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  padding: 8px 12px;
}

.edng-buy:hover {
  background: #273658 !important;
}

/* --- Pulsante "Carica altre estensioni" --- */
.edng-load-more {
  width: 100%;
  margin-top: 12px;
  border: 1px solid #0f172a;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0px 25px 0px 25px !important;
  letter-spacing: 0px !important;
  text-transform: none !important;
  gap: 8px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.edng-load-more:hover {
  background: #f1f5f9;
}

.edng-load-more:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* --- Link "Vedi tutti i domini disponibili" --- */
.edng-view-all-link {
  display: block;
  margin-top: 14px;
  text-align: center;
  color: #475569;
  font-weight: 600;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  transition: color 0.15s ease;
  text-transform: none !important;
  letter-spacing: 0px !important;
}

.edng-view-all-link:hover {
  color: #0f172a;
}

/* --- Empty state, badge premium, count --- */
.edng-center {
  text-align: center;
  padding: 24px 10px;
  color: #64748b;
}

.edng-badge {
  font-size: 11px;
  font-weight: 900;
  background: #fee2e2;
  color: #991b1b;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #fecaca;
  flex-shrink: 0;
}

/* --- Toast (messaggi errore) --- */
.edng-toast {
  margin-top: 10px;
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #9f1239;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 700;
  display: none;
}

.edng-toast.is-show {
  display: block;
}

/* --- Count (risultati / preferiti) --- */
.edng-count {
  margin-top: 10px;
  color: #64748b;
  font-weight: 700;
}

/* --- Powered by --- */
.edng-powered {
  margin: 14px 0 0 0;
  text-align: center;
  font-size: 16px;
  color: #94a3b8;
}

.edng-powered a {
  color: #a4fbc4 !important;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
}

.edng-powered a:hover {
  color: #a4fbc4 !important;
  text-decoration: underline;
}

/* --- Domain right section (prezzo + acquista) --- */
.edng-domain-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.edng-buy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.edng-buy-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.edng-buy-text {
  white-space: nowrap;
}

/* --- Mobile: layout verticale per domini --- */
@media (max-width: 480px) {
  .edng-domain {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .edng-domain-left {
    justify-content: flex-start;
  }

  .edng-domain-right {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding-top: 8px;
    border-top: 1px solid #f1f5f9;
  }

  .edng-buy-text {
    display: none;
  }

  .edng-buy {
    padding: 10px;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
  }

  .edng-buy-icon {
    width: 20px;
    height: 20px;
  }

  .edng-buy-icon svg {
    width: 20px;
    height: 20px;
  }
}