/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */
 /**
 * All of the CSS for your admin-specific functionality should be
 * included in this file.
 */
 /* converts input to albel */


/* Ensure high specificity */
input.as-label {
    border: none !important;
    background: none !important;
    color: inherit !important;
    font-size: inherit !important;
    font-family: inherit !important;
    font-weight: bolder;
    padding: 2px !important;
    margin: 0 !important;
    outline: none !important;
    pointer-events: none !important; /* Make it non-interactive */
    width: auto !important; /* Adjust width as needed */
    display: inline-block !important; /* Ensure it behaves like a label */
    vertical-align: middle !important; /* Align vertically with other elements */
    line-height: normal !important; /* Ensure consistent line height */

}
input.as-dashed-line {
    border: none !important;
    border-bottom: 1px dashed !important; /* Add dashed bottom border */
    background: none !important;
    color: inherit !important;
    font-size: inherit !important;
    font-family: inherit !important;
    font-weight: bolder;
    padding: 2px !important;
    margin: 0 !important;
    outline: none !important;
    width: auto !important; /* Adjust width as needed */
    display: inline-block !important; /* Ensure it behaves like a label */
    vertical-align: middle !important; /* Align vertically with other elements */
    line-height: normal !important; /* Ensure consistent line height */
}


/* Ensure draggable items have relative positioning for absolute icons */
/* .col.draggable-item,
.draggable-item {
    position: relative;
} */

/* Field hover icons container - dynamically injected on hover */
.ezwp-field-hover-icons {
    display: flex;
    flex-direction: row;
    position: absolute;
    top: 2px;
    right: 2px;
    z-index: 1000;
    background: rgba(13, 110, 253, 0.08);
    border: none;
    border-radius: 4px;
    padding: 4px;
    gap: 8px;
    align-items: center;
    box-shadow: 0 1px 4px rgba(13, 110, 253, 0.15);
}

.ezwp-field-hover-icons .hover-icon-btn {
    all: unset;
    display: inline-block;
    cursor: pointer;
    padding: 4px;
    color: #666;
    font-size: 16px;
    line-height: 1;
    transition: color 0.2s ease;
}

.ezwp-field-hover-icons .hover-icon-btn:hover {
    color: #333;
}

.ezwp-field-hover-icons .hover-icon-btn.delete-btn:hover {
    color: #dc3545;
}

.ezwp-field-hover-icons .hover-icon-btn.copy-btn:hover {
    color: #0d6efd;
}

.ezwp-field-hover-icons .hover-icon-btn.hide-btn:hover {
    color: #ffc107;
}

.ezwp-field-label{
    /* make bold */
     font-weight: bold;
   
 }
 

 /* form style  */
.ezwpform-form-container-styles {
    padding: 20px;
   
}

/* Override Bootstrap col-md (768px) threshold for form rows.
   Force single-column layout on all phones and tablets — only go
   multi-column at the lg breakpoint (992px) and above. */
@media (max-width: 991.98px) {
  .ezwpform-form-container-styles .col-md {
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Checkbox and Radio Button Styles make sure they align properly */
.form-check {
  display: flex;
  align-items: center;
}

.form-check-input {
  margin-top: 0; /* Remove default vertical offset */
}

.form-check-label {
  margin-bottom: 0; /* Prevent label from dropping */
  line-height: 1;   /* Optional: tighten vertical spacing */
}

/* =========================================
   Conditional Logic UI Styles
   ========================================= */

/* Root logic container */
#id_logic_root_div {
  padding: 8px 0;
}

/* Enable checkbox row */
#id_cond_logic_chk_box_div {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f0f7ff;
  border: 1px solid #cce0ff;
  border-radius: 6px;
  margin-bottom: 16px;
}

#id_cond_logic_chk_box_div input[type="checkbox"] {
  margin: 0 !important;
  width: 18px;
  height: 18px;
}

#id_cond_logic_chk_box_div label {
  margin: 0 !important;
  font-weight: 600;
  color: #333;
}

/* Logic definition container */
div[divtype="logic_def"] {
  padding: 0;
  margin: 0;
}

/* Flex container for inline elements */
.ezwp-flex-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 100% !important;
}

