:root {
  --modal-surface: rgba(255, 255, 255, 0.94);
  --modal-surface-solid: #fff;
  --modal-chrome: rgba(250, 250, 252, 0.82);
  --modal-hairline: rgba(60, 60, 67, 0.18);
  --modal-shadow: 0 24px 70px rgba(0, 0, 0, 0.24), 0 6px 20px rgba(0, 0, 0, 0.12);
  --modal-radius: 24px;
  --modal-control: rgba(120, 120, 128, 0.16);
  --modal-control-hover: rgba(120, 120, 128, 0.24);
  --modal-control-active: rgba(120, 120, 128, 0.32);
  --modal-label: rgba(60, 60, 67, 0.68);
}

dialog {
  margin: auto;
  z-index: 1;
  width: min(calc(100% - 32px), 720px);
  height: min(calc(100dvh - 32px), 920px);
  max-width: 720px;
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden; /* keep scroll inside modal-body */
  color: #111;
  background: var(--modal-surface);
  border: 1px solid var(--modal-hairline);
  border-radius: var(--modal-radius);
  box-shadow: var(--modal-shadow);
  backdrop-filter: saturate(1.35) blur(18px);
  -webkit-backdrop-filter: saturate(1.35) blur(18px);
}
@media(max-width: 700px){
  dialog {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
  }
  modal-footer{
    padding-bottom: max(14px, env(safe-area-inset-bottom)) !important;
  }
}
.user #event-modal[data-event-id="new"] modal-header h3:before{
  content: 'Suggest a ';
}
#event-modal event-date {
  position: sticky;
  top: 0;
  z-index: 2;
}

/* SPECIFIC AUTHORIZATION LOGIC FOR EVENT MODAL */

body.user dialog .new-profile,
body.user dialog reset-profile-attachment-button{
  display:none;
}

/* These hidden fields are NOT hidden for community events, and there is currently no API endpoint to make sure these don't work if a host edits their own official event */
body.user dialog.edit-mode:has(article.event-modal-content[data-user-status="hosting"]:not([data-event-class="community"])) event-date,
body.user dialog.edit-mode:has(article.event-modal-content[data-user-status="hosting"]:not([data-event-class="community"])) event-capacity-private,
body.user dialog.edit-mode:has(article.event-modal-content[data-user-status="hosting"]:not([data-event-class="community"])) modal-location-father,
body.user dialog.edit-mode:has(article.event-modal-content[data-user-status="hosting"]:not([data-event-class="community"])) .event-date-title{
  display:none;
}
body.user dialog.edit-mode:has(article.event-modal-content[data-user-status="hosting"]:not([data-event-class="community"])) modal-footer .delete-button{
  display:none;
}
#event-modal modal-content:has(article.event-modal-content[data-user-status="hosting"]) modal-header .toggle-edit-mode-button{
  display: block;
}
#event-modal modal-header .toggle-edit-mode-button{
  display: none;
}
body.sheriff #event-modal modal-header .toggle-edit-mode-button{
  display: block;
}
.toggle-edit-mode-button{
  margin-left: auto;
}

/* SPECIFIC AUTHORIZATION LOGIC FOR SPONSOR MODAL */
#sponsor-modal modal-header .toggle-edit-mode-button {
  display: none;
}
#sponsor-modal[data-can-edit="true"] modal-header .toggle-edit-mode-button {
  display: block;
}
#sponsor-modal[data-can-delete="false"] modal-footer .delete-button {
  display: none !important;
}
#sponsor-modal.edit-mode[data-can-manage-admin-fields="false"] sponsor-tier-select,
#sponsor-modal.edit-mode[data-can-manage-admin-fields="false"] sponsor-position-input {
  display: none !important;
}
body.user #sponsor-modal.edit-mode[data-can-edit="true"] .new-profile,
body.user #sponsor-modal.edit-mode[data-can-edit="true"] reset-profile-attachment-button {
  display: inherit;
}

#event-modal.edit-mode .rsvp-button{
  display:none;
}
.rsvp-button buy-text{
  display:none;
  color: var(--restricted-strong);
  align-items: center;
  gap: 3px;
}
.rsvp-button rsvp-text{
  color: var(--rsvp-strong);
  display:flex;
  align-items: center;
  gap: 3px;
}
.rsvp-button rsvp-text > * {
  display:none;
}
.rsvp-button{
  background-color: var(--rsvp-light);
  border-color: var(--rsvp-strong);
  border: none;
  background: none;
  box-shadow: none;
  padding:0;
}
.rsvp-button img{
  width:2em;
}
.rsvp-button.heart-fill-pop rsvp-text heart-icon-filled {
  animation: heart-fill-pop 520ms cubic-bezier(0.2, 0.9, 0.25, 1) both;
  transform-origin: center;
}
#event-modal:has(article[data-access-restricted="true"]) .rsvp-button buy-text{
  display: flex;
}
#event-modal:has(article[data-access-restricted="true"]) .rsvp-button buy-text img{
  transform: rotate(-20deg);
}
#event-modal:has(article[data-access-restricted="true"]) .rsvp-button{
  background-color: var(--restricted-light);
  border-color: var(--restricted-strong);
}
#event-modal:has(article[data-access-restricted="true"]) .rsvp-button rsvp-text{
  display:none;
}
#event-modal:has(article[data-user-status="hosting"]) .rsvp-button rsvp-text heart-icon-filled,
#event-modal:has(article[data-user-status="purchased_standalone"]) .rsvp-button rsvp-text heart-icon-filled{
  display:flex;
}
#event-modal:has(article[data-user-status=""]) .rsvp-button rsvp-text heart-icon {
  display:flex;
}
#event-modal:has(article[data-user-status="liked"]) .rsvp-button rsvp-text heart-icon {
  display:none;
}
#event-modal:has(article[data-user-status="liked"]) .rsvp-button rsvp-text heart-icon-filled {
  display:flex;
}
#authenticatedContent.user #event-modal.edit-mode {
  /* display:none; */
}

