/*
 * Yaran Shipping Line theme: the logo's ocean blue and red on top of the Rubick template.
 * Colours and the side menu only; page layouts are left as they are.
 */

:root {
    --y-navy: #04223b;
    --y-navy-2: #073457;
    --y-navy-3: #0a4372;
    --y-blue: #005a92;
    --y-blue-dark: #004a78;
    --y-blue-light: #e6f0f7;
    --y-red: #bb2222;
    --y-red-dark: #9c1b1b;

    --bs-primary: #005a92;
    --bs-primary-rgb: 0, 90, 146;
    --bs-danger: #bb2222;
    --bs-danger-rgb: 187, 34, 34;
    --bs-theme-1-rgb: 0, 90, 146;
    --bs-theme-3-rgb: 0, 110, 170;
    --bs-theme-4-rgb: 10, 100, 155;
    --bs-theme-6-rgb: 187, 34, 34;
    --bs-theme-10-rgb: 0, 110, 180;
    --bs-theme-19-rgb: 0, 80, 130;
    --bs-theme-20-rgb: 20, 105, 160;
    --bs-theme-21-rgb: 200, 225, 242;
    --bs-theme-22-rgb: 230, 242, 250;
    --bs-theme-23-rgb: 3, 30, 52;
    --bs-theme-24-rgb: 2, 24, 42;
    --bs-theme-25-rgb: 200, 225, 242;
    --bs-theme-26-rgb: 6, 44, 74;
    --bs-theme-27-rgb: 20, 70, 110;
    --bs-theme-28-rgb: 180, 210, 235;
    --bs-theme-29-rgb: 0, 80, 130;
    --bs-theme-30-rgb: 150, 195, 230;
}

/* ------------------------------------------------------------------ page */

html,
body.main {
    background: var(--y-navy) linear-gradient(160deg, var(--y-navy) 0%, var(--y-navy-2) 55%, var(--y-navy-3) 100%) fixed no-repeat;
}

/* ------------------------------------------------------- blue accents */

.btn-primary,
.btn-rounded-primary,
.btn-elevated-primary,
.btn-elevated-rounded-primary {
    background-color: var(--y-blue);
    border-color: var(--y-blue);
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
    background-color: var(--y-blue-dark) !important;
    border-color: var(--y-blue-dark) !important;
}
.btn-outline-primary { border-color: var(--y-blue); color: var(--y-blue); }
.btn-outline-primary:hover { background-color: var(--y-blue); border-color: var(--y-blue); color: #fff; }
.btn-danger { background-color: var(--y-red); border-color: var(--y-red); }
.btn-danger:hover { background-color: var(--y-red-dark); border-color: var(--y-red-dark); }

.table th { background-color: var(--y-blue); }
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: #6aa6cf;
    box-shadow: 0 0 0 .2rem rgba(0, 90, 146, .2);
}
.form-check-input:checked { background-color: var(--y-blue); border-color: var(--y-blue); }
.dropdown-item.active, .dropdown-item:active,
.nav-pills .nav-link.active, .list-group-item.active,
.progress-bar, .alert-primary { background-color: var(--y-blue); border-color: var(--y-blue); }
.page-item.active .page-link { background-color: var(--y-blue); border-color: var(--y-blue); }
::-webkit-scrollbar-thumb { background: var(--y-blue); }
.breadcrumb a { color: var(--y-blue); }

