/**
 * ZERTI admin layer: zerti-base.css
 * #zertiAdmin root, checkboxes, badges, theme backgrounds, links
 * Loaded via assets/css/zerti-admin.css manifest and includes/admin/assets.php.
 * @see docs/DESIGN-SYSTEM.md
 */


#zertiAdmin {
    /* Bootstrap 5.3+ can set a fixed card width; keep panels full-bleed inside main. */
    --bs-card-width: 100%;
    /* Brand, spacing, surfaces: assets/css/zerti-tokens.css */
    /* Force Vazirmatn for the whole shell (themes must not swap the typeface). */
    --zerti-font-family: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-family: var(--zerti-font-family);
    font-size: var(--zerti-font-size-base);
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: none;
    /* Same node as .wrap: fill locked viewport height so backgrounds are not content-sized. */
    min-height: 100%;
    height: 100%;
    flex: 1 1 auto;
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    direction: rtl;
    text-align: right;
}

#zertiAdmin[dir='rtl'] {
    --zerti-select-pad-inline-start: 0.5rem;
    --zerti-select-pad-inline-end: 1.85rem;
    --zerti-select-chevron-pos: left 0.55rem center;
    --zerti-select-text-align: right;
}

#zertiAdmin[dir='ltr'] {
    direction: ltr;
    text-align: left;
    --zerti-select-pad-inline-start: 0.5rem;
    --zerti-select-pad-inline-end: 1.85rem;
    --zerti-select-chevron-pos: right 0.55rem center;
    --zerti-select-text-align: left;
}

/* Inherit Vazirmatn into chrome that WP/Bootstrap often re-font. */
#zertiAdmin .zerti-sidebar,
#zertiAdmin .zerti-sidebar .nav-link,
#zertiAdmin .zerti-sidebar .zerti-nav-tab,
#zertiAdmin .zerti-sidebar .zerti-nav-submenu-item,
#zertiAdmin .zerti-sidebar .zerti-admin-brand-title,
#zertiAdmin .zerti-sidebar .zerti-admin-brand-subtitle,
#zertiAdmin .zerti-sidebar .zerti-admin-brand-edition,
#zertiAdmin .offcanvas,
#zertiAdmin .offcanvas .nav-link,
#zertiAdmin .btn,
#zertiAdmin .form-control,
#zertiAdmin .form-select,
#zertiAdmin .form-label,
#zertiAdmin label,
#zertiAdmin input,
#zertiAdmin select,
#zertiAdmin textarea,
#zertiAdmin button,
#zertiAdmin .card,
#zertiAdmin .modal,
#zertiAdmin .dropdown-menu,
#zertiAdmin .alert,
#zertiAdmin table,
#zertiAdmin .nav-link {
    font-family: var(--zerti-font-family);
}

#zertiAdmin .form-control,
#zertiAdmin .form-select {
    border-radius: var(--zerti-radius-input);
}

#zertiAdmin .card {
    border-radius: var(--zerti-radius-card);
}

/* Zerti default checkboxes — WP admin pattern, purple when checked, yellow tick (plugin-wide). */
#zertiAdmin .form-check,
#zertiAdmin label.form-check {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    padding-inline: 0;
    min-height: 0;
}

#zertiAdmin .form-check-inline {
    display: inline-flex;
    margin-inline-end: 0.75rem;
}

#zertiAdmin .form-check .form-check-label,
#zertiAdmin label.form-check .form-check-label,
#zertiAdmin label.form-check > :not(input) {
    line-height: 1.35;
    margin: 0;
    padding: 0;
}

#zertiAdmin input[type='checkbox']:not(.zerti-settings-toggle-input) {
    --bs-form-check-bg-image: none !important;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid #1e1e1e;
    border-radius: 2px;
    background: #fff !important;
    background-image: none !important;
    color: #1e1e1e;
    clear: none;
    cursor: pointer;
    display: inline-block;
    line-height: 0;
    width: 1rem;
    min-width: 1rem;
    height: 1rem;
    max-width: 1rem;
    max-height: 1rem;
    margin-block: 0;
    margin-inline: 5px;
    outline: 0;
    padding: 0 !important;
    text-align: center;
    vertical-align: middle;
    float: none;
    flex: 0 0 1rem;
    align-self: center;
    flex-shrink: 0;
    box-shadow: none;
    transition: 0.05s border-color ease-in-out;
}

