/* ==========================================================================
   FOREIGN THEME ISOLATION -- EVERY DECLARATION HERE IS !important, ON PURPOSE
   ==========================================================================
   This stylesheet is printed into a page that belongs to someone else: the
   active client area template (Lagom, Twenty-One, Six, Nexus, Nexum, or any
   customised theme). Scoping every selector under our own classes is not
   enough on its own -- a template selector using an ID, like
   `#main-body .panel a:hover`, beats ours on specificity, and a template rule
   that is itself !important beats ours outright. So every declaration in this
   file is !important.

   That does NOT change how this file's own rules interact: among !important
   declarations the browser compares specificity and source order exactly as
   it does among normal ones, so hover, focus, dark mode and the media queries
   all still win where they did before.

   EXCEPTIONS -- never add !important to these:
     * custom properties (--x: ...). The Client Area Styling engine prints the
       admin's colours as --{xx}-* values in a later <style> block, and they
       must win by cascade order. Our !important rules READ them through var(),
       so the admin's customisation still applies.
     * anything inside @keyframes. !important there is invalid, and the
       browser silently DROPS the whole declaration.
     * display and opacity. jQuery's .show()/.hide()/.toggle()/.fadeIn()/
       .fadeOut()/.slideUp()/.slideDown() write them as inline styles, and a
       stylesheet !important beats an inline style -- the element would freeze.
     * position / top / right / bottom / left / width on *-cselect-list.
       pgfPositionCselectList() writes them inline to open the dropdown where
       it belongs.

   EVERY NEW RULE YOU ADD HERE MUST BE !important TOO. A normal declaration in
   an !important sheet silently loses to its neighbours -- it will look like it
   does nothing. The conformance manifest checks this mechanically, with
   tools/css_isolation_check.php in the common reference folder.
   ========================================================================== */

/* 
  DEVELOPER STYLING GUIDELINES & SOPS:
  - Never use inline HTML style attributes (style="..."). All styling must be written in the designated CSS files.
  - Always use custom CSS classes prefixed with the module namespace `whmp_pgf-` (use this single prefix consistently everywhere — do not mix in a shorter `pgf-` variant) to prevent styling conflicts.
  - Never use native/built-in theme classes directly. Style custom classes exclusively.
  - Primary Color and Secondary Color are configured by the administrator and injected as CSS variables.
  - This stylesheet uses --pgf-primary-color and --pgf-secondary-color variables. Feel free to define more variables as required.
  - For service actions, use proper Font Awesome icons instead of images, enabling dynamic coloring and sizing via CSS.
*/

.whmp_pgf-wrapper * {
  box-sizing: border-box !important;
}

.whmp_pgf-wrapper {
  font-family: inherit !important;
  margin-top: 20px !important;
  background-color: transparent !important;
  padding: var(--pgf-card-padding, 16px) !important;
  border-radius: var(--pgf-radius-lg, 10px) !important;
}

/* Text in the brand colour uses --pgf-primary-text: the brand colour as the template
   draws it for TEXT (a button colour can be too dark to read on a dark card). */
