/* Create channel modal — pixel-perfect glass variant (#createChannelModal only) */
#createChannelModal {
  --ccn-blue: #3b82f6;
  --ccn-violet: #8b5cf6;
  --ccn-muted: #b8c8e0;
  --ccn-border: rgba(160, 180, 255, 0.14);
  --ccn-border-hover: rgba(160, 180, 255, 0.24);
  --ccn-transition: 170ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

#createChannelModal.modal-backdrop--glass:not(.hidden) {
  background: rgba(3, 8, 18, 0.72);
  backdrop-filter: blur(10px) saturate(1.1);
  -webkit-backdrop-filter: blur(10px) saturate(1.1);
}

#createChannelModal .create-channel-modal {
  position: relative;
  isolation: isolate;
  width: min(610px, calc(100vw - 40px));
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  background:
    linear-gradient(155deg, rgba(18, 28, 52, 0.94) 0%, rgba(14, 18, 40, 0.9) 45%, rgba(22, 16, 46, 0.92) 100%);
  border: 1px solid rgba(100, 150, 255, 0.22);
  box-shadow:
    0 32px 72px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    inset 0 1px 0 rgba(180, 200, 255, 0.09);
  backdrop-filter: blur(28px) saturate(1.3);
  -webkit-backdrop-filter: blur(28px) saturate(1.3);
  padding: 0 34px 20px;
  color: #f1f5f9;
  box-sizing: border-box;
  overflow: hidden;
  max-height: min(92vh, 860px);
}

#createChannelModal .create-channel-modal::before {
  content: "";
  position: absolute;
  top: -30%;
  right: -20%;
  width: 64%;
  height: 56%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, rgba(139, 92, 246, 0.06) 42%, transparent 72%);
  pointer-events: none;
  z-index: 0;
}

#createChannelModal .create-channel-modal::after {
  content: "";
  position: absolute;
  bottom: -26%;
  left: -18%;
  width: 56%;
  height: 50%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.09) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

#createChannelModal .create-channel-modal > * {
  position: relative;
  z-index: 1;
}

#createChannelModal .create-channel-modal__header {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 44px;
  align-items: center;
  column-gap: 20px;
  padding: 32px 0 22px;
  flex-shrink: 0;
}

#createChannelModal .create-channel-modal__heading {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 4px;
}

#createChannelModal .create-channel-modal__icon {
  width: 82px;
  height: 82px;
  min-width: 82px;
  min-height: 82px;
  flex: 0 0 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
  border: none;
  box-shadow: none;
  padding: 0;
  border-radius: 50%;
  overflow: visible;
}

#createChannelModal .create-channel-modal__title,
#createChannelModal .create-channel-modal__subtitle {
  max-width: 100%;
  overflow-wrap: break-word;
}

@media (max-width: 600px) {
  #createChannelModal .create-channel-modal__header {
    grid-template-columns: 64px minmax(0, 1fr) 40px;
    column-gap: 14px;
  }

  #createChannelModal .create-channel-modal__icon {
    width: 64px;
    height: 64px;
    min-width: 64px;
    min-height: 64px;
    flex-basis: 64px;
  }
}

#createChannelModal .create-channel-modal__title {
  margin: 0;
  font-size: 26px;
  line-height: 1.12;
  font-weight: 750;
  letter-spacing: -0.028em;
  color: rgba(248, 250, 252, 0.98);
}

#createChannelModal .create-channel-modal__subtitle {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 500;
  color: rgba(184, 200, 224, 0.88);
  max-width: 28em;
}

#createChannelModal .create-channel-modal__close {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 13px;
  border: 1px solid rgba(160, 180, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(167, 181, 212, 0.92);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  transition: var(--ccn-transition);
}

#createChannelModal .create-channel-modal__close:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(160, 180, 255, 0.3);
  color: #eef2ff;
}

#createChannelModal .create-channel-modal__body {
  flex: 0 1 auto;
  overflow: visible;
  padding-bottom: 8px;
}

#createChannelModal .create-channel-modal__field {
  display: block;
  margin-bottom: 14px;
}

#createChannelModal .create-channel-modal__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

#createChannelModal .create-channel-modal__label {
  font-size: 15px;
  font-weight: 600;
  color: rgba(210, 220, 240, 0.92);
  letter-spacing: -0.01em;
}

#createChannelModal .create-channel-modal__counter {
  font-size: 12px;
  font-weight: 600;
  color: rgba(148, 163, 184, 0.75);
  font-variant-numeric: tabular-nums;
}

#createChannelModal .create-channel-modal__input-wrap {
  display: flex;
  align-items: center;
  height: 54px;
  border-radius: 14px;
  border: 1px solid var(--ccn-border);
  background: rgba(255, 255, 255, 0.045);
  overflow: hidden;
  transition: var(--ccn-transition);
}

#createChannelModal .create-channel-modal__input-wrap:focus-within {
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
  background: rgba(255, 255, 255, 0.055);
}

#createChannelModal .create-channel-modal__input {
  width: 100%;
  height: 54px;
  border: 0;
  background: transparent;
  color: #f8fafc;
  outline: none;
  padding: 0 16px;
  font-size: 15px;
  font-weight: 500;
  box-sizing: border-box;
}

