/* ==========================================================
   WhatsBot UI Repair V5
   Search + Sidebar + Mobile + Toast + Authentication Icons
   ========================================================== */

:root {
    /*
     * SUCCESS TOAST COLORS
     * Change these values to customize the success notification.
     */
    --wb-toast-success-start: #00ee44;
    --wb-toast-success-end: #00ee44;
    --wb-toast-success-border: rgba(0, 168, 150, 0.45);
    --wb-toast-success-progress: #00ee44;
}


/* ==========================================================
   1. COMPACT SEARCH BAR
   ========================================================== */

.input-group:has(> .search-input),
.sub-sidebar .sp-input-group {
    display: flex !important;
    align-items: stretch !important;
    gap: 0 !important;

    height: 44px !important;
    min-height: 44px !important;

    padding: 0 !important;
    overflow: hidden !important;

    background: #f4f7fb !important;
    border: 1px solid #d9e2ec !important;
    border-radius: 12px !important;

    box-shadow:
        0 2px 5px rgba(15, 23, 42, 0.06),
        0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

.input-group:has(> .search-input) > .search-input,
.input-group:has(> .search-input) > .input-group-text,
.sub-sidebar .sp-input-group > .search-input,
.sub-sidebar .sp-input-group > .input-group-text {
    height: 42px !important;
    min-height: 42px !important;

    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;

    background: transparent !important;
    box-shadow: none !important;
}

.input-group:has(> .search-input) > .search-input,
.sub-sidebar .sp-input-group > .search-input {
    flex: 1 1 auto !important;
    min-width: 0 !important;

    padding: 0 14px !important;

    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 42px !important;

    color: #263247 !important;
}

.input-group:has(> .search-input) > .search-input::placeholder,
.sub-sidebar .sp-input-group > .search-input::placeholder {
    color: #8b98aa !important;
    opacity: 1 !important;
}

.input-group:has(> .search-input) > .input-group-text,
.sub-sidebar .sp-input-group > .input-group-text {
    flex: 0 0 48px !important;

    width: 48px !important;
    min-width: 48px !important;

    padding: 0 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    color: #94a3b8 !important;

    border-inline-end:
        1px solid rgba(148, 163, 184, 0.2) !important;
}

.input-group:has(> .search-input) > .input-group-text i,
.sub-sidebar .sp-input-group > .input-group-text i {
    margin: 0 !important;

    font-size: 20px !important;
    line-height: 1 !important;

    color: inherit !important;
}

.input-group:has(> .search-input):focus-within,
.sub-sidebar .sp-input-group:focus-within {
    background: #ffffff !important;
    border-color: #00a896 !important;

    box-shadow:
        0 0 0 3px rgba(0, 168, 150, 0.1),
        0 3px 8px rgba(15, 23, 42, 0.06) !important;
}

.input-group:has(> .search-input):focus-within > .input-group-text,
.sub-sidebar .sp-input-group:focus-within > .input-group-text {
    color: #00a896 !important;
}


/* ==========================================================
   2. COLLAPSED SIDEBAR
   Remove stray > arrow and align Settings button
   ========================================================== */

@media (min-width: 769px) {

    body.sidebar-small
    .sidebar
    .nav-item.have-menus-sub
    > .nav-link::after,

    body.sidebar-close
    .sidebar
    .nav-item.have-menus-sub
    > .nav-link::after {
        display: none !important;
        content: none !important;
    }

    body.sidebar-small .sidebar .sidebar-footer,
    body.sidebar-close .sidebar .sidebar-footer {
        flex: 0 0 auto !important;

        width: 80px !important;

        margin-top: auto !important;
        padding: 12px 0 16px !important;

        align-items: center !important;

        border-top: 1px solid rgba(148, 163, 184, 0.16) !important;
    }

    body.sidebar-small .sidebar .sidebar-footer > .nav,
    body.sidebar-close .sidebar .sidebar-footer > .nav {
        width: 80px !important;

        display: flex !important;
        align-items: center !important;
    }

    body.sidebar-small .sidebar .sidebar-footer .nav-item,
    body.sidebar-close .sidebar .sidebar-footer .nav-item {
        width: 80px !important;

        margin: 0 !important;
        padding: 0 !important;
    }

    body.sidebar-small .sidebar .sidebar-footer .nav-link,
    body.sidebar-close .sidebar .sidebar-footer .nav-link {
        width: 52px !important;
        height: 52px !important;

        margin: 0 auto !important;
        padding: 0 !important;

        display: flex !important;
        align-items: center !important;
        justify-content: center !important;

        border-radius: 13px !important;
    }

    body.sidebar-small .sidebar .sidebar-footer .nav-link i,
    body.sidebar-close .sidebar .sidebar-footer .nav-link i {
        width: auto !important;

        margin: 0 !important;
        padding: 0 !important;

        text-align: center !important;
        line-height: 1 !important;
    }

    .sidebar .sidebar-toggle {
        display: none !important;
    }
}


/* ==========================================================
   3. MOBILE DRAWERS
   Only one sidebar appears at a time
   ========================================================== */

.sidebar-overlay {
    display: block !important;

    position: fixed !important;
    inset: 0 !important;

    z-index: 2890 !important;

    background: rgba(15, 23, 42, 0.42) !important;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);

    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;

    transition:
        opacity 0.22s ease,
        visibility 0.22s ease !important;
}