/* Action wrapper - outer container */
div[divtype="action_div"] {
  background: #fff;
  border: 1px solid #d0d7de;
  border-left: 4px solid #0d6efd;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* Action header row */
div[divtype="action_div"] > .row:first-child {
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px dashed #dee2e6;
}

/* Labels in action header */
div[divtype="action_div"] .ezwp-flex-container > label {
  font-weight: 600;
  color: #495057;
  margin: 0;
  white-space: nowrap;
}

.ezwp-settings-label-emphesis {
  color: #0d6efd !important;
  font-weight: 500 !important;
}

/* OR group container */
div[divtype="or_group_div"] {
  margin-top: 8px;
}

/* OR row container */
div[divtype="or_row_div"] {
  margin-bottom: 4px;
}

/* Each AND condition row */
div[divtype="and_row_div"] {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
  transition: all 0.15s ease;
}

div[divtype="and_row_div"]:hover {
  background: #fff;
  border-color: #0d6efd;
  box-shadow: 0 2px 8px rgba(13, 110, 253, 0.12);
}

/* Override Bootstrap col-4 to be flexible */
div[divtype="and_row_div"] > .col-4 {
  flex: 1 1 auto;
  max-width: 100%;
  width: auto;
}

/* Combo box wrappers in flex container */
.ezwp-flex-container > div.mx-1,
.ezwp-flex-container > div {
  flex: 0 1 auto;
}

/* Dropdowns - responsive sizing */
.ezwp-flex-container select.form-select {
  min-width: 110px;
  max-width: 200px;
  flex: 1 1 130px;
  font-size: 0.9rem;
}

/* Text/number inputs */
.ezwp-flex-container input[type="text"],
.ezwp-flex-container input[type="number"] {
  min-width: 80px;
  max-width: 120px;
  font-size: 0.9rem;
}

/* Buttons inside AND row */
.ezwp-flex-container > button {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 4px 12px;
  font-size: 0.85rem;
}

/* OR label styling */
div[divtype="or_group_div"] > label {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px 0;
  color: #6c757d;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-transform: uppercase;
}

div[divtype="or_group_div"] > label::before,
div[divtype="or_group_div"] > label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #adb5bd 30%, #adb5bd 70%, transparent);
  margin: 0 12px;
}

/* HR separator */
div[divtype="or_group_div"] > hr {
  margin: 20px 0 16px 0;
  border: 0;
  border-top: 1px solid #dee2e6;
}

/* Add OR Group button */
div[divtype="or_group_div"] > button {
  margin-top: 10px;
  font-size: 0.85rem;
}

/* New Action button */
div[divtype="logic_def"] > button {
  margin-top: 16px;
}

/* Z-order fix for dropdowns */
.ezwp-z-order-top {
  position: relative;
  z-index: 10;
}

