/* ============================================================
   App Marketplace (views/app-marketplace.js) — card grid with
   logos, SecTepe-Integrationen, Preise und Detail-Modal.
   Uses the shared design tokens from colors_and_type.css.
   ============================================================ */
.am-view { max-width: 1200px; margin: 0 auto; }
.am-hero h2 { margin: 0 0 .25rem; }
.am-hero p { color: var(--sec-fg-muted); margin: 0 0 1rem; max-width: 60ch; }
#am-state { min-height: 1.2em; margin: .25rem 0; font-size: .9rem; color: var(--sec-fg-muted); }
#am-state[data-error="true"] { color: var(--sec-coral-600); }

.am-toolbar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin: .5rem 0; }
.am-search {
  flex: 1 1 240px; max-width: 360px; padding: .55rem .8rem;
  border: 1px solid var(--sec-border); border-radius: var(--radius);
  background: var(--sec-surface); color: var(--sec-fg); font-size: .95rem;
}
.am-search:focus { outline: 2px solid var(--sec-accent); outline-offset: 1px; border-color: var(--sec-accent); }
.am-count { color: var(--sec-fg-subtle); font-size: .85rem; margin-left: auto; }

.am-cats { display: flex; flex-wrap: wrap; gap: .4rem; margin: .25rem 0 1.25rem; }
.am-pill {
  padding: .35rem .8rem; border: 1px solid var(--sec-border); border-radius: 999px;
  background: var(--sec-surface); color: var(--sec-fg-muted); font-size: .85rem;
  cursor: pointer; transition: all .15s ease;
}
.am-pill:hover { border-color: var(--sec-border-strong); color: var(--sec-fg); }
.am-pill.is-active { background: var(--sec-coral-300); border-color: var(--sec-coral-400); color: var(--sec-fg-on-coral); font-weight: 600; }

.am-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.am-card {
  display: flex; flex-direction: column; gap: .6rem; padding: 1rem;
  background: var(--sec-surface); border: 1px solid var(--sec-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  cursor: pointer;
}
.am-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--sec-border-coral); }
.am-card__head { display: flex; align-items: center; gap: .7rem; }
.am-card__t { min-width: 0; }
.am-card__t h3 { margin: 0; font-size: 1.05rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-card__meta { display: flex; align-items: center; gap: .4rem; margin-top: .2rem; }

.am-logo {
  position: relative; flex: 0 0 auto; width: 46px; height: 46px; border-radius: 11px;
  overflow: hidden; background: var(--sec-n-50); border: 1px solid var(--sec-border);
  display: inline-flex; align-items: center; justify-content: center;
}
.am-logo__img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.am-logo__fb { display: none; width: 100%; height: 100%; align-items: center; justify-content: center; font-weight: 700; font-size: 1rem; letter-spacing: .02em; }
.am-logo--fb .am-logo__img { display: none; }
.am-logo--fb .am-logo__fb { display: inline-flex; }

.am-cat { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--sec-fg-subtle); }
.am-base { font-size: .68rem; font-weight: 700; padding: .1rem .4rem; border-radius: 999px; background: var(--sec-coral-50); color: var(--sec-coral-700); border: 1px solid var(--sec-coral-200); }
.am-desc { margin: 0; color: var(--sec-fg-muted); font-size: .88rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.am-ints { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; margin: 0; padding: 0; }
.am-int { display: inline-flex; align-items: center; gap: .25rem; font-size: .72rem; padding: .18rem .5rem; border-radius: 999px; background: var(--sec-n-100); color: var(--sec-fg-muted); border: 1px solid var(--sec-border); }
.am-int__i { font-size: .8rem; line-height: 1; }

.am-card__foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; padding-top: .4rem; border-top: 1px solid var(--sec-border); }
.am-price { font-size: .85rem; color: var(--sec-fg-muted); }
.am-price strong { font-size: 1.05rem; color: var(--sec-fg); }
.am-price__per { color: var(--sec-fg-subtle); }
.am-price--ask { font-style: italic; }

