/* ===============================
   FIRA CODE FONT
================================ */

@font-face {
    font-family: 'Fira Code';
    src: url('../fonts/fira-code/FiraCode-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Fira Code';
    src: url('../fonts/fira-code/FiraCode-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Fira Code';
    src: url('../fonts/fira-code/FiraCode-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Fira Code';
    src: url('../fonts/fira-code/FiraCode-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ===============================
   INTER FONT
================================ */

@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter/Inter-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter/Inter-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter/Inter-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter/Inter-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}


:root {
    --bg-body: #ffffff;
    --text-body: #212529;
    --bg-header: #ffffff;
    --text-header: #000000;
    --font-dev: 'Inter', monospace;
    --font-inter: 'Inter', sans-serif;
}

html.dark-mode {
    --bg-body: #000000;
    --text-body: #e0e0e0;
    --bg-header: #0a0a0a;
    --text-header: #ffffff;
    --bs-body-bg: #121212;
    --bs-body-color: #e0e0e0;
}

body {
    font-family: var(--font-dev);
    font-weight: 400;
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
    background-color: var(--bg-body);
    color: var(--text-body);
    transition: background-color 0.3s, color 0.3s;
}

/* Dark Mode Overrides */
html.dark-mode .navbar,
html.dark-mode footer,
html.dark-mode .bg-white,
html.dark-mode .bg-light {
    background-color: var(--bg-header) !important;
    color: var(--text-body) !important;
}

html.dark-mode footer {
    border-top: 1px solid #333 !important;
}

html.dark-mode .bg-secondary {
    background-color: #2c2c2c !important;
}

html.dark-mode .text-dark,
html.dark-mode .text-body,
html.dark-mode .text-muted {
    color: var(--text-body) !important;
}

html.dark-mode .text-primary {
    color: #6ea8fe !important;
}

html.dark-mode .navbar-brand,
html.dark-mode .nav-link,
html.dark-mode .offcanvas-title,
html.dark-mode .btn-close {
    color: var(--text-header) !important;
}

html.dark-mode .offcanvas {
    background-color: var(--bg-header);
    color: var(--text-body);
}

/* Forms & Inputs */
html.dark-mode .form-control,
html.dark-mode .form-select {
    background-color: #2c2c2c;
    border-color: #444;
    color: var(--text-body);
}

html.dark-mode .form-control:focus,
html.dark-mode .form-select:focus {
    background-color: #333;
    color: var(--text-body);
    border-color: #6ea8fe;
}

/* Cards */
html.dark-mode .card {
    background-color: var(--bg-header);
    border-color: #333;
    color: var(--text-body);
}

html.dark-mode .card-header,
html.dark-mode .card-footer {
    background-color: #252525;
    border-color: #333;
}

/* Dropdowns */
html.dark-mode .dropdown-menu {
    background-color: var(--bg-header);
    border-color: #333;
}

html.dark-mode .dropdown-item {
    color: var(--text-body);
}

html.dark-mode .dropdown-item:hover {
    background-color: #333;
    color: #fff;
}

/* Borders */
html.dark-mode .border,
html.dark-mode .border-top,
html.dark-mode .border-bottom,
html.dark-mode .border-start,
html.dark-mode .border-end {
    border-color: #333 !important;
}

html.dark-mode .shadow-sm {
    box-shadow: 0 .125rem .25rem rgba(255, 255, 255, 0.075) !important;
}

html.dark-mode .btn-close {
    filter: invert(1);
}

/* Badge Glass Effect - Dark Mode */
html.dark-mode .bg-glass-white,
html.dark-mode .badge.bg-glass-white {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

html.dark-mode .badge.text-dark {
    color: #ffffff !important;
}

/* Buttons - Dark Mode */
html.dark-mode .btn-outline-primary {
    color: #6ea8fe;
    border-color: #6ea8fe;
}

html.dark-mode .btn-outline-primary:hover {
    background-color: #6ea8fe;
    border-color: #6ea8fe;
    color: #000;
}

/* Blog Content - Dark Mode */
html.dark-mode .prose,
html.dark-mode .blog-content {
    color: var(--text-body) !important;
}

html.dark-mode .prose h1,
html.dark-mode .prose h2,
html.dark-mode .prose h3,
html.dark-mode .prose h4,
html.dark-mode .prose h5,
html.dark-mode .prose h6 {
    color: #ffffff !important;
}

html.dark-mode .prose h2 {
    border-bottom-color: #333 !important;
}

html.dark-mode .prose blockquote {
    background-color: #2c2c2c !important;
    color: var(--text-body) !important;
    border-left-color: #6ea8fe !important;
}

html.dark-mode .prose code:not(pre code) {
    background-color: #2c2c2c !important;
    color: #6ea8fe !important;
}

html.dark-mode .prose table {
    background: #1e1e1e !important;
    color: var(--text-body) !important;
}

html.dark-mode .prose table th {
    background-color: #2c2c2c !important;
    color: #ffffff !important;
    border-bottom-color: #444 !important;
}

html.dark-mode .prose table td {
    border-bottom-color: #333 !important;
}

html.dark-mode .prose table tr:hover td {
    background-color: #2c2c2c !important;
    color: #ffffff !important;
}

/* TOC Active Link - Dark Mode */
html.dark-mode .toc-link.active {
    background-color: rgba(110, 168, 254, 0.1) !important;
    color: #6ea8fe !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

html.dark-mode ::-webkit-scrollbar-track {
    background: #2c2c2c;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* @media (min-width: 992px) {
    .overflow-x-hidden {
        overflow: unset !important;
    }
}

@media (max-width: 465px) {
    .overflow-x-hidden {
        overflow: hidden !important;
    }
} */

/* Bottom Navigation */
.nav-link-active {
    color: var(--bs-primary) !important;
}

/* Navigation Menu Hover & Active Effects */
.navbar-nav .nav-link {
    position: relative;
}

/* Active State Text Color (ensure it's primary) */
.navbar-nav .nav-link.active,
.navbar-nav .nav-link:hover {
    color: var(--bs-primary);
}

/* Bottom Border Animation */
.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background-color: var(--bs-primary);
    transition: width 0.3s ease-in-out;
    border-radius: 2px;
}

/* Hover & Active States for Border */
.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    width: 100%;
}

.pb-safe-area {
    padding-bottom: env(safe-area-inset-bottom);
}

#mobileBottomNav {
    z-index: 1030;
    transition: transform 0.3s ease;
}

html.dark-mode #mobileBottomNav {
    background-color: var(--bg-header) !important;
    border-color: #333 !important;
}

/* Adjust main content padding for mobile to prevent overlap */
@media (max-width: 991.98px) {
    .back-to-top {
        bottom: 80px !important;
    }
}

/* Line Clamp */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-4 {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Icon SVG Wrapper */
.icon-svg-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-svg-wrapper svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
    vertical-align: middle;
}

.object-fit-cover {
    object-fit: cover;
}

/* ===============================
   COMMON LAYOUT & UTILITIES
================================ */

.lazy-wrapper {
    position: relative;
    overflow: hidden;
    background: #e3e3e3;
}

html.dark-mode .lazy-wrapper {
    background: #2c2c2c;
}

.lazyload {
    display: block;
    opacity: 0;
    transition: opacity .4s ease;
}

.lazyload.lazyloaded {
    opacity: 1;
}

.lazy-wrapper::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            #e3e3e3 0%,
            #f4f4f4 50%,
            #e3e3e3 100%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}

html.dark-mode .lazy-wrapper::before {
    background: linear-gradient(90deg,
            #2c2c2c 0%,
            #3d3d3d 50%,
            #2c2c2c 100%);
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.lazy-wrapper.loaded::before,
.lazy-wrapper:has(.lazyloaded)::before {
    display: none !important;
}

/* ===============================
   HEADER STYLES
================================ */

.sticky-top {
    position: sticky !important;
    top: 0;
    z-index: 1020;
}

.sticky-lg-top {
    z-index: 100 !important;
}



.dropdown-toggle::after {
    border-top: unset !important;
    padding-left: 0 !important;
}

.navbar-toggler {
    border: none !important;
}

.offcanvas-header {
    padding: 8px 16px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Reset logo position for offcanvas header specifically */
.offcanvas-header .logo_image {
    position: static !important;
    transform: none !important;
    left: auto !important;
    order: unset !important;
    margin-right: auto;
    display: flex;
    align-items: center;
}

.offcanvas-header .btn-close {
    margin: 0 !important;
    opacity: 0.8;
    padding: 0.5rem;
}

.mobile-body {
    padding: 8px 16px;
    height: calc(100vh - 57px);
    overflow-y: auto;
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.mobile-body::-webkit-scrollbar {
    display: none;
}

/* Mobile Header Layout */
@media (max-width: 991.98px) {
    #header .container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: relative;
    }

    .mobile-lang-selector {
        order: 1;
        flex: 0 0 auto;
    }

    #header .logo_image {
        order: 2;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .mobile-actions {
        order: 3;
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .mobile-lang-selector .dropdown-toggle {
        padding: 0.25rem !important;
        min-width: auto;
    }
}

/* Desktop Layout */
@media (min-width: 992px) {
    #header .container {
        display: flex;
        align-items: center;
    }

    .logo_image {
        margin-right: auto;
    }

    #offcanvasNavbar {
        display: none !important;
    }
}

/* Smooth Offcanvas Animation */
@media (max-width: 991.98px) {
    .offcanvas {
        transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), visibility 0.4s ease-in-out !important;
        background: rgba(255, 255, 255, 0.95) !important;
        box-shadow: 0 4px 8px rgba(16, 16, 16, 0.05) !important;
        backdrop-filter: saturate(180%) blur(40px) !important;
    }

    html.dark-mode .offcanvas {
        background: rgba(30, 30, 30, 0.95) !important;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3) !important;
        backdrop-filter: saturate(180%) blur(40px) !important;
    }
}

/* Theme Toggle Styles */
.theme-toggle-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.3s ease;
    outline: none !important;
    overflow: visible;
}

.theme-toggle-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

html.dark-mode .theme-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.theme-icon-box {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
}

.theme-icon-box i {
    position: absolute;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Tooltip Styles */
.custom-tooltip {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    margin-top: 8px;
}

.custom-tooltip::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 5px 5px 5px;
    border-style: solid;
    border-color: transparent transparent #333 transparent;
}

html.dark-mode .custom-tooltip {
    background-color: #f8f9fa;
    color: #212529;
}

html.dark-mode .custom-tooltip::before {
    border-color: transparent transparent #f8f9fa transparent;
}

.theme-toggle-btn:hover .custom-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.theme-icon-box i[data-icon="moon"] {
    opacity: 1;
    transform: rotate(0deg) scale(1);
    color: #6c757d;
}

.theme-icon-box i[data-icon="sun"] {
    opacity: 0;
    transform: rotate(90deg) scale(0);
    color: #ffc107;
}

html.dark-mode .theme-icon-box i[data-icon="moon"] {
    opacity: 0;
    transform: rotate(-90deg) scale(0);
}

html.dark-mode .theme-icon-box i[data-icon="sun"] {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Mobile Menu Styles */
.mobile-menu-title {
    font-size: 14px;
    padding: 10px 0;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #0d6efd;
    position: relative;
    margin-bottom: 10px;
}

.mobile-menu-title::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, #0d6efd, #0a58ca);
}

.mobile-menu-list {
    margin: 0;
    padding: 0;
}

.mobile-menu-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

html.dark-mode .mobile-menu-item {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    color: #212529;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

html.dark-mode .mobile-menu-link {
    color: #f8f9fa;
}

.mobile-menu-link:hover {
    background-color: rgba(13, 110, 253, 0.05);
    padding-left: 2rem;
}

html.dark-mode .mobile-menu-link:hover {
    background-color: rgba(13, 110, 253, 0.1);
}

.mobile-menu-link.active {
    color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.1);
    border-left: 3px solid #0d6efd;
}

.mobile-menu-link i.bi-chevron-right {
    font-size: 0.875rem;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.mobile-menu-link:hover i.bi-chevron-right {
    opacity: 1;
    transform: translateX(4px);
}

/* Mobile Contact Section */
.mobile-contact-section {
    background-color: rgba(0, 0, 0, 0.02);
}

html.dark-mode .mobile-contact-section {
    background-color: rgba(255, 255, 255, 0.02);
}

.mobile-contact-card {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Mobile Social Icons */
.mobile-social-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-social-icon:hover {
    background-color: #fff;
    color: #0d6efd;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.social-svg-wrapper svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Mobile Contact Info Links */
.mobile-contact-info a {
    transition: all 0.3s ease;
}

.mobile-contact-info a:hover {
    opacity: 0.8;
    text-decoration: underline !important;
}

#mobileBottomNav {
    transition: transform 0.3s ease-in-out;
    z-index: 1040;
}

.bottom-nav-hidden {
    transform: translateY(100%);
}

/* ===============================
   Go To Top
================================ */
.go-to {
    position: fixed;
    bottom: 125px !important;
    right: 25px;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #377dff, #0056b3) !important;
    color: #fff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(55, 125, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    z-index: 120 !important;
    text-decoration: none;
    font-size: 1.2rem;
}

.go-to:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(55, 125, 255, 0.4);
}

@media (max-width: 991.98px) {
    .go-to {
        bottom: 74px !important;
        right: 15px !important;
        width: 42px;
        height: 42px;
    }
}

/* Dark mode tweaks */
html.dark-mode .fab-item {
    background: #2c2c2c;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

html.dark-mode .fab-label {
    background: rgba(255, 255, 255, 0.9);
    color: #000;
}

@media (max-width: 767.98px) {
    .fab-wrapper {
        bottom: 160px;
        right: 20px;
    }

    .fab-label {
        right: 55px;
        /* Smaller gap on mobile */
    }
}

/* ===============================
   ACCESSIBILITY IMPROVEMENTS
================================ */

/* Increase Swiper Pagination Bullet Touch Target */
.swiper-pagination-bullet {
    position: relative;
    cursor: pointer;
}

.swiper-pagination-bullet::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
    background: transparent;
}