/* END SPECIFIC AUTHORIZATION LOGIC FOR EVENT MODAL */





.event-date-title{
  margin-left:8px;
}
dialog label {
  text-transform: uppercase;
}
dialog#add-comment-popover a{
pointer-events: none;
}
dialog#add-comment-popover comment-date{
display:none;
}
dialog#add-comment-popover{
  padding:8px;
  width:100%;
  margin-top: 2.5em;
  height: fit-content;
  max-height:92%;
  overflow-y:scroll;
}
dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  z-index: 0; /* Ensure this is lower than notification-message */
}
modal-content{
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100dvh;
  overflow: hidden; /* allow body to scroll independently */
}
modal-body {
  padding: 14px;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--modal-surface);
}
modal-footer{
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  background: var(--modal-chrome);
  border-top: 1px solid var(--modal-hairline);
  padding: 10px 14px;
  backdrop-filter: saturate(1.35) blur(18px);
  -webkit-backdrop-filter: saturate(1.35) blur(18px);
}
modal-header{
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 54px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--modal-hairline);
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--modal-chrome);
  gap: 8px;
  backdrop-filter: saturate(1.35) blur(18px);
  -webkit-backdrop-filter: saturate(1.35) blur(18px);
}

/* iPhone Safari fallback: avoid compositor/hit-test drift in event modal */
@supports (-webkit-touch-callout: none) {
  @media (max-width: 700px) {
    #event-modal::backdrop {
      backdrop-filter: none;
    }
    #event-modal modal-header,
    #event-modal modal-footer,
    #event-modal event-date {
      position: static;
    }
    #event-modal modal-body {
      overscroll-behavior: auto;
      -webkit-overflow-scrolling: touch;
    }
  }
}
dialog.edit-mode access-and-capacity-container{
  display: block;
  padding: 8px;
}

/* Base styles for all event messages */
.event-message {
  display: none;
}

.event-message p {
  margin: 0;
}

/* Hide all event messages in edit mode */
#event-modal.edit-mode .event-message {
  display: none;
}

/* Common styles for visible event messages */
#event-modal:not(.edit-mode) .event-message {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  transition: background-color 0.2s ease;
}

/* Common icon styles for all event messages */
#event-modal:not(.edit-mode) .event-message::before {
  content: '';
  flex-shrink: 0;
  transform: rotate(-20deg);
  width: 38px;
  height: 38px;
  margin: 5px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

#checkout-modal modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  padding-top:0;
  padding-bottom: 85px;
}
#checkout-included-events-view #included-events-list .checkout-included-event{
  /* tighten up the multi event navigation later */
  /* pointer-events: none; */
}
#checkout-modal #back-to-options{
  background: #333;
}
.price-highlight{
  width: fit-content;
  background: var(--restricted-light);
  padding: 0 0.15rem;
  margin-top: 0.35em;
}
#checkout-modal #submit-payment{
  background: yellow;
  color: black;
  border: var(--standard-border);
  font-size: 1.25em;
}
#checkout-modal #payment-form{
  flex: 1;
  display: flex;
  flex-direction: column;
}
#checkout-modal modal-container{
  display:block;
  height:100%;
  position:relative;
}
standalone-price-container{
  display:none;
}
#event-modal.edit-mode standalone-price-container,
#event-modal.edit-mode maximum-attendance-container{
  display:flex;
  align-items: center;
  margin-top: 0.5em;
  width: 100%;
}
#event-modal:not(.edit-mode) event-title-container {
  display:none;
}
maximum-attendance-container{
  max-width: 100%;
}
.maximum-attendance-input{
  margin-left: auto;
}
standalone-price-container input,
maximum-attendance-container input{
  width:80px;
  text-align: left;
  padding-left: 0.5rem;
}
/* Upgrade ticket message - restricted colors */
#event-modal:not(.edit-mode) article[data-access-restricted="true"] upgrade-ticket-message.event-message {
  border-bottom: 2px solid var(--restricted-strong);
  background-color: var(--restricted-light);
  cursor: pointer;
}

#event-modal:not(.edit-mode) article[data-access-restricted="true"] upgrade-ticket-message.event-message::before {
  background-image: url('/assets/icons/ticket-restricted.svg');
}

/* Hide upgrade message when event is not restricted */
#event-modal:not(.edit-mode) article:not([data-access-restricted="true"]) upgrade-ticket-message {
  display: none;
}

/* Community event message - community colors */
#event-modal:not(.edit-mode) article[data-event-class="community"] community-event-message.event-message {
  border-bottom: 2px solid var(--community-strong);
  background-color: var(--community-light);
}

#event-modal:not(.edit-mode) article[data-event-class="community"] community-event-message.event-message::before {
  background-image: url('/assets/icons/calendar-smile.svg');
}

/* Hide community message when event is not community */
#event-modal:not(.edit-mode) article:not([data-event-class="community"]) community-event-message {
  display: none;
}

/* Capacity limit message - RSVP colors */
#event-modal:not(.edit-mode) article[data-capacity]:not([data-capacity="false"]) capacity-limit-message.event-message {
  border-bottom: 2px solid var(--rsvp-strong);
  background-color: var(--rsvp-light);
}

#event-modal:not(.edit-mode) article[data-capacity]:not([data-capacity="false"]) capacity-limit-message.event-message::before {
  background-image: url('/assets/icons/heart.svg');
}

