/* Add Attendee Modal Styling - Override dialog defaults */
dialog.add-attendee-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: var(--size-6);
  border-radius: var(--radius-x-large);
  background: var(--layer-surface);
  max-width: min(560px, 98%);
  width: 100%;
  max-height: calc(100vh - 96px);
  overflow: visible;
  display: flex;
  flex-direction: column;
  box-shadow: var(--elevation-3);
  border: none;
}

/* Modal close button positioned in top-right */
.modal-close-button {
  position: absolute;
  top: var(--size-3);
  right: var(--size-3);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--on-surface-variant);
  transition: all 0.2s ease;
  z-index: 1;
}

.modal-close-button:hover {
  background: var(--surface-container-highest);
  color: var(--on-surface);
}

/* Ensure proper spacing for header when close button is present */
.add-attendee-modal .modal_header {
  padding-right: var(--size-8); /* Space for close button */
}

/* Search results styling */
.search-results {
  background: var(--surface-container);
  border-radius: var(--radius-medium);
  padding: var(--size-3);
  max-height: 300px;
  overflow-y: auto;
}

/* Search results title */
.search-results .title-small {
  color: var(--on-surface);
  margin-bottom: var(--size-3);
}

/* Search results list */
.search-results [data-user-search-target="resultsList"] {
  margin-top: 0;
}

/* Individual user result item */
.search-results .user-result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--size-3);
  margin-bottom: var(--size-2);
  background: var(--layer-surface);
  border-radius: var(--radius-small);
  border: 1px solid var(--outline-variant);
  transition: all 0.2s ease;
}

.search-results .user-result-item:last-child {
  margin-bottom: 0;
}

.search-results .user-result-item:hover {
  background: var(--surface-container-highest);
  border-color: var(--outline);
}

/* User info in search results */
.search-results .user-info {
  flex: 1;
}

.search-results .user-name {
  font-weight: var(--font-weight-medium);
  color: var(--on-surface);
  margin-bottom: var(--size-1);
}

.search-results .user-email {
  font-size: var(--font-size-body-small);
  color: var(--on-surface-variant);
}

/* Status indicators */
.search-results .user-status {
  font-size: var(--font-size-body-small);
  padding: var(--size-1) var(--size-2);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.search-results .user-status.already-attendee {
  color: var(--success);
  background: var(--success-container);
}

/* Make modal body scrollable */
.add-attendee-modal .modal_body {
  flex: 1;
  overflow-y: auto;
  padding-right: var(--size-2); /* Space for scrollbar */
}

/* Search input styling */
.add-attendee-modal input[type="text"] {
  flex: 1;
  padding: var(--size-2) var(--size-3);
  border: 1px solid var(--outline);
  border-radius: var(--radius-small);
  background: var(--layer-surface);
  color: var(--on-surface);
  font-size: var(--font-size-body-large);
  transition: all 0.2s ease;
}

.add-attendee-modal input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-container);
}

.add-attendee-modal input[type="text"]::placeholder {
  color: var(--on-surface-variant);
  opacity: 0.7;
}

/* Help text styling */
.help-text {
  padding: var(--size-3);
  background: var(--surface-container);
  border-radius: var(--radius-medium);
  font-size: var(--font-size-body-small);
  color: var(--on-surface-variant);
}

.help-text p {
  margin: 0;
  margin-bottom: var(--size-2);
}

.help-text p:last-child {
  margin-bottom: 0;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .add-attendee-modal {
    padding: var(--size-4);
  }
  
  .modal-close-button {
    top: var(--size-2);
    right: var(--size-2);
  }
}