/* Main Layout Container */
.webform-preview {
  max-width: 950px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1e293b;
}

/* Section Cards (Step 1, Step 2, Fieldsets) */
.webform-preview details,
.webform-preview fieldset {
  background: #ffffff;
  border: 1px solid #e2e8f0 !important;
  border-radius: 12px !important;
  margin-bottom: 24px;
  padding: 0 !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
  overflow: hidden;
}

/* Card Header Bars */
.webform-preview summary,
.webform-preview fieldset > legend {
  background-color: #f8fafc;
  padding: 16px 24px !important;
  font-size: 1.1rem;
  font-weight: 700;
  color: #31849B;
  border-bottom: 1px solid #e2e8f0;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}

/* Inner Wrapper Padding */
.webform-preview details > .details-wrapper,
.webform-preview fieldset > .fieldset-wrapper {
  padding: 12px 24px 24px 24px !important;
}

/* 
  FORCE STRICT 2-COLUMN GRID FOR ALL ROWS
  This guarantees labels and values live in separate vertical tracks.
*/
.webform-preview .webform-preview-element,
.webform-preview .form-item,
.webform-preview .js-form-item {
  display: grid !important;
  grid-template-columns: 240px 1fr !important; /* 240px label column, remaining width for value */
  column-gap: 24px !important;
  padding: 12px 0 !important;
  border-bottom: 1px solid #f1f5f9;
  align-items: start !important;
  margin: 0 !important;
}

.webform-preview .webform-preview-element:last-child {
  border-bottom: none;
}

/* Column 1: Labels (Always locked to 240px wide) */
.webform-preview-element-title,
.webform-preview label,
.webform-preview .form-item > label {
  grid-column: 1 !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  color: #64748b !important;
  text-transform: none !important;
  line-height: 1.5 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Column 2: Submitted Values (Locked to right side, will NEVER wrap under label) */
.webform-preview-element-value,
.webform-preview .form-item > .description,
.webform-preview .webform-preview-element > div:not(.webform-preview-element-title) {
  grid-column: 2 !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  color: #0f172a !important;
  line-height: 1.6 !important;
  word-break: break-word !important;
  margin: 0 !important;
}

/* Pill Badges for Multi-select Values */
.webform-preview-element-value li {
  display: inline-block;
  background-color: #eff6ff;
  color: #31849B;
  border: 1px solid #dbeafe;
  padding: 3px 10px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 2px 4px 2px 0;
}

/* Action Edit Button */
.webform-preview input[type="submit"][name*="edit"],
.webform-preview .webform-preview-edit {
  background-color: #ffffff;
  color: #31849B;
  border: 1.5px solid #31849B;
  border-radius: 6px;
  padding: 6px 16px;
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  float: right;
  margin-top: 16px;
}

.webform-preview input[type="submit"][name*="edit"]:hover {
  background-color: #31849B;
  color: #ffffff;
}

/* Widens ONLY the Webform Preview Page */
.webform-preview,
[data-drupal-selector*="webform-preview"] {
  max-width: 1400px !important; /* Increase from 950px to your preferred width */
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Adjust Grid Track Ratio for Extra Space */
.webform-preview .webform-preview-element,
.webform-preview .form-item,
.webform-preview .js-form-item {
  grid-template-columns: 260px 1fr !important; /* Gives 260px to labels and the rest to values */
}


/* Add Gap Between Form Action Buttons (< Previous, Submit, Edit) */
.webform-actions,
.form-actions {
  display: flex !important;
  gap: 16px !important; /* Adjust pixel value to increase/decrease space */
  align-items: center;
  margin-top: 20px;
}

/* Fallback Margin for Older Browsers or Specific Input Buttons */
.webform-actions input[type="submit"],
.form-actions input[type="submit"],
.webform-actions button,
.form-actions button {
  margin-right: 12px !important;
}

.webform-actions input[type="submit"]:last-child,
.form-actions input[type="submit"]:last-child {
  margin-right: 0 !important;
}


/* Uniform Button Sizing & Alignment */
.webform-actions input[type="submit"],
.form-actions input[type="submit"],
.webform-button--previous,
.webform-button--submit {
  min-width: 110px !important;          /* Sets identical minimum width */
  height: 40px !important;              /* Forces identical height */
  padding: 0 18px !important;           /* Equal inner spacing */
  font-size: 0.9rem !important;         /* Matches text size */
  font-weight: 600 !important;
  line-height: 40px !important;         /* Centers text vertically */
  box-sizing: border-box !important;
  border-radius: 6px !important;        /* Same rounded corners */
  outline: none !important;
}

/* horizontal scrollbar for preview */

/* Horizontal scrollbar for preview container */
.webform-preview,
.webform-preview details,
.webform-preview fieldset,
.webform-preview-wrapper {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto !important; /* Enables horizontal scrolling if content overflows */
  -webkit-overflow-scrolling: touch;
}

/* Ensure long text or wide tables inside grid values don't break layout */
.webform-preview-element-value {
  min-width: 0; /* Prevents CSS Grid columns from overflowing parent bounds */
  overflow-wrap: break-word;
}


/*extra code for pdf */


/* Page Layout & Typography */
body, .webform-submission {
  font-family: 'Helvetica', 'Arial', sans-serif;
  color: #222222;
  font-size: 11px;
  line-height: 1.4;
}

/* Force Form Data into Clean Tables */
.webform-submission-table, table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 15px;
}

/* Style Table Rows & Headers */
.webform-submission-table th, 
.webform-submission-table td {
  padding: 6px 8px;
  border: 1px solid #cccccc;
  vertical-align: top;
}

.webform-submission-table th {
  background-color: #f0f0f0;
  font-weight: bold;
  width: 35%;
}

/* Resize Uploaded Images to fit cleanly */
img {
  max-width: 200px;
  height: auto;
}






/* ==========================================
   EXTRA CODE FOR PDF GENERATION ONLY
   ========================================== */

/* Apply typography overrides strictly during print/PDF generation */
@media print {
  body, 
  .webform-submission {
    font-size: 12px !important;
    line-height: 1.5 !important;
  }
}

/* Force word wrapping and prevent single-line overflow on HTML & PDF outputs */
.webform-submission-table, 
.webform-submission,
.webform-preview-element-value,
.webform-submission-table td {
  table-layout: fixed !important;
  word-wrap: break-word !important;
  word-break: break-all !important;
  overflow-wrap: anywhere !important;
  white-space: normal !important;
}

/* Style Table Rows & Headers */
.webform-submission-table th, 
.webform-submission-table td {
  padding: 6px 8px;
  border: 1px solid #cccccc;
  vertical-align: top;
}

.webform-submission-table th {
  background-color: #f0f0f0;
  font-weight: bold;
  width: 35%;
}

/* Resize Uploaded Images */
img {
  max-width: 200px;
  height: auto;
}

/* Hide the 'Show row weights' toggle button on multi-value table fields */
.tabledrag-toggle-weight-wrapper,
.tabledrag-toggle-weight {
  display: none !important;
}








/* css for website to be toggle on all the time */ 


input[name="platforms[website]"] {
  pointer-events: none;
  opacity: 0.7;
}





/* css for next and previous button*/

.webform-button--previous,
.webform-button--next,
.webform-button--preview,
.webform-button--submit {
  min-width: 120px;
}










/* ================================
   GROUP A — titles only, color: #31849b
   (uses label[for=...] so ONLY the title text is affected,
   never the input box or typed value)
   ================================ */
label[for="edit-category"],
label[for="edit-events-type"],
label[for="edit-institution-id"],
label[for="edit-name"],
label[for="edit-category-type"],
label[for="edit-associated-faculty"],
label[for="edit-associated-faculty-email"],
label[for="edit-associated-faculty-contact"],
label[for="edit-department"],
label[for="edit-email-id"],
label[for="edit-contact-number"],
label[for="edit-department-section"],
label[for="edit-title-headline"],
label[for="edit-past-title-headline"],
label[for="edit-description"],
label[for="edit-past-description"],
label[for="edit-venue"],
label[for="edit-venue-details"],
label[for="edit-outside-iist-details"],
label[for="edit-website-link"],
label[for="edit-live-link"],
label[for="edit-register-here"],
label[for="edit-social-media-page"],
label[for="edit-upload-original-submission-pdf"],
label[for="edit-about-the-speaker"],
label[for="edit-press-release"],
label[for="edit-news-coverage"],
label[for="edit-additional-information"],
label[for="edit-brochure-poster"],
label[for="edit-thumbnail"],
label[for="edit-past-cover-image"],
label[for="edit-web-banner"],
label[for="edit-past-web-banner"],
label[for="edit-archive-photographs"],
label[for="edit-past-archive-photographs"],
label[for="edit-running-announcement"],
label[for="edit-photographs-uploaded"],
label[for="edit-standee-display"],
label[for="edit-digital-tv-display"],
label[for="edit-short-video"] {
  color: #31849b !important;
}

/* ================================
   GROUP B — section titles only, color: #fd9226
   (legend = the fieldset's own heading)
   ================================ */
#edit-platforms legend,
#edit-mode legend,
#edit-event-links legend,
#edit-media-uploads legend,
#edit-upload-later-confirmation legend,
#edit-campus-signage-system legend,
#edit-undertaking-section legend,
#edit-past-event-details legend {
  color: #fd9226 !important;
}

/* ================================
   RESET — individual checkbox/radio OPTION text
   (Yes/No, Website, Campus Signage, etc.) stays default/black
   ================================ */
.webform-submission-form .js-form-type-checkbox label,
.webform-submission-form .js-form-type-radio label {
  color: initial !important;
}

/* The Undertaking confirmation sentence itself stays black */
label[for="edit-undertaking-confirmation"] {
  color: initial !important;
}

#edit-upload-original-submission-pdf--label,
#edit-past-cover-image--label,
#edit-past-web-banner--label,
#edit-past-archive-photographs--label,
#edit-thumbnail--label,
#edit-web-banner--label,
#edit-archive-photographs--label,
#edit-brochure-poster--label,
#edit-press-release--label,
#edit-news-coverage--label,
#edit-standee-display--label,
#edit-digital-tv-display--label,
#edit-short-video--label {
  color: #31849b !important;
}

