/* =========================================================
   Add / Edit role + Roles list
   Every class uses the admin-alert-foradd prefix.
   ========================================================= */

/* ---------- Name + image row ---------- */
.admin-alert-foradd-row {
  --field-radius: 14px; /* same radius as the name input */
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: stretch;
  margin: 0 0 8px 0;
}

.admin-alert-foradd-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-alert-foradd-col > .admin-addrole__field {
  flex: 1;
  margin: 0 !important;
  border-radius: var(--field-radius);
}

.admin-alert-foradd-col > .admin-addrole__field > .admin-addrole__input {
  border-radius: var(--field-radius);
}

/* Image box: same radius, border and surface as the name field */
.admin-alert-foradd-filebox {
  flex: 1;
  position: relative;
  box-sizing: border-box;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--field-radius);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.admin-alert-foradd-filebox:focus-within {
  border-color: #ffa814;
}

.admin-alert-foradd-caption {
  font-size: 12px;
  line-height: 1;
  color: #9a9a9a;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.admin-alert-foradd-filebox-body {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* Real file input is hidden; the label acts as the button */
.admin-alert-foradd-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.admin-alert-foradd-pick {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: 999px;
  background: #ffa814;
  color: #000;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: filter 0.2s ease;
}

.admin-alert-foradd-pick:hover {
  filter: brightness(1.08);
}

.admin-alert-foradd-filename {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: #cfcfcf;
}

.admin-alert-foradd-preview {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 8px;
  flex: 0 0 32px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

@media (max-width: 700px) {
  .admin-alert-foradd-row {
    grid-template-columns: 1fr;
  }
}

/* ---------- Success alert: Role Added Successfully ---------- */
.admin-alert-foradd {
  --aa-bg: #14100a;
  --aa-text: #fff3d6;
  --aa-accent: #ffaa17;

  position: fixed;
  top: 22px;
  left: 50%;
  z-index: 3000;
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(92vw, 420px);
  padding: 16px 18px 18px;
  border-radius: 16px;
  overflow: hidden;
  color: var(--aa-text);
  background: var(--aa-bg);
  border: 1px solid rgba(255, 170, 23, 0.55);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), 0 0 28px rgba(255, 170, 23, 0.2);
  transform: translateX(-50%);
  animation: admin-alert-foradd-in 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.25) both;
}

.admin-alert-foradd__icon {
  position: relative;
  flex: 0 0 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--aa-accent);
  color: #000;
}

.admin-alert-foradd__icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--aa-accent);
  animation: admin-alert-foradd-ring 1.2s 0.3s ease-out 2;
}

.admin-alert-foradd__icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-alert-foradd__check {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: admin-alert-foradd-draw 0.5s 0.35s ease forwards;
}

.admin-alert-foradd__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.admin-alert-foradd__title {
  font-size: 16px;
  letter-spacing: 0.02em;
  color: var(--aa-accent);
}

.admin-alert-foradd__text {
  font-size: 13px;
  opacity: 0.85;
}

.admin-alert-foradd__bar {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--aa-accent), #ffd777);
  transform-origin: left;
  animation: admin-alert-foradd-bar 1.8s linear forwards;
}

