/** Overrides Primefaces 8 Reflow Behavior - Adds earlier reflow to larger tables **/
/** #PFCUSTOM - Should be updated to match source of .ui-datatable-reflow section in file datatable.css **/
@media (min-width: 641px) and (max-width: 900px) {
    .ui-datatable-reflow-lg-table {
        min-width: 0;
    }
    
    .ui-datatable-reflow-lg-table thead th,
    .ui-datatable-reflow-lg-table tfoot td {
        display: none;
    }

    .ui-datatable-reflow-lg-table .ui-datatable-data td[role="gridcell"]:not(.ui-helper-hidden) { 
        text-align: left;
        display: block;
        border: 0px none;
        width: 100%;
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
        float: left;
        clear: left;
    }
    
    .ui-datatable-reflow-lg-table .ui-datatable-data.ui-widget-content {
        border: 0px none;
    }
    
    .ui-datatable-reflow-lg-table .ui-datatable-data tr.ui-widget-content {
        border-left: 0px none;
        border-right: 0px none;
    }

    .ui-datatable-reflow-lg-table .ui-datatable-data td[role="gridcell"] .ui-column-title { 
        padding: .4em; 
        min-width: 30%; 
        display: inline-block;
        margin: -.4em 1em -.4em -.4em;
    }
    
    .ui-datatable-reflow-lg-table .ui-reflow-label,
    .ui-datatable-reflow-lg-table .ui-reflow-dropdown {
        display: inline-block;
    }
    
    .ui-datatable-reflow-lg-table .ui-reflow-dropdown {
        margin-left: 5px;
        border-top-left-radius: 3px;
        border-bottom-left-radius: 3px;
    }
    
    .ui-datatable-reflow-lg-table tr.ui-datatable-empty-message > td {
        display: block;
        border: 0 none;
    }
}

/** Overrides Primefaces 8 Reflow Behavior - Adds earlier reflow to larger tables **/
/** #PFCUSTOM - Should be updated to match source of .ui-datatable-reflow section in file datatable.css **/
    .ui-datatable-always-reflow {
        min-width: 0;
    }
    
    .ui-datatable-always-reflow thead th,
    .ui-datatable-always-reflow tfoot td {
        display: none;
    }

    .ui-datatable-always-reflow .ui-datatable-data td[role="gridcell"]:not(.ui-helper-hidden) { 
        text-align: left;
        display: block;
        border: 0px none;
        width: 100%;
        -webkit-box-sizing: border-box;
        -moz-box-sizing: border-box;
        box-sizing: border-box;
        float: left;
        clear: left;
    }
    
    .ui-datatable-always-reflow .ui-datatable-data.ui-widget-content {
        border: 0px none;
    }
    
    .ui-datatable-always-reflow .ui-datatable-data tr.ui-widget-content {
        border-left: 0px none;
        border-right: 0px none;
    }

    .ui-datatable-always-reflow .ui-datatable-data td[role="gridcell"] .ui-column-title { 
        padding: .4em; 
        min-width: 30%; 
        display: inline-block;
        margin: -.4em 1em -.4em -.4em;
    }
    
    .ui-datatable-always-reflow .ui-reflow-label,
    .ui-datatable-always-reflow .ui-reflow-dropdown {
        display: inline-block;
    }
    
    .ui-datatable-always-reflow .ui-reflow-dropdown {
        margin-left: 5px;
        border-top-left-radius: 3px;
        border-bottom-left-radius: 3px;
    }
    
    .ui-datatable-always-reflow tr.ui-datatable-empty-message > td {
        display: block;
        border: 0 none;
    }

/** #PFCUSTOM - Allows the content to overlflow on large tables rather than collapse **/
/** This is the key to having the horizontal scrollbar of a datatable work properly in our theme **/
.ui-datatable-reflow-lg-table {
    overflow: auto;
}

