/* Canonical media library surfaces and photo dialogs */

.photo-dialog--naming {
  width: min(540px, 100%);
}

.photo-dialog {
  width: min(1040px, 100%);
  padding: 18px;
  border-radius: 24px;
}

.photo-dialog__media {
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: #000;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.photo-dialog__media img {
  width: 100%;
  max-height: 62vh;
  display: block;
  object-fit: contain;
  background: #020617;
}

.photo-dialog__actions {
  margin-top: 12px;
  justify-content: flex-start;
}

.photo-dialog__lookup {
  display: grid;
  gap: 14px;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.05), transparent 24%),
    rgba(7, 12, 21, 0.84);
}

.photo-dialog__lookup[hidden] {
  display: none;
}

.photo-dialog__lookup-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.photo-dialog__lookup-head h3 {
  margin: 2px 0 0;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.photo-dialog__lookup-eyebrow {
  color: rgba(148, 163, 184, 0.82);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.photo-dialog__lookup-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(214, 187, 24, 0.12);
  border: 1px solid rgba(214, 187, 24, 0.26);
  color: #f7e79a;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.photo-dialog__lookup-status {
  margin: 0;
  color: rgba(226, 232, 240, 0.8);
  font-size: 13px;
  line-height: 1.5;
}

.photo-dialog__lookup-status[data-state="loading"] {
  color: #f7e79a;
}

.photo-dialog__lookup-status[data-state="error"] {
  color: #fca5a5;
}

.photo-dialog__lookup-status[data-state="success"] {
  color: #bbf7d0;
}

.photo-dialog__lookup-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}

.photo-dialog__lookup-actions[hidden] {
  display: none;
}

.photo-dialog__lookup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.photo-dialog__lookup-item {
  display: grid;
  gap: 6px;
  padding: 12px 13px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.photo-dialog__lookup-item small {
  color: rgba(148, 163, 184, 0.72);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.photo-dialog__lookup-item strong {
  color: #f8fafc;
  font-size: 14px;
  line-height: 1.32;
  letter-spacing: -0.01em;
}

.photo-dialog--lookup-advanced {
  width: min(1080px, 100%);
}

.photo-overlay--stacked {
  z-index: 64;
}

.photo-dialog__lookup--advanced-modal {
  margin-top: 0;
  max-height: calc(100vh - 180px);
  overflow: auto;
}

.photo-dialog__lookup-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.photo-dialog__lookup-option {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background:
    radial-gradient(circle at top right, rgba(214, 187, 24, 0.06), transparent 22%),
    rgba(255, 255, 255, 0.03);
}

.photo-dialog__lookup-option-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(214, 187, 24, 0.16);
  border: 1px solid rgba(214, 187, 24, 0.3);
  color: #f7e79a;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.photo-dialog__lookup-option strong {
  color: #f8fafc;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.photo-dialog__lookup-option span {
  color: rgba(226, 232, 240, 0.78);
  font-size: 13px;
  line-height: 1.5;
}

.photo-dialog__lookup-option-highlights {
  margin: 0;
  padding-left: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  color: rgba(226, 232, 240, 0.8);
  font-size: 12px;
  line-height: 1.5;
}

.photo-dialog__lookup-option-highlights li {
  margin: 0;
}

.photo-dialog__lookup-option-price {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(214, 187, 24, 0.12);
  border: 1px solid rgba(214, 187, 24, 0.28);
  color: #f7e79a !important;
  font-size: 12px !important;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.photo-library-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.photo-library-summary__card {
  display: grid;
  min-height: 118px;
  gap: 8px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.05), transparent 24%),
    linear-gradient(180deg, rgba(9, 14, 24, 0.96), rgba(5, 9, 17, 0.99));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.02),
    0 16px 28px rgba(2, 6, 23, 0.14);
}

