/* invite-modal.css */

dialog.invite-modal {
  background: #1a1a2e;
  border: 1px solid #2d2d4e;
  border-radius: 12px;
  color: #e0e0f0;
  margin: auto;
  max-height: 80vh;
  max-width: 480px;
  overflow: hidden;
  padding: 0;
  width: 100%;
}

dialog.invite-modal::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.invite-modal__header {
  align-items: center;
  border-bottom: 1px solid #2d2d4e;
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.25rem;
}

.invite-modal__header h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-modal__close {
  background: none;
  border: none;
  color: #9090b8;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.25rem;
}

.invite-modal__close:hover {
  color: #e0e0f0;
}

.invite-modal__body {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: calc(80vh - 120px);
  overflow-y: auto;
  padding: 0;
}

.invite-modal__section {
  border-bottom: 1px solid #2d2d4e;
  padding: 0.875rem 1.25rem;
}

.invite-modal__section:last-child {
  border-bottom: none;
}

.invite-modal__section-label {
  color: #9a9ac6;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-bottom: 0.625rem;
  text-transform: uppercase;
}

/* Avatar */

.invite-modal__avatar {
  border-radius: 50%;
  flex-shrink: 0;
  height: 28px;
  object-fit: cover;
  width: 28px;
}

.invite-modal__avatar.avatar--initials {
  align-items: center;
  background: hsl(var(--avatar-hue, 240), 50%, 35%);
  color: #fff;
  display: flex;
  font-size: 0.7rem;
  font-weight: 700;
  justify-content: center;
}

/* Friends */

.invite-modal__friend-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  max-height: 180px;
  overflow-y: auto;
}

.invite-modal__friend-item {
  align-items: center;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  gap: 0.625rem;
  padding: 0.375rem 0.5rem;
  transition: background 0.15s;
}

.invite-modal__friend-item:hover {
  background: #2a2a44;
}

.invite-modal__friend-item input[type="checkbox"] {
  accent-color: #7c7cdb;
  cursor: pointer;
  flex-shrink: 0;
  height: 16px;
  width: 16px;
}

.invite-modal__friend-item input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.invite-modal__friend-name {
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-modal__friend-name--muted {
  color: #6060a0;
  font-style: italic;
}

/* Discord guilds */

.invite-modal__guild-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.invite-modal__guild-toggle {
  align-items: center;
  background: #22223a;
  border: 1px solid #2d2d4e;
  border-radius: 8px;
  color: #e0e0f0;
  cursor: pointer;
  display: flex;
  font-size: 0.88rem;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  text-align: left;
  transition: background 0.15s;
  width: 100%;
}

.invite-modal__guild-toggle:hover {
  background: #2a2a44;
}

.invite-modal__guild-icon {
  align-items: center;
  background: #3a3a5c;
  border-radius: 50%;
  display: flex;
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 700;
  height: 24px;
  justify-content: center;
  overflow: hidden;
  width: 24px;
}

.invite-modal__guild-icon img {
  border-radius: 50%;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.invite-modal__guild-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invite-modal__guild-arrow {
  color: #6060a0;
  font-size: 0.7rem;
  transition: transform 0.2s;
}

.invite-modal__guild-arrow--open {
  transform: rotate(90deg);
}

.invite-modal__channel-list {
  border: 1px solid #2d2d4e;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 0.25rem;
  max-height: 150px;
  overflow-y: auto;
}

.invite-modal__channel-item {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-size: 0.85rem;
  gap: 0.5rem;
  padding: 0.375rem 0.625rem;
  transition: background 0.15s;
}

.invite-modal__channel-item:hover {
  background: #22223a;
}

.invite-modal__channel-item input[type="checkbox"] {
  accent-color: #7c7cdb;
  cursor: pointer;
  flex-shrink: 0;
}

.invite-modal__channel-label {
  color: #b0b0d8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Link section */

.invite-modal__link-row {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.invite-modal__link-input {
  background: #12122a;
  border: 1px solid #2d2d4e;
  border-radius: 6px;
  color: #9090b8;
  flex: 1;
  font-size: 0.82rem;
  min-width: 0;
  padding: 0.4rem 0.6rem;
  user-select: all;
}

/* Footer & buttons */

.invite-modal__footer {
  border-top: 1px solid #2d2d4e;
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 0.875rem 1.25rem;
}

.invite-modal__btn {
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: background 0.15s, opacity 0.15s;
}

.invite-modal__btn--primary {
  background: #5b5bdb;
  color: #fff;
}

.invite-modal__btn--primary:hover:not(:disabled) {
  background: #6e6eea;
}

.invite-modal__btn--primary:disabled {
  background: #3a3a70;
  cursor: not-allowed;
  opacity: 0.55;
}

.invite-modal__btn--ghost {
  background: #2a2a44;
  color: #c0c0e0;
}

.invite-modal__btn--ghost:hover:not(:disabled) {
  background: #33334d;
}

.invite-modal__btn--sm {
  font-size: 0.8rem;
  padding: 0.35rem 0.7rem;
}

.invite-modal__empty {
  color: #6060a0;
  font-size: 0.85rem;
  padding: 0.25rem 0;
}

.invite-modal__spinner {
  color: #6060a0;
  font-size: 0.85rem;
}