/* Hide capacity message when event has no capacity limit */
#event-modal:not(.edit-mode) article[data-capacity="false"] capacity-limit-message,
#event-modal:not(.edit-mode) article:not([data-capacity]) capacity-limit-message {
  display: none;
}
#event-modal:not(.edit-mode) article[data-sponsor-count]:not([data-sponsor-count="0"]) sponsored-event-message.event-message {
  background: color-mix(in srgb, var(--sponsor-tier-color, #000) 9%, white);
  border-top: 1px solid color-mix(in srgb, var(--sponsor-tier-color, #000) 25%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--sponsor-tier-color, #000) 25%, transparent);
  cursor: pointer;
}
#event-modal:not(.edit-mode) article[data-sponsor-count]:not([data-sponsor-count="0"]) sponsored-event-message.event-message::before {
  content: none;
}
#event-modal:not(.edit-mode) sponsored-event-message.event-message img {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  background: color-mix(in srgb, var(--sponsor-tier-color, #000) 6%, white);
}
#event-modal:not(.edit-mode) article[data-sponsor-count="0"] sponsored-event-message,
#event-modal:not(.edit-mode) article:not([data-sponsor-count]) sponsored-event-message {
  display: none;
}
#event-modal article[data-user-status="hosting"] capacity-limit-message,
#event-modal article[data-user-status="purchased_standalone"] capacity-limit-message,
#event-modal article[data-user-status="liked"] capacity-limit-message {
  display: none !important;
}

/* Hide capacity message when event is access-restricted (upgrade ticket message takes priority) */
#event-modal:not(.edit-mode) article[data-access-restricted="true"] capacity-limit-message {
  display: none;
}
modal-footer{
  background: var(--modal-chrome);
  border-top: 1px solid var(--modal-hairline);
  padding: 10px 14px;
  position: sticky;
  bottom: 0;
  width: 100%;
  z-index: 100;
  margin-top: auto;
  justify-content: space-between;
  backdrop-filter: saturate(1.35) blur(18px);
  -webkit-backdrop-filter: saturate(1.35) blur(18px);
}
#event-modal.edit-mode #event-modal-add-comment-section{
  display: none;
}

#discussion-thread-modal modal-body {
  padding: 0;
}

#announcement-archive-modal modal-body {
  padding: 0;
}

#discussion-create-modal modal-body {
  padding: 12px;
}
modal-footer > button:first-child:last-child {
  margin-left: auto;
}
button.close-popover {
  background-color: var(--modal-control);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%233c3c43' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='m5 12 6 6'/%3E%3Cpath d='m5 12 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 24px;
  min-height: 32px;
  height: 32px;
  width: 32px;
  padding: 0;
  border: 0 !important;
  border-radius: 50%;
  box-shadow: none !important;
  flex: 0 0 32px;
  order: -1;
  opacity: 1;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
button.close-popover:hover {
  background-color: var(--modal-control-hover);
}
button.close-popover:active {
  background-color: var(--modal-control-active);
  transform: scale(0.94);
}
modal-header > *:not(button.close-popover) {
  /* flex: 1; */
}
modal-header > h3,
modal-header > name-title-container,
modal-header > modal-header-container {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
}
modal-header .toggle-edit-mode-button {
  flex: 0 0 32px !important;
  width: 32px;
  min-height: 32px;
  height: 32px;
  margin-left: 0;
  padding: 0;
  overflow: hidden;
  color: transparent;
  background-color: var(--modal-control);
  background-image: url('/assets/icons/pencil.svg');
  background-repeat: no-repeat;
  background-position: center;
  border: 0;
  border-radius: 50%;
  box-shadow: none;
}
modal-header .toggle-edit-mode-button:hover {
  background-color: var(--modal-control-hover);
}
modal-header .toggle-edit-mode-button:active {
  background-color: var(--modal-control-active);
  transform: scale(0.94);
}

/* Sponsor logo wrapper - matching profile image pattern */
.sponsor-modal sponsor-logo image-wrapper {
  position: relative;
  padding: 4px;
  border: var(--standard-border);
  border-radius: 10px;
  display: inline-block;
}

.sponsor-modal sponsor-logo image-wrapper img.sponsor-logo-image {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}

sponsor-banner-image, sponsor-card sponsor-banner {
  position: relative;
  /* hidden sponsor banner images for now */
  display: none;
}

.sponsor-modal:not(.edit-mode) sponsor-banner-image:not(:has(image-wrapper img.uploadedImage[data-original-url]:not([data-original-url=""]):not([data-original-url="null"]):not([data-original-url="undefined"]))) {
  display: none !important;
}

.sponsor-modal sponsor-banner-image image-wrapper {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  min-height: 100px;
  border-radius: 0;
  border: 0;
}

.sponsor-modal sponsor-banner-image image-wrapper img.uploadedImage {
  width: 100%;
  max-height: 300px;
  display: block;
  object-fit: contain;
}

.sponsor-modal.edit-mode sponsor-profile.new-profile{
  margin-bottom: 10em;
}

/* Edit mode overlay styles - matching profile image pattern */
.sponsor-modal.edit-mode sponsor-logo image-overlay,
.sponsor-modal.edit-mode sponsor-banner-image image-overlay {
  cursor: pointer;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%; 
  background: linear-gradient(to top, 
    rgba(0, 0, 0, 0.5) 10%,
    rgba(0, 0, 0, 0) 100%
  );
  align-items: end;
  padding-bottom: 15px;
  justify-content: center;
  border-radius: 10px;
}
dialog.edit-mode .edit-only {
  display: flex !important;
}
dialog.edit-mode .ajax-link {
  pointer-events:none;
}

.sponsor-modal sponsor-logo image-overlay .upload-icon,
.sponsor-modal sponsor-banner-image image-overlay .upload-icon {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1); /* Makes the icon white */
}

section-title {
  display: block;
}
/* Hide section titles when content is empty in view mode */
dialog:not(.edit-mode) section-title:has(+ sponsor-message pre:empty),
dialog:not(.edit-mode) section-title:has(+ sponsor-message pre[data-content=""]),
dialog:not(.edit-mode) section-title:has(+ sponsor-profiles-container:empty) {
  display: none;
}

