
/* ==========================================
   PRISMIQUE CONNECT — AD BUILDER
   Widget + Linkout
   ========================================== */

   .ab-hidden {
    display: none !important;
  }
  
  /* ==========================================
     PROJECT & AD TYPE SELECTION
     ========================================== */
  
  .ab-setup-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
    margin: 14px 0 24px;
    box-sizing: border-box;
  }
  
  .ab-setup-row > .ab-card {
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    box-shadow: none;
  }
  
  .ab-project-card {
    flex: 0 0 300px;
    width: 300px;
    min-width: 0;
  }
  
  .ab-type-card {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
  }
  
  .ab-setup-row h2 {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 700;
    color: #131827;
  }
  
  .ab-project-card .ab-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 0;
  }
  
  .ab-project-card label {
    font-size: 12px;
    font-weight: 700;
    color: #374151;
  }
  
  .ab-project-card select {
    width: 100%;
    height: 38px;
    padding: 7px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #131827;
    font: 12px "DM Sans", sans-serif;
    box-sizing: border-box;
  }
  
  .ab-project-card small {
    font-size: 11px;
    line-height: 1.5;
    color: #64748b;
  }
  
  /* Ad Type Buttons */
  
  .ab-type-grid {
    display: flex;
    gap: 10px;
  }
  
  .ab-type {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 38px;
    min-height: 38px;
    padding: 7px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #131827;
    font-family: "DM Sans", sans-serif;
    cursor: pointer;
    transition: 0.15s ease;
  }
  
  .ab-type strong {
    font-size: 12px;
    font-weight: 700;
  }
  
  .ab-type:hover:not(:disabled) {
    border-color: #20a878;
    background: #ecfdf5;
  }
  
  .ab-type.selected {
    border-color: #20a878;
    background: #ecfdf5;
    color: #147d58;
  }
  
  .ab-type:disabled {
    opacity: 0.45;
    cursor: not-allowed;
  }
  
  /* ==========================================
     FORM HEADER
     ========================================== */
  
  #adForm {
    width: 100%;
    margin: 22px 0 0;
    box-sizing: border-box;
  }
  
  .ab-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
  }
  
  .ab-form-header h2 {
    margin: 0 0 4px;
    font-size: 21px;
    font-weight: 700;
    color: #131827;
  }
  
  .ab-form-header p {
    margin: 0;
    font-size: 12px;
    color: #64748b;
  }
  
  .ab-status {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 5px 11px;
    border-radius: 20px;
    background: #e8f7ef;
    color: #147d58;
    font-size: 11px;
    font-weight: 700;
  }
  
  /* ==========================================
     MAIN FORM LAYOUT
     ========================================== */
  
  #adForm .ab-form-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: stretch;
  }
  
  #adForm .ab-form-layout > .ab-card {
    display: block;
    min-width: 0;
    margin: 0;
    padding: 18px;
    border: 1px solid #dce3eb;
    border-radius: 10px;
    background: #fff;
    box-shadow: none;
  }
  
  #adForm .ab-form-layout > .ab-card h2,
  #adForm .ab-form-layout > .ab-card h3 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 700;
    color: #131827;
  }
  
  /* Dynamic sections — independent of card order */
  
  #adForm .ab-section-general {
    grid-column: 1;
    grid-row: 1;
  }
  
  #adForm .ab-section-content {
    grid-column: 2;
    grid-row: 1;
  }
  
  #adForm .ab-section-tracking {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  
  #adForm .ab-section-targeting {
    grid-column: 1 / -1;
    grid-row: 3;
  }
  
  #adForm .ab-section-additional {
    grid-column: 1 / -1;
    grid-row: 4;
  }
  
  /* ==========================================
     INPUT GRID
     ========================================== */
  
  #adForm .ab-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 12px;
  }
  
  #adForm .ab-section-targeting .ab-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  
  /* ==========================================
     FORM FIELDS
     ========================================== */
  
  #adForm .ab-field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    min-width: 0;
    margin-bottom: 10px;
  }
  
  #adForm .ab-field label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #374151;
  }
  
  #adForm .ab-field input,
  #adForm .ab-field select,
  #adForm .ab-field textarea {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #fff;
    color: #131827;
    font-family: "DM Sans", sans-serif;
    font-size: 12px;
    box-sizing: border-box;
  }
  
  #adForm .ab-field input,
  #adForm .ab-field select {
    height: 36px;
  }
  
  #adForm .ab-field textarea {
    min-height: 70px;
    resize: vertical;
    line-height: 1.5;
  }
  
  #adForm .ab-field small {
    display: block;
    font-size: 10px;
    line-height: 1.5;
    color: #64748b;
  }
  
  #adForm .ab-field a {
    width: fit-content;
    color: #168765;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
  }
  
  #adForm .ab-field a:hover {
    text-decoration: underline;
  }
  
  #adForm .ab-field input:focus,
  #adForm .ab-field select:focus,
  #adForm .ab-field textarea:focus {
    outline: none;
    border-color: #20a878;
    box-shadow: 0 0 0 3px rgba(32, 168, 120, 0.12);
  }
  
  /* ==========================================
     AD CONTENT
     ========================================== */
  
  #adForm #description {
    min-height: 70px;
  }
  
  #adForm #comments {
    min-height: 55px;
  }
  
  /* ==========================================
     TRACKING LINK BUILDER
     ========================================== */
  
  #adForm .ab-muted {
    margin: -8px 0 16px;
    font-size: 12px;
    line-height: 1.5;
    color: #64748b;
  }
  
  #adForm #buyerUrl {
    min-height: 85px;
  }
  
  #adForm #parameterSection {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
  }
  
  #adForm #parameterSection h3 {
    margin: 0 0 14px;
    font-size: 13px;
    font-weight: 700;
    color: #131827;
  }
  
  #adForm .ab-parameter-heading {
    margin-bottom: 14px;
  }
  
  #adForm .ab-parameter-heading h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
  }
  
  #adForm #parameterCount {
    margin-left: 6px;
    font-size: 11px;
    color: #64748b;
  }
  
  /* Parameter rows */
  
  #adForm .ab-parameter-labels,
  #adForm .ab-parameter-row {
    display: grid;
    grid-template-columns:
      minmax(0, 1fr)
      minmax(0, 1fr)
      36px;
    gap: 10px;
    align-items: start;
  }
  
  #adForm .ab-parameter-labels {
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
  }
  
  #adForm .ab-parameter-row {
    margin-bottom: 9px;
  }
  
  #adForm .ab-parameter-cell {
    min-width: 0;
  }
  
  #adForm .ab-parameter-cell input {
    width: 100%;
    min-width: 0;
    height: 38px;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    background: #fff;
    color: #131827;
    font: 12px "DM Sans", sans-serif;
    box-sizing: border-box;
  }
  
  #adForm .ab-parameter-cell small {
    display: block;
    margin-top: 5px;
    font-size: 10px;
    color: #64748b;
  }
  
  #adForm .ab-parameter-cell input:focus {
    outline: none;
    border-color: #20a878;
    box-shadow: 0 0 0 3px rgba(32, 168, 120, 0.12);
  }
  
  /* ==========================================
     GENERATED TRACKING LINK
     ========================================== */
  
  #adForm .ab-url-output {
    margin-top: 18px;
  }
  
  #adForm #redirect_url,
  #adForm #tracking_link {
    min-height: 85px;
    background: #f8fafc;
    overflow-wrap: anywhere;
  }
  
  /* ==========================================
     VALIDATION
     ========================================== */
  
  #adForm .ab-invalid {
    border-color: #dc2626 !important;
    background: #fff7f7 !important;
  }
  
  #adForm .ab-field .ab-error-text,
  #adForm .ab-parameter-cell .ab-error-text {
    display: block;
    margin-top: 5px;
    font-size: 10px;
    color: #dc2626;
  }
  
  #adForm .ab-form-error {
    padding: 12px 14px;
    margin: 14px 0;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 12px;
  }
  
  /* ==========================================
     REMOVE PARAMETER BUTTON
     ========================================== */
  
  #adForm .ab-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 38px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    background: #fff;
    color: #dc2626;
    font-size: 17px;
    cursor: pointer;
  }
  
  #adForm .ab-remove:hover {
    background: #fef2f2;
    border-color: #fca5a5;
  }
  
  /* ==========================================
     BUTTONS
     ========================================== */
  
  #adForm .ab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 9px 14px;
    border-radius: 7px;
    font-family: "DM Sans", sans-serif;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.15s ease;
    border: 1px solid #20a878;
    margin-bottom: 20px;
  }
  
  #adForm .ab-btn-secondary,
  #adForm .ab-btn-outline,
  #adForm #addParameter {
    border: 1px solid #20a878;
    border-radius: 7px;
    background: #ecfdf5;
    color: #147d58;
  }
  
  #adForm #addParameter {
    min-height: 38px;
    padding: 9px 14px;
    font: 700 12px "DM Sans", sans-serif;
    cursor: pointer;
    transition: 0.15s ease;
    margin-bottom: 20px;
  }
  
  #adForm .ab-btn-secondary:hover,
  #adForm .ab-btn-outline:hover,
  #adForm #addParameter:hover {
    background: #d9f7e9;
  }
  
  #adForm .ab-btn-primary {
    border: 1px solid #168765;
    background: #168765;
    color: #fff;
  }
  
  #adForm .ab-btn-primary:hover {
    background: #116b50;
  }
  
  /* ==========================================
     AD PREVIEW
     ========================================== */
  
  #adForm > .ab-preview-card {
    display: block;
    margin-top: 14px;
    padding: 18px;
    border: 1px solid #dce3eb;
    border-radius: 10px;
    background: #fff;
    box-shadow: none;
  }
  
  #adForm > .ab-preview-card h3 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 700;
    color: #131827;
  }


