/* ================================= */
/* HUB → МОДАЛКА → ОБНОВЛЕНИЕ */
/* Дизайн: compact tactical update panel */
/* ================================= */

.migorix-update-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--z-hub-overlay);
  padding: 18px;
  align-items: center;
  justify-content: center;
  background: rgba(3, 8, 14, 0.86);
  backdrop-filter: blur(20px);
}

.migorix-update-modal.is-active {
  display: flex;
  pointer-events: auto;
}

/* ================================= */
/* UPDATE MODAL → CARD */
/* Основная карточка со срезанными углами */
/* ================================= */

.migorix-update-card {
  position: relative;
  width: min(336px, calc(100vw - 32px));
  padding: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: var(--font-main);
  color: var(--color-text-main);
  background:
    radial-gradient(circle at 50% 0%, rgba(74, 154, 218, 0.13), transparent 34%),
    linear-gradient(145deg, rgba(8, 20, 34, 0.98) 0%, rgba(3, 11, 21, 0.98) 100%);
  clip-path: polygon(
    18px 0,
    calc(100% - 18px) 0,
    100% 18px,
    100% calc(100% - 18px),
    calc(100% - 18px) 100%,
    18px 100%,
    0 calc(100% - 18px),
    0 18px
  );
  filter: drop-shadow(0 22px 54px rgba(0, 0, 0, 0.72));
}

.migorix-update-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 1px solid rgba(205, 226, 242, 0.28);
  clip-path: polygon(
    18px 0,
    calc(100% - 18px) 0,
    100% 18px,
    100% calc(100% - 18px),
    calc(100% - 18px) 100%,
    18px 100%,
    0 calc(100% - 18px),
    0 18px
  );
}

.migorix-update-card::after {
  content: "";
  position: absolute;
  inset: 1px;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(76, 159, 220, 0.10), transparent 22%, transparent 78%, rgba(76, 159, 220, 0.08)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 36%);
  opacity: 0.72;
}

/* ================================= */
/* UPDATE MODAL → DECOR CORNERS */
/* Малые технические уголки */
/* ================================= */

.migorix-update-corner {
  position: absolute;
  z-index: 4;
  width: 17px;
  height: 17px;
  pointer-events: none;
  border-color: rgba(205, 226, 242, 0.42);
}

.migorix-update-corner--tl {
  top: 12px;
  left: 12px;
  border-top: 1px solid;
  border-left: 1px solid;
}

.migorix-update-corner--tr {
  top: 12px;
  right: 12px;
  border-top: 1px solid;
  border-right: 1px solid;
}

.migorix-update-corner--bl {
  bottom: 12px;
  left: 12px;
  border-bottom: 1px solid;
  border-left: 1px solid;
}

.migorix-update-corner--br {
  right: 12px;
  bottom: 12px;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

/* ================================= */
/* UPDATE MODAL → ICONS CENTER */
/* Верхняя иконка и статусные бейджи */
/* ================================= */

.migorix-update-center {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* ================================= */
/* UPDATE MODAL → HERO ICON */
/* Главная иконка обновления */
/* ================================= */

.migorix-update-hero {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  color: #68CFFF;
  border: 1px solid rgba(104, 207, 255, 0.42);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(104, 207, 255, 0.14), transparent 62%),
    rgba(4, 17, 30, 0.72);
  box-shadow:
    0 0 0 5px rgba(104, 207, 255, 0.045),
    0 0 20px rgba(55, 139, 205, 0.26);
}

.migorix-update-hero-icon {
  width: 43px;
  height: 43px;
  color: inherit;
}

/* ================================= */
/* UPDATE MODAL → BADGES */
/* Проверено / Быстрее / Новое */
/* ================================= */

.migorix-update-icons {
  width: 100%;
  padding: 9px 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  border-top: 1px solid rgba(205, 226, 242, 0.08);
}

.migorix-update-badge {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: rgba(205, 218, 232, 0.70);
  font-size: 8.5px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

.migorix-update-badge svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  color: #68CFFF;
  stroke-width: 1.8;
}

/* ================================= */
/* UPDATE MODAL → CONTENT */
/* Бренд, заголовок, описание */
/* ================================= */

.migorix-update-content {
  position: relative;
  z-index: 3;
  text-align: center;
}

.migorix-update-brand {
  margin-bottom: 5px;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0.12em;
  color: #68CFFF;
  text-transform: uppercase;
}

.migorix-update-heading {
  margin: 0;
  font-size: 20px;
  font-weight: 850;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--color-text-main);
}

.migorix-update-text {
  margin: 7px auto 0;
  max-width: 230px;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.34;
  text-align: center;
  color: rgba(205, 218, 232, 0.70);
}

.migorix-update-version-pill {
  width: fit-content;
  margin: 9px auto 0;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
  color: #68CFFF;
  border: 1px solid rgba(104, 207, 255, 0.22);
  border-radius: 6px;
  background: rgba(4, 18, 31, 0.72);
}

/* ================================= */
/* UPDATE MODAL → VERSIONS */
/* Панель текущей и новой версии */
/* ================================= */

.migorix-update-versions {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  padding: 7px 11px;
  border: 1px solid rgba(205, 226, 242, 0.11);
  background: rgba(4, 17, 30, 0.58);
  clip-path: polygon(
    11px 0,
    calc(100% - 11px) 0,
    100% 11px,
    100% calc(100% - 11px),
    calc(100% - 11px) 100%,
    11px 100%,
    0 calc(100% - 11px),
    0 11px
  );
}

