/* =============================================================================
 * AMAC Suite shared icon library / picker v1.0.0  (amac-icon-library-v1.js)
 * -----------------------------------------------------------------------------
 * Reusable across any suite app. Buttons are styled with !important on the
 * critical visual props so the picker looks correct even inside hosts whose
 * `button` baseline is the suite-shell crimson palette.
 * ============================================================================= */

.amac-iconpick { display: block; }

.amac-iconpick-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.amac-iconpick-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  font-size: 24px;          /* emoji size; <img> renders at 1em = 24px */
  line-height: 1;
  border: 1px solid #d7e2ef;
  border-radius: 9px;
  background: #fff;
  flex: 0 0 auto;
}

.amac-iconpick-upload {
  appearance: none !important;
  background: #eef3f8 !important;
  background-image: none !important;
  color: #11263d !important;
  border: 1px solid #d7e2ef !important;
  border-radius: 9px !important;
  padding: 8px 12px !important;
  font: inherit !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  flex: 0 0 auto;
}
.amac-iconpick-upload:hover { background: #e2ebf4 !important; }

.amac-iconpick-custom {
  width: 110px;
  box-sizing: border-box;
  padding: 8px 10px;
  font: inherit;
  font-size: 16px;
  text-align: center;
  border: 1px solid #c5d3e2;
  border-radius: 9px;
  background: #fff;
  color: #11263d;
  flex: 0 0 auto;
}

.amac-iconpick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #e3eaf2;
  border-radius: 10px;
  background: #f7f9fc;
}

.amac-iconpick-cell {
  appearance: none !important;
  background: #fff !important;
  background-image: none !important;
  color: #11263d !important;
  border: 1px solid #e3eaf2 !important;
  border-radius: 8px !important;
  aspect-ratio: 1 / 1;
  min-height: 38px;
  padding: 0 !important;
  font-size: 20px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease, border-color 0.1s ease, background 0.1s ease;
}
.amac-iconpick-cell:hover {
  transform: translateY(-1px);
  border-color: #2e78b7 !important;
  background: #eef5fc !important;
}
.amac-iconpick-cell.is-selected {
  border-color: #2e78b7 !important;
  background: #dcebf8 !important;
  box-shadow: 0 0 0 2px rgba(46, 120, 183, 0.35);
}

/* ---- dark mode ---------------------------------------------------------- */
[data-theme="dark"] .amac-iconpick-preview {
  background: #0f1c2b;
  border-color: rgba(255, 255, 255, 0.16);
}
[data-theme="dark"] .amac-iconpick-upload {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #e8eef5 !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
}
[data-theme="dark"] .amac-iconpick-upload:hover { background: rgba(255, 255, 255, 0.14) !important; }
[data-theme="dark"] .amac-iconpick-custom {
  background: #0f1c2b;
  color: #e8eef5;
  border-color: rgba(255, 255, 255, 0.16);
}
[data-theme="dark"] .amac-iconpick-grid {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.12);
}
[data-theme="dark"] .amac-iconpick-cell {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #e8eef5 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}
[data-theme="dark"] .amac-iconpick-cell:hover {
  background: rgba(46, 120, 183, 0.25) !important;
  border-color: #4a90d9 !important;
}
[data-theme="dark"] .amac-iconpick-cell.is-selected {
  background: rgba(46, 120, 183, 0.45) !important;
  border-color: #4a90d9 !important;
}
