/* ShowroomAI additions on top of the base theme (assets/css/styles.css). Uses the theme's own
   Bootstrap variables so light/dark mode keep working. */

/* The theme sizes every .card to its column's full height (--bs-card-height: calc(100% - gutter)),
   which assumes one card per column. Columns that stack several cards (or hold a sticky card)
   opt out with .card-stack so each card is only as tall as its content. */
.card-stack > .card { --bs-card-height: auto; }

/* Sign-in / create-account cover panel with a photo (ShowroomAi:LoginCoverImage). The inline
   background stacks the theme's blue shapes over a dark fade over the photo; here every layer
   fills the panel, and the heading sits at the bottom in white over the fade. */
.auth-cover-wrapper .auth-cover.auth-cover-photo {
  background-size: cover, cover, cover;
  background-position: center, center, center;
  background-repeat: no-repeat;
  align-items: flex-end;
  text-align: left;
}
.auth-cover-wrapper .auth-cover.auth-cover-photo .auth-content {
  margin-left: 0;
  color: #fff;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .35);
}
.auth-cover-wrapper .auth-cover.auth-cover-photo .auth-content h1 { color: #fff; }
.auth-cover-wrapper .auth-cover.auth-cover-photo .auth-content p { color: #fff; opacity: .85; }

/* Read-only standard prompt wording (see _SpecialRequirements / Admin → AI Prompts) */
.standard-wording-text {
  font-size: .8rem;
  line-height: 1.55;
  color: var(--bs-secondary-color);
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: .5rem;
  padding: .75rem .9rem;
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* UK-style number plate */
.reg-plate {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 800;
  letter-spacing: .06em;
  color: #111;
  background: #f7d117;
  border: 2px solid #111;
  border-radius: .35rem;
  /* Yellow margin all round the blue UK band, as on a real plate — in em so it scales with
     the -sm / -lg sizes. */
  padding: .15em .55em .15em .15em;
  line-height: 1.5;
  white-space: nowrap;
  text-transform: uppercase;
}
.reg-plate::before {
  content: "UK";
  align-self: stretch;
  display: flex;
  align-items: center;
  font-size: .55em;
  font-weight: 700;
  color: #fff;
  background: #1f4db8;
  padding: 0 .3rem;
  border-radius: .2rem;
}
.reg-plate.reg-plate-lg { font-size: 1.5rem; }
.reg-plate.reg-plate-sm { font-size: .8rem; }

.reg-plate-input {
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  background-color: #f7d117 !important;
  color: #111 !important;
  border: 2px solid #111 !important;
  font-size: 1.35rem;
  text-align: center;
}
.reg-plate-input::placeholder { color: rgba(0, 0, 0, .35); }

/* Upload drop zone */
.upload-dropzone {
  border: 2px dashed var(--bs-border-color);
  border-radius: 1rem;
  padding: 2.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
  background: var(--bs-tertiary-bg);
}
.upload-dropzone:hover,
.upload-dropzone.is-dragover {
  border-color: var(--bs-primary);
  background: rgba(var(--bs-primary-rgb), .05);
}
.upload-dropzone .upload-icon {
  font-size: 2.5rem;
  color: var(--bs-primary);
  line-height: 1;
}

.upload-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); /* wide enough for the Exterior / Interior / Close-up toggle */
  gap: .75rem;
}
.upload-preview-item {
  position: relative;
  aspect-ratio: var(--photo-aspect, 4 / 3);
  border-radius: .75rem;
  overflow: hidden;
  background: var(--bs-tertiary-bg);
}
.upload-preview-item img { width: 100%; height: 100%; object-fit: cover; }
.upload-preview-item .btn-remove {
  position: absolute;
  top: .35rem;
  right: .35rem;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
}

/* Exterior / Interior marker on upload previews and original-photo tiles */
.photo-type-toggle {
  position: absolute;
  left: .35rem;
  bottom: .35rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}
.photo-type-toggle .btn { font-size: .68rem; padding: .15rem .45rem; line-height: 1.3; }
.image-tile .photo-type-toggle { left: .5rem; bottom: .5rem; }

/* Drag-and-drop ordering on the vehicle page (Sortable) */
[data-reorder] .js-reorder-item .image-tile { cursor: grab; }
.reorder-ghost .image-tile { opacity: .35; outline: 2px dashed var(--bs-primary); outline-offset: 2px; }
.reorder-chosen .image-tile { box-shadow: 0 .75rem 2rem rgba(0, 0, 0, .25); }

/* Per-photo wording button (New Generation previews and original-photo tiles). Highlighted when
   the photo has wording saved; the wording itself shows as the tooltip. */
.btn-photo-wording {
  position: absolute;
  top: .35rem;
  left: .35rem;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}
.image-tile .btn-photo-wording { top: .3rem; left: 2.25rem; }
.image-tile .btn-photo-wording.is-first { left: .5rem; } /* no select checkbox beside it */

/* Pages use the full width (container-fluid), so add a breakpoint above Bootstrap's xxl (1400px)
   for very wide screens — vehicle card grids go to six per row rather than stretching. */
@media (min-width: 1800px) {
  .col-3xl-2 { flex: 0 0 auto; width: 16.66666667%; }
}

/* Credit Usage: small thumbnails of what each request generated (click for full size) */
.usage-thumb {
  width: 64px;
  height: 36px;
  object-fit: cover;
  border-radius: .35rem;
  cursor: zoom-in;
  background: var(--bs-tertiary-bg);
}

/* Vehicle and image cards */
.vehicle-card-cover {
  aspect-ratio: 16 / 9;
  background: var(--bs-tertiary-bg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vehicle-card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.vehicle-card:hover .vehicle-card-cover img { transform: scale(1.03); }
.vehicle-card-cover .placeholder-icon { font-size: 2.5rem; color: var(--bs-secondary-color); }

.image-tile {
  position: relative;
  border-radius: .75rem;
  overflow: hidden;
  background: var(--bs-tertiary-bg);
}
.image-tile img { width: 100%; aspect-ratio: var(--photo-aspect, 16 / 9); object-fit: cover; display: block; cursor: zoom-in; }
.image-tile.image-tile-original img { aspect-ratio: var(--photo-aspect, 4 / 3); }
.image-tile .image-tile-actions {
  position: absolute;
  inset: auto .5rem .5rem auto;
  display: flex;
  gap: .35rem;
  opacity: 0;
  transition: opacity .15s;
}
.image-tile:hover .image-tile-actions,
.image-tile:focus-within .image-tile-actions { opacity: 1; }
@media (hover: none) { .image-tile .image-tile-actions { opacity: 1; } }
.image-tile .image-tile-actions .btn { width: 2rem; height: 2rem; padding: 0; display: flex; align-items: center; justify-content: center; }
.image-tile .image-tile-check {
  position: absolute;
  top: .5rem;
  left: .5rem;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .15);
}
.image-tile .image-tile-badge { position: absolute; top: .5rem; right: .5rem; }
.image-tile .image-tile-badge-start { position: absolute; top: .5rem; left: .5rem; }

.generating-tile {
  aspect-ratio: var(--photo-aspect, 16 / 9);
  border-radius: .75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  color: var(--bs-secondary-color);
  background: linear-gradient(110deg, var(--bs-tertiary-bg) 8%, var(--bs-secondary-bg) 18%, var(--bs-tertiary-bg) 33%);
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
}
@keyframes shimmer { to { background-position-x: -200%; } }

.credit-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .35rem .8rem;
  border-radius: 2rem;
  font-weight: 600;
  font-size: .8rem;
  background: rgba(var(--bs-primary-rgb), .1);
  color: var(--bs-primary);
  text-decoration: none;
  white-space: nowrap;
}
.credit-pill.is-low { background: rgba(var(--bs-warning-rgb), .15); color: var(--bs-warning-text-emphasis); }
.credit-pill.is-empty { background: rgba(var(--bs-danger-rgb), .12); color: var(--bs-danger); }

.hero-gradient {
  background: linear-gradient(120deg, #6c5ffc 0%, #4b8cf5 55%, #0dcaf0 100%);
  color: #fff;
}
.hero-gradient .text-white-75 { color: rgba(255, 255, 255, .8); }

/* Same shape as generated images (1376×768) and as .logo-stage, so the backdrop and logo
   previews on My Account match. */
.backdrop-preview {
  width: 100%;
  aspect-ratio: 1376 / 768;
  object-fit: cover;
  border-radius: .75rem;
  background: var(--bs-tertiary-bg);
}

#lightboxModal .modal-content { background: transparent; border: 0; }
#lightboxModal img { max-height: 85vh; width: auto; max-width: 100%; border-radius: .75rem; }

/* Confirmation popup (_ConfirmDialog) */
.confirm-dialog { border-radius: 1rem; }
.confirm-dialog-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.confirm-dialog-icon .fi { line-height: 1; display: flex; }

/* Dealer logo positioning (Profile/_LogoCard) */
.logo-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1376 / 768; /* the shape the logo is actually applied to */
  overflow: hidden;
  border-radius: .75rem;
  background: var(--bs-tertiary-bg);
  user-select: none;
  touch-action: none;
}
.logo-stage-bg { display: block; width: 100%; height: 100%; object-fit: cover; }
.logo-stage-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, .55);
  background: linear-gradient(180deg, #3a4150 0%, #23272f 62%, #15171c 100%);
}
.logo-stage-logo {
  position: absolute;
  cursor: grab;
  outline: 1px dashed rgba(255, 255, 255, .75);
  outline-offset: 3px;
  transition: outline-color .15s;
}
.logo-stage-logo:hover { outline-color: #fff; }
.logo-stage-logo.is-dragging { cursor: grabbing; outline-style: solid; }
.logo-stage-logo:focus-visible { outline: 2px solid var(--bs-primary); }
.logo-stage-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(0, 0, 0, .35);
  font-weight: 600;
}
.logo-glow-colour { width: 2rem; height: 1.6rem; padding: .15rem; }
.logo-position-grid {
  display: grid;
  grid-template-columns: repeat(3, 1.4rem);
  gap: .25rem;
  flex-shrink: 0;
}
.logo-position-grid button {
  width: 1.4rem;
  height: 1rem;
  padding: 0;
  border: 1px solid var(--bs-border-color);
  border-radius: .25rem;
  background: var(--bs-tertiary-bg);
}
.logo-position-grid button:hover,
.logo-position-grid button:focus-visible { background: var(--bs-primary); border-color: var(--bs-primary); }