/* Minimum width for a column HEADER in a large table. Override setting width on class (see .ui-datatable-datetime). Do not override on style as this breaks reflow */
.ui-datatable-reflow-lg-table thead th {
    width: 75px;
}

/* Minimum width for a column FOOTER in a large table. Override setting width on class (see .ui-datatable-datetime). Do not override on style as this breaks reflow */
.ui-datatable-reflow-lg-table tfoot tr td {
    width: 75px;
    text-align: left;
}

.ui-datatable-reflow-lg-table .ui-datatable-datetime, .ui-datatable-datetime {
    width: 130px;
}

.ui-datatable-reflow-lg-table .ui-datatable-xxlarge, .ui-datatable-xxlarge {
    width: 400px;
}

.ui-datatable-reflow-lg-table .ui-datatable-xlarge, .ui-datatable-xlarge {
    width: 300px;
}

.ui-datatable-reflow-lg-table .ui-datatable-215, .ui-datatable-215 {
    width: 215px;
}

.ui-datatable-reflow-lg-table .ui-datatable-large, .ui-datatable-large {
    width: 200px;
}

.ui-datatable-reflow-lg-table .ui-datatable-medium, .ui-datatable-medium {
    width: 100px;
}

.ui-datatable-reflow-lg-table .ui-datatable-xsmall, .ui-datatable-xsmall {
    width: 40px;
}

.ui-datatable-reflow-lg-table .ui-datatable-small, .ui-datatable-small {
    width: 50px;
}

.ui-datatable-reflow-lg-table .ui-datatable-xmedium, .ui-datatable-xmedium {
    width: 55px;
}

.ui-datatable-reflow-lg-table .ui-datatable-checkbox, .ui-datatable-checkbox {
    width: 18px;
    text-align: center;
}

@media (max-width: 900px) {
    .ui-datatable-reflow-lg-table-hide {
        display: none;
    }
}

.rowtoggle {
    width: 30px;
}

.ui-datatable tbody td {
    overflow: auto;
}

/** #PFCUSTOM - Sets the width of reflow to 100% on fixed scrollWidth tables **/
@media (max-width: 900px) {
    .ui-datatable-reflow-lg-table .ui-datatable-scrollable-body {
        width: 100% !important;
    }
    
    .ui-datatable-reflow-lg-table .ui-paginator {
        width: 100% !important;
    }
}

#noGpsDialog {
    max-width: 500px;
}

/** #PFCUSTOM - Sets max-width to dialogs by id for dialog framwork. Move to dialog framework if PF adds maxWidth **/
#myAccountForm\:updateSecurityQuestion_dlg,
#myAccountForm\:editPersonalInfo_dlg,
#myAccountForm\:changePassword_dlg,
#alertDistributionForm\:distributionFrequency_dlg,
#BcfValidationForm\:createButton_dlg,
#BcfValidationForm\:editButton_dlg,
#AutoReportsListForm\:createButton_dlg,
#AutoReportsListForm\:editButton_dlg,
#AutoReportsListForm\:createCustomButton_dlg,
#AutoReportsListForm\:createCustomButton_dlg,
#EpdMapsForm\:createButton_dlg,
#EpdMapsForm\:editButton_dlg,
#LocomotiveListForm\:createButton_dlg,
#LocomotiveListForm\:editButton_dlg,
#OcuListForm\:createButton_dlg,
#OcuListForm\:editButton_dlg,
#PspMapsForm\:createButton_dlg,
#PspMapsForm\:editButton_dlg,
#rfRepeaterListForm\:createButton_dlg,
#rfRepeaterListForm\:editButton_dlg,
#gatewayListForm\:editButton_dlg,
#gatewayListForm\:provisionButton_dlg,
#assetListForm\:editButton_dlg,
#assetListForm\:assetMappingButton_dlg {
    max-width: 700px;
}

