/* ============================================================
   NAVBAR-VERTICAL.CSS — Vertical sidebar for themes 7-12
   ============================================================ */

/* Hide sidebar for horizontal themes (1-6) */
.vertical-sidebar,
.sidebar-overlay {
    display: none;
}

/* ============================================================
   VERTICAL LAYOUT — themes 7-12
   ============================================================ */

body.layout-vertical .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 199;
}

/* Desktop only: start overlay right after the sidebar so the sidebar
   itself stays clickable. On mobile the sidebar slides fully off-screen,
   so the overlay must cover from 0, not 240px (see mobile block below). */
@media (min-width: 992px) {
    body.layout-vertical .sidebar-overlay {
        left: 240px;
    }
}

body.layout-vertical .sidebar-overlay.show {
    display: block;
}

/* Sidebar: fixed on left, full height */
body.layout-vertical .vertical-sidebar {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--theme-nav-bg);
    box-shadow: 2px 0 15px rgba(0,0,0,0.12);
    padding: 8px 0 30px;
    z-index: 200;
}

/* Push ALL page content right by sidebar width — original behavior restored */
body.layout-vertical .top-info-bar,
body.layout-vertical .company-branding-section,
body.layout-vertical .vpage-wrapper,
body.layout-vertical .modern-footer {
    margin-left: 240px;
    width: calc(100% - 240px);
    box-sizing: border-box;
}

/* Logo block at top of sidebar (vertical theme only) */
.sidebar-logo-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 22px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 20px;
}

.sidebar-logo-img {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

/* vpage-wrapper: normal block, no flex */
.vpage-wrapper {
    display: block;
    width: 100%;
}

    .vpage-wrapper > .main-content {
        padding-top: 0;
    }

/* ---- Sidebar nav links ---- */
.vertical-sidebar .sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
}

.vertical-sidebar .nav-item {
    width: 100%;
}

.vertical-sidebar .nav-link {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 11px 18px !important;
    color: var(--theme-nav-link-color) !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
    border-radius: 0 !important;
    border-left: 3px solid transparent;
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s;
    transform: none !important;
}

    .vertical-sidebar .nav-link i {
        width: 18px;
        text-align: center;
        font-size: 14px;
        flex-shrink: 0;
    }

    .vertical-sidebar .nav-link:hover,
    .vertical-sidebar .nav-item.active .nav-link {
        background: var(--theme-nav-link-hover-bg) !important;
        color: var(--theme-nav-link-hover-color) !important;
        border-left-color: var(--theme-secondary) !important;
    }

/* Dropdown inside sidebar */
.vertical-sidebar .dropdown-menu {
    position: static !important;
    transform: none !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: rgba(0,0,0,0.12) !important;
    animation: none !important;
    min-width: unset !important;
    width: 100%;
}

.vertical-sidebar .dropdown-item {
    padding: 9px 18px 9px 46px !important;
    font-size: 12.5px !important;
    border-radius: 0 !important;
    color: var(--theme-nav-link-color) !important;
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 3px solid transparent;
    transform: none !important;
}

    .vertical-sidebar .dropdown-item:hover {
        background: rgba(255,255,255,0.1) !important;
        color: var(--theme-nav-link-hover-color) !important;
        border-left-color: var(--theme-secondary) !important;
        transform: none !important;
    }

    .vertical-sidebar .dropdown-item i {
        width: 16px;
        text-align: center;
        flex-shrink: 0;
    }

.vertical-sidebar .nav-link.dropdown-toggle::after {
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.vertical-sidebar .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

/* Login button */
.vertical-sidebar .btn-login {
    margin: 8px 12px !important;
    width: calc(100% - 24px) !important;
    border-radius: 8px !important;
    justify-content: center !important;
    padding: 10px 14px !important;
}

/* User/admin menus */
.vertical-sidebar .user-menu .nav-link,
.vertical-sidebar .admin-menu {
    margin: 4px 10px;
    border-radius: 8px !important;
    width: calc(100% - 20px);
}

/* Desktop: hide mobile toggle */
@media (min-width: 992px) {
    body.layout-vertical .mobile-menu-toggle {
        display: none !important;
    }
}

/* Mobile: sidebar slides in */
@media (max-width: 991px) {
    body.layout-vertical .vertical-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 200;
    }

        body.layout-vertical .vertical-sidebar.sidebar-open {
            transform: translateX(0);
        }

    body.layout-vertical .top-info-bar,
    body.layout-vertical .company-branding-section,
    body.layout-vertical .vpage-wrapper,
    body.layout-vertical .modern-footer {
        margin-left: 0;
        width: 100%;
    }

    /* Overlay must sit ABOVE the sidebar's stacking but the toggle button
       must sit above BOTH, otherwise the second tap (to close) is
       swallowed by the overlay/sidebar instead of reaching the button. */
    body.layout-vertical .sidebar-overlay {
        left: 0;
        z-index: 199;
    }

    body.layout-vertical .mobile-menu-toggle {
        display: flex !important;
        position: relative;
        z-index: 201;
    }

    /* The toggle's own stacking context only works if its parent isn't
       statically positioned underneath the fixed sidebar in paint order. */
    body.layout-vertical .company-branding-section {
        position: relative;
        z-index: 201;
    }
}

/* ---- Fix all page content alignment for vertical layout ---- */
@media (min-width: 992px) {
    /* Standard Bootstrap container */
    body.layout-vertical .main-content .container,
    body.layout-vertical .page-header .container,
    body.layout-vertical .footer-top .container,
    body.layout-vertical .footer-bottom .container {
        max-width: 100%;
        padding-left: 24px;
        padding-right: 24px;
    }

    /* Custom page containers used by individual pages */
    body.layout-vertical .calculator-container,
    body.layout-vertical .calculator-page,
    body.layout-vertical .about-page > .container,
    body.layout-vertical .directors-page > .container,
    body.layout-vertical .contact-page > .container,
    body.layout-vertical .downloads-page > .container,
    body.layout-vertical .gallery-page > .container,
    body.layout-vertical .notice-page > .container,
    body.layout-vertical .scheme-page > .container,
    body.layout-vertical .member-page > .container,
    body.layout-vertical .home-page > .container,
    body.layout-vertical .main-content > div > .container,
    body.layout-vertical .main-content > .container {
        max-width: 100%;
        padding-left: 24px;
        padding-right: 24px;
    }
}
