/* modal.css */

/* =========================================
   Dashboard Modal / LLModal Shell
   ========================================= */

:root {
  --modal-overlay-bg: rgba(0, 0, 0, 0.45);
  --modal-content-bg: #fff;
  --modal-max-w: 1100px;
  --modal-z: 12000;

  --radius-sm: 4px;
  --radius-md: 8px;
  --shadow-modal: 0 4px 10px rgba(0,0,0,0.2);
}

/* Root: JS may set display:block/none. Do not override with !important. */
#dashboard-modal.dashboard-modal,
.dashboard-modal {
  position: relative;
}

/* Overlay controls visual open/close */
.dashboard-modal .dashboard-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: var(--modal-overlay-bg);
  justify-content: center;
  align-items: center;
  z-index: var(--modal-z);
  overflow: auto;
  padding: 20px;
  box-sizing: border-box;
}

.dashboard-modal.is-open .dashboard-modal-overlay {
  display: flex;
}

/* Keep dashboard modal below WP Media modal */
#dashboard-modal .dashboard-modal-overlay {
  z-index: 100000;
}

/* Modal card */
.dashboard-modal .dashboard-modal-content {
  position: relative;
  background: var(--modal-content-bg);
  border-radius: var(--radius-md);
  width: 90vw;
  max-width: var(--modal-max-w);
  max-height: 95vh;
  overflow-y: auto;
  padding: 20px;
  box-shadow: var(--shadow-modal);
}

/* Close row pinned to top */
.dashboard-modal .modal-close-wrapper {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: flex-end;
  width: 100%;
  z-index: calc(var(--modal-z) + 1);
  margin-bottom: -10px;
  pointer-events: none;
}

.dashboard-modal .modal-close-wrapper .close-popup {
  pointer-events: auto;
}

/* “X” button */
.dashboard-modal .close-popup {
  position: relative;
  top: -10px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 18px;
  line-height: 1;
  color: #333;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,.2);
  transition: background-color .2s ease, color .2s ease;
}

.dashboard-modal .close-popup:hover {
  background: #f0f0f0;
  color: #0073aa;
}

/* Headers / intro rows within modal */
.dashboard-modal .modal-header,
.dashboard-modal .dashboard-modal-header {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: inherit;
  padding: 10px;
  z-index: calc(var(--modal-z) + 1);
}

.dashboard-modal .dashboard-modal-header h2,
.dashboard-modal .dashboard-modal-header h3 {
  text-align: center;
}

/* Text blocks used in several modals */
.dashboard-modal .dashboard-modal-lines p,
.dashboard-modal .modal-lines p {
  margin: 4px 0;
  color: #555;
  text-align: left;
  font-size: 14px;
}

/* Modal form error messages */
#dashboard-modal-content-container .ll-error-msg,
#dashboard-modal-content-container #ll-email-status {
  margin-top: 8px;
  color: #dc2626;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
}

/* Payment modal content */
#dashboard-modal .payment-header {
  text-align: center;
}

#dashboard-modal .product-name {
  margin: 0;
  font-size: 1.5em;
}

#dashboard-modal .product-description {
  margin: 0.25em 0 1em;
  color: #555;
}

#dashboard-modal .total-due {
  margin-top: 0.5em;
}

/* Optional absolute-positioned close used in some legacy views */
#close-success-popup {
  position: absolute;
  top: 10px;
  right: 10px;
}

/* Place ID proposal content */
.ll-place-id-proposal {
  font-size: 14px;
  line-height: 1.5;
}

.ll-place-id-proposal h3 {
  font-size: 18px;
  margin-bottom: 12px;
}

.ll-place-id-proposal p {
  margin: 6px 0;
}

.ll-place-id-proposal strong {
  color: #222;
}

.ll-place-id-proposal a {
  color: #0073aa;
  text-decoration: none;
}

.ll-place-id-proposal a:hover {
  text-decoration: underline;
}

.ll-place-id-proposal .actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

/* GBP conflict resolution modal */
.ll-gbp-conflict-resolution {
  max-width: 820px;
  margin: 0 auto;
}

.ll-gbp-conflict-resolution h2 {
  margin: 0 0 10px;
  text-align: center;
  font-size: 28px;
  line-height: 1.2;
}

.ll-gbp-conflict-intro,
.ll-gbp-conflict-note {
  margin: 0 0 18px;
  color: #555;
  font-size: 15px;
  line-height: 1.45;
  text-align: center;
}

.ll-gbp-conflict-list {
  display: grid;
  gap: 16px;
  margin: 18px 0;
}

.ll-gbp-conflict-card {
  border: 1px solid #d8dee6;
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.ll-gbp-conflict-card h3 {
  margin: 0 0 12px;
  font-size: 18px;
  line-height: 1.25;
}

.ll-gbp-conflict-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid #d8dee6;
  border-radius: 6px;
  background: #f8fafc;
  cursor: pointer;
  margin: 10px 0;
}

.ll-gbp-conflict-option input[type="radio"] {
  margin-top: 4px;
  flex: 0 0 auto;
}

.ll-gbp-conflict-option span {
  display: block;
  min-width: 0;
}

.ll-gbp-conflict-option strong {
  display: block;
  color: #1f2937;
  margin-bottom: 4px;
}

.ll-gbp-conflict-option strong small {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e6f4ff;
  color: #0073aa;
  font-size: 12px;
  font-weight: 700;
}

.ll-gbp-conflict-option em {
  display: block;
  color: #374151;
  font-style: normal;
  overflow-wrap: anywhere;
}

.ll-gbp-conflict-option--recommended {
  border-color: #9cc9e2;
  background: #f0f8fc;
}

.ll-gbp-conflict-actions {
  margin-top: 22px;
}

.ll-bv-code {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 6px;
  margin-top: 10px;
  text-align: center;
}

/* Magic link sent modal */
.ll-magic-link-sent {
  position: relative;
}

.ll-magic-link-close {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 32px;
  height: 32px;
  border: 1px solid #ddd;
  border-radius: 999px;
  background: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.ll-magic-link-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

/* WP Media modal z-index fixes */
.media-modal-backdrop {
  z-index: 160000 !important;
}

.media-modal-wrap,
.media-modal {
  z-index: 160010 !important;
}

.media-frame,
.media-frame-content {
  z-index: 160020 !important;
}

.media-modal-close {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  z-index: 160100 !important;
  pointer-events: auto !important;
}

.media-frame-title h1 {
  pointer-events: none !important;
}

@media (max-width: 767px) {
  .ll-gbp-conflict-resolution h2 {
    font-size: 24px;
  }

  .ll-gbp-conflict-card {
    padding: 14px;
  }

  .ll-gbp-conflict-actions {
    flex-direction: column;
  }

  .ll-gbp-conflict-actions .ll-btn {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .ll-magic-link-actions .ll-btn {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .dashboard-modal .dashboard-modal-content {
    padding: 16px;
    width: 94vw;
  }
}

.ll-event-prompt-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}