.am-actions { display: flex; align-items: center; gap: .4rem; }
.am-details, .am-request { padding: .4rem .8rem; border-radius: var(--radius); font-size: .85rem; cursor: pointer; border: 1px solid var(--sec-border); }
.am-details { background: var(--sec-surface); color: var(--sec-fg); }
.am-details:hover { border-color: var(--sec-border-strong); }
.am-request { background: var(--sec-coral-300); border-color: var(--sec-coral-400); color: var(--sec-fg-on-coral); font-weight: 600; }
.am-request:hover { background: var(--sec-coral-400); }

.am-badge { font-size: .75rem; font-weight: 600; padding: .25rem .55rem; border-radius: 999px; background: var(--sec-n-100); color: var(--sec-fg-muted); border: 1px solid var(--sec-border); }
.am-badge-deployed, .am-badge-approved { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.am-badge-pending, .am-badge-deploying { background: #fef9c3; color: #854d0e; border-color: #fde68a; }
.am-badge-rejected, .am-badge-failed { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.am-target { font-size: .7rem; padding: .15rem .45rem; border-radius: 6px; background: var(--sec-n-100); color: var(--sec-fg-muted); border: 1px solid var(--sec-border); }
.am-targets { display: inline-flex; gap: .3rem; flex-wrap: wrap; }

.am-rh { margin-top: 2rem; }
.am-empty { color: var(--sec-fg-subtle); padding: 1.5rem 0; }
.am-requests { width: 100%; border-collapse: collapse; font-size: .88rem; }
.am-requests th, .am-requests td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--sec-border); vertical-align: top; }
.am-requests th { color: var(--sec-fg-subtle); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
.am-requests code { font-size: .78rem; color: var(--sec-fg-subtle); }

/* Detail modal */
.am-modal { position: fixed; inset: 0; z-index: 1000; background: rgba(28,26,25,.45); display: flex; align-items: center; justify-content: center; padding: 1rem; }
.am-modal__box { position: relative; width: 100%; max-width: 560px; max-height: 86vh; overflow-y: auto; background: var(--sec-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 1.5rem; }
.am-modal__x { position: absolute; top: .8rem; right: .8rem; border: none; background: transparent; font-size: 1.1rem; cursor: pointer; color: var(--sec-fg-subtle); line-height: 1; }
.am-modal__x:hover { color: var(--sec-fg); }
.am-modal__head { display: flex; align-items: center; gap: .9rem; margin-bottom: .8rem; }
.am-modal__head .am-logo { width: 58px; height: 58px; }
.am-modal__head h3 { margin: 0; font-size: 1.3rem; }
.am-modal__desc { color: var(--sec-fg-muted); line-height: 1.5; margin: 0 0 1rem; }
.am-modal__h { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--sec-fg-subtle); margin: 1rem 0 .5rem; }
.am-modal__ints { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .6rem; }
.am-modal__int { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; }
.am-modal__int-i { font-size: 1.1rem; line-height: 1.3; flex: 0 0 auto; }
.am-modal__int-d { color: var(--sec-fg-muted); font-size: .82rem; }
.am-modal__grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; padding: .9rem; background: var(--sec-bg-warm); border-radius: var(--radius); margin-bottom: 1rem; }
.am-modal__grid > div { display: flex; flex-direction: column; gap: .15rem; }
.am-modal__k { font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--sec-fg-subtle); }
.am-modal__v { font-size: .92rem; color: var(--sec-fg); }
.am-modal__foot { display: flex; align-items: center; gap: .6rem; }
.am-modal__spacer { flex: 1; }
.am-modal__home { font-size: .88rem; color: var(--sec-coral-600); text-decoration: none; }
.am-modal__home:hover { text-decoration: underline; }

@media (max-width: 520px) {
  .am-grid { grid-template-columns: 1fr; }
  .am-modal__grid { grid-template-columns: 1fr; }
  .am-count { margin-left: 0; }
}
