/* Shared index-style navbar for all pages */

.navbar-fixed {
    z-index: 20000;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    background-color: #0B132B;
    height: 56px;
    width: 100%;
    padding: 0 1rem 0 0.5rem;
    overflow: visible;
}

body.light .navbar-fixed {
    background-color: #eef1f6;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.08);
}

.navbar-toggle-wrap,
#mytoggle,
#theme-toggle-button {
    display: none !important;
}

body.login-page .navbar-toggle-wrap {
    right: 28px;
}

#mytoggle {
    display: flex;
    align-items: center;
    justify-content: center;
}

#theme-toggle-button {
    position: relative;
    display: inline-block;
    width: 76px;
    height: 42px;
    cursor: pointer;
    margin: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#toggle {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(18, 18, 26, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.5), 0 1px 2px rgba(255,255,255,0.05);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.toggle-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    transition: color 0.35s, filter 0.35s, opacity 0.35s;
    pointer-events: none;
}

.toggle-sun {
    left: 11px;
}

.toggle-moon {
    right: 11px;
}

.toggle-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.toggle-pill {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 34px;
    height: 34px;
    background: #1e293b;
    border: none;
    border-radius: 50%;
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4), inset 0 1px 1px rgba(255, 255, 255, 0.12);
    box-sizing: border-box;
}

/* Checked state (Dark Mode / Moon Active) */
#toggle:checked + .toggle-slider .toggle-pill {
    transform: translateX(34px);
}

#toggle:checked + .toggle-slider .toggle-sun {
    color: #94a3b8;
    opacity: 0.4;
}

#toggle:checked + .toggle-slider .toggle-moon {
    color: #6bb0ff;
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(107, 176, 255, 0.6));
}

/* Unchecked state (Light Mode / Sun Active) */
#toggle:not(:checked) + .toggle-slider .toggle-moon {
    color: #94a3b8;
    opacity: 0.4;
}

#toggle:not(:checked) + .toggle-slider .toggle-sun {
    color: #ffb74d;
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(255, 183, 77, 0.6));
}

/* Light mode specific background styling */
body.light .toggle-slider {
    background: rgba(220, 220, 230, 0.65);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.15), 0 1px 1px rgba(255,255,255,0.6);
}

body.light .toggle-pill {
    background: var(--bg-primary);
    border: none;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.8);
}

.navbar-fixed header {
    position: static;
    z-index: 20001;
    flex: 0 0 auto;
}

.navbar-title {
    color: var(--text-primary);
    font-size: 24px;
    font-family: 'Playfair Display', serif;
    font-weight: 500;
    position: absolute;
    top: 50%;
    left: 28px;
    transform: translateY(-50%);
    max-width: calc(100vw - 180px);
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    line-height: 1;
}

body.light .navbar-title,
body.light #headish,
body.light #headno {
    color: #1e293b !important;
}