dialog:not(.edit-mode) sponsor-tagline:has(pre:empty) {
  display: none;
}
sponsor-position-input {
  margin-top: 6px;
}
sponsor-position-input label{
  font-weight: 700;
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
sponsor-tier-select {
  display: flex;
  align-items: center;
  gap: 5px;
}
sponsor-tier-select > .edit-only {
  font-weight: 700;
  font-size: 0.75em;
  text-transform: uppercase;
}
sponsor-position-input input{
  border-radius: 8px;
  padding: 0.35rem 0.625rem;
  background: white;
  width: fit-content;
  width: 80px;
}
/* Hide empty sponsor tier in view mode (value = 0 means no tier selected) */
dialog:not(.edit-mode) sponsor-tier-select:has(select option:checked[value="0"]) {
  display: none;
}
.edit-mode sponsor-tier-select select{
  width: fit-content;
  appearance: auto;
  padding: 0.35rem 0.625rem;
  border-radius: 8px;
  border: var(--edit-input-border);
  background: white !important;
  color: inherit;
  font-size: 1rem;
  font-weight: initial;
  text-transform: none;
}

/* Always show the edit surface for edit and create flows */
dialog.edit-mode,
#profile-edit-modal[data-id="new"],
#event-modal[data-event-id="new"],
#sponsor-modal[data-sponsor-id="new"],
#profile-edit-modal[data-profile-modal-view="bulk"],
#event-import-modal {
  background-color: var(--edit-color);
}
dialog.edit-mode modal-body,
#profile-edit-modal[data-id="new"] modal-body,
#event-modal[data-event-id="new"] modal-body,
#sponsor-modal[data-sponsor-id="new"] modal-body,
#profile-edit-modal[data-profile-modal-view="bulk"] modal-body,
#event-import-modal modal-body {
  background-color: var(--edit-color);
}
dialog.edit-mode modal-header,
dialog.edit-mode modal-footer,
#profile-edit-modal[data-id="new"] modal-header,
#profile-edit-modal[data-id="new"] modal-footer,
#event-modal[data-event-id="new"] modal-header,
#event-modal[data-event-id="new"] modal-footer,
#sponsor-modal[data-sponsor-id="new"] modal-header,
#sponsor-modal[data-sponsor-id="new"] modal-footer,
#profile-edit-modal[data-profile-modal-view="bulk"] modal-header,
#profile-edit-modal[data-profile-modal-view="bulk"] modal-footer,
#event-import-modal modal-header,
#event-import-modal modal-footer {
  background: color-mix(in srgb, var(--edit-color) 82%, white);
}
dialog.edit-mode section-title {
  display: block;
}
.new-profile{
  display: none;
}
comment-post.edit-mode edit-button {
  display: none;
}
#event-modal.edit-mode event-description{
  margin-bottom: 4em;
}
[contenteditable="true"] {
  cursor: text;
  display: inline-block;
  min-width: 50px;
  width: 100%;
  border: var(--edit-input-border);
  border-radius: 8px;
  padding: 0.5rem 0.625rem;
  background: white;
}
[contenteditable="true"]:focus {
  outline: none;
  text-overflow: unset;
}
dialog.edit-mode .new-profile{
  display: inherit;
}
dialog.edit-mode .toggle-edit-mode-button{
  display: none !important;
}
reset-profile-attachment-button,
reset-sponsor-attachment-button {
  display: none;
}
dialog.edit-mode reset-profile-attachment-button,
dialog.edit-mode reset-sponsor-attachment-button{
  display: inherit;
}
button.save-button, button.delete-button{
  display: none;
}
#profile-edit-modal button.save-button, 
#profile-edit-modal button.delete-button{
  display: inherit;
}
#profile-edit-modal transaction-ledger-section .transaction-incomplete{
  display:none;
}
dialog.edit-mode button.save-button, dialog.edit-mode button.delete-button{
  display: inherit;
}
dialog.edit-mode button.save-button:disabled,
dialog.edit-mode button.save-button.is-saving {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}
/* Never show delete button when creating a new sponsor */
#sponsor-modal[data-sponsor-id="new"] button.delete-button{
  display: none !important;
}
/* When only one visible button, align it to the right */
modal-footer > button:not([style*="display: none"]):first-child:not([style*="display: none"]):last-child,
modal-footer > button.toggle-edit-mode-button:not([style*="display: none"]) {
  margin-left: auto;
}

.website-url-input{
  text-transform: none;
  font-weight: initial;
  background: white;
}

sponsor-website {
  display: block;
  margin-top: 0.75rem;
}

sponsor-website label {
  font-weight: 700;
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  align-items: center;
  gap: 5px;
}

sponsor-website input {
  width: 100%;
}

dialog:not(.edit-mode) sponsor-website label,
dialog.edit-mode sponsor-website .partner-website {
  display: none !important;
}

dialog:not(.edit-mode) sponsor-website:has(.partner-website[href=""]),
dialog:not(.edit-mode) sponsor-website:has(.partner-website[href="#"]) {
  display: none;
}

dialog:not(.edit-mode) sponsor-offer .offer-url-input {
  display: none;
}

dialog:not(.edit-mode) sponsor-offer .offer-header-input {
  display: none;
}

dialog.edit-mode sponsor-offer .sponsor-offer-link {
  display: none !important;
}

dialog.edit-mode sponsor-offer label {
  display: block;
  font-weight: 700;
  font-size: 0.75em;
  text-transform: uppercase;
  align-items: center;
  gap: 5px;
}

.sponsor-modal sponsor-offer {
  display: block;
}

.sponsor-modal section-title {
  margin-top: 2em;
}

.sponsor-modal .offer-url-input,
.sponsor-modal .offer-header-input {
  width: 100%;
  text-transform: none;
  font-weight: initial;
}

.sponsor-modal:not(.edit-mode) sponsor-banner-image image-wrapper {
  width: 100%;
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 10px 10px 0 0;
  overflow: hidden;
}

.sponsor-modal:not(.edit-mode) sponsor-banner-image image-wrapper img.uploadedImage {
  border-radius: 10px 10px 0 0;
}

.sponsor-modal:not(.edit-mode):has(sponsor-banner-image img.uploadedImage[data-original-url]:not([data-original-url=""]):not([data-original-url="null"]):not([data-original-url="undefined"])) sponsor-header {
  position: relative;
  align-items: flex-end;
  padding: 0 4px;
  z-index: 1;
}