.whmp_pgf-section-title {
  font-size: var(--pgf-font-size-lg, 16px) !important;
  font-weight: var(--pgf-font-weight, 700) !important;
  color: var(--pgf-primary-text, var(--pgf-primary-color, #1a4d80)) !important;
  margin: 0 0 15px 10px !important;
}

/* Service Actions Panel */
.whmp_pgf-actions-wrapper {
  margin-bottom: 25px !important;
}

.whmp_pgf-actions-boxes {
  display: flex;
  gap: 15px !important;
  margin-left: 10px !important;
  flex-wrap: wrap !important;
}

.whmp_pgf-action-box {
  display: flex;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100px !important;
  height: 100px !important;
  background-color: var(--pgf-card-bg, #ffffff) !important;
  border: 1px solid var(--pgf-border-color, #e5e7eb) !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  transition:
    transform 0.2s,
    border-color 0.2s,
    box-shadow 0.2s !important;
  user-select: none !important;
  box-shadow: var(--pgf-shadow, 0 2px 8px rgba(0, 0, 0, 0.05)) !important;
}

.whmp_pgf-action-box:hover {
  transform: translateY(-2px) !important;
  border-color: var(--pgf-primary-color, #1a4d80) !important;
}

.whmp_pgf-action-box.disabled {
  opacity: 0.5;
  cursor: not-allowed !important;
  transform: none !important;
}

.whmp_pgf-action-box img {
  width: 28px !important;
  height: 28px !important;
  margin-bottom: 8px !important;
  object-fit: contain !important;
}

.whmp_pgf-action-box span {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--pgf-text-color, #1a1d23) !important;
}

/* Service Detail Table styling */
.whmp_pgf-info-table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border-radius: var(--pgf-radius, 6px) !important;
  overflow: hidden !important;
  border: var(--pgf-border-width, 1px) var(--pgf-border-style, solid) var(--pgf-table-border, var(--pgf-border-color, #e5e7eb)) !important;
}

/* Tables read the dedicated --pgf-table-* variables so an admin can match a
   template whose tables differ from its cards (striped header, tinted rows).
   Each falls back to the matching surface variable, so a theme with nothing
   table-specific to map still looks right. */
.whmp_pgf-info-table tr:nth-child(odd) td,
.whmp_pgf-info-table tr:nth-child(odd) th {
  background-color: var(--pgf-table-row-bg, var(--pgf-bg-color, #ffffff)) !important;
}

.whmp_pgf-info-table tr:nth-child(even) td,
.whmp_pgf-info-table tr:nth-child(even) th {
  background-color: var(--pgf-table-row-alt-bg, var(--pgf-alt-row-bg, #f9fafb)) !important;
}

.whmp_pgf-info-table th {
  padding: var(--pgf-cell-padding, 12px 16px) !important;
  text-align: left !important;
  background-color: var(--pgf-table-header-bg, var(--pgf-header-bg, #f9fafb)) !important;
  color: var(--pgf-table-header-text, var(--pgf-primary-color, #1a4d80)) !important;
  font-weight: 600 !important;
  font-size: var(--pgf-font-size, 13px) !important;
  width: 40% !important;
  border-bottom: 1px solid var(--pgf-table-border, var(--pgf-border-color, #e5e7eb)) !important;
}

.whmp_pgf-info-table td {
  padding: var(--pgf-cell-padding, 12px 16px) !important;
  text-align: left !important;
  font-size: var(--pgf-font-size, 13px) !important;
  color: var(--pgf-table-text, var(--pgf-text-color, #1a1d23)) !important;
  border-bottom: 1px solid var(--pgf-table-border, var(--pgf-border-color, #e5e7eb)) !important;
  word-break: break-all !important;
}

.whmp_pgf-info-table tr:last-child th,
.whmp_pgf-info-table tr:last-child td {
  border-bottom: none !important;
}

/* Badges styling */
.whmp_pgf-badge {
  display: inline-block;
  padding: 2px 10px !important;
  border-radius: var(--pgf-radius-sm, 10px) !important;
  font-size: var(--pgf-font-size-sm, 11px) !important;
  font-weight: 600 !important;
}

.whmp_pgf-badge-active {
  background-color: var(--pgf-badge-active-bg, #e8f8ee) !important;
  color: var(--pgf-badge-active-text, #1e7e34) !important;
}

.whmp_pgf-badge-inactive {
  background-color: var(--pgf-badge-inactive-bg, #fdf0ef) !important;
  color: var(--pgf-badge-inactive-text, #c0392b) !important;
}

/* Interactive Utility Buttons */
.whmp_pgf-copy-btn {
  background: none !important;
  border: 1px solid var(--pgf-primary-text, var(--pgf-primary-color, #1a4d80)) !important;
  border-radius: var(--pgf-radius-sm, 4px) !important;
  color: var(--pgf-primary-text, var(--pgf-primary-color, #1a4d80)) !important;
  padding: 1px 6px !important;
  font-size: var(--pgf-font-size-sm, 11px) !important;
  cursor: pointer !important;
  margin-left: 5px !important;
  transition:
    background 0.2s,
    color 0.2s !important;
  vertical-align: middle !important;
}

.whmp_pgf-copy-btn:hover {
  background: var(--pgf-primary-text, var(--pgf-primary-color, #1a4d80)) !important;
  color: var(--pgf-bg-color, #ffffff) !important;
}

.whmp_pgf-url-wrap {
  display: flex;
  align-items: center !important;
  gap: 4px !important;
  flex-wrap: wrap !important;
}

.whmp_pgf-url-text {
  word-break: break-all !important;
  flex: 1 !important;
  min-width: 0 !important;
}

/* Float Popup messages styling */
.whmp_pgf-popup {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  padding: 12px 18px !important;
  border-radius: 4px !important;
  border: 1px solid transparent !important;
  color: #155724 !important;
  background-color: #d4edda !important;
  border-color: #c3e6cb !important;
  z-index: 99999 !important;
  opacity: 0;
  animation: whmpPgfSlideInOutRight 3s ease-in-out forwards !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
  font-size: var(--pgf-font-size, 13px) !important;
}

.whmp_pgf-popup.error-popup {
  background-color: #f8d7da !important;
  color: #721c24 !important;
  border-color: #f5c6cb !important;
}

@keyframes whmpPgfSlideInOutRight {
  0% {
    opacity: 0;
    transform: translateX(40px);
  }
  10% {
    opacity: 1;
    transform: translateX(0);
  }
  90% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(40px);
  }
}

/* 
==========================================================================
   Responsive Design Breakpoints Guidelines & Overrides:
==========================================================================
   SOP Rule: The client area must be designed and styled to show correctly 
   on all viewport sizes (Mobile, Tablet, Laptop, and Big Desktop). 
   Use the media queries below to adjust widths, grids, layouts, and font 
   properties to ensure seamless responsiveness across devices.
*/

/* 1. Mobile Screens (Smartphones, max-width: 576px) */
@media (max-width: 576px) {
  .whmp_pgf-wrapper {
    padding: 12px !important;
  }
  .whmp_pgf-actions-boxes {
    margin-left: 0 !important;
    gap: 8px !important;
  }
  .whmp_pgf-action-box {
    width: calc(50% - 4px) !important;
    height: 90px !important;
  }
  .whmp_pgf-action-box i {
    font-size: 24px !important;
  }
  .whmp_pgf-info-table th,
  .whmp_pgf-info-table td {
    display: block;
    width: 100% !important;
    border-bottom: none !important;
  }
  .whmp_pgf-info-table th {
    padding-bottom: 3px !important;
  }
  .whmp_pgf-info-table td {
    padding-top: 3px !important;
    border-bottom: 1px solid var(--pgf-border-color, #e5e7eb) !important;
  }
  .whmp_pgf-info-table tr:last-child td {
    border-bottom: none !important;
  }
}

/* 2. Tablet Screens (min-width: 577px) and (max-width: 768px) */
@media (min-width: 577px) and (max-width: 768px) {
  .whmp_pgf-wrapper {
    padding: 16px !important;
  }
  .whmp_pgf-actions-boxes {
    gap: 12px !important;
  }
  .whmp_pgf-action-box {
    width: 100px !important;
    height: 100px !important;
  }
}

/* 3. Laptop/Notebook Screens (min-width: 769px) and (max-width: 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .whmp_pgf-wrapper {
    max-width: 100% !important;
  }
  .whmp_pgf-actions-boxes {
    gap: 16px !important;
  }
  .whmp_pgf-action-box {
    width: 105px !important;
    height: 105px !important;
  }
}

/* 4. Large Desktop Displays (min-width: 1025px) */
@media (min-width: 1025px) {
  .whmp_pgf-wrapper {
    max-width: 1200px !important;
    margin: 20px auto !important;
  }
  .whmp_pgf-actions-boxes {
    gap: 20px !important;
  }
  .whmp_pgf-action-box {
    width: 110px !important;
    height: 110px !important;
  }
}

/* ==========================================================================
   Alerts
   ==========================================================================
   Self-contained on purpose. This used to be a bare `margin-top` bolted onto
   the active template's own `.alert alert-danger`, i.e. the module's alerts
   inherited a foreign template's classes — which breaks isolation and looks
   wrong the moment a template restyles `.alert`. Every tone now paints its own
   background, ink and border from its own --pgf-alert-<tone>-* triplet, mapped
   per template in the Client Area Customization tab. Defaults are the
   Bootstrap 4 palette. See styling.php.

   Markup: `<div class="whmp_pgf-alert whmp_pgf-alert-danger">`.
   ========================================================================== */
.whmp_pgf-alert {
  position: relative !important;
  padding: var(--pgf-card-padding, 12px 16px) !important;
  margin-top: 15px !important;
  margin-bottom: 15px !important;
  border: var(--pgf-border-width, 1px) var(--pgf-border-style, solid) transparent !important;
  border-radius: var(--pgf-radius, 6px) !important;
  font-size: var(--pgf-font-size, 13px) !important;
  line-height: 1.5 !important;
}

.whmp_pgf-alert-success {
  background-color: var(--pgf-alert-success-bg, #d4edda) !important;
  color: var(--pgf-alert-success-text, #155724) !important;
  border-color: var(--pgf-alert-success-border, #c3e6cb) !important;
}

.whmp_pgf-alert-danger {
  margin-top: 15px !important;
  background-color: var(--pgf-alert-danger-bg, #f8d7da) !important;
  color: var(--pgf-alert-danger-text, #721c24) !important;
  border-color: var(--pgf-alert-danger-border, #f5c6cb) !important;
}

.whmp_pgf-alert-warning {
  background-color: var(--pgf-alert-warning-bg, #fff3cd) !important;
  color: var(--pgf-alert-warning-text, #856404) !important;
  border-color: var(--pgf-alert-warning-border, #ffeeba) !important;
}

.whmp_pgf-alert-info {
  background-color: var(--pgf-alert-info-bg, #d1ecf1) !important;
  color: var(--pgf-alert-info-text, #0c5460) !important;
  border-color: var(--pgf-alert-info-border, #bee5eb) !important;
}

.whmp_pgf-alert-primary {
  background-color: var(--pgf-alert-primary-bg, #cce5ff) !important;
  color: var(--pgf-alert-primary-text, #004085) !important;
  border-color: var(--pgf-alert-primary-border, #b8daff) !important;
}

.whmp_pgf-alert-secondary {
  background-color: var(--pgf-alert-secondary-bg, #e2e3e5) !important;
  color: var(--pgf-alert-secondary-text, #383d41) !important;
  border-color: var(--pgf-alert-secondary-border, #d6d8db) !important;
}

.whmp_pgf-alert a,
.whmp_pgf-alert a:link,
.whmp_pgf-alert a:visited,
.whmp_pgf-alert a:hover,
.whmp_pgf-alert a:focus,
.whmp_pgf-alert a:active {
  color: inherit !important;
  font-weight: 600 !important;
  text-decoration: underline !important;
}

/* ==========================================================================
   Buttons — one --pgf-btn-<tone>-{bg,text,border} triplet per tone.
   Every variant sets background, colour AND border from its own triplet: that
   is what lets the mapping reproduce a template whose secondary button is a
   light plate with dark ink, which is impossible if `color` is hardcoded.
   ========================================================================== */
.whmp_pgf-btn {
  padding: var(--pgf-btn-padding, 10px 20px) !important;
  border-radius: var(--pgf-radius-sm, 5px) !important;
  cursor: pointer !important;
  font-size: var(--pgf-font-size, 14px) !important;
  font-weight: 500 !important;
  transition: var(--pgf-transition, all 0.3s ease) !important;
}

.whmp_pgf-btn-primary {
  background-color: var(--pgf-btn-primary-bg, var(--pgf-primary-color, #1a4d80)) !important;
  color: var(--pgf-btn-primary-text, #fff) !important;
  border: 1px solid var(--pgf-btn-primary-border, transparent) !important;
}

.whmp_pgf-btn-secondary {
  background-color: var(--pgf-btn-secondary-bg, var(--pgf-secondary-color, #153d66)) !important;
  color: var(--pgf-btn-secondary-text, #fff) !important;
  border: 1px solid var(--pgf-btn-secondary-border, transparent) !important;
}

.whmp_pgf-btn-success {
  background-color: var(--pgf-btn-success-bg, #28a745) !important;
  color: var(--pgf-btn-success-text, #fff) !important;
  border: 1px solid var(--pgf-btn-success-border, transparent) !important;
}

.whmp_pgf-btn-danger {
  background-color: var(--pgf-btn-danger-bg, #dc3545) !important;
  color: var(--pgf-btn-danger-text, #fff) !important;
  border: 1px solid var(--pgf-btn-danger-border, transparent) !important;
}

.whmp_pgf-btn-warning {
  background-color: var(--pgf-btn-warning-bg, #ffc107) !important;
  color: var(--pgf-btn-warning-text, #212529) !important;
  border: 1px solid var(--pgf-btn-warning-border, transparent) !important;
}

.whmp_pgf-btn-info {
  background-color: var(--pgf-btn-info-bg, #17a2b8) !important;
  color: var(--pgf-btn-info-text, #fff) !important;
  border: 1px solid var(--pgf-btn-info-border, transparent) !important;
}

.whmp_pgf-btn-primary:hover,
.whmp_pgf-btn-secondary:hover,
.whmp_pgf-btn-success:hover,
.whmp_pgf-btn-danger:hover,
.whmp_pgf-btn-warning:hover,
.whmp_pgf-btn-info:hover {
  opacity: 0.9;
}

/* Plain inline Font Awesome glyphs (a label prefix, a table cell hint). */
.whmp_pgf-inline-icon {
  color: var(--pgf-icon-color, var(--pgf-primary-color, #1a4d80)) !important;
}

.whmp_pgf-inline-icon-muted {
  color: var(--pgf-icon-muted-color, var(--pgf-muted-color, #6b7280)) !important;
}

.whmp_pgf-pw-toggle-btn {
  margin-left: 4px !important;
}

/* 
==========================================================================
   White/Dark Mode Toggle Styling Examples
==========================================================================
   If the admin has enabled the toggle feature:
   1. CSS variables (e.g. --pgf-bg-color) are overridden dynamically inside 
      hooks.php mapping rules.
   2. Standardized theme state classes (.whmp_pgf-dark-mode and .whmp_pgf-light-mode) are
      dynamically applied to the .whmp_pgf-wrapper container via JS, allowing you
      to write direct static rules for mode-specific styling:
*/

/* Dark Mode Specific Overrides Example */
.whmp_pgf-wrapper.whmp_pgf-dark-mode {
  /* Styles that should only apply when the client area is in Dark Mode */
  border-color: var(--pgf-border-color, #374151) !important;
}

/* Light Mode Specific Overrides Example */
.whmp_pgf-wrapper.whmp_pgf-light-mode {
  /* Styles that should only apply when the client area is in Light Mode */
  border-color: var(--pgf-border-color, #e5e7eb) !important;
}

/* ==========================================================================
   Custom Select (Single-Select / cselect) Styling
   ========================================================================== */
.whmp_pgf-wrapper .whmp_pgf-cselect {
  position: relative !important;
  width: 100% !important;
}

.whmp_pgf-wrapper select.whmp_pgf-cselect-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.whmp_pgf-wrapper .whmp_pgf-cselect-trigger {
  display: flex;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  width: 100% !important;
  min-height: 40px !important;
  padding: var(--pgf-input-padding, 8px 12px) !important;
  background: var(--pgf-card-bg, #ffffff) !important;
  color: var(--pgf-text-color, #1a1d23) !important;
  border: 1px solid var(--pgf-border-color, #e5e7eb) !important;
  border-radius: var(--pgf-radius, 8px) !important;
  cursor: pointer !important;
  font-size: 14px !important;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease !important;
  box-sizing: border-box !important;
}

.whmp_pgf-wrapper .whmp_pgf-cselect-trigger:hover,
.whmp_pgf-wrapper .whmp_pgf-cselect.open .whmp_pgf-cselect-trigger {
  border-color: var(--pgf-primary-color, #1a4d80) !important;
}

.whmp_pgf-wrapper .whmp_pgf-cselect.open .whmp_pgf-cselect-trigger {
  box-shadow: 0 0 0 3px rgba(26, 77, 128, 0.15) !important;
}

.whmp_pgf-wrapper .whmp_pgf-cselect-label {
  flex: 1 !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  text-align: left !important;
}

.whmp_pgf-wrapper .whmp_pgf-cselect-caret {
  flex-shrink: 0 !important;
  font-size: 12px !important;
  color: var(--pgf-muted-color, #9ca3af) !important;
  transition: transform 0.2s ease !important;
}

.whmp_pgf-wrapper .whmp_pgf-cselect.open .whmp_pgf-cselect-caret {
  transform: rotate(180deg) !important;
}

.whmp_pgf-wrapper .whmp_pgf-cselect-list {
  /* position/top/left/width/bottom are set dynamically in JS (see
     pgfPositionCselectList() in js/scripts.js) using position: fixed,
     computed from the trigger's actual on-screen coordinates. This lets
     the dropdown escape any ancestor with overflow:hidden/auto instead
     of being visually clipped. */
  position: fixed;
  z-index: 100060 !important;
  margin: 0 !important;
  padding: 6px !important;
  list-style: none !important;
  background: var(--pgf-card-bg, #ffffff) !important;
  border: 1px solid var(--pgf-border-color, #e5e7eb) !important;
  border-radius: var(--pgf-radius, 8px) !important;
  box-shadow: var(--pgf-shadow, 0 4px 12px rgba(0, 0, 0, 0.08)) !important;
  max-height: 260px !important;
  overflow-y: auto !important;
  display: none;
}

.whmp_pgf-wrapper .whmp_pgf-cselect.open .whmp_pgf-cselect-list {
  display: block;
}

/* Search box injected only when the select has more than 10 options
   (see CSELECT_SEARCH_THRESHOLD in js/scripts.js) */
.whmp_pgf-wrapper .whmp_pgf-cselect-search {
  width: 100% !important;
  padding: var(--pgf-input-padding, 8px 12px) !important;
  margin-bottom: 6px !important;
  border: 1px solid var(--pgf-border-color, #e5e7eb) !important;
  border-radius: var(--pgf-radius-sm, 4px) !important;
  outline: none !important;
  box-sizing: border-box !important;
  font-size: var(--pgf-font-size, 13px) !important;
  color: var(--pgf-text-color, #1a1d23) !important;
  background: var(--pgf-card-bg, #ffffff) !important;
}

.whmp_pgf-wrapper .whmp_pgf-cselect-search:focus {
  border-color: var(--pgf-primary-color, #1a4d80) !important;
  box-shadow: 0 0 0 2px rgba(26, 77, 128, 0.15) !important;
}

.whmp_pgf-wrapper .whmp_pgf-cselect-option {
  padding: var(--pgf-input-padding, 8px 12px) !important;
  border-radius: 4px !important;
  color: var(--pgf-text-color, #1a1d23) !important;
  cursor: pointer !important;
  font-size: 14px !important;
  transition:
    background 0.15s ease,
    color 0.15s ease !important;
}

.whmp_pgf-wrapper .whmp_pgf-cselect-option:hover {
  background: var(--pgf-hover-bg, #f3f4f6) !important;
}

.whmp_pgf-wrapper .whmp_pgf-cselect-option.selected {
  background: var(--pgf-primary-color, #1a4d80) !important;
  color: #ffffff !important;
}

.whmp_pgf-wrapper .whmp_pgf-cselect-option.disabled {
  opacity: 0.5;
  cursor: not-allowed !important;
}

.whmp_pgf-wrapper .whmp_pgf-cselect-list::-webkit-scrollbar {
  width: 6px;
}

.whmp_pgf-wrapper .whmp_pgf-cselect-list::-webkit-scrollbar-thumb {
  background: var(--pgf-border-color, #e5e7eb) !important;
  border-radius: 6px !important;
}

.whmp_pgf-modal,
.whmp_pgf-msd-dropdown {
  scrollbar-width: auto !important;
  scrollbar-color: var(--pgf-primary-color, #1a4d80) var(--pgf-hover-bg, #f3f4f6) !important;
}

.whmp_pgf-modal::-webkit-scrollbar,
.whmp_pgf-msd-dropdown::-webkit-scrollbar {
  width: 8px !important;
  background: var(--pgf-hover-bg, #f3f4f6) !important;
  border-radius: 8px !important;
}
.whmp_pgf-modal::-webkit-scrollbar-thumb,
.whmp_pgf-msd-dropdown::-webkit-scrollbar-thumb {
  background: var(--pgf-primary-color, #1a4d80) !important;
  border-radius: 8px !important;
}
.whmp_pgf-modal::-webkit-scrollbar-thumb:hover,
.whmp_pgf-msd-dropdown::-webkit-scrollbar-thumb:hover {
  background: var(--pgf-secondary-color, #1a4d80) !important;
}
.whmp_pgf-modal::-webkit-scrollbar-corner,
.whmp_pgf-msd-dropdown::-webkit-scrollbar-corner {
  background: var(--pgf-hover-bg, #f3f4f6) !important;
}

/* ══════════════════════════════════════════════════════════════════
   PAYMENT GATEWAY FEES — the module's own client-area pieces.

   Everything above this line is the starter template's client component
   library, unchanged. Below are only what this module prints into WHMCS's
   own pages: the checkout fee line and gateway charges table, and the
   credit notice on View Invoice. Every --pgf-* value they read is defined
   by the Client Area Styling engine (styling.php) in the <style> block
   printed after this file.
══════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════
   §1  CHECKOUT — nothing of the order form's own is restyled.
       Up to 2.3.4 this section changed the order form's own elements
       (.price-amount, .panel-check .check, #recurringMonthly) to make room
       for the fee line, which re-laid out Lagom's gateway list and the One
       Step Order Form's total. The fee now goes into the order form's own
       summary as one of its rows, or into the module's own elements below,
       so the order form keeps its layout exactly.
══════════════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════
   §2  MODULE COMPONENTS
══════════════════════════════════════════════════════════════════ */

/* The fee notice. It is an alert in every sense, so it reads the alert
   targets rather than owning a palette of its own — which is what makes it
   match whatever the active template's own success alert looks like. */
.whmp_pgf_tax_applying {
  background-color: var(--pgf-alert-success-bg, #d4edda) !important;
  border: var(--pgf-border-width, 1px) var(--pgf-border-style, solid) var(--pgf-alert-success-border, #c3e6cb) !important;
  border-radius: var(--pgf-radius, 0) !important;
  color: var(--pgf-alert-success-text, #155724) !important;
  font-size: var(--pgf-font-size, 14px) !important;
  margin: 10px 0 !important;
  padding: 10px 14px !important;
}

/* An order form that prints {$paymentGatewayFeesContent} gets the anchor even
   on a checkout where the script ends up prepending into the theme's own order
   summary instead. Without this, that unused anchor would show as a small
   empty tinted bar. */
.whmp_pgf_tax_applying:empty {
  display: none;
}

/* The fee rows the standard carts get above their "Total Due Today" line,
   and the module's own panel on an order form with no summary list. They
   read the alert's own ink, so they sit in the alert box as its text does. */
.whmp_pgf-gateway-text {
  margin: 0 auto 8px auto !important;
  max-width: 420px !important;
  padding-bottom: 8px !important;
  border-bottom: var(--pgf-border-width, 1px) var(--pgf-border-style, solid) currentColor !important;
  font-size: var(--pgf-font-size, 14px) !important;
  line-height: 1.6 !important;
  text-align: left !important;
}

.whmp_pgf_tax_applying .whmp_pgf-gateway-text {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  border-bottom: 0 !important;
}

.whmp_pgf-summary-item {
  display: flex;
  justify-content: space-between !important;
  align-items: baseline !important;
  gap: 12px !important;
}

.whmp_pgf-summary-name {
  font-weight: 400 !important;
  text-align: left !important;
}

.whmp_pgf-summary-price {
  font-weight: 600 !important;
  text-align: right !important;
  white-space: nowrap !important;
}

/* Shown while the fee for a newly chosen gateway loads. Inline, so it can sit
   inside a total that is a bare amount. */
.whmp_pgf-checkout-loader {
  display: inline-block;
  margin: 0 6px !important;
  font-size: var(--pgf-font-size, 14px) !important;
  color: var(--pgf-icon-color, inherit) !important;
}

#paymentGatewaysContainer + .whmp_pgf-checkout-loader {
  display: block;
  text-align: center !important;
  padding: 8px !important;
}

.whmp_pgf-table-container-checkout {
  overflow-x: auto !important;
}

/* The table styles itself entirely from the --pgf-table-* targets, mapped per
   template in the Client Area Customization tab. Up to 2.3.4 it also carried
   the theme's own `table table-striped`, whose margins and stripes differ per
   template and fought these rules. */
.whmp_pgf-table-container-checkout {
  margin: 10px 0 !important;
}

.whmp_pgf-checkout-table {
  width: 100% !important;
  margin: 0 !important;
  font-size: var(--pgf-font-size, 14px) !important;
  border-collapse: collapse !important;
}

.whmp_pgf-checkout-table th,
.whmp_pgf-checkout-table td {
  padding: var(--pgf-cell-padding, 8px) !important;
  border-bottom: var(--pgf-border-width, 1px) var(--pgf-border-style, solid) var(--pgf-table-border, #dee2e6) !important;
  text-align: left !important;
  vertical-align: middle !important;
}

.whmp_pgf-checkout-table th {
  background-color: var(--pgf-table-header-bg, transparent) !important;
  color: var(--pgf-table-header-text, inherit) !important;
  font-weight: var(--pgf-font-weight, 600) !important;
}

.whmp_pgf-checkout-table td {
  background-color: var(--pgf-table-row-bg, transparent) !important;
  color: var(--pgf-table-text, inherit) !important;
}

.whmp_pgf-checkout-table tbody tr:nth-of-type(odd) td {
  background-color: var(--pgf-table-row-alt-bg, transparent) !important;
}

.whmp_pgf-checkout-table td:last-child,
.whmp_pgf-checkout-table th:last-child {
  text-align: right !important;
  white-space: nowrap !important;
}

/* View Invoice: the "you cannot apply more credit than this" hint. */
.whmp_pgf-credit-limit-notice {
  color: var(--pgf-alert-danger-text, #dc3545) !important;
  font-size: var(--pgf-font-size-sm, 12px) !important;
  margin-top: 5px !important;
  display: none;
}

.whmp_pgf-credit-limit-notice.whmp_pgf-visible {
  display: block;
}

/*
==========================================================================
   Responsive Design Breakpoints Guidelines & Overrides:
==========================================================================
   SOP Rule: The client area must be designed and styled to show correctly
   on all viewport sizes (Mobile, Tablet, Laptop, and Big Desktop).
*/

/* 1. Mobile Screens (Smartphones, max-width: 576px) */
@media (max-width: 576px) {
  .whmp_pgf_tax_applying {
    padding: 8px 10px !important;
    font-size: var(--pgf-font-size-sm, 13px) !important;
  }

  .whmp_pgf-checkout-table th,
  .whmp_pgf-checkout-table td {
    padding: 6px 8px !important;
    font-size: var(--pgf-font-size-sm, 12px) !important;
  }
}

/* 2. Tablet Screens (min-width: 577px and max-width: 768px) */
@media (min-width: 577px) and (max-width: 768px) {
  .whmp_pgf-checkout-table th,
  .whmp_pgf-checkout-table td {
    font-size: var(--pgf-font-size-sm, 13px) !important;
  }
}

/* 3. Laptop Screens (min-width: 769px and max-width: 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .whmp_pgf_tax_applying {
    padding: 8px 12px !important;
  }
}

/* 4. Big Desktop Screens (min-width: 1025px) */
@media (min-width: 1025px) {
  .whmp_pgf-table-container-checkout {
    margin-top: 10px !important;
  }
}