/* The template has no colour for these, so badges were white on white. */
.badge.bg-primary { background-color: var(--y-blue) !important; color: #fff; }
.badge.bg-success { background-color: #16a34a !important; color: #fff; }
.badge.bg-danger { background-color: var(--y-red) !important; color: #fff; }
.badge.bg-warning { background-color: #f59e0b !important; color: #1f2937; }
.badge.bg-info { background-color: #0ea5e9 !important; color: #fff; }
.badge.bg-secondary { background-color: #64748b !important; color: #fff; }
.badge.bg-dark { background-color: #1f2937 !important; color: #fff; }

/* ------------------------------------------------------------ side menu */

.side-nav {
    width: 250px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .25) transparent;
}
.side-nav::-webkit-scrollbar { width: 6px; }
.side-nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .2); }

.side-nav .yl-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 6px 0 0 12px;
    padding: 12px 14px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 10px 25px -12px rgba(0, 0, 0, .55);
    border-bottom: 3px solid var(--y-red);
}
.side-nav .yl-brand img { width: 150px; max-width: 100%; height: auto; display: block; }
.side-nav .side-nav__devider { background: rgba(255, 255, 255, .1); margin: 1.1rem 0 1rem 12px !important; width: calc(100% - 12px); }

.side-nav .yl-search { position: relative; margin: 0 0 .9rem 12px; }
.side-nav .yl-search svg {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    width: 16px; height: 16px; color: rgba(255, 255, 255, .55); pointer-events: none;
}
.side-nav #menuSearch {
    background: rgba(255, 255, 255, .08) !important;
    border: 1px solid rgba(255, 255, 255, .14);
    color: #fff;
    border-radius: 12px;
    padding: .6rem .75rem .6rem 2.35rem;
    font-size: .875rem;
}
.side-nav #menuSearch::placeholder { color: rgba(255, 255, 255, .55); }
.side-nav #menuSearch:focus { background: rgba(255, 255, 255, .14) !important; border-color: rgba(255, 255, 255, .35); box-shadow: none; }

.side-nav .side-menu {
    color: rgba(255, 255, 255, .82);
    height: 44px;
    margin-bottom: 2px;
    font-size: .9rem;
    transition: background-color .15s, color .15s;
}
.side-nav .side-menu:hover { color: #fff; }
.side-nav .side-menu:not(.side-menu--active):hover { background-color: rgba(255, 255, 255, .07); }
.side-nav .side-menu .side-menu__icon svg { width: 19px; height: 19px; stroke-width: 1.8; }

/* Top level item of the page being shown: the template's tab into the page, with a red icon. */
.side-nav > ul > li > .side-menu.side-menu--active .side-menu__icon { color: var(--y-red); }
.side-nav > ul > li > .side-menu.side-menu--active .side-menu__title { color: var(--y-navy); font-weight: 600; }

/* Opened groups */
.side-nav > ul ul {
    background: rgba(0, 0, 0, .2);
    border-radius: 14px;
    padding: 4px 0;
    margin: 2px 0 6px;
}
.side-nav > ul ul ul { background: rgba(0, 0, 0, .18); margin: 2px 6px 6px; }
.side-nav > ul ul .side-menu { height: 40px; font-size: .85rem; color: rgba(255, 255, 255, .78); }
.side-nav > ul ul .side-menu .side-menu__icon svg { width: 15px; height: 15px; }
.side-nav > ul ul .side-menu.side-menu--active {
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--y-red);
}
.side-nav .side-menu.side-menu--open:not(.side-menu--active) { color: #fff; }

/* Laptops: the template shrank the menu to icons here, which hides every page name. */
@media (min-width: 992px) and (max-width: 1279.98px) {
    .side-nav { width: 240px; }
    .side-nav .side-menu .side-menu__title { display: flex !important; }
    .side-nav .side-menu .side-menu__title .side-menu__sub-icon { display: block !important; }
    .side-nav > ul > li > .side-menu:not(.side-menu--active) .side-menu__icon:before { display: none; }
}

/* --------------------------------------------------- phones and tablets */

.yl-mobile-bar, .yl-nav-backdrop, .side-nav .yl-nav-close { display: none; }

@media (max-width: 991.98px) {
    body.main { padding-top: 0; }

    .yl-mobile-bar {
        display: flex;
        align-items: center;
        gap: 12px;
        position: sticky;
        top: 0;
        z-index: 55;
        margin: 0 -1rem;
        padding: 10px 14px;
        background: rgba(255, 255, 255, .96);
        backdrop-filter: blur(6px);
        border-bottom: 1px solid #e2e8f0;
        border-radius: 22px 22px 0 0;
    }
    .yl-mobile-bar img { height: 44px; width: auto; display: block; }
    .yl-menu-button {
        display: inline-flex; align-items: center; justify-content: center;
        width: 40px; height: 40px; border-radius: 12px; border: 0;
        background: var(--y-blue); color: #fff;
        box-shadow: 0 6px 14px -6px rgba(0, 90, 146, .7);
    }
    .yl-menu-button svg { width: 20px; height: 20px; }
    .content { border-radius: 22px; min-height: 100vh; }

    .side-nav {
        display: block !important;
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1060;
        width: 290px !important;
        max-width: 86vw;
        padding: 14px 12px 3rem 0;
        overflow-y: auto;
        background: linear-gradient(170deg, var(--y-navy) 0%, var(--y-navy-2) 60%, var(--y-navy-3) 100%);
        transform: translateX(-105%);
        transition: transform .25s ease;
        box-shadow: none;
    }
    body.yl-nav-open .side-nav { transform: none; box-shadow: 12px 0 40px rgba(0, 0, 0, .35); }
    body.yl-nav-open { overflow: hidden; }

    .side-nav .yl-nav-close {
        display: inline-flex; position: absolute; top: 10px; right: 10px; z-index: 2;
        width: 34px; height: 34px; align-items: center; justify-content: center;
        border: 0; border-radius: 10px; background: rgba(255, 255, 255, .12); color: #fff;
    }
    .side-nav .yl-nav-close svg { width: 18px; height: 18px; }
    .side-nav .yl-brand { margin-right: 52px; justify-content: flex-start; }
    .side-nav .yl-brand img { width: 130px; }

    /* Full names in the drawer, and a plain highlight instead of the tab into the page. */
    .side-nav .side-menu { border-radius: 12px; padding-left: 1rem; margin-left: 12px; }
    .side-nav .side-menu .side-menu__title { display: flex !important; }
    .side-nav .side-menu .side-menu__title .side-menu__sub-icon { display: block !important; }
    .side-nav > ul > li > .side-menu.side-menu--active { background: #fff; }
    .side-nav > ul > li > .side-menu.side-menu--active:before,
    .side-nav > ul > li > .side-menu.side-menu--active:after,
    .side-nav > ul > li > .side-menu .side-menu__icon:before { display: none !important; }
    .side-nav > ul ul { margin-left: 12px; }
    .side-nav > ul ul .side-menu { margin-left: 4px; }

    .yl-nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1055;
        background: rgba(2, 18, 32, .55);
        opacity: 0;
        pointer-events: none;
        transition: opacity .25s ease;
    }
    body.yl-nav-open .yl-nav-backdrop { opacity: 1; pointer-events: auto; }
}

/* ------------------------------------------------------- account menu */

.yl-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--y-blue), var(--y-navy-3));
    color: #fff; font-weight: 600; font-size: .85rem; letter-spacing: .02em;
    box-shadow: 0 0 0 3px #fff, 0 4px 12px -4px rgba(0, 0, 0, .4);
    cursor: pointer; user-select: none;
}
.top-bar .dropdown-content.bg-theme-26 { background: var(--y-navy-2) !important; border-radius: 12px; }