.photo-library-summary__card small {
  color: rgba(148, 163, 184, 0.74);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.photo-library-summary__card strong {
  color: #f8fafc;
  font-size: 22px;
  line-height: 1.08;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.photo-library-summary__card span {
  color: rgba(191, 219, 254, 0.72);
  font-size: 12px;
  line-height: 1.5;
}

.photo-library-filters {
  gap: 16px;
}

.photo-library-filters .panel-header {
  margin-bottom: 2px;
}

.photo-library-filters .filters-grid {
  margin-top: 2px;
}

.photo-gallery-panel .panel-header {
  margin-bottom: 18px;
}

.photo-gallery-panel__actions {
  align-items: center;
  justify-content: flex-end;
  gap: 10px 12px;
}

@media (max-width: 760px) {
  .photo-library-summary {
    grid-template-columns: 1fr;
  }

  .photo-library-summary__card {
    min-height: 0;
    padding: 16px;
  }

  .photo-library-filters {
    gap: 14px;
  }

  .photo-library-filters .filters-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .photo-library-filters .button-row {
    width: 100%;
    justify-content: flex-start;
  }

  .photo-gallery-panel__actions {
    justify-content: flex-start;
  }

  .photo-gallery-panel__actions > * {
    flex: 1 1 220px;
  }

  .photo-dialog__actions {
    flex-wrap: wrap;
  }

  .photo-dialog__lookup-grid {
    grid-template-columns: 1fr;
  }

  .photo-dialog__lookup-actions > * {
    flex: 1 1 220px;
  }
}

@media (max-width: 560px) {
  .photo-dialog {
    padding: 14px;
    border-radius: 20px;
  }

  .photo-dialog__media img {
    max-height: 52vh;
  }

  .photo-dialog__lookup {
    padding: 14px;
  }

  .photo-dialog--lookup-advanced {
    padding: 14px;
  }

  .photo-dialog__lookup--advanced-modal {
    max-height: calc(100vh - 150px);
  }

  .photo-dialog__lookup-options {
    grid-template-columns: 1fr;
  }

  .photo-dialog__lookup-option-highlights {
    grid-template-columns: 1fr;
  }

  .photo-dialog__lookup-head {
    flex-direction: column;
    align-items: stretch;
  }

  .photo-dialog__actions {
    width: 100%;
  }

  .photo-dialog__actions > * {
    flex: 1 1 100%;
  }

  .photo-library-summary__card strong {
    font-size: 20px;
  }

  .photo-library-summary__card span {
    font-size: 11px;
  }

  .photo-gallery-panel__actions {
    width: 100%;
  }

  .photo-gallery-panel__actions > * {
    flex: 1 1 100%;
  }
}

@media (max-width: 980px) {
  .photo-library-summary__card {
    min-height: 0;
    padding: 16px;
    border-radius: 18px;
  }

  .photo-gallery-panel .panel-header {
    margin-bottom: 14px;
  }

  .photo-gallery-panel__actions {
    gap: 8px;
  }
}

@media (max-width: 560px) {
  .photo-dialog__media img {
    max-height: 46vh;
  }

  .photo-library-filters .button-row,
  .photo-gallery-panel__actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .photo-library-filters .button-row > *,
  .photo-gallery-panel__actions > * {
    width: 100%;
    flex: 1 1 100%;
  }
}

@media (max-width: 760px) {
  .photo-library-summary {
    gap: 10px;
  }

  .photo-library-summary__card {
    gap: 6px;
    padding: 12px;
    border-radius: 16px;
  }

  .photo-library-summary__card small {
    font-size: 10px;
  }

  .photo-library-summary__card strong {
    font-size: 18px;
  }

  .photo-library-summary__card span {
    font-size: 11px;
    line-height: 1.4;
  }

  .photo-library-filters {
    gap: 10px;
  }

  .photo-gallery-panel .panel-header {
    margin-bottom: 10px;
  }

  .photo-gallery-panel__actions {
    gap: 6px;
  }
}

@media (max-width: 560px) {
  .photo-library-summary__card {
    padding: 10px;
    border-radius: 14px;
  }

  .photo-library-summary__card strong {
    font-size: 16px;
  }
}

body[data-theme-mode="light"][data-user-theme="true"] .photo-library-summary__card {
  border-color: var(--ui-surface-card-border, rgba(15, 23, 42, 0.1));
  background:
    radial-gradient(circle at top left, rgba(var(--user-theme-accent-rgb, 56, 189, 248), 0.08), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(var(--user-theme-panel-rgb, 244, 247, 251), 0.94));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.7),
    0 16px 28px rgba(15, 23, 42, 0.08);
}

body[data-theme-mode="light"][data-user-theme="true"] .photo-library-summary__card--success {
  background:
    radial-gradient(circle at top left, rgba(34, 197, 94, 0.12), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(240, 253, 244, 0.96));
}

body[data-theme-mode="light"][data-user-theme="true"] .photo-library-summary__card--warning {
  background:
    radial-gradient(circle at top left, rgba(245, 158, 11, 0.14), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(255, 251, 235, 0.96));
}

body[data-theme-mode="light"][data-user-theme="true"] .photo-library-summary__card--info {
  background:
    radial-gradient(circle at top left, rgba(var(--user-theme-accent-rgb, 56, 189, 248), 0.14), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(239, 246, 255, 0.96));
}

body[data-theme-mode="light"][data-user-theme="true"] .photo-library-summary__card--neutral {
  background:
    radial-gradient(circle at top left, rgba(148, 163, 184, 0.12), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 252, 0.96));
}