@keyframes admin-alert-foradd-in {
  from { opacity: 0; transform: translate(-50%, -40px) scale(0.92); }
  to   { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
@keyframes admin-alert-foradd-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes admin-alert-foradd-ring {
  from { transform: scale(1); opacity: 0.8; }
  to   { transform: scale(1.9); opacity: 0; }
}
@keyframes admin-alert-foradd-bar {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* ---------- Roles list: table helpers ---------- */
.admin-table-design__table th,
.admin-table-design__table td {
  vertical-align: middle;
}

/* Status pill as a button */
button.admin-table-design__status {
  border: 0;
  font: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
button.admin-table-design__status:hover { transform: translateY(-1px); }
button.admin-table-design__status:disabled { opacity: 0.6; cursor: wait; }

/* Image thumbnail: small square, click to enlarge */
.admin-alert-foradd-thumb {
  width: 44px;
  height: 44px;
  padding: 0;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  cursor: zoom-in;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.admin-alert-foradd-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.admin-alert-foradd-thumb:hover {
  box-shadow: 0 0 0 2px #ffaa17;
  transform: translateY(-1px);
}

.admin-alert-foradd-thumb--empty {
  cursor: default;
  font-weight: 700;
  color: #ffaa17;
  font-size: 14px;
}

.admin-alert-foradd-thumb--empty:hover {
  box-shadow: none;
  transform: none;
}

/* Role name: one line */
.admin-alert-foradd-name {
  white-space: nowrap;
  color: #fff;
}

/* Description + "View more" */
.admin-alert-foradd-desc {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-alert-foradd-desc-text {
  line-height: 1.4;
}

/* "View more" as a text link */
button.admin-alert-foradd-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: #ffaa17;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.2s ease;
}

button.admin-alert-foradd-more::after {
  content: "";
  font-size: 12px;
  transition: transform 0.2s ease;
}

button.admin-alert-foradd-more:hover {
  color: #ffffff;
  background: none;
}

button.admin-alert-foradd-more:hover::after {
  transform: translateX(3px);
}

button.admin-alert-foradd-more:focus-visible {
  outline: 1px solid #ffaa17;
  outline-offset: 3px;
  border-radius: 2px;
}

/* Action: edit icon button */
.admin-table-design__actions {
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-alert-foradd-edit {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255, 170, 23, 0.5);
  border-radius: 10px;
  color: #ffaa17;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.admin-alert-foradd-edit:hover {
  background: #ffaa17;
  color: #000;
}

/* ---------- Popup shell (image, description, edit) ---------- */
.admin-manage-popup {
  --amp-bg: #0b0b0b;
  --amp-text: #ffffff;
  --amp-muted: rgba(255, 255, 255, 0.6);
  --amp-line: #ffaa17;
  --amp-accent: #ffaa17;

  position: fixed;
  inset: 0;
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(3px);
  animation: admin-manage-popup-fade 0.2s ease both;
}

.admin-manage-popup__dialog {
  display: flex;
  flex-direction: column;
  width: min(100%, 520px);
  max-height: calc(100dvh - 32px);
  color: var(--amp-text);
  background: var(--amp-bg);
  border: 2px solid var(--amp-line);
  border-radius: 6px;
  box-shadow: 14px 14px 0 var(--amp-accent);
  animation: admin-manage-popup-rise 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.1) both;
}

.admin-manage-popup__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 26px;
  border-bottom: 2px solid var(--amp-line);
}

.admin-manage-popup__title {
  margin: 0;
  font-family: "Oswald", sans-serif;
  font-weight: 700;
  font-size: 26px;
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--amp-accent);
  overflow-wrap: anywhere;
}

.admin-manage-popup__close {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  color: #ffffff;
  background: #2a2a2a;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.admin-manage-popup__close:hover {
  background: #ffaa17;
  color: #000;
}

.admin-manage-popup__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 26px;
  overflow-y: auto;
}

.admin-manage-popup__desc {
  margin: 0;
  font-family: "Rubik", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.78);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Edit form fields */
.admin-manage-popup__label {
  margin-top: 8px;
  font-family: "Rubik", sans-serif;
  font-size: 14px;
  color: var(--amp-muted);
}

.admin-manage-popup__input,
.admin-manage-popup__textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  font-family: "Rubik", sans-serif;
  font-size: 16px;
  color: #ffffff;
  background: #1c1c1c;
  border: 1px solid var(--amp-line);
  border-radius: 10px;
  outline: none;
  resize: vertical;
  transition: box-shadow 0.2s ease;
}

.admin-manage-popup__input:focus,
.admin-manage-popup__textarea:focus {
  box-shadow: 0 0 0 3px rgba(255, 170, 23, 0.25);
}

.admin-manage-popup__input[aria-invalid="true"] {
  border-color: #ff5a46;
}

.admin-manage-popup__count {
  align-self: flex-end;
  font-size: 13px;
  color: var(--amp-muted);
}

.admin-manage-popup__error {
  margin: 6px 0 0;
  font-size: 14px;
  color: #ff8a7a;
}

.admin-manage-popup__actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  padding: 18px 26px 24px;
  border-top: 2px solid var(--amp-line);
}

.admin-manage-popup__btn {
  min-width: 120px;
  padding: 13px 26px;
  font-family: "Oswald", sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #ffffff;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.admin-manage-popup__btn:hover {
  border-color: #ffaa17;
  color: #ffaa17;
}

.admin-manage-popup__btn--primary {
  color: #000;
  background: #ffaa17;
  border-color: #ffaa17;
}
.admin-manage-popup__btn--primary:hover {
  color: #000;
  background: #ffc247;
  border-color: #ffc247;
}
.admin-manage-popup__btn--primary:disabled {
  opacity: 0.65;
  cursor: wait;
}

/* Enlarged image inside the popup */
.admin-alert-foradd-full {
  display: block;
  max-width: 100%;
  max-height: 62vh;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 12px;
}

@keyframes admin-manage-popup-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes admin-manage-popup-rise {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 560px) {
  .admin-manage-popup { align-items: flex-end; padding: 0; }
  .admin-manage-popup__dialog {
    width: 100%;
    max-height: 90dvh;
    border-radius: 18px 18px 0 0;
  }
  .admin-manage-popup__actions { flex-direction: column-reverse; }
  .admin-manage-popup__btn { width: 100%; }
}

@media (max-width: 480px) {
  .admin-alert-foradd {
    top: 16px;
    width: calc(100vw - 32px);
  }
}