/* ==========================================
   AQC WIDGET PREVIEW
   ========================================== */

#adForm .ab-preview {
  min-height: 0;
  padding: 18px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
}

/* Main horizontal widget card */
#adForm .ab-widget-preview {
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 1200px;
  min-height: 320px;
  margin: 0 auto;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e0e3e9;
  border-radius: 30px;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.04);
}

/* Left image area */
#adForm .ab-widget-preview-image {
  position: relative;
  flex: 0 0 35%;
  width: 35%;
  min-height: 320px;
  overflow: hidden;
  background: #f1f5f9;
}

#adForm .ab-widget-preview-image img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Right content area */
#adForm .ab-widget-preview-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 34px 36px;
}

#adForm .ab-widget-preview-content h4 {
  margin: 0 0 18px;
  color: #111827;
  font-family: "DM Sans", sans-serif;
  font-size: clamp(23px, 2.4vw, 34px);
  font-weight: 800;
  line-height: 1.2;
}

#adForm .ab-widget-preview-content p {
  margin: 0 0 28px;
  color: #475569;
  font-family: "DM Sans", sans-serif;
  font-size: 12px;
  line-height: 1.4;
}

/* CTA */
#adForm .ab-widget-preview-content .ab-widget-preview-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 70px;
  padding: 16px 30px;
  border: none;
  border-radius: 16px;
  background: #0865db;
  color: #ffffff;
  font-family: "DM Sans", sans-serif;
  font-size: clamp(16px, 1.7vw, 24px);
  font-weight: 800;
  line-height: 1.2;
  cursor: default;
}

