/* NABIC GLOBAL LAYOUT PREVIEW */

body:has(.nabic-global-preview) {
    background: #fff;
}

/* Hide the original EmyUI public header */
body:has(.nabic-global-preview) header.site-header {
    display: none !important;
}

/* Hide original hero/banner */
body:has(.nabic-global-preview) .hero-area-header-banner {
    display: none !important;
}

/* Hide original EmyUI footer */
body:has(.nabic-global-preview) .footer-gradient-default {
    display: none !important;
}

/* New header */
body:has(.nabic-global-preview) .nabic-global-preview {
    position: relative;
    z-index: 100;
    width: 100%;
}

/* New footer */
body:has(.nabic-global-preview) #nabic-global-footer-preview {
    display: block;
    width: 100%;
    position: relative;
    z-index: 2;
}

/* Main content */
body:has(.nabic-global-preview) #main-body {
    padding-top: 30px;
}

/* Prevent old header spacing */
body:has(.nabic-global-preview) .site-wrapper {
    padding-top: 0 !important;
}

/* Global footer preview fixes */
body:has(.nabic-global-preview) .nabic-global-footer-preview {
    width: 100%;
    overflow: hidden;
}

body:has(.nabic-global-preview) .nabic-global-footer-preview .nb4-footer {
    width: 100%;
}

body:has(.nabic-global-preview) .nabic-global-footer-preview .nb4-footer-v3-logo {
    max-width: 180px;
    width: 100%;
    height: auto;
}

/* Login page layout fixes */
body:has(.nabic-global-preview) {
    overflow-x: hidden;
}

body:has(.nabic-global-preview) .site-wrapper {
    min-height: 0 !important;
    height: auto !important;
}

body:has(.nabic-global-preview) #main-body {
    min-height: 0 !important;
    height: auto !important;
}

/* Prevent login artwork from extending beyond the content */
body:has(.nabic-global-preview) .site-wrapper > section {
    height: auto !important;
}

/* Footer spacing */
body:has(.nabic-global-preview) .nabic-global-footer-preview {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    clear: both;
}

/* Remove trailing empty space */
body:has(.nabic-global-preview) .site-wrapper {
    margin-bottom: 0 !important;
}

/* Login page layout fixes */
body:has(.nabic-global-preview) {
    overflow-x: hidden;
}

body:has(.nabic-global-preview) .site-wrapper {
    min-height: 0 !important;
    height: auto !important;
}

body:has(.nabic-global-preview) #main-body {
    min-height: 0 !important;
    height: auto !important;
}

/* Prevent login artwork from extending beyond the content */
body:has(.nabic-global-preview) .site-wrapper > section {
    height: auto !important;
}

/* Footer spacing */
body:has(.nabic-global-preview) .nabic-global-footer-preview {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    clear: both;
}

/* Remove trailing empty space */
body:has(.nabic-global-preview) .site-wrapper {
    margin-bottom: 0 !important;
}

/* NABIC - Centered password login */

body:has(.nabic-global-preview):has(form[action*="login-validate"])
#main-body .row > [class*="col-"] {
    display: none !important;
}

body:has(.nabic-global-preview):has(form[action*="login-validate"])
#main-body .row > [class*="col-"]:has(form[action*="login-validate"]) {
    display: block !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
}

body:has(.nabic-global-preview):has(form[action*="login-validate"])
form[action*="login-validate"] {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
}

body:has(.nabic-global-preview):has(form[action*="login-validate"])
#main-body {
    padding: 65px 20px 85px !important;
}


/* NABIC PASSWORD LOGIN - REMOVE RIGHT PANEL */

body:has(.nabic-global-preview):has(form[action*="login-validate"])
#main-body .row:has(form[action*="login-validate"]) {
    display: flex !important;
    justify-content: center !important;
}

/* Hide the entire right-hand information panel */
body:has(.nabic-global-preview):has(form[action*="login-validate"])
#main-body .row:has(form[action*="login-validate"]) > :not(:has(form[action*="login-validate"])) {
    display: none !important;
}

/* Center the column containing the login form */
body:has(.nabic-global-preview):has(form[action*="login-validate"])
#main-body .row:has(form[action*="login-validate"]) > :has(form[action*="login-validate"]) {
    display: block !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 auto !important;
}

/* Center form itself */
body:has(.nabic-global-preview):has(form[action*="login-validate"])
form[action*="login-validate"] {
    max-width: 460px !important;
    width: 100% !important;
    margin: 0 auto !important;
}

/* NABIC FOOTER SPACING FIX */
.nabic-global-footer-preview {
    min-height: 0 !important;
    height: auto !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.nabic-global-footer-preview .nb4-footer {
    min-height: 0 !important;
    height: auto !important;
    padding-bottom: 24px !important;
    margin-bottom: 0 !important;
}

body:has(.nabic-global-footer-preview) .site-wrapper {
    min-height: 0 !important;
}

body:has(.nabic-global-footer-preview) {
    min-height: 0 !important;
}
