/* Agency Grade Websites gallery & live preview browser (js/agency-grade-websites.js).
   Extends css/premium-websites.css so cards and modal match Scale.gg's showcase system. */

.ag-filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin: 0 0 14px;
  padding-left: 4px;
}

.ag-search-box {
  position: relative;
  flex: 1 1 280px;
  min-width: 0;
}

.ag-search-box svg {
  position: absolute;
  left: 13px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  fill: none;
  stroke: #8b8fa3;
  stroke-width: 2.2;
  stroke-linecap: round;
  pointer-events: none;
}

.ag-search-box input {
  box-sizing: border-box;
  width: 100%;
  height: 40px;
  padding: 0 13px 0 38px;
  border: 1px solid #d9d5ea;
  border-radius: 11px;
  background: #fff;
  color: var(--ink, #0f0d1a);
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ag-search-box input:focus {
  border-color: #7b61ff;
  box-shadow: 0 0 0 3px rgba(123, 97, 255, 0.15);
}

.ag-select-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.ag-select-box > span {
  color: #6d28d9;
  font-size: 9.5px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ag-select-box select {
  box-sizing: border-box;
  height: 40px;
  padding: 0 28px 0 11px;
  border: 1px solid #c4b5fd;
  border-radius: 11px;
  background: #fff;
  color: #374151;
  font: inherit;
  font-size: 12.5px;
  font-weight: 750;
  outline: none;
}

.ag-select-box select:focus {
  border-color: #7b61ff;
  box-shadow: 0 0 0 3px rgba(123, 97, 255, 0.15);
}

/* Live scaled iframe thumbnail inside each card */
.ag-card-preview {
  display: block;
}

.ag-thumb {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.ag-thumb-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px;
  text-align: center;
  pointer-events: none;
}

.ag-thumb-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  opacity: 0.9;
}

.ag-thumb-placeholder strong {
  font-size: 15px;
  font-weight: 850;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.ag-thumb-placeholder small {
  font-size: 11px;
  opacity: 0.72;
  line-height: 1.3;
  max-width: 24ch;
}

.ag-thumb iframe {
  position: absolute;
  left: 0;
  top: 0;
  width: 1280px;
  height: 800px;
  border: 0;
  background: transparent;
  transform-origin: 0 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.ag-thumb.is-loaded iframe {
  opacity: 1;
}

.ag-thumb.is-loaded .ag-thumb-placeholder {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.ag-card-badge {
  background: rgba(15, 13, 26, 0.86);
  color: #fff;
}

.ag-gallery-after {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.ag-gallery-after:empty {
  display: none;
}

.ag-clear-btn {
  margin-left: 8px;
  padding: 6px 12px;
  border: 1px solid #c4b5fd;
  border-radius: 8px;
  background: #fff;
  color: #6d28d9;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

/* Modal enhancements */
.ag-rail-selects {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.ag-rail-swatchbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 10px 8px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.ag-rail-swatchstrip {
  display: inline-flex;
  gap: 4px;
}

.ag-rail-swatchstrip i {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.ag-rail-style {
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ag-modal-meta {
  align-items: center;
  flex-wrap: wrap;
}

.ag-modal-swatches {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
}

.ag-modal-swatches i {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, 0.14);
}

.ag-newtab-link {
  display: inline-flex;
  align-items: center;
  height: 31px;
  padding: 0 11px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #374151;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.ag-newtab-link:hover {
  border-color: #a78bfa;
  color: #5b21b6;
}

.ag-full-bar {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ag-full-bar span {
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ag-full-overlay .template-full-close {
  position: static;
  flex: 0 0 auto;
}

@media (max-width: 700px) {
  .ag-filter-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .ag-select-box {
    display: grid;
    gap: 5px;
  }
  .ag-select-box select {
    width: 100%;
    height: 42px;
  }
  .ag-rail-selects {
    grid-template-columns: 1fr 1fr;
    grid-column: 1 / -1;
  }
  .ag-browser-modal .template-browser-rail-head {
    grid-template-columns: 1fr;
  }
  .ag-newtab-link {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ag-thumb iframe,
  .ag-thumb-placeholder {
    transition: none;
  }
}