.migorix-update-version-row {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.migorix-update-version-row + .migorix-update-version-row {
  border-top: 1px solid rgba(205, 226, 242, 0.07);
}

.migorix-update-version-row span {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: rgba(205, 218, 232, 0.70);
  font-size: 12px;
  font-weight: 650;
}

.migorix-update-version-row span::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 1px solid rgba(104, 207, 255, 0.46);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(104, 207, 255, 0.85) 0 2px, transparent 3px),
    rgba(104, 207, 255, 0.08);
  box-shadow: 0 0 10px rgba(55, 139, 205, 0.20);
}

.migorix-update-version-row:nth-child(2) span::before {
  border-radius: 5px;
  background:
    linear-gradient(135deg, rgba(104, 207, 255, 0.72), rgba(46, 117, 195, 0.28)),
    rgba(104, 207, 255, 0.08);
}

.migorix-update-version-row strong {
  flex: 0 0 auto;
  font-size: 15px;
  font-weight: 850;
  color: var(--color-text-main);
}

#migorixLatestVersion {
  color: #68CFFF;
}

/* ================================= */
/* UPDATE MODAL → CHANGES */
/* Список изменений */
/* ================================= */

.migorix-update-changes {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  padding: 6px 11px;
  border: 1px solid rgba(205, 226, 242, 0.095);
  background: rgba(4, 17, 30, 0.43);
  clip-path: polygon(
    10px 0,
    calc(100% - 10px) 0,
    100% 10px,
    100% calc(100% - 10px),
    calc(100% - 10px) 100%,
    10px 100%,
    0 calc(100% - 10px),
    0 10px
  );
}

.migorix-update-change-row {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(205, 218, 232, 0.70);
  font-size: 11.5px;
  font-weight: 650;
}

.migorix-update-change-row + .migorix-update-change-row {
  border-top: 1px solid rgba(205, 226, 242, 0.06);
}

.migorix-update-change-row span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.migorix-update-change-row span::before {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 1px solid rgba(104, 207, 255, 0.42);
  background:
    radial-gradient(circle at 50% 50%, rgba(104, 207, 255, 0.55), transparent 58%),
    rgba(104, 207, 255, 0.08);
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(55, 139, 205, 0.16);
}

.migorix-update-change-row:nth-child(1) span::before {
  clip-path: polygon(
    50% 0,
    62% 35%,
    100% 50%,
    62% 65%,
    50% 100%,
    38% 65%,
    0 50%,
    38% 35%
  );
  border-radius: 0;
}

.migorix-update-change-row:nth-child(2) span::before {
  clip-path: polygon(55% 0, 20% 52%, 48% 52%, 42% 100%, 82% 40%, 54% 40%);
  border-radius: 0;
}

.migorix-update-change-row:nth-child(3) span::before {
  border-radius: 4px;
}

/* ================================= */
/* UPDATE MODAL → ACTIONS */
/* Кнопки Позже / Скачать APK / OK */
/* ================================= */

.migorix-update-actions {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 9px;
  width: 100%;
}

.migorix-update-button,
.migorix-update-actions button {
  min-height: 40px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font: inherit;
  font-size: 13px;
  font-weight: 760;
  line-height: 1;
  color: var(--color-text-main);
  border: 1px solid rgba(205, 226, 242, 0.20);
  background: rgba(5, 17, 29, 0.74);
  clip-path: polygon(
    9px 0,
    calc(100% - 9px) 0,
    100% 9px,
    100% calc(100% - 9px),
    calc(100% - 9px) 100%,
    9px 100%,
    0 calc(100% - 9px),
    0 9px
  );
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background-color 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease;
}

.migorix-update-button--secondary {
  color: rgba(205, 218, 232, 0.82);
  background: rgba(6, 16, 27, 0.58);
}

.migorix-update-button--primary {
  color: #EAF9FF;
  border-color: rgba(104, 207, 255, 0.48);
  background:
    linear-gradient(135deg, rgba(60, 146, 209, 0.90), rgba(12, 70, 118, 0.92));
  box-shadow:
    0 0 18px rgba(55, 139, 205, 0.28),
    inset 0 0 16px rgba(255, 255, 255, 0.07);
}

.migorix-update-button:active,
.migorix-update-actions button:active {
  transform: scale(0.985);
}

.migorix-update-button:disabled,
.migorix-update-actions button:disabled {
  opacity: 0.48;
  pointer-events: none;
}

/* ================================= */
/* UPDATE MODAL → ACTUAL STATE */
/* Когда обновлений нет и остаётся одна кнопка OK */
/* ================================= */

.migorix-update-actions:has(#migorixUpdateDownload[style*="display: none"]) {
  grid-template-columns: 1fr;
}

/* ================================= */
/* UPDATE MODAL → MOBILE */
/* Подгонка под 390px */
/* ================================= */

@media (max-width: 430px) {
  .migorix-update-modal {
    padding: 14px;
  }

  .migorix-update-card {
    width: min(336px, calc(100vw - 28px));
    padding: 15px;
    gap: 10px;
  }

  .migorix-update-hero {
    width: 60px;
    height: 60px;
  }

  .migorix-update-hero-icon {
    width: 40px;
    height: 40px;
  }

  .migorix-update-heading {
    font-size: 19px;
  }

  .migorix-update-text {
    max-width: 220px;
    font-size: 11.5px;
    line-height: 1.32;
  }

  .migorix-update-icons {
    gap: 5px;
  }

  .migorix-update-badge {
    font-size: 8.5px;
    gap: 4px;
  }

  .migorix-update-badge svg {
    width: 13px;
    height: 13px;
  }

  .migorix-update-version-row {
    min-height: 32px;
  }

  .migorix-update-change-row {
    min-height: 29px;
  }

  .migorix-update-actions {
    grid-template-columns: 1fr 1.1fr;
    gap: 8px;
  }

  .migorix-update-button,
  .migorix-update-actions button {
    min-height: 39px;
    font-size: 12.5px;
  }
}