/* ============================================
   Sector Selection - Multi-Select UI
   ============================================ */

/* Sector control row sits above existing controls */
.sector-controls {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
  flex-wrap: wrap;
  align-items: flex-start;
}

.sector-group {
  flex: 1;
  min-width: 280px;
}

.sector-group label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: var(--space-1);
  color: var(--gray-700);
}

/* Pill-toggle grid */
.sector-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.sector-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-2) var(--space-3);
  border: 2px solid var(--navy-900);
  border-radius: 0;
  background: var(--white);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
  color: var(--navy-900);
}

.sector-pill:hover {
  border-color: var(--gold-500);
  color: var(--navy-900);
  background: #f8f8f8;
  transform: scale(1.03);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.sector-pill.active {
  border-color: var(--gold-500);
  background: var(--navy-900);
  color: var(--gold-500);
}

.sector-pill.active .pill-icon {
  opacity: 1;
}

.pill-icon {
  font-size: 1rem;
  line-height: 1;
}

.pill-check {
  display: none;
  font-size: 0.75rem;
}

.sector-pill.active .pill-check {
  display: inline;
}

/* Default sector (General) is always on and slightly different style */
.sector-pill.default-sector {
  border-color: var(--gold-500);
  background: var(--navy-900);
  color: var(--gold-500);
  cursor: default;
}

.sector-pill.default-sector:hover {
  transform: none;
  background: var(--navy-900);
}

.sector-pill.default-sector.active {
  opacity: 1;
}

/* Sector notice bar — always visible */
.sector-notice {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--gold-500);
  color: var(--navy-900);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  line-height: 1.4;
  font-weight: 400;
  transition: font-weight 0.2s ease;
}

/* Hide the emoji icon */
.sector-notice-icon {
  display: none;
}

/* Bold when specialty sector active */
.sector-notice.specialty-active {
  font-weight: 700;
}

.sector-notice.visible {
  display: flex;
}

.sector-notice-icon {
  flex-shrink: 0;
  font-size: 1rem;
}

/* Sector badge — styled via index.html consolidated block */

.sector-badge + .sector-badge {
  margin-left: 4px;
}

/* ============================================
   EMOJI OVERLAY - CSS skin over buried JS emojis
   Hides native emoji, replaces with clean glyphs
   ============================================ */

.pill-icon {
  display: none !important;       /* hide emoji entirely — clean text pills */
}

/* ============================================
   PREMIUM PILL & DROPDOWN STYLING
   Adds depth and quality to match brand
   ============================================ */