#edit-platforms--label,
#edit-mode--label {
  color: #fd9226 !important;
}

#edit-social-media-page--label {
  color: #31849b !important;
}


/* Social media page stays teal/blue */
label[for="edit-social-media-page"],
#edit-social-media-page--label,
#edit-social-media-page-table--label {
  color: #31849b !important;
}

/* Platforms + Mode: orange (keep this LAST in the file) */
#edit-platforms--label,
#edit-platforms legend,
#edit-platforms legend span,
#edit-platforms .fieldset-legend,
.js-webform-type-checkboxes[data-drupal-selector*="edit-platforms"] legend,
.js-webform-type-checkboxes[data-drupal-selector*="edit-platforms"] legend span,

#edit-mode--label,
#edit-mode legend,
#edit-mode legend span,
#edit-mode .fieldset-legend,
.js-webform-type-radios[data-drupal-selector*="edit-mode"] legend,
.js-webform-type-radios[data-drupal-selector*="edit-mode"] legend span {
  color: #fd9226 !important;
}





/* URL field (webform multiple / table) - blue */
.form-item-social-media-page > label,
.form-item-social-media-page > legend,
.form-item-social-media-page > legend span,
.form-item-social-media-page > h4,
.form-item-social-media-page > .label,
.form-item-social-media-page > .fieldset-legend,
[data-drupal-selector="edit-social-media-page"] > legend,
[data-drupal-selector="edit-social-media-page"] > legend span,
[data-drupal-selector="edit-social-media-page"] > label,
[data-drupal-selector="edit-social-media-page"] > .label,
.webform-element--title-social-media-page,
div[class*="social-media-page"] > label,
div[class*="social-media-page"] > .label {
  color: #31849b !important;
}