.sponsor-modal:not(.edit-mode) sponsor-logo image-wrapper {
  background: white;
  padding: 6px;
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.sponsor-modal:not(.edit-mode) sponsor-info {
  padding-bottom: 8px;
}

.sponsor-modal:not(.edit-mode) sponsor-tier-select select {
  border: 0;
  border-radius: 0;
  background: transparent !important;
  color: var(--sponsor-tier-color, #000);
  padding: 0;
  margin: 0 0 8px;
  pointer-events: none;
  font-weight: 700;
}

.sponsor-modal:not(.edit-mode) sponsor-tier-select {
  display: block;
}

.sponsor-modal:not(.edit-mode) sponsor-tier-select:has(select option:checked[value="0"]) {
  display: none;
}

.sponsor-modal:not(.edit-mode) sponsor-name {
  margin-bottom: 0;
}

.sponsor-modal:not(.edit-mode) sponsor-name pre {
  margin: 0;
}

.sponsor-modal:not(.edit-mode) .partner-website,
.sponsor-modal:not(.edit-mode) .sponsor-offer-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  font-weight: 600;
  text-decoration: none;
  text-transform: none;
  letter-spacing: 0;
}

.sponsor-modal:not(.edit-mode) .partner-website img,
.sponsor-modal:not(.edit-mode) .sponsor-offer-link img {
  width: 22px;
  height: 22px;
}

.sponsor-modal:not(.edit-mode) sponsor-offer {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--sponsor-tier-color, #000);
  border-radius: 8px;
  padding: 0.75rem;
  background: color-mix(in srgb, var(--sponsor-tier-color, #000) 7%, white);
}

.sponsor-modal:not(.edit-mode) section-title:has(+ sponsor-offer .sponsor-offer-link[href=""]),
.sponsor-modal:not(.edit-mode) section-title:has(+ sponsor-offer .sponsor-offer-link[href="#"]),
.sponsor-modal:not(.edit-mode) sponsor-offer:has(.sponsor-offer-link[href=""]),
.sponsor-modal:not(.edit-mode) sponsor-offer:has(.sponsor-offer-link[href="#"]) {
  display: none;
}

.sponsor-modal:not(.edit-mode) sponsor-offer .sponsor-offer-link {
  display: contents;
}

.sponsor-modal:not(.edit-mode) sponsor-offer offer-icon {
  width: 40px;
  height: 40px;
  border-radius: 100%;
  background: color-mix(in srgb, var(--sponsor-tier-color, #000) 10%, white);
  color: var(--sponsor-tier-color, #000);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sponsor-modal:not(.edit-mode) sponsor-offer offer-icon svg {
  width: 22px;
  height: 22px;
}

.sponsor-modal:not(.edit-mode) sponsor-offer offer-header {
  flex: 1;
  min-width: 0;
  font-weight: 700;
}

.sponsor-modal:not(.edit-mode) sponsor-offer offer-header:empty {
  display: block;
}

.sponsor-modal:not(.edit-mode) sponsor-offer offer-header:empty::before {
  content: 'Click to view special offer';
}

.sponsor-modal:not(.edit-mode) sponsor-offer .sponsor-offer-link > span {
  display: none;
}

.sponsor-modal:not(.edit-mode) sponsor-offer .sponsor-offer-link::after {
  content: '';
  margin-left: auto;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='icon icon-tabler icons-tabler-outline icon-tabler-arrow-left'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M5 12l14 0' /%3E%3Cpath d='M5 12l6 6' /%3E%3Cpath d='M5 12l6 -6' /%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transform: rotate(145deg);
}
.sponsor-modal.edit-mode sponsor-name pre:empty::before {
  content: 'Partner Name';
}

.sponsor-modal.edit-mode sponsor-tagline pre:empty::before {
  content: 'Tagline';
}

.sponsor-modal.edit-mode sponsor-message pre:empty::before {
  content: 'Partner Description';
}

button{
  font-weight: 600;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
sponsor-profile-name {
  width: 100%;
  display:block;
}
sponsor-profile-name input{
  width: 100%;
}
.profile-attached .ajax-link,
.sponsor-attached .ajax-link{
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.sponsor-attached event-sponsor-name {
  overflow-wrap: anywhere;
}

/* Show/hide elements based on new vs edit mode */
.hideForEditModal {
  display: none;
}

#profile-edit-modal[data-id="new"] .hideForEditModal {
  display: block;
}

#profile-edit-modal[data-id="new"] .hideForNewModal {
  display: none;
}

/* Name title container in header */
name-title-container > *[contenteditable="true"] {
  width: fit-content;
  min-width: 0;
}

profile-type-selector select {
  padding: 0.5rem 0.625rem;
  text-align: center;
  border-radius: 6px;
  font-size: 0.875rem;
}

/* Role selector */
role-selector {
  position: relative;
  display: flex;
}

role-selector select, profile-type-selector select, csv-upload-section label {
  background: antiquewhite;
  padding: 0.5rem 0.625rem;
  text-align: center;
  max-width: 100%;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
}

role-selector select[disabled] {
  background-color: lightgray;
}

role-selector:has(select#edit-role[disabled])::after {
  content: 'Head Sheriff';
  color: black;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 1;
  font-size: 0.9em;
  padding: 0.6rem;
}
/* Event modal comments fade transition */
#event-modal-comments-container {
  transition: opacity 0.15s ease-in-out;
}
modal-location-father{
  display: flex;
  align-items:center;
  margin: 1.25em 8px;
  justify-content: space-between;
  gap: 8px;
}
#event-modal:not(.edit-mode) modal-location-father location-title-container{
  flex: 1;
}
event-comments-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
event-comments-header comment-count{
  font-size: 0.875em;
}
comment-count-number:before{
  content: attr(data-comment-count);
}
#event-modal.edit-mode attendees-button-section{
  display: none;
}
attendees-button-section{
  margin:8px;
  display:block;
}
attendees-button-section button{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
attendees-button-section attendees-count{
  margin-left: 6px;
}
attendees-button-section attendees-count-number:before{
  content: attr(data-attendee-count);
}
attendees-button-section capacity-number[data-capacity="false"]{ 
  display:none;
}
attendees-button-section capacity-number:after{
  content: attr(data-capacity);
  font-size: 0.85em;
}
modal-header-container {
  line-height:1.2;
}
modal-header-container > span {
  color: #555;
  font-style: normal !important;
  font-size: 0.875em;
}
#event-modal:not(.edit-mode) modal-location-father,
#event-modal attendees-button-section button{
  background: #e8f1fc;
  padding: 6px 8px;
  border-radius: 8px;
  border: 2px solid #e9edf3;
  box-shadow: none;
  gap: 5px;
}
attendees-button-section .attendee-avatars{
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
attendees-button-section .attendee-avatars img.avatar{
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  border: var(--standard-border);
  background-color: var(--profile-color);
}
count-wrap{
  flex-shrink:0;
}
#event-modal:not(.edit-mode) modal-location-father location-title{
  display:flex;
  flex-direction: column;
}
#event-modal:not(.edit-mode) modal-location-father location-title:before {
  content: 'Get Directions';
  font-weight: 700;
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #666;
}
#event-modal.edit-mode event-comments-section{
  display: none;
}
dialog.edit-mode modal-location-father .location-icon{
  display: none;
}
#qr-scanner {
  display: flex;
  align-items: center;
  gap: 0.5em;
  background: yellow;
}
#event-modal article event-edit-container > * {
  margin: 1em 0;
}
#event-modal.edit-mode event-date-formatted, 
#event-modal.edit-mode event-time img,
#event-modal.edit-mode location-title-container img{
  display:none;
}
#event-modal event-date-formatted{
  font-weight: 400;
}