/* Notification bell (wwwroot/js/live-updates.js) */
.notification-count {
  position: absolute;
  top: 2px;
  right: 0;
  font-size: .6rem;
  min-width: 1.1rem;
  padding: .2em .35em;
}
.notification-menu { width: 360px; max-width: calc(100vw - 2rem); }
.notification-list { max-height: 420px; overflow-y: auto; }
.notification-item {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--bs-border-color-translucent);
  color: inherit;
  text-decoration: none;
}
.notification-item:last-child { border-bottom: 0; }
a.notification-item:hover { background: var(--bs-tertiary-bg); }
.notification-icon { font-size: 1.1rem; line-height: 1.3; }
.notification-message { font-size: .875rem; line-height: 1.35; }
.notification-dot {
  flex-shrink: 0;
  width: .5rem;
  height: .5rem;
  margin-top: .45rem;
  border-radius: 50%;
  background: var(--bs-primary);
}
.min-w-0 { min-width: 0; }
#liveToasts .toast { background: var(--bs-body-bg); box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .2); }

/* Type-ahead suggestions (wwwroot/js/make-suggest.js) */
.suggest { position: relative; }
.suggest-menu {
  width: 100%;
  max-height: 280px;
  overflow-y: auto;
  margin-top: .25rem;
  padding: .35rem;
  border-radius: .75rem;
  box-shadow: 0 .75rem 2rem rgba(0, 0, 0, .15);
  inset: 100% auto auto 0;
}
.suggest-menu .dropdown-item {
  border-radius: .5rem;
  padding: .45rem .75rem;
  cursor: pointer;
}
.suggest-menu .dropdown-item mark {
  padding: 0;
  background: none;
  color: inherit;
  font-weight: 700;
}
.suggest-menu .dropdown-item.active mark { color: inherit; }