body[data-theme-mode="light"][data-user-theme="true"] .photo-library-summary__card small {
  color: var(--ui-text-subtle, rgba(51, 65, 85, 0.78));
}

body[data-theme-mode="light"][data-user-theme="true"] .photo-library-summary__card strong {
  color: var(--ui-text-strong, #0f172a);
}

body[data-theme-mode="light"][data-user-theme="true"] .photo-library-summary__card span {
  color: var(--ui-text-muted, rgba(15, 23, 42, 0.68));
}

body[data-theme-mode="light"][data-user-theme="true"] .photo-dialog__lookup {
  border-color: var(--ui-surface-card-border, rgba(15, 23, 42, 0.1));
  background:
    radial-gradient(circle at top left, rgba(var(--user-theme-accent-rgb, 56, 189, 248), 0.08), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(var(--user-theme-panel-rgb, 244, 247, 251), 0.94));
}

body[data-theme-mode="light"][data-user-theme="true"] .photo-dialog__lookup-eyebrow,
body[data-theme-mode="light"][data-user-theme="true"] .photo-dialog__lookup-item small {
  color: var(--ui-text-subtle, rgba(51, 65, 85, 0.78));
}

body[data-theme-mode="light"][data-user-theme="true"] .photo-dialog__lookup-status {
  color: var(--ui-text-muted, rgba(15, 23, 42, 0.68));
}

body[data-theme-mode="light"][data-user-theme="true"] .photo-dialog__lookup-item {
  border-color: var(--ui-surface-card-border, rgba(15, 23, 42, 0.1));
  background: rgba(255, 255, 255, 0.7);
}

body[data-theme-mode="light"][data-user-theme="true"] .photo-dialog__lookup-option {
  border-color: var(--ui-surface-card-border, rgba(15, 23, 42, 0.1));
  background:
    radial-gradient(circle at top right, rgba(214, 187, 24, 0.08), transparent 24%),
    rgba(255, 255, 255, 0.82);
}

body[data-theme-mode="light"][data-user-theme="true"] .photo-dialog__lookup-option strong {
  color: var(--ui-text-strong, #0f172a);
}

body[data-theme-mode="light"][data-user-theme="true"] .photo-dialog__lookup-option span {
  color: var(--ui-text-muted, rgba(15, 23, 42, 0.68));
}

body[data-theme-mode="light"][data-user-theme="true"] .photo-dialog__lookup-option-badge {
  background: rgba(214, 187, 24, 0.12);
  border-color: rgba(214, 187, 24, 0.24);
  color: #8a6a00;
}

body[data-theme-mode="light"][data-user-theme="true"] .photo-dialog__lookup-option-highlights {
  color: var(--ui-text-muted, rgba(15, 23, 42, 0.68));
}

body[data-theme-mode="light"][data-user-theme="true"] .photo-dialog__lookup-item strong {
  color: var(--ui-text-strong, #0f172a);
}