/* Sector pills — subtle gradient, inner light, refined edges */
.sector-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 1.1rem;
  border: 2px solid var(--navy-900);
  border-radius: 0;
  background: linear-gradient(180deg, #ffffff 0%, #f4f5f7 100%);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  color: var(--navy-900);
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.sector-pill:hover {
  border-color: var(--gold-500);
  color: var(--navy-900);
  background: linear-gradient(180deg, #fffdf5 0%, #fef9e7 100%);
  transform: translateY(-1px);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.12),
    0 1px 3px rgba(212, 175, 55, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.sector-pill.active {
  border-color: var(--gold-500);
  background: linear-gradient(180deg, #1a3a5c 0%, var(--navy-900) 100%);
  color: var(--gold-500);
  box-shadow:
    0 2px 8px rgba(15, 39, 68, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.sector-pill.active .pill-check {
  display: inline;
  opacity: 0.8;
}

/* Default (General) — locked-on look */
.sector-pill.default-sector {
  border-color: var(--gold-500);
  background: linear-gradient(180deg, #1a3a5c 0%, var(--navy-900) 100%);
  color: var(--gold-500);
  cursor: default;
  box-shadow:
    0 2px 8px rgba(15, 39, 68, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.sector-pill.default-sector:hover {
  transform: none;
  background: linear-gradient(180deg, #1a3a5c 0%, var(--navy-900) 100%);
}

/* ============================================
   DROPDOWN SELECTS — premium treatment
   ============================================ */

.select-wrapper select {
  width: 100%;
  padding: 0.65rem 2.5rem 0.65rem 0.9rem;
  border: 2px solid var(--navy-900);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--navy-900);
  appearance: none;
  background: linear-gradient(180deg, #ffffff 0%, #f8f9fb 100%);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.select-wrapper select:hover {
  border-color: var(--gold-500);
  background: linear-gradient(180deg, #fffefb 0%, #fefcf3 100%);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(212, 175, 55, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.select-wrapper select:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow:
    0 0 0 3px rgba(212, 175, 55, 0.15),
    0 2px 8px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* Custom dropdown arrow — gold chevron */
.select-wrapper::after {
  content: '';
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--navy-900);
  pointer-events: none;
  transition: border-color 0.2s ease;
}

.select-wrapper:hover::after {
  border-top-color: var(--gold-500);
}

/* Control labels — slightly bolder */
.polisher-controls label,
.select-wrapper label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--navy-900);
  margin-bottom: 0.35rem;
}

/* Mobile: stack pills vertically on very small screens */
@media (max-width: 480px) {
  .sector-pills {
    flex-direction: column;
  }
  .sector-pill {
    justify-content: center;
  }
}


/* ============================================
   PAYLOAD REVIEW MODAL — emoji removal
   ============================================ */

/* Hide the lock/warning emoji in modal header */
.modal-header .modal-icon {
  display: none !important;
}

/* Consent checkbox + approve button layout:
   Move checkbox to far right, above approve button */
.modal-content label.consent-checkbox {
  justify-content: flex-end !important;
}

/* ============================================
   OUTPUT SECTION — emoji removal
   ============================================ */

/* Result heading "✅ Polished Document" — hide the tick via CSS */
#result-panel > h4 > span[style*="color:var(--success)"] {
  display: none !important;
}

/* Action buttons — strip leading emoji text nodes.
   We hide the emoji by making the button use font-size:0
   then restoring text in a wrapper or via specific overrides.
   Simpler: just target buttons and use CSS to hide emoji glyphs */
.polisher-actions button,
.polisher-result .polisher-actions button {
  font-size: 0;        /* hide all text including emoji */
}

/* X-Ray button is NOT emoji-prefixed — restore its own font-size */
.polisher-actions button.xray-btn,
.polisher-actions button.xray-btn:hover,
.polisher-actions button.xray-btn:focus,
.polisher-actions button.xray-btn:active,
.polisher-actions button#xray-output-btn,
.polisher-actions button#xray-output-btn:hover {
  font-size: 12px !important;
}

/* Restore the text labels only (not the emoji) using a data-attr 
   or by nesting spans. Since we can't change HTML easily, 
   we'll use a different approach: hide emoji via text-indent trick
   and use ::after for clean labels. Actually, simplest: 
   override with visibility + spans inside. 

   Better approach: The buttons have text like "📋 Copy". 
   We set font-size: 0 and then use ::after to put back the label. */

.polisher-actions button::after {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* Individual button labels */
.polisher-actions button[onclick*="copy()"]::after { content: 'Copy'; }
.polisher-actions button[onclick*="downloadDocx"]::after { content: 'Download .docx'; }
.polisher-actions button[onclick*="download()"]::after { content: 'Download PDF'; }
.polisher-actions button[onclick*="printPolished"]::after { content: 'Print'; }
.polisher-actions button[onclick*="certificate"]::after { content: 'View Certificate'; }
.polisher-actions button#btn-xray-output::after { content: 'X-Ray'; }

/* Checkbox label — hide the green tick emoji if present */
.download-options label input[type="checkbox"] {
  accent-color: var(--gold-500);
}

/* ============================================
   META BADGES — styled via index.html
   ============================================ */

/* ============================================
   PAYLOAD REVIEW MODAL — emoji removal & layout
   ============================================ */

/* Hide the emoji icon span in modal header */
.modal-header .modal-icon {
  display: none !important;
}

/* Consent checkbox area — restructure layout: checkbox far right above button */
.modal-body > div[style*="margin:var(--space-4)"] {
  position: relative;
}

.modal-body .consent-checkbox {
  justify-content: flex-end !important;
  flex-direction: row-reverse !important;
}

/* ============================================
   OUTPUT SECTION — remaining emoji cleanup
   ============================================ */

/* Doc viewer header: 📄 icon, download buttons */
.doc-viewer-header .doc-filename .icon {
  display: none;
}

/* Dropzone icon: 📄 */
.dropzone-icon {
  display: none !important;
}

/* Systems panel ⚡ icon */
.systems-header .systems-icon {
  display: none;
}

/* Approve button ✓ prefix — handled via font-size:0 + ::after */
#modal-approve {
  font-size: 0;
}
#modal-approve::after {
  content: 'Approve & Polish';
  font-size: 0.875rem;
  font-weight: 600;
}

/* Doc viewer action buttons */
.doc-actions button {
  font-size: 0;
}
.doc-actions button::after {
  font-size: 0.75rem;
  font-weight: 500;
}
#btn-download-docx-viewer::after { content: '.docx'; }
#btn-download-pdf-viewer::after { content: '.pdf'; }
#btn-clear-doc::after { content: '✕'; }

/* Keep the X-Ray input button readable */
.doc-actions button.xray-btn,
.doc-actions button.xray-btn:hover {
  font-size: 12px !important;
}


/* ============================================
   GLOBAL EMOJI REMOVAL & UI FIXES
   ============================================ */

/* === FIX 1: X-Ray pill hover text visibility === */
.pill-xray:hover {
  background: rgba(212, 175, 55, 0.15) !important;
  color: #D4AF37 !important;
  border-color: rgba(212, 175, 55, 0.4) !important;
}
.pill-xray.active:hover {
  background: #D4AF37 !important;
  color: #1a2744 !important;
}

/* === FIX 2: Payload modal — hide emoji icon === */
.modal-icon {
  display: none !important;
}

/* === FIX 2b: Modal consent — checkbox far right above approve === */
.modal-body .consent-checkbox {
  justify-content: flex-end !important;
  text-align: right !important;
}