/* Responsive: Small screens */
@media (max-width: 600px) {
  .ezwp-flex-container {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  
  .ezwp-flex-container select.form-select,
  .ezwp-flex-container input {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 100% !important;
  }
  
  .ezwp-flex-container > button {
    width: 100%;
  }
  
  div[divtype="and_row_div"] {
    padding: 12px;
  }
}

/* Responsive: Medium screens */
@media (min-width: 601px) and (max-width: 900px) {
  .ezwp-flex-container select.form-select {
    min-width: 120px;
    max-width: 160px;
    flex: 1 1 130px;
  }
}

/* Responsive: Large screens - grow more */
@media (min-width: 901px) {
  .ezwp-flex-container select.form-select {
    min-width: 140px;
    max-width: 240px;
    flex: 1 1 160px;
  }
  
  .ezwp-flex-container input[type="text"],
  .ezwp-flex-container input[type="number"] {
    min-width: 100px;
    max-width: 160px;
  }
}

/* Property Panel Checkbox Styling */
.form-control-checkbox {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    vertical-align: middle;
    cursor: pointer;
    accent-color: #0d6efd;
}

.form-control-checkbox + label {
    cursor: pointer;
    user-select: none;
    margin-bottom: 0;
    vertical-align: middle;
}

/* =========================================
   jQuery Validation Error Styling
   ========================================= */

/* Error message labels - highest specificity */
label.error,
.error.error,
label.error.error {
    display: block !important;
    color: #dc3545 !important;
    font-size: 0.875em !important;
    margin-top: 0.25rem !important;
    font-weight: normal !important;
    font-style: italic !important;
    background-color: transparent !important;
    border: none !important;
    padding-left: 0 !important;
}

/* Input fields with errors - exclude grid fields */
input.error:not([fldtype="ezwp_grid"]),
textarea.error:not([fldtype="ezwp_grid"]),
select.error:not([fldtype="ezwp_grid"]) {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* Focus state for error fields */
input.error:focus:not([fldtype="ezwp_grid"]),
textarea.error:focus:not([fldtype="ezwp_grid"]),
select.error:focus:not([fldtype="ezwp_grid"]) {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25) !important;
    outline: none !important;
}

/* Radio and checkbox error containers */
.form-check input[type="radio"].error,
.form-check input[type="checkbox"].error {
    border-color: #dc3545 !important;
    outline: 2px solid #dc3545 !important;
}

/* Field error styling for custom fields */
.ezwp-field-error:not([fldtype="ezwp_grid"]) {
    border-color: #dc3545 !important;
}

/* File upload error styling */
label.ezwp-file-upload-error,
.ezwp-file-upload-error.error {
    display: block !important;
    color: #dc3545 !important;
    font-size: 0.875em !important;
    margin-top: 0.25rem !important;
    font-weight: normal !important;
}
/* Summernote Modal Fixes - Ensure modals appear above scrollable container */
.note-modal.modal-backdrop {
    position: fixed !important;
    z-index: 9999 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Summernote dialog */
.note-modal {
    z-index: 10001 !important;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
}

.note-modal.modal {
    z-index: 10001 !important;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
}

.note-modal .note-modal-content {
    z-index: 10001 !important;
}

/* Bootstrap modal fixes for Summernote */
.modal.in,
.modal.show {
    z-index: 10001 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.modal-backdrop {
    z-index: 10000 !important;
    opacity: 0.5 !important;
}

.modal-backdrop.show {
    z-index: 10000 !important;
    opacity: 0.5 !important;
}

/* Ensure body doesn't get locked */
body.modal-open {
    overflow: auto !important;
}

/* Summernote dialog positioning */
.summernote-dialog {
    position: fixed !important;
    z-index: 10001 !important;
}

/* Ensure Summernote popovers and tooltips are visible */
.popover,
.note-popover {
    z-index: 10002 !important;
    position: fixed !important;
    pointer-events: auto !important;
}

.tooltip {
    z-index: 10002 !important;
}

/* Fix Summernote link dialog */
.note-dialog {
    z-index: 10001 !important;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
}

/* Ensure color picker appears properly */
.note-color-picker {
    z-index: 10003 !important;
    position: fixed !important;
}

/* Ensure all inputs in dialogs are accessible */
.note-modal input,
.note-modal button,
.note-modal .form-control,
.note-dialog input,
.note-dialog button,
.note-dialog .form-control {
    pointer-events: auto !important;
}

/* =========================================
   Grid — duration, currency, formula, totals
   ========================================= */

/* Duration input — narrow, no spinner */
.ezwp-grid-duration {
    text-align: center;
    min-width: 74px;
}

/* Fixed table layout so th widths (set via column config) are respected at all times,
   preventing columns from collapsing to content-width when cells are in display mode. */
.ezwp-grid-table {
    table-layout: fixed;
    width: 100%;
}

/* Text/number display cells: truncate overflow with ellipsis, show full text as tooltip */
.ezwp-grid-cell-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Currency input-group — keep symbol flush */
.ezwp-grid-table .input-group.input-group-sm {
    flex-wrap: nowrap;
}
.ezwp-grid-table .input-group-text.ezwp-currency-symbol {
    padding: 0 6px;
    font-weight: 600;
    background: #f8f9fa;
}

/* Formula cell — styled like a disabled input, clearly read-only */
.ezwp-grid-formula-cell {
    background-color: #f0f4ff !important;
    color: #0d47a1;
    font-weight: 600;
    cursor: default !important;
    user-select: none;
    min-width: 60px;
    text-align: right;
}

/* Totals tfoot row */
.ezwp-grid-totals-row td {
    background-color: #e9ecef;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 5px 8px;
    border-top: 2px solid #adb5bd !important;
}
.ezwp-grid-totals-row td:first-child {
    color: #495057;
    font-style: italic;
}

/* Mobile: currency stays inline, formula full-width */
@media (max-width: 576px) {
    .ezwp-grid-table tbody td .input-group.input-group-sm {
        flex: 1 1 auto;
        min-width: 0;
    }
    .ezwp-grid-formula-cell {
        flex: 1 1 auto;
        min-width: 0;
        width: 100% !important;
    }
}

/* =========================================
   Responsive Grid — card layout on mobile
   ========================================= */
@media (max-width: 576px) {
    /* Hide only the column-name header cells; keep the action th (+ button) visible */
    .ezwp-grid-table thead th:not([data-col-type="actions"]) {
        display: none;
    }

    /* Let the action th (+ button) span full width and align right */
    .ezwp-grid-table thead th[data-col-type="actions"] {
        display: block;
        width: 100%;
        text-align: right;
        border: none;
        background: transparent;
        padding: 4px 6px;
    }

    /* Each row becomes a card */
    .ezwp-grid-table tbody tr {
        display: block;
        border: 1px solid #dee2e6;
        border-radius: 6px;
        margin-bottom: 10px;
        padding: 4px 0;
        background: #fff;
    }

    /* Each cell becomes a full-width flex row */
    .ezwp-grid-table tbody td {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 6px 10px;
        border: none;
        border-bottom: 1px solid #f0f0f0;
        width: 100%;
        box-sizing: border-box;
    }

    .ezwp-grid-table tbody td:last-child {
        border-bottom: none;
        justify-content: flex-end;
    }

    /* Column header label shown before the cell content */
    .ezwp-grid-table tbody td[data-label]::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.78rem;
        color: #495057;
        white-space: nowrap;
        flex: 0 0 auto;
        min-width: 80px;
        max-width: 40%;
    }

    /* No label on the actions column (last td, no data-label set by JS) */
    .ezwp-grid-table tbody td:not([data-label])::before {
        content: none;
    }

    /* Inputs, selects and label-divs fill remaining space */
    .ezwp-grid-table tbody td input:not([type="checkbox"]),
    .ezwp-grid-table tbody td select,
    .ezwp-grid-table tbody td .ezwp-grid-cell-label {
        flex: 1 1 auto;
        min-width: 0;
        width: 100% !important;
    }

    /* Checkboxes stay natural size */
    .ezwp-grid-table tbody td input[type="checkbox"] {
        flex: 0 0 auto;
        width: auto !important;
    }
}

/* =========================================
   Sticky first column
   ========================================= */
.ezwp-grid-sticky-col .table-responsive {
    overflow-x: auto !important;
}

/* Override the inline overflow:hidden on the table element.
   That inline style creates a sticky context that traps position:sticky
   and prevents it from looking up to .table-responsive (the real scroller). */
.ezwp-grid-sticky-col .ezwp-grid-table {
    overflow: visible !important;
}

.ezwp-grid-sticky-col .ezwp-grid-table > thead > tr > th:first-child,
.ezwp-grid-sticky-col .ezwp-grid-table > tbody > tr > td:first-child,
.ezwp-grid-sticky-col .ezwp-grid-table > tfoot > tr > td:first-child {
    position: sticky !important;
    left: 0 !important;
    z-index: 2;
    background-color: #fff !important;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.ezwp-grid-sticky-col .ezwp-grid-table > thead > tr > th:first-child {
    z-index: 3;
}

/* =========================================
   Scrollable rows (maxVisibleRows setting)
   ========================================= */

/* Scrollable wrapper: height is set inline via JS using --ezwp-grid-max-h */
.ezwp-grid-scroll .table-responsive {
    max-height: var(--ezwp-grid-max-h, none);
    overflow-y: auto !important;
    /* Keep horizontal behaviour intact */
    overflow-x: auto;
}

/* Sticky header inside the scrollable container */
.ezwp-grid-scroll .ezwp-grid-table > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Bump z-index when BOTH sticky-col and scroll-rows are active */
.ezwp-grid-scroll.ezwp-grid-sticky-col .ezwp-grid-table > thead > tr > th:first-child {
    z-index: 4;
}

/* On mobile the responsive card layout stacks rows — vertical scroll applies
   to the wrapper itself, not a theoretical table height, so just ensure
   overflow is set and the header is still readable. */
@media (max-width: 576px) {
    .ezwp-grid-scroll .table-responsive {
        max-height: var(--ezwp-grid-max-h, none);
        overflow-y: auto !important;
    }
    /* In card layout thead is hidden, so no sticky header needed */
    .ezwp-grid-scroll .ezwp-grid-table > thead > tr > th {
        position: static;
    }
}