/* "Take a photo" buttons — only on touch devices (phones/tablets), where capture opens the camera.
   On a desktop the photo picker already covers it. */
.camera-only { display: none; }
@media (pointer: coarse) {
  .camera-only { display: inline-block; }
}

/* Photo shape (My Account → Photo shape): a box drawn in each shape */
.photo-shape-swatch {
  display: block;
  width: 4.5rem;
  max-height: 4.5rem;
  border: 2px solid currentColor;
  border-radius: .35rem;
  opacity: .8;
}
.photo-shape-options .photo-shape-hint { opacity: .75; font-size: .75rem; line-height: 1.3; }

/* Admin → AI Service: image service and output resolution choices */
.ai-service-options .ai-service-hint { opacity: .75; font-size: .75rem; line-height: 1.3; }
.ai-service-options .btn-check:disabled + .btn { opacity: .45; }
.ai-service-options code { color: inherit; }

/* Number plate design (Profile/_PlateCard) — UK plate proportions, as PlateService draws it */
.plate-stage {
  position: relative;
  width: 100%;
  max-width: 640px;
  aspect-ratio: 1040 / 222;
  overflow: hidden;
  border-radius: 1.35% / 6.3%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .25), 0 4px 14px rgba(0, 0, 0, .25);
  user-select: none;
  touch-action: none;
}
.plate-stage-image {
  position: absolute;
  cursor: grab;
  outline: 1px dashed rgba(127, 127, 127, .9);
  outline-offset: 2px;
}
.plate-stage-image.is-dragging { cursor: grabbing; outline-style: solid; }
.plate-stage-image:focus-visible { outline: 2px solid var(--bs-primary); }
.plate-stage-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  text-align: center;
  font-size: .85rem;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, .35);
}
.plate-swatch {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: .35rem;
  border: 1px solid var(--bs-border-color);
}