#RailYardGroupListForm\:createButton_dlg,
#RailYardGroupListForm\:editButton_dlg,
#messengerListForm\:editButton_dlg,
#messengerListForm\:provisionButton_dlg {
    max-width: 800px;
}

#BcfValidationForm\:createButton_dlg,
#BcfValidationForm\:editButton_dlg,
#PspMapsForm\:createButton_dlg,
#PspMapsForm\:editButton_dlg,
#RailYardGroupListForm\:createButton_dlg,
#RailYardGroupListForm\:editButton_dlg {
    max-height: 380px;
}

#messengerListForm\:editButton_dlg,
#messengerListForm\:provisionButton_dlg {
    max-height: 470px;
}

#OcuListForm\:createButton_dlg,
#OcuListForm\:editButton_dlg {
    max-height: 350px;
}

#AutoReportsListForm\:createButton_dlg,
#AutoReportsListForm\:editButton_dlg,
#AutoReportsListForm\:createCustomButton_dlg,
#AutoReportsListForm\:createCustomButton_dlg
{
    max-height: 680px;
}

#myAccountForm\:updateSecurityQuestion_dlg,
#myAccountForm\:editPersonalInfo_dlg,
#myAccountForm\:changePassword_dlg,
#alertDistributionForm\:distributionFrequency_dlg,
#EpdMapsForm\:createButton_dlg,
#EpdMapsForm\:editButton_dlg {
    max-height: 315px;
}

#LocomotiveListForm\:createButton_dlg,
#LocomotiveListForm\:editButton_dlg {
    max-height: 600px;
}

#rfRepeaterListForm\:createButton_dlg,
#rfRepeaterListForm\:editButton_dlg {
    max-height: 760px;
}

#myAccountForm\:editPersonalInfo_dlg,
#gatewayListForm\:editButton_dlg,
#gatewayListForm\:provisionButton_dlg {
    max-height: 320px;
}

#assetListForm\:editButton_dlg,
#assetListForm\:assetMappingButton_dlg {
    max-height: 275px;
}

#myAccountForm\:changePassword_dlg,
#myAccountForm\:updateSecurityQuestion_dlg {
    max-height: 210px;
}

#PspMapsForm\:associateYardButton_dlg {
    max-width: 400px;
}

#gatewayHistoryForm\:gatewayHistoryDialog {
    max-width: 1100px;
}

/** Password toggle mask icon styles (Paradise theme designer/_password.scss) **/
body .ui-password .ui-password-icon {
    cursor: pointer;
}

body .ui-password.ui-password-masked .ui-password-icon {
    font-family: 'primeicons' !important;
    speak: none;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    display: inline-block;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-indent: 0 !important;
    background-image: none !important;
}

body .ui-password.ui-password-masked .ui-password-icon:before {
    content: "\e966";
}

body .ui-password.ui-password-unmasked .ui-password-icon {
    font-family: 'primeicons' !important;
    speak: none;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    display: inline-block;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-indent: 0 !important;
    background-image: none !important;
}

body .ui-password.ui-password-unmasked .ui-password-icon:before {
    content: "\e965";
}

/** Keep password fields full-width in grid and login layouts **/
.login-body .login-panel .input-wrapper .ui-password {
    display: block;
    width: 100%;
}

.login-body .login-panel .input-wrapper .ui-password .ui-inputfield {
    width: 100%;
}

/** Password wrapper inside a PrimeFlex column (toggleMask puts grid class on input, not wrapper) **/
[class*="p-col-"] > .ui-password.ui-input-icon-right {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

/** Plain password input when toggleMask is off (e.g. auto-generate disabled state) **/
[class*="p-col-"] > input.ui-inputfield[type="password"] {
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.ui-password.ui-input-icon-right > .ui-inputfield {
    width: 100%;
    box-sizing: border-box;
    padding-right: 2rem;
}

.ui-password.ui-input-icon-right > .ui-inputfield:disabled ~ .ui-password-icon {
    display: none;
    pointer-events: none;
}