#zertiAdmin input[type='checkbox']:not(.zerti-settings-toggle-input):focus {
    border-color: #1e1e1e;
    box-shadow:
        0 0 0 2px #fff,
        0 0 0 4px var(--wp-admin-theme-color);
    outline: 2px solid transparent;
}

#zertiAdmin input[type='checkbox']:not(.zerti-settings-toggle-input):checked {
    background: var(--wp-admin-theme-color) !important;
    border-color: var(--wp-admin-theme-color);
    background-image: none !important;
}

#zertiAdmin input[type='checkbox']:not(.zerti-settings-toggle-input):checked::before {
    float: right;
    display: inline-block;
    vertical-align: middle;
    width: 1rem;
    height: 1rem;
    margin: 0 0 0 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    content: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.83%204.89l1.34.94-5.81%208.38H9.02L5.78%209.67l1.34-1.25%202.57%202.4z%27%20fill%3D%27%23f0c33c%27%2F%3E%3C%2Fsvg%3E");
    content: url("data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.83%204.89l1.34.94-5.81%208.38H9.02L5.78%209.67l1.34-1.25%202.57%202.4z%27%20fill%3D%27%23f0c33c%27%2F%3E%3C%2Fsvg%3E") / '';
}

#zertiAdmin input[type='checkbox']:not(.zerti-settings-toggle-input):disabled,
#zertiAdmin input[type='checkbox']:not(.zerti-settings-toggle-input)[aria-disabled='true'],
#zertiAdmin input[type='checkbox']:not(.zerti-settings-toggle-input):disabled:checked::before {
    opacity: 0.7;
    cursor: default;
}

#zertiAdmin[data-bs-theme='dark'] input[type='checkbox']:not(.zerti-settings-toggle-input) {
    border-color: var(--zerti-docs-border);
    background: var(--zerti-docs-bg) !important;
    color: var(--zerti-docs-text);
}

#zertiAdmin .text-white {
    color: var(--zerti-color-white-text) !important;
}

#zertiAdmin .badge.bg-primary,
#zertiAdmin .badge.bg-secondary,
#zertiAdmin .badge.bg-success,
#zertiAdmin .badge.bg-danger,
#zertiAdmin .badge.bg-dark,
#zertiAdmin .badge.bg-info:not(.text-dark),
#zertiAdmin .badge.text-bg-primary,
#zertiAdmin .badge.text-bg-secondary,
#zertiAdmin .badge.text-bg-success,
#zertiAdmin .badge.text-bg-danger,
#zertiAdmin .badge.text-bg-dark,
#zertiAdmin .badge.text-bg-info:not(.text-dark) {
    color: var(--zerti-color-white-text) !important;
}

/* Badges & buttons — center label/icon vertically and horizontally (plugin-wide). */
#zertiAdmin .badge,
body.toplevel_page_zerti-admin .zerti-jalali-datepicker .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    text-align: center;
    vertical-align: middle;
    line-height: 1.2;
    box-sizing: border-box;
}

#zertiAdmin .btn,
#zertiAdmin a.btn,
#zertiAdmin button.btn,
#zertiAdmin label.btn,
body.toplevel_page_zerti-admin .zerti-jalali-datepicker .btn,
body.toplevel_page_zerti-admin .zerti-inv-reviews__edit-modal .btn,
body.toplevel_page_zerti-admin .zerti-inv-reviews__delete-modal .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    vertical-align: middle;
    gap: 0.35em;
    box-sizing: border-box;
}

#zertiAdmin .btn .fa-solid,
#zertiAdmin .btn .fa-regular,
#zertiAdmin .btn .fa-brands,
#zertiAdmin .btn i[class*='fa-'],
body.toplevel_page_zerti-admin .zerti-jalali-datepicker .btn .fa-solid,
body.toplevel_page_zerti-admin .zerti-jalali-datepicker .btn .fa-regular {
    line-height: 1;
    flex-shrink: 0;
}