/* "Has this event already been submitted previously?" - orange */
[data-drupal-selector*="submitted"] > legend,
[data-drupal-selector*="submitted"] > legend span,
[data-drupal-selector*="previous"] > legend,
[data-drupal-selector*="previous"] > legend span,
[id*="submitted"] > legend,
[id*="submitted"] > legend span,
[id*="submitted"] > .fieldset-legend,
[id*="previous"] > legend,
[id*="previous"] > legend span {
  color: #fd9226 !important;
}




/* Start date + End date titles - blue */
label[for*="start-date"],
label[for*="end-date"],
#edit-start-date--label,
#edit-end-date--label,
[id*="start-date"] > legend,
[id*="start-date"] > legend span,
[id*="end-date"] > legend,
[id*="end-date"] > legend span,
[data-drupal-selector*="start-date"] > legend,
[data-drupal-selector*="start-date"] > legend span,
[data-drupal-selector*="end-date"] > legend,
[data-drupal-selector*="end-date"] > legend span,
.form-item-start-date > label,
.form-item-end-date > label,
.js-form-item-start-date > label,
.js-form-item-end-date > label {
  color: #31849b !important;
}



/* Step 1 subtitle - orange */
.webform-submission-form h3 font,
.webform-submission-form h3 {
  color: #fd9226 !important;
}