.navbar-fixed header button.sidebar-toggle-btn,
.sidebar-toggle-btn {
    position: absolute;
    left: auto;
    right: 28px;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    max-width: 42px;
    max-height: 42px;
    padding: 0;
    margin: 0;
    z-index: 20001;
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 16px rgba(2, 6, 23, 0.24);
    transition: right 0.25s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-toggle-btn svg,
.sidebar-toggle-btn .svg_img {
    display: block;
    width: 22px;
    height: 22px;
    max-width: 22px;
    max-height: 22px;
    margin: 0 auto;
    color: var(--secondary-accent) !important;
    stroke: currentColor;
    fill: none;
    font-weight: 600;
    transition: transform 0.3s ease;
}

.sidebar-toggle-btn.btn-open svg,
.sidebar-toggle-btn.btn-open .svg_img {
    transform: rotate(180deg);
}

.sidebar-toggle-btn:hover {
    background: rgba(140, 111, 255, 0.12);
    border-color: rgba(140, 111, 255, 0.4);
    box-shadow: 0 10px 28px rgba(140, 111, 255, 0.22), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    transform: translateY(-50%) scale(1.04);
}

.sidebar-toggle-btn:active {
    transform: translateY(-50%) scale(0.96);
}

.br-sidebar-toggle,
.sidebar-toggle-btn {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.br-sidebar-overlay {
    display: none;
    width: 100%;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.br-sidebar {
    width: 240px;
    height: 100%;
    padding: 30px;
    font-size: 14px;
    font-weight: 400;
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: right 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    right: -320px;
    transform: none !important;
    background-color: #07091c;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 1;
    z-index: 1001;
    will-change: transform;
}

.br-sidebar-open, .br-open {
    right: 0 !important;
    transform: none !important;
}


.br-sidebar .menu-list ul {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0;
    margin: 0;
    width: 100%;
    gap: 14px;
}
.br-sidebar .menu-list ul li {
    list-style: none;
    transition: all 0.3s ease-in-out;
}
.br-sidebar .menu-list ul li a,
.br-sidebar .menu-list .blogspace-sidebar-menu .nav-link {
    transition: all 0.3s ease-in-out;
    height: 50px;
    padding-left: 30px;
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-light, var(--text-primary));
    position: relative;
    text-decoration: none !important;
    gap: 0;
}
.br-sidebar .menu-list ul li a:hover,
.br-sidebar .menu-list .blogspace-sidebar-menu .nav-link:hover {
    color: var(--secondary-accent);
    transform: none;
    text-shadow: none;
}
.br-sidebar .menu-list ul li a::after,
.br-sidebar .menu-list .blogspace-sidebar-menu .nav-link::after {
    transition: all 0.3s ease-in-out;
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 30px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    background-color: var(--text-light, var(--text-primary));
    box-shadow: none;
    display: block !important;
}
.br-sidebar .menu-list ul li a::before,
.br-sidebar .menu-list .blogspace-sidebar-menu .nav-link::before {
    content: none !important;
    display: none !important;
}

.br-sidebar .menu-list ul li.active a,
.br-sidebar .menu-list ul li a.active,
.br-sidebar .menu-list .blogspace-sidebar-menu .nav-link.active {
    padding-left: 30px;
    color: var(--primary-accent);
    font-size: 18px;
    font-weight: 800;
    transform: none;
    text-shadow: none;
}
.br-sidebar .menu-list ul li.active a:hover,
.br-sidebar .menu-list ul li a.active:hover,
.br-sidebar .menu-list .blogspace-sidebar-menu .nav-link.active:hover {
    color: var(--secondary-accent);
}
.br-sidebar .menu-list ul li.active a::after,
.br-sidebar .menu-list ul li a.active::after,
.br-sidebar .menu-list .blogspace-sidebar-menu .nav-link.active::after {
    width: 18px;
    height: 4px;
    background-color: var(--primary-accent);
    border-radius: 4px;
    left: -4px;
    top: 50%;
    transform: translateY(-50%);
}

/* Light mode overrides */
body.light .br-sidebar {
    background-color: #f5f7fa;
    box-shadow: -2px 0 8px rgba(15, 23, 42, 0.08);
}
body.light .br-sidebar .menu-list ul li a,
body.light .br-sidebar .menu-list .blogspace-sidebar-menu .nav-link {
    color: #1e293b;
    font-size: 16px;
    font-weight: 500;
}
body.light .br-sidebar .menu-list ul li a::after,
body.light .br-sidebar .menu-list .blogspace-sidebar-menu .nav-link::after {
    background-color: #1e293b;
}
body.light .br-sidebar .menu-list ul li a:hover,
body.light .br-sidebar .menu-list .blogspace-sidebar-menu .nav-link:hover {
    color: var(--secondary-accent);
}
body.light .br-sidebar .menu-list ul li.active a,
body.light .br-sidebar .menu-list ul li a.active,
body.light .br-sidebar .menu-list .blogspace-sidebar-menu .nav-link.active {
    color: var(--primary-accent);
    font-size: 18px;
    font-weight: 800;
}
body.light .br-sidebar .menu-list ul li.active a::after,
body.light .br-sidebar .menu-list ul li a.active::after,
body.light .br-sidebar .menu-list .blogspace-sidebar-menu .nav-link.active::after {
    background-color: var(--primary-accent);
}


/* Responsive Navbar & Sidebar Controls across all screen sizes */
@media (max-width: 991px) {
    .navbar-fixed header button.sidebar-toggle-btn,
    .sidebar-toggle-btn {
        right: 20px;
        width: 38px;
        height: 38px;
        max-width: 38px;
        max-height: 38px;
    }

    .sidebar-toggle-btn svg,
    .sidebar-toggle-btn .svg_img {
        width: 20px;
        height: 20px;
    }

    .navbar-toggle-wrap {
        right: 70px;
    }

    #theme-toggle-button {
        width: 68px;
        height: 38px;
    }

    .toggle-pill {
        width: 30px;
        height: 30px;
        top: 3px;
        left: 3px;
    }

    .toggle-icon {
        width: 16px;
        height: 16px;
    }

    .toggle-icon svg {
        width: 16px;
        height: 16px;
    }

    .toggle-sun {
        left: 10px;
    }

    .toggle-moon {
        right: 10px;
    }

    #toggle:checked + .toggle-slider .toggle-pill {
        transform: translateX(30px);
    }

    .navbar-title {
        left: 20px;
        font-size: 20px;
        max-width: calc(100vw - 156px);
    }

    body.login-page .navbar-toggle-wrap {
        right: 20px;
    }
}

