/* =============================================================================
 * AMAC Suite Home v2.5.0 -- "My Links" (per-user link tiles)
 * -----------------------------------------------------------------------------
 * Pairs with public/js/home-user-links.js. Link tiles reuse the shared
 * .home-tile / .home-section look from suite-home-v2_0.css (so they theme with
 * dark mode automatically); this sheet only adds the <a>-tile reset, the
 * edit/remove controls, the "Add link" tile, and the add/edit modal.
 * ============================================================================= */

/* link tiles are <a> -- drop the underline, keep the .home-tile look */
body.suite-shell.suite-home-v2 a.home-tile,
body.suite-shell.suite-home-v2 a.home-tile:hover,
body.suite-shell.suite-home-v2 a.home-tile:visited {
  text-decoration: none !important;
}

/* per-tile edit / remove controls (revealed on hover or keyboard focus) */
body.suite-shell.suite-home-v2 .ul-tile-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.12s ease;
}
body.suite-shell.suite-home-v2 .home-tile--link:hover .ul-tile-actions,
body.suite-shell.suite-home-v2 .home-tile--link:focus-within .ul-tile-actions {
  opacity: 1;
}
body.suite-shell.suite-home-v2 .ul-tile-actions button.ul-edit,
body.suite-shell.suite-home-v2 .ul-tile-actions button.ul-del {
  appearance: none !important;
  background: rgba(255, 255, 255, 0.92) !important;
  background-image: none !important;
  color: #11263d !important;
  border: 1px solid #d7e2ef !important;
  border-radius: 6px !important;
  width: 22px;
  height: 22px;
  padding: 0 !important;
  font-size: 12px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(2, 37, 68, 0.12);
}
body.suite-shell.suite-home-v2 .ul-tile-actions button.ul-del:hover {
  border-color: #d9534f !important;
  color: #c0392b !important;
}

/* the dashed "Add link" tile */
body.suite-shell.suite-home-v2 .home-tile--add {
  border-style: dashed !important;
  border-color: #b9c8da !important;
  opacity: 0.92;
}
body.suite-shell.suite-home-v2 .home-tile--add:hover {
  opacity: 1;
}

/* ---- add / edit modal --------------------------------------------------- */
.ul-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 37, 68, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4000;
  padding: 16px;
}
.ul-modal {
  background: var(--panel, #fff);
  color: var(--ink, #11263d);
  width: 100%;
  max-width: 420px;
  border-radius: 14px;
  border: 1px solid #d7e2ef;
  box-shadow: 0 18px 48px rgba(2, 37, 68, 0.28);
  padding: 18px 18px 16px;
}
.ul-modal-title {
  margin: 0 0 12px;
  font-size: 17px;
}
.ul-field {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
}
.ul-field > span {
  display: block;
  margin-bottom: 4px;
  font-weight: 700;
  opacity: 0.85;
}
.ul-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 10px;
  font: inherit;
  font-size: 14px;
  border: 1px solid #c5d3e2;
  border-radius: 9px;
  background: #fff;
  color: #11263d;
}
.ul-field--icon input {
  width: 90px;
  text-align: center;
  font-size: 18px;
}
.ul-modal-err {
  background: rgba(217, 83, 79, 0.10);
  color: #b3322c;
  border: 1px solid rgba(217, 83, 79, 0.35);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  margin: 6px 0 10px;
}
.ul-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}
.ul-btn {
  appearance: none;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 14px;
  border-radius: 9px;
  cursor: pointer;
  border: 1px solid transparent;
}
.ul-btn--ghost {
  background: #eef3f8;
  color: #11263d;
  border-color: #d7e2ef;
}
.ul-btn--primary {
  background: #2e78b7;
  color: #fff;
}
.ul-btn--primary:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ---- dark mode ---------------------------------------------------------- */
[data-theme="dark"] .ul-modal {
  border-color: rgba(255, 255, 255, 0.12);
}
[data-theme="dark"] .ul-field input {
  background: #0f1c2b;
  color: #e8eef5;
  border-color: rgba(255, 255, 255, 0.16);
}
[data-theme="dark"] .ul-btn--ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #e8eef5;
  border-color: rgba(255, 255, 255, 0.16);
}
[data-theme="dark"] .ul-tile-actions button.ul-edit,
[data-theme="dark"] .ul-tile-actions button.ul-del {
  background: rgba(20, 32, 46, 0.95) !important;
  color: #e8eef5 !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
}
[data-theme="dark"] .home-tile--add {
  border-color: rgba(255, 255, 255, 0.22) !important;
}