/* Responsive */
@media (max-width: 760px) {
  #adForm .ab-widget-preview {
    flex-direction: column;
    min-height: 0;
    border-radius: 20px;
  }

  #adForm .ab-widget-preview-image {
    flex: none;
    width: 100%;
    min-height: 0;
    aspect-ratio: 16 / 10;
  }

  #adForm .ab-widget-preview-content {
    padding: 24px;
  }

  #adForm .ab-widget-preview-content h4 {
    font-size: 24px;
  }

  #adForm .ab-widget-preview-content p {
    font-size: 12px;
    margin-bottom: 20px;
  }

  #adForm .ab-widget-preview-content .ab-widget-preview-cta {
    min-height: 50px;
    padding: 12px 22px;
    border-radius: 12px;
    font-size: 17px;
  }
}

  
  /* ==========================================
     FORM ACTIONS
     ========================================== */
  
  #adForm .ab-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 0 22px;
  }
  
  /* ==========================================
     RESPONSIVE — TABLET
     ========================================== */
  
  @media (max-width: 900px) {
    #adForm .ab-form-layout {
      grid-template-columns: minmax(0, 1fr);
    }
  
    #adForm .ab-form-layout > .ab-card {
      grid-column: 1 !important;
      grid-row: auto !important;
    }
  
    #adForm .ab-section-targeting .ab-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }
  
  /* ==========================================
     RESPONSIVE — SMALL TABLET
     ========================================== */
  
  @media (max-width: 760px) {
    .ab-setup-row {
      gap: 18px;
    }
  
    .ab-project-card,
    .ab-type-card {
      flex: 1 1 100%;
      width: 100%;
    }
  
    #adForm {
      max-width: 100%;
    }
  
    #adForm .ab-form-layout > .ab-card {
      padding: 16px;
    }
  
    #adForm .ab-parameter-labels {
      display: none;
    }
  
    #adForm .ab-parameter-row {
      grid-template-columns: minmax(0, 1fr) 36px;
    }
  
    #adForm .ab-parameter-cell {
      grid-column: 1;
    }
  
    #adForm .ab-remove {
      grid-column: 2;
      grid-row: 1 / span 2;
    }
  
    #adForm .ab-actions {
      flex-wrap: wrap;
    }
  }
  
  /* ==========================================
     RESPONSIVE — MOBILE
     ========================================== */
  
  @media (max-width: 600px) {
    #adForm .ab-grid,
    #adForm .ab-section-targeting .ab-grid {
      grid-template-columns: minmax(0, 1fr);
    }
  
    .ab-type-grid {
      flex-wrap: wrap;
    }
  
    .ab-type {
      flex: 1 1 auto;
    }
  
    #adForm .ab-actions {
      flex-direction: column;
    }
  
    #adForm .ab-actions .ab-btn {
      width: 100%;
    }
  }
  
  
  
/* ==========================================
   PUBLISH SUCCESS MODAL
   ========================================== */

.ab-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.55);
}

.ab-modal-overlay[hidden] {
  display: none;
}

.ab-modal {
  width: 100%;
  max-width: 440px;
  box-sizing: border-box;
  padding: 36px;
  border-radius: 18px;
  background: #fff;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.ab-modal-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: #e6f5ed;
  color: #16845b;
  font-size: 32px;
  font-weight: 700;
}

.ab-modal h2 {
  margin: 0 0 12px;
  color: #131827;
  font-size: 23px;
  font-weight: 700;
}

.ab-modal > p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
}

.ab-modal-details {
  margin: 24px 0;
  padding: 16px;
  border-radius: 10px;
  background: #f8fafc;
  text-align: left;
}

.ab-modal-details > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.ab-modal-details strong {
  color: #374151;
}

.ab-modal-details span {
  color: #64748b;
  text-align: right;
}

.ab-modal-close {
  width: 100%;
  padding: 13px 20px;
  border: none;
  border-radius: 9px;
  background: #168765;
  color: #fff;
  font: 700 14px "DM Sans", sans-serif;
  cursor: pointer;
}

.ab-modal-close:hover {
  background: #116b50;
}