/* Hide time inputs in modal when not in edit mode */
#event-modal:not(.edit-mode) event-time .time-input {
  display: none;
}
#event-modal modal-body{
  padding:0;
}
#event-modal section-title {
  font-size: 0.875em;
}
event-modal-wrapper {
  padding: 8px;
}
#event-modal event-hosts-container{
  padding: 0 8px;
  display: block;
}
#event-modal .new-profile{
  padding: 0 8px;
}
event-image section-title {
  margin-left: 8px;
}
#event-modal-profile-search-input {
  width: 100%;
}
/* Hide time text in modal when in edit mode */
#event-modal.edit-mode start-time,
#event-modal.edit-mode end-time {
  display: none;
}
#event-modal.edit-mode event-title-container{
  padding:8px;
}

/* Show time inputs in modal when in edit mode */
#event-modal.edit-mode event-time .time-input {
  display: inline-block;
}
/* Hide event-image section when there's no image URL */
.event-modal-content[data-image-url=""]:not(.edit-mode) event-image,
.event-modal-content:not([data-image-url]):not(.edit-mode) event-image {
  display: none;
}

/* Event modal image styling */
#event-modal event-image image-wrapper {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  min-height: 100px; /* Prevent layout shift on initial load */
  border-radius: 0;
  border: 0;
}

#event-modal event-image image-wrapper img.uploadedImage {
  width: 100%;
  max-height: 300px;
  /* object fit cover interesting idea */
  object-fit: cover;
  display: block;
}

/* Edit mode overlay styles */
#event-modal.edit-mode event-image image-overlay {
  cursor: pointer;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100%; 
  background: linear-gradient(to top, 
    rgba(0, 0, 0, 0.5) 10%,
    rgba(0, 0, 0, 0) 100%
  );
  align-items: end;
  padding-bottom: 15px;
  justify-content: center;
}

#event-modal event-image image-overlay .upload-icon {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1); /* Makes the icon white */
}
#profile-edit-form select#edit-role option {
  padding: 0.5em;
  font-weight: bold;
  letter-spacing: -0.05em;
  color: black;
  background: white;
}

/* Ticket type selector */
ticket-type-selector {
  display: block;
}

ticket-type-selector select {
  background: antiquewhite;
  color: black;
  padding: 0.5rem 0.625rem;
  text-align: center;
  max-width: 100%;
  border-radius: 6px;
  font-size: 0.875rem;
}

/* Invitation link section */
invitation-link-section {
  display: block;
}

invitation-link-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: space-between;
  margin-top: 1em;
}

invitation-button-container{
  background: yellow;
  border: 1.5px solid black;
  padding: 2px 4px;
  border-radius: 4px;
}

invitation-email-input {
  display: block;
}

#invitation-link-email pre:empty:before {
  content: 'Email Address';
}

/* Name inputs */
first-name-input, last-name-input {
  display: block;
}

/* Credit balance section */
credit-balance-section {
  display: block;
  margin: 20px 0;
}

.current-balance {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.5em;
  margin-bottom: 0.5em;
}
.current-balance app-currency {
  font-size: 0.75em;
}
.current-balance label {
  font-weight: bold;
  margin-right: auto;
}

.credit-update {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.credit-update label {
  margin-right: auto;
}

.credit-input-container {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Transaction tables */
#standalone-purchases-table,
.transaction-table {
  width: 100%;
}

#standalone-purchases-table th.col-description {
  display: flex;
  align-items: center;
  gap: 5px;
  text-align: left;
}

#standalone-purchases-table td,
#standalone-purchases-table th {
  padding: 0.1rem 0.35rem;
}

#standalone-purchases-table th {
  text-align: center;
  background: black;
  color: white;
  padding: 0.25rem;
}

#standalone-purchases-table tr[data-reassign-profile-id] td.col-description::after {
  content: 'Transfer to ' attr(data-reassign-profile-name);
  display: inline-block;
  padding: 2px 6px;
  font-size: 0.875em;
  font-weight: 600;
  margin-top:0.5em;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 1.5px solid #111;
  border-radius: 4px;
  background: yellow;
  color: #111;
}

