/* Main container: two-column, balanced width */
.sgi-container {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  margin: 40px auto;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);

  /* Required for sticky to work */
  overflow: visible;
}

/* Left side (Form) */
.sgi-left {
  flex: 1.2;
  padding: 50px 60px;
  box-sizing: border-box;
  border-right: 1px solid #f0f0f0;
  overflow-y: auto;
}

/* Right side (Helper Panel) – fills full height */
.sgi-right {
  flex: 0.8;
  padding: 50px 40px;
  background: linear-gradient(to bottom, #fafafa 0%, #fafafa 50%, #ececec 100%);
  box-sizing: border-box;
  display: block;
}

/* Sticky helper content */
#sugarcrm-help-pane {
  width: 100%;
  color: #444;
  line-height: 1.6;
  font-size: 15px;

  /* Always visible during scroll */
  position: sticky;
  top: 120px;

  /* Allows all content types to stay inside */
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Ensure ALL dynamic HTML stays inside the panel -------------------------- */

/* Responsive images */
#sugarcrm-help-pane img {
  max-width: 100% !important;
  height: auto !important;
  display: block !important;
  border-radius: 6px;
  margin: 12px 0;
}

/* Responsive videos */
#sugarcrm-help-pane video {
  max-width: 100% !important;
  height: auto !important;
  display: block !important;
  margin: 12px 0;
}

/* Responsive iframes (YouTube, Vimeo, dashboards, etc.) */
#sugarcrm-help-pane iframe {
  max-width: 100% !important;
  width: 100% !important;
  height: auto;
  aspect-ratio: 16/9;
  border: none;
  border-radius: 6px;
  margin: 12px 0;
}

/* Responsive tables */
#sugarcrm-help-pane table {
  width: 100% !important;
  border-collapse: collapse;
  overflow: hidden;
  display: block;
  overflow-x: auto;
}

/* Any DIV or block content stays inside */
#sugarcrm-help-pane div,
#sugarcrm-help-pane p,
#sugarcrm-help-pane section,
#sugarcrm-help-pane article {
  max-width: 100% !important;
}

/* Prevent long URLs or long words breaking layout */
#sugarcrm-help-pane a,
#sugarcrm-help-pane span {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Empty state */
.sgi-empty-state {
  text-align: center;
  color: #666;
  padding-top: 20px;
}

.sgi-empty-icon {
  font-size: 110px;
  opacity: 0.4;
  margin-bottom: 10px;
}

.sgi-empty-state h3 {
  margin: 0;
  font-size: 18px;
  color: #333;
}

.sgi-empty-state p {
  margin-top: 6px;
  font-size: 14px;
  color: #888;
  line-height: 1.5;
}

/* Responsive layout for smaller screens */
@media (max-width: 1024px) {
  .sgi-container {
    flex-direction: column;
    max-width: 95%;
    margin: 20px auto;
  }

  /* Sticky disabled for mobile */
  #sugarcrm-help-pane {
    position: static;
  }

  .sgi-left,
  .sgi-right {
    padding: 30px 25px;
    border-right: none;
    border-bottom: 1px solid #eee;
  }

  .sgi-right {
    background: #fff;
  }
}

