/*
 * iDara Fatoora: the parts every page shares (public site, admin, client portal, sign-in).
 *   1. the scroll bar in the brand colour
 *   2. the two round buttons (dark mode, back to top), built by js/brand.js
 *   3. dark mode for what the theme's own dark style does not reach (the public site)
 * The brand colour is the theme's --primary-bg-color (#6c5ffc).
 */

/* ---- 1. scroll bar (every scrolling area, not only the page) ---- */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-bg-color, #6c5ffc) #eceaff;
}

html.idara-dark * {
    scrollbar-color: var(--primary-bg-color, #6c5ffc) #23263a;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: #eceaff;
}

*::-webkit-scrollbar-thumb {
    background: var(--primary-bg-color, #6c5ffc);
    border-radius: 10px;
    border: 2px solid #eceaff;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--primary-bg-hover, #5a4ee0);
}

html.idara-dark *::-webkit-scrollbar-track {
    background: #23263a;
}

html.idara-dark *::-webkit-scrollbar-thumb {
    border-color: #23263a;
}

/* ---- 2. round buttons ---- */
.idara-fabs {
    position: fixed;
    inset-inline-end: 16px;
    inset-block-end: 16px;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.idara-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--primary-bg-color, #6c5ffc);
    color: #fff;
    box-shadow: 0 4px 14px rgba(108, 95, 252, .4);
    cursor: pointer;
    transition: transform .15s ease, opacity .2s ease, background-color .15s ease;
}

.idara-fab:hover,
.idara-fab:focus-visible {
    background: var(--primary-bg-hover, #5a4ee0);
    transform: translateY(-2px);
}

.idara-fab:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--primary-bg-color, #6c5ffc);
}

.idara-fab svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* the moon is shown in the light theme, the sun in the dark one */
.idara-fab .idara-sun,
html.idara-dark .idara-fab .idara-moon {
    display: none;
}

html.idara-dark .idara-fab .idara-sun {
    display: block;
}

#idara-top {
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
}

#idara-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .idara-fab {
        transition: none;
    }
}

/* ---- 3. dark mode of the public site ---- */
html.idara-dark body.landing-page {
    background-color: #17192a;
    color: #d9dcef;
}

html.idara-dark .landing-page .page,
html.idara-dark .landing-page .page-main,
html.idara-dark .landing-page .main-content {
    background-color: #17192a;
}

html.idara-dark .landing-page .header,
html.idara-dark .landing-page .responsive-navbar .navbar-collapse,
html.idara-dark .landing-page .app-sidebar.bg-transparent,
html.idara-dark .landing-page .app-sidebar {
    background-color: #1f2236 !important;
    border-color: #2f3350;
}

html.idara-dark .landing-page .side-menu__item,
html.idara-dark .landing-page .side-menu__label,
html.idara-dark .landing-page .navbar-toggler,
html.idara-dark .landing-page .app-sidebar__toggle {
    color: #e6e8f6 !important;
}

html.idara-dark .landing-page h1,
html.idara-dark .landing-page h2,
html.idara-dark .landing-page h3,
html.idara-dark .landing-page h4,
html.idara-dark .landing-page h5,
html.idara-dark .landing-page h6,
html.idara-dark .landing-page .text-dark {
    color: #f1f2fb !important;
}

html.idara-dark .landing-page .card {
    background-color: #1f2236;
    border-color: #2f3350;
}

html.idara-dark .landing-page .card-shadow {
    box-shadow: 0 0 20px rgba(0, 0, 0, .35);
}

/* the soft coloured cards keep their hue but get dark enough for light text */
html.idara-dark .landing-page .bg-primary-transparent { background-color: rgba(108, 95, 252, .18) !important; }
html.idara-dark .landing-page .bg-secondary-transparent { background-color: rgba(5, 195, 251, .14) !important; }
html.idara-dark .landing-page .bg-success-transparent { background-color: rgba(9, 173, 149, .16) !important; }
html.idara-dark .landing-page .bg-warning-transparent { background-color: rgba(255, 173, 0, .14) !important; }
html.idara-dark .landing-page .bg-danger-transparent { background-color: rgba(230, 59, 59, .16) !important; }

html.idara-dark .landing-page .bg-landing,
html.idara-dark .landing-page .bg-image-style {
    background-color: #1b1e31 !important;
    background-image: none !important;
}

html.idara-dark .landing-page .top-footer,
html.idara-dark .landing-page .demo-footer,
html.idara-dark .landing-page footer {
    background-color: #1f2236 !important;
    color: #c9cce4;
}

html.idara-dark .landing-page .top-footer a,
html.idara-dark .landing-page .demo-footer a {
    color: #c9cce4;
}

html.idara-dark .landing-page .btn-link {
    color: #a9a0ff;
}

html.idara-dark .landing-page .btn-outline-primary {
    color: #a9a0ff;
    border-color: #a9a0ff;
}

html.idara-dark .landing-page img.logo-2,
html.idara-dark .landing-page .header-brand-img {
    background: #fff;
    padding: 3px 8px;
    border-radius: 6px;
}

/* pictures drawn for a white page: the wave behind the hero and the veil over the grey sections */
html.idara-dark .landing-page .landing-top-header {
    background-image: none !important;
}

html.idara-dark .landing-page .landing-top-header::before {
    opacity: .2;
}

html.idara-dark .landing-page .bg-image-style {
    background-image: none !important;
}

html.idara-dark .landing-page .bg-image-style::before {
    background-color: transparent;
}

html.idara-dark .landing-page .bg-image-landing {
    background-image: none !important;
}

html.idara-dark .landing-page .top.sticky.stickyClass {
    background: #1f2236;
    border-color: #2f3350;
}

/* the flow picture is drawn for a white page: it keeps its own light panel */
html.idara-dark .landing-page img[src*="flow"] {
    background: #f4f3ff;
    border-radius: 16px;
}

/* contact form of the public site */
html.idara-dark .landing-page .form-control {
    background-color: #17192a;
    border-color: #2f3350;
    color: #e6e8f6;
}

html.idara-dark .landing-page .form-control::placeholder {
    color: #8b90ad;
}

html.idara-dark .landing-page .form-label,
html.idara-dark .landing-page .text-muted {
    color: #b9bdd8 !important;
}

html.idara-dark .landing-page .alert-success {
    background-color: rgba(9, 173, 149, .18);
    border-color: rgba(9, 173, 149, .4);
    color: #8be0d1;
}

html.idara-dark .landing-page .alert-danger {
    background-color: rgba(230, 59, 59, .18);
    border-color: rgba(230, 59, 59, .4);
    color: #ffb3b3;
}