@media (max-width: 768px) {
    .navbar-fixed header button.sidebar-toggle-btn,
    .sidebar-toggle-btn {
        right: 16px;
        width: 34px;
        height: 34px;
        max-width: 34px;
        max-height: 34px;
    }

    .sidebar-toggle-btn svg,
    .sidebar-toggle-btn .svg_img {
        width: 18px;
        height: 18px;
    }

    .navbar-toggle-wrap {
        right: 58px;
    }

    #theme-toggle-button {
        width: 62px;
        height: 34px;
    }

    .toggle-pill {
        width: 26px;
        height: 26px;
        top: 3px;
        left: 3px;
    }

    .toggle-icon {
        width: 14px;
        height: 14px;
    }

    .toggle-icon svg {
        width: 14px;
        height: 14px;
    }

    .toggle-sun {
        left: 9px;
    }

    .toggle-moon {
        right: 9px;
    }

    #toggle:checked + .toggle-slider .toggle-pill {
        transform: translateX(28px);
    }

    .navbar-title {
        left: 16px;
        font-size: 18px;
        max-width: calc(100vw - 132px);
    }

    body.login-page .navbar-toggle-wrap {
        right: 16px;
    }
}

@media (max-width: 480px) {
    .navbar-fixed header button.sidebar-toggle-btn,
    .sidebar-toggle-btn {
        right: 12px;
        width: 30px;
        height: 30px;
        max-width: 30px;
        max-height: 30px;
    }

    .sidebar-toggle-btn svg,
    .sidebar-toggle-btn .svg_img {
        width: 16px;
        height: 16px;
    }

    .navbar-toggle-wrap {
        right: 48px;
    }

    #theme-toggle-button {
        width: 54px;
        height: 30px;
    }

    .toggle-slider {
        border-radius: 999px;
    }

    .toggle-pill {
        width: 24px;
        height: 24px;
        top: 2px;
        left: 2px;
    }

    .toggle-icon {
        width: 12px;
        height: 12px;
    }

    .toggle-icon svg {
        width: 12px;
        height: 12px;
    }

    .toggle-sun {
        left: 8px;
    }

    .toggle-moon {
        right: 8px;
    }

    #toggle:checked + .toggle-slider .toggle-pill {
        transform: translateX(24px);
    }

    .navbar-title {
        left: 12px;
        font-size: 16px;
        max-width: calc(100vw - 110px);
    }

    .br-sidebar {
        width: 220px;
    }

    body.login-page .navbar-toggle-wrap {
        right: 12px;
    }
}

@media (max-width: 360px) {
    .navbar-fixed header button.sidebar-toggle-btn,
    .sidebar-toggle-btn {
        right: 8px;
        width: 26px;
        height: 26px;
        max-width: 26px;
        max-height: 26px;
    }

    .sidebar-toggle-btn svg,
    .sidebar-toggle-btn .svg_img {
        width: 14px;
        height: 14px;
    }

    .navbar-toggle-wrap {
        right: 38px;
    }

    #theme-toggle-button {
        width: 46px;
        height: 26px;
    }

    .toggle-slider {
        border-radius: 999px;
    }

    .toggle-pill {
        width: 20px;
        height: 20px;
        top: 2px;
        left: 2px;
    }

    .toggle-icon {
        width: 10px;
        height: 10px;
    }

    .toggle-icon svg {
        width: 10px;
        height: 10px;
    }

    .toggle-sun {
        left: 7px;
    }

    .toggle-moon {
        right: 7px;
    }

    #toggle:checked + .toggle-slider .toggle-pill {
        transform: translateX(20px);
    }

    .navbar-title {
        left: 8px;
        font-size: 14px;
        max-width: calc(100vw - 86px);
    }

    body.login-page .navbar-toggle-wrap {
        right: 8px;
    }
}

/* Remove purple tap highlight on mobile devices */
.br-sidebar a, .navbar-fixed a, .br-sidebar .menu-list a, .nav-link, .close-sidebar, .sidebar-toggle-btn {
    -webkit-tap-highlight-color: transparent !important;
    outline: none !important;
}

.br-sidebar a:focus,
.br-sidebar a:focus-visible,
.br-sidebar .menu-list a:focus,
.br-sidebar .menu-list a:focus-visible,
.br-sidebar .nav-link:focus,
.br-sidebar .nav-link:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* Brand link — removes browser default link decoration without inline styles */
.navbar-brand-link {
    text-decoration: none;
    color: inherit;
}

/* Subtitle separator beside cert page title */
.cert-page-subtitle {
    font-size: 0.8em;
    opacity: 0.85;
    vertical-align: middle;
}

/* ==========================================================================
   TOP NETWORK PROGRESS BAR (Crimson Red / Portfolio Brand Accent)
   Feedback bar when navigating between pages (Index, Cert, BlogSpace, Projects)
   ========================================================================== */
#topProgressBar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 3px !important;
    width: 0%;
    z-index: 1000000 !important;
    background: linear-gradient(90deg, #ff4d6d, var(--primary-accent, #ff6f6f), #e63946) !important;
    box-shadow: 0 0 10px rgba(255, 111, 111, 0.85), 0 0 4px rgba(230, 57, 70, 0.95) !important;
    transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease-out !important;
    opacity: 0;
    pointer-events: none !important;
}

#topProgressBar.is-loading {
    opacity: 1 !important;
}