.sidebar-overlay.active {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

html.wb-drawer-open,
body.wb-drawer-open {
    overflow: hidden !important;
}

@media (max-width: 768px) {

    body {
        overflow-x: hidden !important;
    }

    body > .d-flex.h-100,
    body .d-flex.h-100 {
        display: block !important;

        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .sidebar-wrapper {
        position: static !important;

        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;

        flex: 0 0 0 !important;
    }

    .sidebar-wrapper > .sidebar,
    .sidebar {
        position: fixed !important;

        top: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        right: auto !important;

        z-index: 3000 !important;

        width: min(86vw, 300px) !important;
        max-width: 300px !important;
        height: 100dvh !important;

        transform: translateX(-110%) !important;

        transition: transform 0.25s ease !important;

        border-radius: 0 18px 18px 0 !important;
        box-shadow: 18px 0 50px rgba(15, 23, 42, 0.18) !important;
    }

    html[dir="rtl"] .sidebar-wrapper > .sidebar,
    html[dir="rtl"] .sidebar {
        left: auto !important;
        right: 0 !important;

        transform: translateX(110%) !important;

        border-radius: 18px 0 0 18px !important;
        box-shadow: -18px 0 50px rgba(15, 23, 42, 0.18) !important;
    }

    .sidebar-wrapper > .sidebar.active,
    .sidebar.active,

    html[dir="rtl"] .sidebar-wrapper > .sidebar.active,
    html[dir="rtl"] .sidebar.active {
        transform: translateX(0) !important;
    }

    .sub-sidebar {
        display: flex !important;

        position: fixed !important;

        top: 65px !important;
        bottom: 0 !important;
        left: 0 !important;
        right: auto !important;

        z-index: 2995 !important;

        width: min(88vw, 320px) !important;
        min-width: 0 !important;
        max-width: 320px !important;
        height: calc(100dvh - 65px) !important;

        transform: translateX(-110%) !important;

        overflow-y: auto !important;

        transition: transform 0.25s ease !important;

        border-radius: 0 18px 18px 0 !important;
        box-shadow: 18px 0 50px rgba(15, 23, 42, 0.18) !important;
    }

    html[dir="rtl"] .sub-sidebar {
        left: auto !important;
        right: 0 !important;

        transform: translateX(110%) !important;

        border-radius: 18px 0 0 18px !important;
        box-shadow: -18px 0 50px rgba(15, 23, 42, 0.18) !important;
    }

    .sub-sidebar.active,
    html[dir="rtl"] .sub-sidebar.active {
        transform: translateX(0) !important;
    }

    .main-wrapper {
        position: relative !important;

        display: block !important;

        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;

        flex: 1 1 100% !important;

        margin-inline: 0 !important;

        overflow-x: hidden !important;
    }

    .main-wrapper > .container,
    .main-wrapper > .container-fluid,
    .main-wrapper .container,
    .main-wrapper .container-fluid {
        width: 100% !important;
        max-width: 100% !important;

        margin-inline: auto !important;
    }

    .header {
        display: flex !important;

        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;

        z-index: 2800 !important;

        width: 100% !important;
        max-width: 100% !important;
    }

    .btn-open-sidebar,
    .btn-open-sub-sidebar {
        position: relative !important;
        z-index: 1 !important;
    }
}


/* ==========================================================
   4. IZITOAST SUCCESS
   No icon/text overlap, no duplicated Success title
   ========================================================== */

body .iziToast-wrapper .iziToast.iziToast-color-green {
    min-height: 62px !important;

    padding: 8px 42px 8px 12px !important;

    overflow: hidden !important;

    background:
        linear-gradient(
            135deg,
            var(--wb-toast-success-start) 0%,
            var(--wb-toast-success-end) 100%
        ) !important;

    border:
        1px solid var(--wb-toast-success-border) !important;

    border-radius: 15px !important;

    box-shadow:
        0 18px 45px rgba(0, 67, 51, 0.24),
        0 5px 15px rgba(15, 23, 42, 0.12) !important;
}

body
.iziToast-wrapper
.iziToast.iziToast-color-green
.iziToast-body {
    display: flex !important;
    align-items: center !important;

    min-height: 44px !important;

    margin: 0 !important;
    padding: 0 !important;

    gap: 12px !important;

    text-align: start !important;
}

body
.iziToast-wrapper
.iziToast.iziToast-color-green
.iziToast-icon {
    position: static !important;

    display: block !important;
    flex: 0 0 27px !important;

    width: 27px !important;
    height: 27px !important;

    margin: 0 !important;

    transform: none !important;

    color: #ffffff !important;
    opacity: 1 !important;
}

body
.iziToast-wrapper
.iziToast.iziToast-color-green
.iziToast-texts {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    justify-content: center !important;

    min-width: 0 !important;

    float: none !important;

    margin: 0 !important;
    padding: 0 !important;

    gap: 2px !important;
}

body
.iziToast-wrapper
.iziToast.iziToast-color-green
.iziToast-title,

body
.iziToast-wrapper
.iziToast.iziToast-color-green
.iziToast-message {
    float: none !important;

    margin: 0 !important;
    padding: 0 !important;

    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;

    text-align: start !important;
    white-space: normal !important;

    opacity: 1 !important;
}

body
.iziToast-wrapper
.iziToast.iziToast-color-green
.iziToast-title {
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
}

body
.iziToast-wrapper
.iziToast.iziToast-color-green
.iziToast-message {
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
}

/* Hide duplicated default title when a message exists */
body
.iziToast-wrapper
.iziToast.iziToast-color-green
.iziToast-body:has(.iziToast-message:not(:empty))
.iziToast-title {
    display: none !important;
}

body
.iziToast-wrapper
.iziToast.iziToast-color-green
.iziToast-message:empty {
    display: none !important;
}

body
.iziToast-wrapper
.iziToast.iziToast-color-green
.iziToast-close {
    top: 50% !important;
    right: 10px !important;

    width: 28px !important;
    height: 28px !important;

    margin-top: -14px !important;

    opacity: 0.88 !important;
    filter: brightness(0) invert(1) !important;
}

body
.iziToast-wrapper
.iziToast.iziToast-color-green
.iziToast-progressbar
> div {
    background:
        var(--wb-toast-success-progress) !important;
}


/* ==========================================================
   5. LOGIN / SIGNUP ICONS
   Frontend uses Font Awesome 6, not backend Font Awesome 5
   ========================================================== */

.login-wrapper .fa,
.login-wrapper .fas,
.login-wrapper .fa-solid {
    font-family: "Font Awesome 6 Free" !important;
    font-style: normal !important;
    font-weight: 900 !important;

    text-rendering: auto !important;
    -webkit-font-smoothing: antialiased !important;
}

.login-wrapper .far,
.login-wrapper .fa-regular {
    font-family: "Font Awesome 6 Free" !important;
    font-style: normal !important;
    font-weight: 400 !important;
}

.login-wrapper .fab,
.login-wrapper .fa-brands {
    font-family: "Font Awesome 6 Brands" !important;
    font-style: normal !important;
    font-weight: 400 !important;
}

.login-wrapper .position-relative > i.position-absolute {
    z-index: 3 !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 18px !important;
    height: 18px !important;

    background: transparent !important;
    border: 0 !important;

    line-height: 1 !important;
}

/* WHATSBOT_COMPACT_SEARCH_ARROW_V6_START */

/* ==========================================================
   Compact sub-sidebar search
   ========================================================== */

/* Reduce the empty space surrounding the search bar */
.sub-sidebar > .d-flex.mb-10.p-20:first-child {
    margin-bottom: 6px !important;
    padding: 12px 16px !important;
}

/* Exact sidebar search container */
.sub-sidebar
> .d-flex.mb-10.p-20:first-child
.sp-input-group {
    box-sizing: border-box !important;

    width: 100% !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;

    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;

    overflow: hidden !important;

    border: 1px solid #d9e2ec !important;
    border-radius: 10px !important;

    background: #f4f7fb !important;

    box-shadow:
        0 1px 3px rgba(15, 23, 42, 0.06) !important;
}

/* Search input */
.sub-sidebar
> .d-flex.mb-10.p-20:first-child
.sp-input-group
> input.search-input {
    box-sizing: border-box !important;

    flex: 1 1 auto !important;

    width: auto !important;
    min-width: 0 !important;

    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;

    margin: 0 !important;
    padding: 0 12px !important;

    border: 0 !important;
    border-radius: 0 !important;

    background: transparent !important;
    box-shadow: none !important;

    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 34px !important;
}

/* Search icon area */
.sub-sidebar
> .d-flex.mb-10.p-20:first-child
.sp-input-group
> .input-group-text {
    box-sizing: border-box !important;

    flex: 0 0 40px !important;

    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;

    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;

    margin: 0 !important;
    padding: 0 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    border: 0 !important;
    border-radius: 0 !important;
    border-inline-end:
        1px solid rgba(148, 163, 184, 0.18) !important;

    background: transparent !important;
    box-shadow: none !important;
}

.sub-sidebar
> .d-flex.mb-10.p-20:first-child
.sp-input-group
> .input-group-text
i {
    margin: 0 !important;
    padding: 0 !important;

    font-size: 16px !important;
    line-height: 1 !important;

    color: #94a3b8 !important;
}

/* Focus state */
.sub-sidebar
> .d-flex.mb-10.p-20:first-child
.sp-input-group:focus-within {
    border-color: #00a896 !important;

    background: #ffffff !important;

    box-shadow:
        0 0 0 2px rgba(0, 168, 150, 0.09) !important;
}


/* ==========================================================
   Remove stray > button on desktop
   This is .btn-open-sub-sidebar from the header.
   ========================================================== */

@media (min-width: 769px) {
    .header .btn-open-sub-sidebar {
        display: none !important;
        visibility: hidden !important;

        width: 0 !important;
        min-width: 0 !important;
        height: 0 !important;

        margin: 0 !important;
        padding: 0 !important;

        border: 0 !important;

        opacity: 0 !important;
        pointer-events: none !important;
    }

    .header .btn-open-sub-sidebar i {
        display: none !important;
    }

    .header
    .d-flex.align-items-center:has(> .btn-open-sub-sidebar) {
        display: none !important;

        width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}


/* Keep the sub-sidebar opener styled correctly on mobile */
@media (max-width: 768px) {
    .header .btn-open-sub-sidebar {
        width: 40px !important;
        min-width: 40px !important;
        height: 40px !important;

        padding: 0 !important;

        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;

        border-radius: 10px !important;
    }

    .header .btn-open-sub-sidebar i {
        display: inline-block !important;

        margin: 0 !important;
        padding: 0 !important;

        font-size: 14px !important;
        line-height: 1 !important;
    }
}

/* WHATSBOT_COMPACT_SEARCH_ARROW_V6_END */