#createChannelModal .create-channel-modal__input::placeholder {
  color: rgba(120, 140, 170, 0.55);
}

#createChannelModal .create-channel-modal__slug-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#createChannelModal .create-channel-modal__help {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(160, 180, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(167, 181, 212, 0.9);
  font-size: 11px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  cursor: help;
  flex-shrink: 0;
}

#createChannelModal .create-channel-modal__link-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(160, 180, 255, 0.1);
  font-size: 13px;
  font-weight: 500;
  color: rgba(184, 200, 224, 0.85);
  min-height: 40px;
}

#createChannelModal .create-channel-modal__link-preview svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  flex-shrink: 0;
  opacity: 0.75;
}

#createChannelModal .create-channel-modal__link-preview-slug {
  color: #a78bfa;
  font-weight: 650;
}

#createChannelModal .create-channel-modal__section-title {
  margin: 18px 0 10px;
  font-size: 15px;
  font-weight: 650;
  color: rgba(226, 232, 240, 0.95);
  letter-spacing: -0.01em;
}

#createChannelModal .create-channel-modal__access-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

#createChannelModal .create-channel-modal__choice-card {
  position: relative;
  min-height: 118px;
  height: 118px;
  border: 1px solid var(--ccn-border);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  width: 100%;
  box-sizing: border-box;
  transition: var(--ccn-transition);
}

#createChannelModal .create-channel-modal__choice-card:hover {
  border-color: var(--ccn-border-hover);
  background: rgba(255, 255, 255, 0.05);
}

#createChannelModal .create-channel-modal__choice-card.is-active {
  border-color: rgba(99, 130, 255, 0.62);
  background:
    linear-gradient(148deg, rgba(59, 130, 246, 0.16) 0%, rgba(99, 102, 241, 0.14) 55%, rgba(139, 92, 246, 0.12) 100%);
  box-shadow: inset 0 1px 0 rgba(160, 200, 255, 0.1);
}

#createChannelModal .create-channel-modal__choice-card:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.75);
  outline-offset: 2px;
}

#createChannelModal .create-channel-modal__card-check {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(160, 180, 255, 0.28);
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.85);
  transition: var(--ccn-transition);
}

#createChannelModal .create-channel-modal__choice-card.is-active .create-channel-modal__card-check {
  opacity: 1;
  transform: scale(1);
  border-color: rgba(96, 165, 250, 0.7);
  background: linear-gradient(145deg, #3b82f6, #8b5cf6);
  color: #fff;
}

#createChannelModal .create-channel-modal__card-check svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
}

#createChannelModal .create-channel-modal__card-icon {
  width: 28px;
  height: 28px;
  color: #7eb8f7;
  display: grid;
  place-items: center;
}

#createChannelModal .create-channel-modal__card-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
}

#createChannelModal .create-channel-modal__card-title {
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.2;
}

#createChannelModal .create-channel-modal__card-meta {
  font-size: 12px;
  line-height: 1.4;
  color: rgba(184, 200, 224, 0.82);
  max-width: 100%;
}

#createChannelModal .create-channel-modal__info {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(160, 180, 255, 0.12);
  font-size: 13px;
  line-height: 1.45;
  color: rgba(184, 200, 224, 0.9);
  margin-bottom: 4px;
}

#createChannelModal .create-channel-modal__info svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: #60a5fa;
  fill: none;
  margin-top: 1px;
}

#createChannelModal .create-channel-modal__footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding-top: 16px;
  flex-shrink: 0;
}

#createChannelModal .create-channel-modal__btn {
  height: 48px;
  min-width: 120px;
  padding: 0 22px;
  border-radius: 13px;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  border: 0;
  transition: var(--ccn-transition);
}

#createChannelModal .create-channel-modal__btn--secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(160, 180, 255, 0.18);
  color: rgba(226, 232, 240, 0.92);
}

#createChannelModal .create-channel-modal__btn--secondary:hover {
  background: rgba(255, 255, 255, 0.09);
}

#createChannelModal .create-channel-modal__btn--primary {
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 52%, #8b5cf6 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.28);
}

#createChannelModal .create-channel-modal__btn--primary:hover:not(:disabled) {
  filter: brightness(1.06);
}

#createChannelModal .create-channel-modal__btn--primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

@media (max-width: 600px) {
  #createChannelModal .create-channel-modal {
    width: calc(100vw - 20px);
    padding: 0 18px 16px;
    border-radius: 20px;
  }

  #createChannelModal .create-channel-modal__header {
    padding: 22px 0 16px;
  }

  #createChannelModal .create-channel-modal__icon {
    width: 64px;
    height: 64px;
    min-width: 64px;
    min-height: 64px;
  }

  #createChannelModal .create-channel-modal__title {
    font-size: 22px;
  }

  #createChannelModal .create-channel-modal__subtitle {
    font-size: 14px;
  }

  #createChannelModal .create-channel-modal__access-grid {
    grid-template-columns: 1fr;
  }

  #createChannelModal .create-channel-modal__footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  #createChannelModal .create-channel-modal__btn {
    width: 100%;
    min-height: 44px;
  }
}