/* getbootstrap.com .bd-masthead stack; Bootstrap tokens from data-bs-theme on #zertiAdmin. */
#zertiAdmin[data-bs-theme='dark'] {
    --bd-pink-rgb: 214, 51, 132;
    --bd-accent-rgb: 255, 228, 132;
    --bd-violet-rgb: 149, 97, 251;
    color-scheme: dark;
    color: var(--zerti-docs-text);
    background-color: var(--bs-body-bg);
    /* Light wash only at bottom; old 85%â†’opaque stop read as a flat band tied to box height. */
    background-image:
        linear-gradient(180deg, rgba(var(--bs-body-bg-rgb), 0) 0%, rgba(var(--bs-body-bg-rgb), 0.22) 55%, rgba(var(--bs-body-bg-rgb), 0.5) 100%),
        radial-gradient(ellipse at top left, rgba(var(--bs-primary-rgb), 0.5), transparent 50%),
        radial-gradient(ellipse at top right, rgba(var(--bd-accent-rgb), 0.5), transparent 50%),
        radial-gradient(ellipse at center right, rgba(var(--bd-violet-rgb), 0.5), transparent 50%),
        radial-gradient(ellipse at center left, rgba(var(--bd-pink-rgb), 0.5), transparent 50%);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center top;
    background-attachment: fixed, fixed, fixed, fixed, fixed;
}

#zertiAdmin[data-bs-theme='light'] {
    --bd-pink-rgb: 214, 51, 132;
    --bd-accent-rgb: 255, 228, 132;
    --bd-violet-rgb: 113, 44, 249;
    color-scheme: light;
    color: var(--zerti-docs-text);
    background-color: var(--bs-body-bg);
    background-image:
        linear-gradient(180deg, rgba(var(--bs-body-bg-rgb), 0) 0%, rgba(var(--bs-body-bg-rgb), 0.12) 55%, rgba(var(--bs-body-bg-rgb), 0.28) 100%),
        radial-gradient(ellipse at top left, rgba(var(--bs-primary-rgb), 0.5), transparent 50%),
        radial-gradient(ellipse at top right, rgba(var(--bd-accent-rgb), 0.5), transparent 50%),
        radial-gradient(ellipse at center right, rgba(var(--bd-violet-rgb), 0.5), transparent 50%),
        radial-gradient(ellipse at center left, rgba(var(--bd-pink-rgb), 0.5), transparent 50%);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center top;
    background-attachment: fixed, fixed, fixed, fixed, fixed;
}

body.toplevel_page_zerti-admin:has(#zertiAdmin[data-bs-theme='light']) {
    background-color: #fff;
}

body.toplevel_page_zerti-admin #wpcontent,
body.toplevel_page_zerti-admin #wpbody,
body.toplevel_page_zerti-admin #wpbody-content {
    background: transparent;
}

#zertiAdmin a:not(.btn):not(.nav-link):hover,
#zertiAdmin a:not(.btn):not(.nav-link):focus-visible {
    color: var(--zerti-link-hover-color, #adb5bd);
}

#zertiAdmin .btn-link {
    --bs-btn-color: var(--zerti-docs-text);
    --bs-btn-hover-color: var(--zerti-link-hover-color, #adb5bd);
    --bs-btn-active-color: var(--zerti-link-hover-color, #adb5bd);
}

#zertiAdmin .btn-link:hover,
#zertiAdmin .btn-link:focus-visible {
    color: var(--zerti-link-hover-color, #adb5bd);
}

#zertiAdmin .btn,
#zertiAdmin .nav-link,
#zertiAdmin .navbar,
#zertiAdmin .card-title,
#zertiAdmin h1,
#zertiAdmin h2,
#zertiAdmin h3,
#zertiAdmin h4,
#zertiAdmin h5,
#zertiAdmin h6,
#zertiAdmin .h1,
#zertiAdmin .h2,
#zertiAdmin .h3,
#zertiAdmin .h4,
#zertiAdmin .h5,
#zertiAdmin .h6 {
    font-size: inherit;
}