reassign-ticket-panel profile-item[data-cannot-reassign="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

reassign-ticket-panel profile-item[data-cannot-reassign="true"]::after {
  content: 'Has ticket already';
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #888;
}

/* Hide standalone purchases section when empty */
standalone-purchases-section[data-empty="true"] {
  display: none;
}

/* Hide section title when the following section is empty */
#profile-edit-modal section-title:has(+ standalone-purchases-section[data-empty="true"]),
#profile-edit-modal section-title:has(+ transaction-ledger-section:not(:has(tbody tr:not(.no-transactions)))) {
  display: none;
}

/* ========================================
   Profile Edit Modal Improvements
   ======================================== */

/* Better background for new profiles */
#profile-edit-modal{
  background-color: var(--edit-color);
}

/* Name title container in header */
#profile-edit-modal name-title-container {
  display: flex;
  gap: 6px;
  align-items: center;
}

#profile-edit-modal name-title-container h3 {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 600;
}

#profile-edit-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.7em;
}

#profile-edit-form label {
  font-weight: bold;
  text-transform: uppercase;
}
/* For new profiles, hide the last name and style first name as title */
#profile-edit-modal[data-id="new"] name-title-container h3#profile-edit-last-name-title {
  display: none;
}

#profile-edit-modal[data-id="new"] name-title-container h3#profile-edit-first-name-title {
  font-size: 1rem;
}

/* Improved selector styling */
selector-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  text-transform: uppercase;
  font-weight: 500;
}

selector-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
selector-wrapper select {
  user-select: none;
}
selector-wrapper label {
  font-weight: 600;
  font-size: 0.75rem;
  color: #666;
}


/* Better invitation section */
invitation-link-section {
  margin-bottom: 12px;
}

invitation-link-header label {
  font-weight: 600;
  font-size: 0.75rem;
  color: #666;
  text-transform: uppercase;
}

#invitation-link-email pre:empty:before {
  content: 'Enter email address';
  color: #999;
}

/* Name fields side by side */
profile-name-fields {
  display: flex;
  gap: 10px;
  flex-direction:column;
}

first-name-input,
last-name-input {
  flex: 1;
}

first-name-input input,
last-name-input input {
  width: 100%;
  border: var(--edit-input-border);
  border-radius: 8px;
  padding: 0.5rem 0.625rem;
  background: white;
  font: inherit;
}

.current-balance label,
.credit-update label {
  font-weight: 600;
  font-size: 0.75rem;
  color: #666;
}

.credit-update {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.credit-input-container input {
  width: 6.25rem;
}

/* Better table styling */
#standalone-purchases-table,
.transaction-table {
  margin-top: 8px;
}
#standalone-purchases-table{
  margin-bottom:3em;
}

#standalone-purchases-table td,
#standalone-purchases-table th,
.transaction-table td,
.transaction-table th {
  padding: 6px 8px;
}

#standalone-purchases-table th,
.transaction-table th {
  font-weight: 600;
}

/* Modal footer buttons - consistent styling for all modals */
#event-modal-add-comment-section{
  position: sticky;
  z-index: 1;
  bottom: 0;
  border-bottom: 4px solid white;
}
#discussion-thread-add-comment-section{
  position: sticky;
  z-index: 1;
  bottom: 0;
  border-bottom: 4px solid white;
  margin-top: auto;
}
#event-modal-add-comment-section comment-info comment-metadata,
#discussion-thread-add-comment-section name-cont,
#event-modal-add-comment-section name-cont{
  display: none;
}
#discussion-thread-add-comment-section comment-info comment-metadata{
  display: none;
}
#event-modal-add-comment-section comment-post{
  background: #f4e38b;
  padding:6px;
  margin:0;
  border:0;
  box-shadow:none;
}
#discussion-thread-add-comment-section comment-post{
  background: #f4e38b;
  padding: 6px;
  margin: 0;
  border: 0;
  box-shadow: none;
}
comment-post blockquote{
  align-items:center;
}
modal-footer {
  gap: 8px;
}

dialog button, body#sheriff dialog button, marker-popup button {
  min-height: 34px;
  padding: 0.45em 0.85em;
  border-radius: 10px;
  border: 1px solid rgba(60, 60, 67, 0.18);
  font-size: 0.875rem;
  font-weight: 650;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
/* 
dialog button:hover,
body#sheriff dialog button:hover,
marker-popup button:hover {
  background: #fff;
  border-color: rgba(60, 60, 67, 0.26);
} */

dialog button:active,
body#sheriff dialog button:active,
marker-popup button:active {
  transform: translateY(1px);
  box-shadow: none;
}

#discussion-thread-modal modal-header {
  align-items: center;
}

#discussion-thread-modal modal-footer flex-box {
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

#discussion-thread-modal modal-footer .save-button {
  margin-left: 0;
}

modal-footer .save-button {
  color: #174a2a;
  background: #d9f0dd;
  border-color: rgba(23, 74, 42, 0.18);
  margin-left: auto;
}
modal-footer .save-button:hover {
  color: #123d22;
  background: #c9e8cf;
  border-color: rgba(23, 74, 42, 0.24);
}

modal-footer .delete-button {
  color: #7f1d1d;
  background: #f6d7d7;
  border-color: rgba(127, 29, 29, 0.16);
  margin-right:auto;
}
modal-footer .delete-button:hover {
  color: #681818;
  background: #efc7c7;
  border-color: rgba(127, 29, 29, 0.24);
}

modal-footer .toggle-edit-mode-button {
  background: color-mix(in srgb, var(--edit-color) 72%, white);
}

#event-modal:not(.edit-mode) modal-footer flex-box {
  justify-content: flex-end;
}

#discussion-create-submit-button{
  background: #d9f0dd;
}
/* ========================================
   Profile Modal View Toggle
   ======================================== */

/* View toggle buttons in header */
profile-modal-view-toggle {
  display: flex;
  gap: 4px;
  padding: 2px;
  margin-left: auto;
  background: #f5f5f5;
  border-radius: 6px;
  border: var(--standard-border);
  flex: unset !important;
}

profile-modal-view-toggle .modal-view-toggle-btn {
  padding: 4px 12px;
  border: none;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  border-radius: 4px;
  color: #666;
  box-shadow: none;
}
dialog .edit-modal-only{
  display: none;
}
dialog.edit-mode .edit-modal-only{
  display: block;
}

