/* Glass panel used by the calendar and notifications:
   the translucent green of the tab bar, frosted, with a light rim */

.glass-panel {
  border: 1px solid var(--stroke-low);
  border-radius: 30px;
  background: color-mix(in srgb, var(--accent) 70%, transparent);
  box-shadow:
    inset 0 1px 0 var(--neutral-white-alpha-20),
    0 12px 32px var(--effect-black-alpha-45);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  backdrop-filter: blur(22px) saturate(1.3);
  color: var(--text-white-100);
}

/* Panels hang from the top: they drop in and fade, and rise back when closing */
@keyframes drop-in {
  from { opacity: 0; transform: translateY(-16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes lift-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-16px) scale(0.98); }
}

/* ---------- Notification ---------- */

.notice {
  position: absolute;
  z-index: 30;
  top: 58px;
  left: 16px;
  right: 16px;
  display: flex;
  gap: var(--gap-base);
  padding: var(--gap-medium) 18px;
  font: var(--type-text-s);
  animation: drop-in 500ms var(--ease-soft) both;
}

/* Tone: the panel is tinted and glows in the colour of the status */
.notice[data-tone="red"] { --tone: var(--utility-red-light); }
.notice[data-tone="yellow"] { --tone: var(--utility-yellow-full); }
.notice[data-tone="green"] { --tone: var(--gradient-earth-start); }

.notice[data-tone] {
  border-color: var(--tone);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--tone) 28%, transparent), color-mix(in srgb, var(--tone) 10%, transparent)),
    rgba(12, 14, 8, 0.45);
  box-shadow:
    inset 0 1px 0 var(--neutral-white-alpha-20),
    0 0 22px color-mix(in srgb, var(--tone) 45%, transparent),
    0 12px 32px var(--effect-black-alpha-45);
}

.notice--closing {
  animation: lift-out 400ms var(--ease-soft) both;
}

.notice__icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0.5px solid var(--el, var(--stroke-low));
  border-radius: 50%;
  background: var(--el-gradient, var(--fill-dark-alpha-50));
}

.notice__icon img {
  display: block;
  max-width: 20px;
  max-height: 22px;
}

.notice__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.notice__title {
  margin: 0;
  font: var(--type-text-m);
}

.notice__text {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.35;
}

.notice__list {
  margin: 2px 0 0;
  padding-left: 16px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.82);
}

.notice__list li::marker {
  color: var(--el, var(--text-white-60));
}

.notice__extra {
  margin: 4px 0 0;
  color: var(--text-white-60);
  line-height: 1.35;
}

@media (prefers-reduced-motion: reduce) {
  .notice,
  /* Tone: the panel is tinted and glows in the colour of the status */
.notice[data-tone="red"] { --tone: var(--utility-red-light); }
.notice[data-tone="yellow"] { --tone: var(--utility-yellow-full); }
.notice[data-tone="green"] { --tone: var(--gradient-earth-start); }

.notice[data-tone] {
  border-color: var(--tone);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--tone) 28%, transparent), color-mix(in srgb, var(--tone) 10%, transparent)),
    rgba(12, 14, 8, 0.45);
  box-shadow:
    inset 0 1px 0 var(--neutral-white-alpha-20),
    0 0 22px color-mix(in srgb, var(--tone) 45%, transparent),
    0 12px 32px var(--effect-black-alpha-45);
}

.notice--closing {
    animation: none;
  }
}

/* ---------- Modal (js/components/modal.js) ---------- */

.modal {
  position: absolute;
  inset: 0;
  z-index: 40;
  color: var(--text-white-100);
  font: var(--type-text-s);
}

.modal button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.modal p {
  margin: 0;
}

.modal__outside {
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 17, 0.35);
  animation: fade-in 400ms var(--ease-soft) both;
}

.modal__panel {
  position: absolute;
  top: 70px;
  left: 24px;
  right: 24px;
  max-height: calc(100% - 160px);
  display: flex;
  flex-direction: column;
  gap: var(--gap-medium);
  padding: var(--gap-medium) 18px 18px;
  overflow-y: auto;
  scrollbar-width: none;
  border-radius: 24px;
  background: rgba(16, 18, 30, 0.9) !important;
  animation: drop-in 450ms var(--ease-soft) both;
}

.modal--closing .modal__panel {
  animation: lift-out 350ms var(--ease-soft) both;
}

.modal--closing .modal__outside {
  animation: fade-in 350ms var(--ease-soft) reverse both;
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal__title {
  font: var(--type-display-small);
}

.modal__close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--stroke-low);
  border-radius: 50%;
  background: rgba(5, 6, 17, 0.3);
}

.modal__body {
  display: flex;
  flex-direction: column;
  gap: var(--gap-medium);
}

.modal__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-base);
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-white-60);
}

.modal-field--row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.modal-field--row input {
  width: 110px;
  text-align: center;
  font: 400 26px / 1 var(--font-display) !important;
}

.modal-field input,
.modal-field textarea,
.modal-field select {
  padding: 10px 14px;
  border: 1px solid var(--stroke-low);
  border-radius: 14px;
  background: rgba(5, 6, 17, 0.35);
  color: var(--text-white-100);
  font: var(--type-text-m);
  color-scheme: dark;
  resize: none;
  outline: none;
}

.modal-field input:focus,
.modal-field textarea:focus,
.modal-field select:focus {
  border-color: var(--stroke-border-active);
}

/* Time wheels */
.wheels {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-base);
}

.wheels__band {
  position: absolute;
  left: 30px;
  right: 30px;
  top: 50%;
  height: 36px;
  margin-top: -18px;
  border-top: 1px solid var(--neutral-white-alpha-20);
  border-bottom: 1px solid var(--neutral-white-alpha-20);
  pointer-events: none;
}

.wheels__colon {
  font: var(--type-display-medium);
}

.wheel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wheel__list {
  height: 180px;
  width: 64px;
  padding: 72px 0;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent);
  mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent);
}

.wheel__list::-webkit-scrollbar {
  display: none;
}

.wheel__item {
  display: grid;
  place-items: center;
  height: 36px;
  font: 400 30px / 1 var(--font-display);
  color: var(--text-white-60);
  scroll-snap-align: center;
  cursor: pointer;
  transition: color 200ms, transform 200ms;
}

.wheel__item.is-selected {
  color: var(--text-white-100);
  transform: scale(1.15);
}

.wheel__label {
  color: var(--text-white-60);
}

@media (prefers-reduced-motion: reduce) {
  .modal__panel,
  .modal--closing .modal__panel {
    animation: none;
  }
}