/* Image quality picker on a batch (_ResolutionPicker) */
.resolution-options .resolution-hint { opacity: .75; font-size: .75rem; line-height: 1.3; }

/* Photos that aren't the dealership's photo shape — "Crop" badge on upload previews and
   original-photo tiles (photo-crop.js) */
.photo-crop-badge {
  position: absolute;
  right: .35rem;
  bottom: .35rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
  font-size: .68rem;
  padding: .15rem .45rem;
  line-height: 1.3;
}
.image-tile .photo-crop-badge { left: .5rem; right: auto; bottom: 2.35rem; } /* above the Exterior/Interior toggle */
.upload-preview-item .photo-crop-badge { right: auto; bottom: auto; top: 50%; left: 50%; transform: translate(-50%, -50%); white-space: nowrap; }
.upload-preview-item.needs-crop img,
.image-tile.needs-crop img { outline: 3px solid var(--bs-warning); outline-offset: -3px; }

/* The crop dialog: the photo fills the dialog, Cropper.js draws the box over it */
.photo-crop-stage { height: min(60vh, 560px); background: #111; border-radius: .5rem; overflow: hidden; }
.photo-crop-stage img { display: block; max-width: 100%; }

/* ShowroomAI logo (master artwork in Branding/Logo). The sidebar shows the full logo, reversed in dark
   mode via the theme's visible-light / visible-dark, and only the car symbol when collapsed. */
.app-navbar-brand .navbar-brand-mini { display: flex; align-items: center; line-height: 0; }
.sr-app-logo { width: auto; height: 46px; }
.app-navbar-brand .navbar-brand-logo { display: none; line-height: 0; }
.app-navbar-brand .navbar-brand-logo img { width: 30px; height: 30px; }
[data-app-sidebar=mini] .app-menubar .app-navbar-brand .navbar-brand-logo { display: block; }
.sr-auth-logo { width: auto; height: 64px; max-width: 100%; }

/* Before/after on the vehicle page's showroom images: the original photo sits over the showroom
   image, clipped to the left of --pos, which the slider under the tile sets (0 = showroom only). */
.image-tile { --pos: 0%; }
.image-tile .compare-before {
  position: absolute;
  inset: 0;
  pointer-events: none; /* clicks open the showroom image, with the slider */
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}
.image-tile .compare-before img { height: 100%; }
.image-tile .compare-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 2px;
  transform: translateX(-50%);
  background: #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, .35);
  pointer-events: none;
  display: none;
}
.image-tile .compare-label { position: absolute; top: .5rem; pointer-events: none; display: none; }
.image-tile .compare-label-before { left: .5rem; background: rgba(255, 255, 255, .92); color: #1f2937; }
.image-tile .compare-label-after { right: .5rem; background: var(--bs-primary); }
.image-tile.is-comparing .compare-divider,
.image-tile.is-comparing .compare-label { display: block; }
.image-tile.is-comparing .image-tile-badge-start { display: none; } /* "Revised" makes way for "Original" */
.compare-slider .form-range { height: 1.25rem; }

/* The same before/after in the full-size view (Views/Shared/_Lightbox.cshtml): the stage is the
   showroom image's own size, and the original is fitted over it. */
#lightboxStage { --pos: 0%; position: relative; display: inline-block; max-width: 100%; border-radius: .75rem; overflow: hidden; vertical-align: top; }
#lightboxStage > img { display: block; border-radius: 0; }
#lightboxStage .lightbox-compare { display: none; }
#lightboxStage.has-compare .lightbox-compare { display: block; }
#lightboxStage .compare-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); pointer-events: none; }
#lightboxModal #lightboxStage .compare-before img { width: 100%; height: 100%; max-height: none; object-fit: cover; border-radius: 0; }
#lightboxStage .compare-divider { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; transform: translateX(-50%); background: #fff; box-shadow: 0 0 10px rgba(0, 0, 0, .35); pointer-events: none; display: none; }
#lightboxStage .compare-label { position: absolute; top: .75rem; pointer-events: none; display: none; }
#lightboxStage .compare-label-before { left: .75rem; background: rgba(255, 255, 255, .92); color: #1f2937; }
#lightboxStage .compare-label-after { right: .75rem; background: var(--bs-primary); }
#lightboxStage.is-comparing .compare-divider,
#lightboxStage.is-comparing .compare-label { display: block; }
.lightbox-compare-slider { display: none !important; max-width: 36rem; }
#lightboxStage.has-compare + .lightbox-compare-slider { display: flex !important; }