profile-modal-view-toggle .modal-view-toggle-btn.active {
  background: black;
  color: white;
  box-shadow: none;
}

event-modal-view-toggle {
  display: flex;
  gap: 4px;
  padding: 2px;
  margin-left: auto;
  background: #f5f5f5;
  border-radius: 6px;
  border: var(--standard-border);
  flex: unset !important;
}

event-modal-view-toggle .modal-view-toggle-btn {
  padding: 4px 12px;
  border: none;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  border-radius: 4px;
  color: #666;
  box-shadow: none;
}

event-modal-view-toggle .modal-view-toggle-btn.active {
  background: black;
  color: white;
  box-shadow: none;
}

/* Show/hide based on view mode */
#profile-edit-modal[data-profile-modal-view="single"] .bulk-import-view,
#profile-edit-modal[data-profile-modal-view="single"] .partner-profile-view,
#profile-edit-modal[data-profile-modal-view="bulk"] .single-profile-view,
#profile-edit-modal[data-profile-modal-view="bulk"] .partner-profile-view,
#profile-edit-modal[data-profile-modal-view="partner"] .single-profile-view,
#profile-edit-modal[data-profile-modal-view="partner"] .bulk-import-view {
  display: none !important;
}

/* Hide name title container for new profiles (both single and bulk) */
#profile-edit-modal[data-id="new"] name-title-container {
  display: none;
}

/* Show view toggle only for new profiles (data-id="new") */
#profile-edit-modal:not([data-id="new"]) profile-modal-view-toggle {
  display: none;
}

#event-modal:not([data-event-id="new"]) event-modal-view-toggle,
#event-modal[data-event-import-enabled="false"] event-modal-view-toggle {
  display: none;
}

/* Import form specific styling */
.bulk-import-view csv-upload-section {
  margin: 1em 0;
  margin-bottom: 4em;
  display:block;
}

.bulk-import-view import-preview-section {
  margin-top: 1rem;
}


/* Delete Image Button - only shows when image exists */
delete-image-button {
  position: absolute;
  top: 18px;
  left: -8px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 100% 80% 100% 50% / 100% 50% 100% 55%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: 32px;
  height: 32px;
  z-index: 10;
}

delete-image-button img {
  width: 24px;
  height: 24px;
  margin: 0;
}

/* Only show delete button when there's an actual image (not default placeholder) and in edit mode */
/* Show if: image has data-original-url (saved image) OR src is not empty and not the default placeholder */
#event-modal.edit-mode event-image:has(image-wrapper img.uploadedImage[data-original-url]:not([data-original-url=""])) delete-image-button,
#event-modal.edit-mode event-image:has(image-wrapper img.uploadedImage[src]:not([src=""]):not([src="/assets/icons/user.svg"])) delete-image-button,
.sponsor-modal.edit-mode sponsor-banner-image:has(image-wrapper img.uploadedImage[data-original-url]:not([data-original-url=""])) delete-image-button,
.sponsor-modal.edit-mode sponsor-banner-image:has(image-wrapper img.uploadedImage[src]:not([src=""]):not([src="/assets/icons/user.svg"])) delete-image-button {
  display: flex;
}


/* Make sure event-image is positioned relative for absolute positioning */
event-image{
  position: relative;
  display: block;
}

.event-modal-content:not(.edit-mode) location-title-container:after{
  content: '';
  display: inline-block;
  width: 30px;
  height: 24px;
  margin-left: 0.25em;
  vertical-align: middle;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6' /%3E%3Cpath d='M11 13l9 -9' /%3E%3Cpath d='M15 4h5v5' /%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}
/* Hide image with empty or broken src in modal */
.event-modal-content event-image img[src=""],
.event-modal-content event-image img:not([src]) {
  display: none;
}

/* Hide image upload controls in modal by default */
.event-modal-content event-image .image-upload {
  display: none;
}

/* Show image upload controls only in modal edit-mode */
.event-modal-content.edit-mode event-image .image-upload {
  display: block;
}

/* Hide "Description" section title when description pre is empty */
#event-modal:not(.edit-mode) event-description section-title:has(+ pre.event-description-edit:empty),
#event-modal:not(.edit-mode) event-description section-title:has(+ pre.event-description-edit[data-content=""]) {
  display: none;
}

/* Hide "Hosts" section title when event-hosts-container is empty */
#event-modal:not(.edit-mode) section-title:has(+ event-hosts-container:empty) {
  display: none;
}
#event-modal:not(.edit-mode) modal-location-father:has(location-title-container[data-venue-url=""]){
  opacity: 0.7;
  padding: 5px;
  box-shadow: none;
  /* for now just dont show at all, but unhide for no location message */
  display: none;
}
/* Show message when no location is attached (data-venue-url is empty) */
#event-modal:not(.edit-mode) modal-location-father:has(location-title-container[data-venue-url=""])::after {
  content: 'This event does not have a location';
  display: block;
  color: black;
  text-transform: initial;
  letter-spacing: 0;
  font-weight: 450;
  transform: skew(-4deg);
}
ticket-access-container {
  display: none;
}
#event-modal.edit-mode ticket-access-container {
  display: block;
}
event-class-container {
  display: none;
}
#event-modal.edit-mode event-class-container {
  display: block;
}
access-and-capacity-container{
  display: flex;
  flex-direction: column;
}

#event-modal[data-event-id="new"] modal-footer .delete-button{
  display: none;
}
event-comments-section{
  padding-top: 1rem;
  border-top: 1em solid var(--background);
  display: block;
  padding: 8px;
}
event-description {
  display: block;
  padding: 8px;
}
modal-header h3{
  font-size: 1.05em;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0;
}
dialog.edit-mode .no-comments-message{
  display:none;
}
.no-comments-message{
  text-align:center;
  margin-top: 5em;
  margin-bottom: 5em;
}

#discussion-thread-modal modal-footer:not(:has(button:not([hidden]))) {
  display: none;
}
