:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #10b981;
    --secondary-dark: #059669;
    --background-dark: #0f172a;
    --background-light: #f8fafc;
    --text-dark: #e2e8f0;
    --text-light: #1e293b;
    --card-bg-dark: #1e293b;
    --card-bg-light: #ffffff;
    --nav-bg-dark: rgba(15, 23, 42, 0.95);
    --nav-bg-light: rgba(248, 250, 252, 0.95);
    --border-radius: 12px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --project-cta-glow: 37, 99, 235;
    --project-cta-text: #93c5fd;
    --contact-icon-color: #93c5fd;
    --contact-link-color: #ffffff;
    --contact-hover-color: #bfdbfe;
}

:root.light-mode {
    --primary-color: #10b981;
    --primary-dark: #059669;
    --secondary-color: #2563eb;
    --secondary-dark: #1d4ed8;
    --background-dark: #f8fafc;
    --background-light: #0f172a;
    --text-dark: #1e293b;
    --text-light: #e2e8f0;
    --card-bg-dark: #ffffff;
    --card-bg-light: #1e293b;
    --nav-bg-dark: rgba(248, 250, 252, 0.95);
    --nav-bg-light: rgba(15, 23, 42, 0.95);
    --project-cta-glow: 16, 185, 129;
    --project-cta-text: var(--primary-dark);
    --contact-icon-color: var(--primary-color);
    --contact-link-color: var(--text-dark);
    --contact-hover-color: var(--primary-color);
}

html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    scrollbar-color: var(--primary-color) var(--background-dark);
    scrollbar-width: thin;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    background: var(--background-dark);
    color: var(--text-dark);
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    transition: background 0.5s, color 0.5s;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

@supports (overflow: clip) {
    html,
    body {
        overflow-x: clip;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

img,
video,
canvas,
iframe {
    max-width: 100%;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2rem;
    position: relative;
    display: inline-block;
    margin-bottom: 3rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.lead {
    font-size: 1.25rem;
    font-weight: 300;
}

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

::-webkit-scrollbar-track {
    background: var(--background-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

@media (max-width: 575px) {
    html {
        scrollbar-color: var(--primary-color) var(--background-dark);
        scrollbar-width: thin;
    }

    ::-webkit-scrollbar {
        height: 8px;
        width: 8px;
    }
}

/* Navbar */
.navbar {
    background: var(--nav-bg-dark);
    padding: 1rem 0;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.navbar-brand {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
    margin: 0;
    line-height: inherit;
    text-decoration: none;
}

.navbar-brand h1 {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    letter-spacing: inherit;
    margin: 0;
    line-height: inherit;
    display: inline;
}

.navbar-brand span {
    color: var(--primary-color);
    font-weight: 700;
}

:root.light-mode .navbar-brand {
    font-size: 1.8rem;
    font-weight: 700;
    color: #000000;
    letter-spacing: -0.5px;
    margin: 0;
    line-height: inherit;
}

:root.light-mode .navbar-brand h1 {
    color: inherit;
}

.nav-link {
    color: var(--text-dark);
    margin: 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 1rem;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 70%;
}

.nav-link.active{
    color: var(--primary-color) !important;
}

/* Blog Nav Link */
.blog-link {
    position: relative;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(168, 85, 247, 0.14));
    border: 1px solid rgba(14, 165, 233, 0.32);
    border-radius: 25px;
    padding: 0.5rem 1.2rem !important;
    margin-left: 0.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.blog-link::after {
    display: none;
}

.blog-link::before {
    content: '';
    position: absolute;
    inset: -55% auto -55% -55%;
    width: 28%;
    pointer-events: none;
    transform: skewX(-20deg);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.24), transparent);
    animation: blog-shine 2.8s ease-in-out infinite;
}

.blog-link i {
    color: #38bdf8;
    margin-right: 5px;
    font-size: 0.9rem;
    transition: transform 0.3s ease, color 0.3s ease;
    animation: blog-icon-pop 1.7s ease-in-out infinite;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

.blog-link:hover {
    background: linear-gradient(135deg, #0ea5e9, #8b5cf6);
    border-color: transparent;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(14, 165, 233, 0.3);
}

.blog-link:hover i {
    color: #ffffff;
    animation: blog-icon-bounce 0.65s ease-in-out;
}

:root.light-mode .blog-link {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.16), rgba(139, 92, 246, 0.13));
    border-color: rgba(14, 165, 233, 0.42);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.12);
}

:root.light-mode .blog-link::before {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(14, 165, 233, 0.2),
        rgba(139, 92, 246, 0.26),
        transparent
    );
}

:root.light-mode .blog-link:hover {
    background: linear-gradient(135deg, #0284c7, #7c3aed);
    border-color: transparent;
    color: #ffffff !important;
    box-shadow: 0 8px 22px rgba(14, 165, 233, 0.28);
}

/* Featured Nav Link - Distinct style for external page navigation */
.featured-link {
    position: relative;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(16, 185, 129, 0.15));
    border: 1px solid rgba(37, 99, 235, 0.3);
    border-radius: 25px;
    padding: 0.5rem 1.2rem !important;
    margin-left: 0.5rem;
    transition: all 0.3s ease;
    overflow: hidden;
}

.featured-link::after {
    display: none;
}

.featured-link i {
    color: #f59e0b;
    margin-right: 5px;
    font-size: 0.85rem;
    animation: featured-star-pulse 1.5s ease-in-out infinite;
}

.featured-link::before {
    content: '';
    position: absolute;
    inset: -55% auto -55% -55%;
    width: 28%;
    pointer-events: none;
    transform: skewX(-20deg);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: featured-shine 2.5s ease-in-out infinite;
}

.featured-link:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary-color));
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
    color: #ffffff !important;
}

.featured-link:hover i {
    color: #ffffff;
    animation: featured-star-spin 0.6s ease-in-out;
}

:root.light-mode .featured-link {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(37, 99, 235, 0.14));
    border-color: rgba(5, 150, 105, 0.42);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.12);
}

:root.light-mode .featured-link::before {
    width: 30%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(37, 99, 235, 0.22),
        rgba(16, 185, 129, 0.28),
        transparent
    );
}

:root.light-mode .featured-link i {
    text-shadow: 0 0 6px rgba(245, 158, 11, 0.28);
}

:root.light-mode .featured-link:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--secondary-color));
    border-color: transparent;
    color: #ffffff !important;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

@keyframes blog-icon-pop {
    0%, 100% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    45% {
        transform: translateY(-3px) rotate(-5deg) scale(1.1);
        opacity: 0.85;
    }
    70% {
        transform: translateY(1px) rotate(4deg) scale(0.98);
    }
}

@keyframes blog-icon-bounce {
    0%, 100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }
    30% {
        transform: translateY(-7px) rotate(-8deg) scale(1.16);
    }
    60% {
        transform: translateY(2px) rotate(6deg) scale(0.96);
    }
}

@keyframes blog-shine {
    0%, 45% {
        left: -65%;
    }
    82%, 100% {
        left: 125%;
    }
}

@keyframes featured-star-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

@keyframes featured-star-spin {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.3);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

@keyframes featured-shine {
    0%, 42% {
        left: -65%;
    }
    78%, 100% {
        left: 125%;
    }
}

/* Active link text color in light mode */
:root.light-mode .nav-link.active {
    color: #000 !important;
}

:root.light-mode .navbar-dark .nav-link {
    color: #1e293b; /* dark text for light mode */
}

:root.light-mode .navbar-dark .nav-link.active {
    color: var(--primary-color) !important;
}

/* Navbar Toggle */
.navbar-toggler {
    border: 1px solid var(--text-dark);
}

:root.light-mode .navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='black' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(226, 232, 240, 1)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

.mobile-nav-close {
    display: none;
}

@media (max-width: 991.98px) {
    .navbar {
        backdrop-filter: none;
        padding: 0.75rem 0;
    }

    .navbar > .container {
        position: relative;
    }

    .navbar-toggler {
        align-items: center;
        background: rgba(15, 23, 42, 0.62);
        border: 1px solid rgba(226, 232, 240, 0.2);
        border-radius: 8px;
        box-shadow: 0 14px 34px rgba(15, 23, 42, 0.24);
        display: inline-flex;
        height: 2.75rem;
        justify-content: center;
        padding: 0;
        position: relative;
        width: 2.75rem;
        z-index: 1065;
    }

    :root.light-mode .navbar-toggler {
        background: rgba(255, 255, 255, 0.82);
        border-color: rgba(15, 23, 42, 0.14);
        box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
    }

    .navbar-toggler:focus {
        box-shadow: 0 0 0 0.22rem rgba(16, 185, 129, 0.22);
    }

    .navbar-toggler[aria-expanded="true"] {
        background: rgba(15, 23, 42, 0.92);
        border-color: rgba(226, 232, 240, 0.22);
    }

    body.mobile-nav-open .navbar-toggler {
        background: rgba(15, 23, 42, 0.92);
        border-color: rgba(226, 232, 240, 0.22);
        position: fixed;
        right: max(0.75rem, calc((100vw - 960px) / 2 + 0.75rem));
        top: 0.75rem;
    }

    :root.light-mode .navbar-toggler[aria-expanded="true"] {
        background: rgba(255, 255, 255, 0.94);
        border-color: rgba(15, 23, 42, 0.16);
    }

    :root.light-mode body.mobile-nav-open .navbar-toggler {
        background: rgba(255, 255, 255, 0.94);
        border-color: rgba(15, 23, 42, 0.16);
    }

    .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon,
    body.mobile-nav-open .navbar-toggler .navbar-toggler-icon {
        background-image: none;
        display: inline-block;
        height: 1.5rem;
        position: relative;
        width: 1.5rem;
    }

    .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::before,
    .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::after,
    body.mobile-nav-open .navbar-toggler .navbar-toggler-icon::before,
    body.mobile-nav-open .navbar-toggler .navbar-toggler-icon::after {
        background: #ffffff;
        border-radius: 999px;
        content: '';
        height: 2px;
        left: 50%;
        position: absolute;
        top: 50%;
        width: 1.35rem;
    }

    :root.light-mode .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::before,
    :root.light-mode .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::after,
    :root.light-mode body.mobile-nav-open .navbar-toggler .navbar-toggler-icon::before,
    :root.light-mode body.mobile-nav-open .navbar-toggler .navbar-toggler-icon::after {
        background: #0f172a;
    }

    .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::before,
    body.mobile-nav-open .navbar-toggler .navbar-toggler-icon::before {
        transform: translate(-50%, -50%) rotate(45deg);
    }

    .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::after,
    body.mobile-nav-open .navbar-toggler .navbar-toggler-icon::after {
        transform: translate(-50%, -50%) rotate(-45deg);
    }

    .navbar:has(.navbar-collapse.show)::before,
    .navbar:has(.navbar-collapse.collapsing)::before,
    .navbar.mobile-nav-open::before,
    body.mobile-nav-open::before {
        background: rgba(2, 6, 23, 0.58);
        backdrop-filter: blur(4px);
        content: '';
        inset: 0;
        position: fixed;
        z-index: 1050;
    }

    .navbar-collapse {
        background:
            linear-gradient(145deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98)),
            var(--nav-bg-dark);
        border-left: 1px solid rgba(226, 232, 240, 0.12);
        bottom: 0 !important;
        box-shadow: -28px 0 60px rgba(2, 6, 23, 0.38);
        display: block !important;
        height: auto !important;
        inset: 0 0 0 auto;
        max-width: 23rem;
        max-height: none !important;
        min-height: 0 !important;
        opacity: 0;
        overflow-x: hidden;
        overflow-y: auto;
        padding: 4.65rem 1.15rem 1.5rem;
        position: fixed;
        transform: translateX(100%);
        transition: transform 0.34s ease, opacity 0.24s ease, visibility 0.34s ease;
        visibility: hidden;
        width: min(86vw, 23rem);
        z-index: 1055;
    }

    .mobile-nav-close {
        align-items: center;
        background: rgba(15, 23, 42, 0.92);
        border: 1px solid rgba(226, 232, 240, 0.22);
        border-radius: 8px;
        color: #ffffff;
        display: inline-flex;
        font-size: 1.15rem;
        height: 2.75rem;
        justify-content: center;
        padding: 0;
        position: absolute;
        right: 1rem;
        top: 0.9rem;
        width: 2.75rem;
        z-index: 2;
    }

    .mobile-nav-close:focus-visible {
        box-shadow: 0 0 0 0.22rem rgba(16, 185, 129, 0.22);
        outline: none;
    }

    :root.light-mode .navbar-collapse {
        background:
            linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.98)),
            var(--nav-bg-dark);
        border-left-color: rgba(15, 23, 42, 0.1);
        box-shadow: -28px 0 60px rgba(15, 23, 42, 0.18);
    }

    :root.light-mode .mobile-nav-close {
        background: rgba(255, 255, 255, 0.94);
        border-color: rgba(15, 23, 42, 0.16);
        color: #0f172a;
    }

    .navbar-collapse.show,
    .navbar-collapse.collapsing,
    .navbar.mobile-nav-open .navbar-collapse,
    body.mobile-nav-open #navbarNav.navbar-collapse {
        height: auto !important;
        opacity: 1;
        transform: translateX(0);
        visibility: visible;
    }

    .navbar-collapse.collapsing {
        transition: transform 0.34s ease, opacity 0.24s ease;
    }

    .navbar-nav {
        gap: 0.7rem;
        width: 100%;
    }

    .navbar-collapse .nav-link {
        align-items: center;
        background: transparent;
        border: 1px solid transparent;
        border-radius: 8px;
        display: flex;
        justify-content: space-between;
        margin: 0;
        padding: 0.92rem 1rem;
        width: 100%;
    }

    :root.light-mode .navbar-collapse .nav-link {
        background: transparent;
        border-color: transparent;
    }

    .navbar-collapse .nav-link::after {
        display: none;
    }

    .navbar-collapse .nav-link.active {
        background: transparent;
        border-color: transparent;
        color: var(--primary-color) !important;
        transform: none;
    }

    :root.light-mode .navbar-collapse .nav-link.active {
        color: var(--primary-color) !important;
    }

    .navbar-collapse .nav-link:hover,
    .navbar-collapse .nav-link:focus-visible {
        background: transparent;
        border-color: rgba(16, 185, 129, 0.26);
        color: var(--primary-color) !important;
        transform: translateX(-3px);
    }

    .navbar-collapse .blog-link,
    .navbar-collapse .featured-link {
        justify-content: center;
        margin-left: 0;
        margin-top: 0.25rem;
        min-height: 3.1rem;
    }

    .navbar-collapse .blog-link {
        background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(168, 85, 247, 0.14));
        border-color: rgba(14, 165, 233, 0.32);
        color: var(--text-dark) !important;
    }

    .navbar-collapse .blog-link:hover,
    .navbar-collapse .blog-link:focus-visible {
        background: linear-gradient(135deg, #0ea5e9, #8b5cf6);
        border-color: transparent;
        color: #ffffff !important;
        transform: translateY(-2px);
    }

    :root.light-mode .navbar-collapse .blog-link {
        background: linear-gradient(135deg, rgba(14, 165, 233, 0.16), rgba(139, 92, 246, 0.13));
        border-color: rgba(14, 165, 233, 0.42);
        color: var(--text-dark) !important;
    }

    :root.light-mode .navbar-collapse .blog-link:hover,
    :root.light-mode .navbar-collapse .blog-link:focus-visible {
        background: linear-gradient(135deg, #0284c7, #7c3aed);
        border-color: transparent;
        color: #ffffff !important;
    }

    .navbar-collapse .featured-link {
        background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(16, 185, 129, 0.15));
        border-color: rgba(37, 99, 235, 0.3);
        color: var(--text-dark) !important;
    }

    .navbar-collapse .featured-link:hover,
    .navbar-collapse .featured-link:focus-visible {
        background: linear-gradient(135deg, var(--primary-dark), var(--secondary-color));
        border-color: transparent;
        color: #ffffff !important;
        transform: translateY(-2px);
    }

    :root.light-mode .navbar-collapse .featured-link {
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(37, 99, 235, 0.14));
        border-color: rgba(5, 150, 105, 0.42);
        color: var(--text-dark) !important;
    }

    :root.light-mode .navbar-collapse .featured-link:hover,
    :root.light-mode .navbar-collapse .featured-link:focus-visible {
        background: linear-gradient(135deg, var(--primary-dark), var(--secondary-color));
        border-color: transparent;
        color: #ffffff !important;
    }
}

/* Profile Picture */
@keyframes floating {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0px);
    }
}

.profile-picture-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto;
}

.profile-picture {
    border-radius: 50%;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 5px solid var(--primary-color);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
    animation: floating 4s ease-in-out infinite;
    transition: var(--transition);
}

.profile-picture-container::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 50%;
    border: 2px dashed var(--primary-color);
    animation: spin 15s linear infinite;
    opacity: 0.7;
    z-index: -1;
}

:root.light-mode .profile-picture {
    border-color: var(--primary-color);
    box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Sections */
section {
    padding: 6rem 0;
    position: relative;
    scroll-margin-top: 44px;
}

/* Cards */
.card {
    background: var(--card-bg-dark);
    color: var(--text-dark);
    border-radius: var(--border-radius);
    transition: var(--transition);
    border: none;
    height: 100%;
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.card-img-top {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: var(--transition);
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.card-text {
    margin-bottom: 1.5rem;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card:hover .card-img-top {
    transform: scale(1.05);
}

#projects {
    padding-top: 4.75rem;
    padding-bottom: 4.75rem;
}

#projects h2 {
    margin-bottom: 2rem;
}

#projects .lead {
    max-width: 620px;
    margin: 0 auto;
    font-size: 1.05rem;
}

#projects .card {
    border-radius: 10px;
}

#projects .card:hover {
    transform: translateY(-6px);
}

#projects .card-img-top {
    height: 150px;
}

#projects .card-body {
    padding: 1rem 1rem 0.65rem;
}

#projects .card-title {
    min-height: 2.6rem;
    margin-bottom: 0.55rem;
    font-size: 1rem;
}

#projects .card-text {
    max-height: 4.8rem;
    margin-bottom: 0.9rem;
    overflow-y: auto;
    padding-right: 0.25rem;
    font-size: 0.88rem;
    line-height: 1.45;
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--project-cta-glow), 0.55) transparent;
}

#projects .card-text::-webkit-scrollbar {
    width: 4px;
}

#projects .card-text::-webkit-scrollbar-track {
    background: transparent;
}

#projects .card-text::-webkit-scrollbar-thumb {
    background: rgba(var(--project-cta-glow), 0.55);
    border-radius: 999px;
}

#projects .project-tags {
    flex-wrap: wrap;
    gap: 0.4rem;
}

#projects .badge {
    padding: 0.38rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 500;
}

#projects .card-footer {
    padding: 0.45rem 1rem 1rem;
}

@media (max-width: 767.98px) {
    #projects {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }

    #projects .card {
        max-width: 420px;
        margin: 0 auto;
    }

    #projects .card-img-top {
        height: 165px;
    }

    #projects .card-title,
    #projects .card-text {
        min-height: auto;
    }
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    border: none;
    letter-spacing: 0.5px;
}

.btn-primary {
    background-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

#projects .card-footer .btn-outline-primary {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-color: var(--primary-color);
    background:
        linear-gradient(135deg, rgba(var(--project-cta-glow), 0.12), rgba(var(--project-cta-glow), 0.04)),
        transparent;
    color: var(--project-cta-text);
    padding: 0.62rem 1rem;
    font-size: 0.95rem;
    letter-spacing: 0.2px;
    box-shadow: 0 7px 16px rgba(var(--project-cta-glow), 0.12);
    animation: project-cta-bounce 2.6s ease-in-out infinite;
}

#projects .card-footer .btn-outline-primary::before {
    content: '';
    position: absolute;
    inset: -55% auto -55% -55%;
    width: 28%;
    pointer-events: none;
    transform: skewX(-20deg);
    background: linear-gradient(90deg, transparent, rgba(var(--project-cta-glow), 0.24), transparent);
    animation: project-cta-shine 1.55s ease-in-out infinite;
}

#projects .card-footer .btn-outline-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border: 2px solid rgba(var(--project-cta-glow), 0.46);
    border-radius: inherit;
    animation: project-cta-ring 2.6s ease-in-out infinite;
}

#projects .card-footer .btn-outline-primary .project-cta-icon {
    margin-left: 0.45rem;
    width: 1.35rem;
    height: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(var(--project-cta-glow), 0.14);
    font-size: 0.78rem;
    transition: transform 0.25s ease;
}

#projects .card-footer .btn-outline-primary:hover,
#projects .card-footer .btn-outline-primary:focus-visible {
    animation-play-state: paused;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    color: #ffffff;
    border-color: transparent;
    transform: translateY(-3px);
    box-shadow: 0 14px 24px rgba(var(--project-cta-glow), 0.28);
}

#projects .card-footer .btn-outline-primary:hover::before,
#projects .card-footer .btn-outline-primary:focus-visible::before,
#projects .card-footer .btn-outline-primary:hover::after,
#projects .card-footer .btn-outline-primary:focus-visible::after {
    animation-play-state: paused;
}

#projects .card-footer .btn-outline-primary:hover .project-cta-icon,
#projects .card-footer .btn-outline-primary:focus-visible .project-cta-icon {
    background: rgba(255, 255, 255, 0.22);
    transform: translateX(5px);
}

/* View project detail hover border in light mode */
:root.light-mode .btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

:root.light-mode .btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

:root.light-mode #projects .card-footer .btn-outline-primary:hover,
:root.light-mode #projects .card-footer .btn-outline-primary:focus-visible {
    color: #ffffff;
}

@keyframes project-cta-bounce {
    0%,
    72%,
    100% {
        transform: translateY(0) scale(1);
        box-shadow: 0 7px 16px rgba(var(--project-cta-glow), 0.12);
    }

    78% {
        transform: translateY(-4px) scale(1.01);
        box-shadow: 0 13px 22px rgba(var(--project-cta-glow), 0.22);
    }

    84% {
        transform: translateY(0) scale(1);
    }

    90% {
        transform: translateY(-2px) scale(1.006);
        box-shadow: 0 10px 18px rgba(var(--project-cta-glow), 0.18);
    }
}

@keyframes project-cta-shine {
    0%,
    42% {
        left: -65%;
    }

    78%,
    100% {
        left: 125%;
    }
}

@keyframes project-cta-ring {
    0%,
    68% {
        opacity: 0;
        transform: scale(1);
    }

    76% {
        opacity: 0.95;
        transform: scale(0.98);
    }

    100% {
        opacity: 0;
        transform: scale(1.08);
    }
}

@media (prefers-reduced-motion: reduce) {
    #projects .card-footer .btn-outline-primary,
    #projects .card-footer .btn-outline-primary::before,
    #projects .card-footer .btn-outline-primary::after,
    .btn-view,
    .btn-view::before,
    .btn-view::after {
        animation: none;
    }
}

/* Skills Section */
#skills {
    padding: 4.5rem 0;
}

#skills .text-center.mb-5 {
    margin-bottom: 2rem !important;
}

.skill-item {
    text-align: center;
    padding: 1.5rem;
    transition: var(--transition);
    border-radius: var(--border-radius);
}

.skill-item:hover {
    background: rgba(37, 99, 235, 0.1);
    transform: translateY(-5px);
}

/* Skill icon hover color in light mode */
:root.light-mode .skill-item:hover {
    background: rgba(16, 185, 129, 0.1);
}

.skill-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    transition: var(--transition);
}

/* Skill icon hover color in light mode */
:root.light-mode .skill-item:hover .skill-icon {
    color: #10b981;
}

.skill-name {
    font-weight: 500;
    margin-bottom: 0;
}

.skill-category-panel {
    padding: 1rem;
    border-radius: var(--border-radius);
    background: rgba(30, 41, 59, 0.24);
    border: 1px solid rgba(226, 232, 240, 0.1);
}

:root.light-mode .skill-category-panel {
    background: rgba(255, 255, 255, 0.55);
    border-color: rgba(30, 41, 59, 0.1);
}

.skill-category-panel .skill-item {
    min-height: 84px;
    padding: 0.65rem 0.35rem;
}

.skill-category-panel .skill-icon {
    font-size: 1.65rem;
    margin-bottom: 0.45rem;
}

.skill-category-panel .skill-name {
    font-size: 0.72rem;
    line-height: 1.25;
}

.skill-category-panel .skill-icon.tailwind,
.skill-category-panel .skill-icon.nextjs,
.skill-category-panel .skill-icon.img-icon {
    width: 28px;
    height: 28px;
}

.skill-category-title {
    color: var(--primary-color);
    font-size: 1rem;
    margin: 0 0 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.14);
}

:root.light-mode .skill-category-title {
    border-bottom-color: rgba(30, 41, 59, 0.14);
}

/* Tailwind CSS Icon */
.skill-icon.tailwind,
.skill-icon.nextjs {
    fill: var(--primary-color);
    width: 48px;
    height: 48px;
}

/* C++ Logo */
.skill-icon.img-icon {
    filter: brightness(0) saturate(100%) invert(28%) sepia(65%) saturate(4199%) hue-rotate(205deg) brightness(104%) contrast(103%);
    transition: var(--transition);
    width: 48px;
    height: 48px;
}

:root.light-mode .skill-icon.img-icon {
    filter: brightness(0) saturate(100%) invert(48%) sepia(90%) saturate(690%) hue-rotate(119deg) brightness(94%) contrast(87%);
}

/* Contact Section */
#contact {
    padding-top: 4.75rem;
    padding-bottom: 4.75rem;
}

#contact .text-center.mb-4 {
    margin-bottom: 1.25rem !important;
}

.contact-panel {
    max-width: 640px;
    margin: 0 auto;
    padding: 0;
    border: 1px solid rgba(var(--project-cta-glow), 0.28);
    border-radius: 10px;
    background:
        radial-gradient(circle at 18% 0%, rgba(var(--project-cta-glow), 0.16), transparent 32%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.86)),
        var(--card-bg-dark);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

:root.light-mode .contact-panel {
    background:
        radial-gradient(circle at 18% 0%, rgba(var(--project-cta-glow), 0.14), transparent 34%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.92));
    border-color: rgba(var(--project-cta-glow), 0.34);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.terminal-titlebar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.8rem;
    padding: 0.72rem 0.95rem;
    border-bottom: 1px solid rgba(var(--project-cta-glow), 0.22);
    background: rgba(2, 6, 23, 0.54);
    color: #cbd5e1;
    font-family: "Fira Code", "Consolas", "Courier New", monospace;
    font-size: 0.82rem;
}

:root.light-mode .terminal-titlebar {
    background: rgba(226, 232, 240, 0.7);
    color: #475569;
}

.terminal-controls {
    display: inline-flex;
    gap: 0.42rem;
}

.terminal-controls span {
    width: 0.68rem;
    height: 0.68rem;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.38);
}

.terminal-controls span:nth-child(2) {
    background: #f59e0b;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.34);
}

.terminal-controls span:nth-child(3) {
    background: #22c55e;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.34);
}

.terminal-path {
    justify-self: center;
    color: inherit;
    letter-spacing: 0;
}

.terminal-titlebar i {
    color: var(--contact-icon-color);
}

.contact-panel .col-auto {
    width: 100%;
    padding: 1.15rem 1.2rem 0;
}

.contact-panel .col-auto p,
.contact-intro {
    margin: 0 0 0.95rem;
    text-align: left;
    font-family: "Fira Code", "Consolas", "Courier New", monospace;
    font-size: 0.95rem;
    color: var(--text-dark);
}

.contact-info {
    display: grid;
    gap: 0.75rem;
    padding: 0 1.2rem 1.2rem;
}

.contact-info a,
.contact-item {
    color: var(--contact-link-color);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.85rem;
    min-height: 4rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid rgba(var(--project-cta-glow), 0.2);
    border-radius: 8px;
    background: rgba(2, 6, 23, 0.42);
    text-align: left;
    overflow-wrap: anywhere;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

:root.light-mode .contact-info a,
:root.light-mode .contact-item {
    background: rgba(255, 255, 255, 0.74);
    border-color: rgba(var(--project-cta-glow), 0.26);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.contact-info a:hover,
.contact-info a:focus-visible {
    color: var(--contact-hover-color);
    border-color: rgba(var(--project-cta-glow), 0.48);
    background: rgba(var(--project-cta-glow), 0.12);
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.contact-info i {
    color: var(--contact-icon-color);
    font-size: 1.05rem;
    width: 2.15rem;
    height: 2.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 2.15rem;
    border: 1px solid rgba(var(--project-cta-glow), 0.28);
    border-radius: 7px;
    background: rgba(var(--project-cta-glow), 0.14);
    text-align: center;
}

.contact-command {
    display: grid;
    gap: 0.14rem;
    min-width: 0;
    font-family: "Fira Code", "Consolas", "Courier New", monospace;
}

.command-prompt {
    color: #7dd3fc;
    font-size: 0.76rem;
}

.command-value {
    color: var(--contact-link-color);
    font-size: 0.96rem;
    line-height: 1.35;
}

.contact-info a:hover .command-value,
.contact-info a:focus-visible .command-value {
    color: var(--contact-hover-color);
}

:root.light-mode .command-prompt {
    color: var(--primary-dark);
}

/* Light mode adjustments */
:root.light-mode .contact-info a {
    color: var(--contact-link-color);
}

:root.light-mode .contact-info a:hover {
    color: var(--primary-color);
}

/* Add this to your existing CSS */

/* Dark mode hand icon color */
.wave i.fa-hand {
    color: var(--contact-icon-color);
}

/* Light mode hand icon color */
:root.light-mode .wave i.fa-hand {
    color: var(--primary-color);
    /* or any other color you prefer */
}

.social-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 0;
    padding: 0 1.2rem 1.25rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.1);
    color: var(--contact-icon-color);
    font-size: 1.25rem;
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-5px);
}

.social-links a {
    text-decoration: none;
}

.social-link {
    outline: none;
    text-decoration: none;
}

.social-link:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

@media (max-width: 576px) {
    #contact {
        padding-top: 3.75rem;
        padding-bottom: 3.75rem;
    }

    .contact-panel {
        padding: 0;
    }

    .terminal-titlebar {
        grid-template-columns: auto 1fr;
    }

    .terminal-titlebar i {
        display: none;
    }

    .contact-panel .col-auto,
    .contact-info,
    .social-links {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }

    .contact-panel .col-auto {
        padding-top: 0.95rem;
    }

    .contact-info {
        padding-bottom: 0.95rem;
    }

    .contact-info a,
    .contact-item {
        align-items: flex-start;
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .command-prompt {
        font-size: 0.72rem;
    }

    .command-value {
        font-size: 0.86rem;
    }

    .social-link {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}

/* Floating Buttons */
.floating-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 1000;
}

.back-to-top,
.theme-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--box-shadow);
}

.back-to-top:hover,
.theme-toggle:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.back-to-top {
    bottom: 85px;
}

/* Footer */
footer {
    background: var(--card-bg-dark);
    color: var(--text-dark);
    padding: 2rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.5s, color 0.5s;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.footer-content p {
    margin: 0;
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 1s ease-out forwards;
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

.delay-3 {
    animation-delay: 0.6s;
}

.delay-4 {
    animation-delay: 0.8s;
}

/* Typing Animation Container */
.typing-container {
    min-height: 4.5rem;
    display: flex;
    justify-content: center;
    padding: 0 15px;
    box-sizing: border-box;
    width: 100%;
    text-align: center;
}

/* Mobile-specific adjustments */
@media (max-width: 768px) {
    .typing-container {
        justify-content: flex-start;
        text-align: left;
    }
}

/* Text element with cursor */
#typing-text {
    display: inline;
    position: relative;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 100%;
}

/* Cursor styling - now using a span element */
.blinking-cursor {
    display: inline-block;
    width: 8px;
    height: 1.2em;
    background-color: var(--primary-color);
    animation: blink 1s step-end infinite;
    border-radius: 2px;
    vertical-align: middle;
    margin-left: 2px;
}

@keyframes blink {

    from,
    to {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Wave Animation */
.wave {
    display: inline-block;
    animation: wave 2s infinite;
    transform-origin: 70% 70%;
}

@keyframes wave {
    0% {
        transform: rotate(0deg);
    }

    10% {
        transform: rotate(-10deg);
    }

    20% {
        transform: rotate(12deg);
    }

    30% {
        transform: rotate(-10deg);
    }

    40% {
        transform: rotate(9deg);
    }

    50% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    #about {
        padding-top: 7rem;
    }

    section {
        padding: 4rem 0;
    }

    .profile-picture-container {
        width: 250px;
        height: 250px;
        margin-bottom: 2rem;
    }
}

@media (max-width: 768px) {
    h2 {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }

    .lead {
        font-size: 1.1rem;
    }

    .navbar-brand {
        font-size: 1.5rem;
    }

    .featured-link {
        margin-left: 0;
        margin-top: 0.5rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    section {
        padding: 3rem 0;
    }

    .profile-picture-container {
        width: 200px;
        height: 200px;
    }

    .card {
        margin-bottom: 1.5rem;
    }
}

/* Cosmic Download Button */
.cosmic-download-btn {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 15rem;
    height: 3.5rem;
    overflow: hidden;
    background-size: 300% 300%;
    cursor: pointer;
    backdrop-filter: blur(1rem);
    border-radius: 5rem;
    transition: all 0.5s ease;
    animation: cosmic-gradient 8s ease infinite;
    border: double 4px transparent;
    background-image: linear-gradient(var(--background-dark), var(--background-dark)),
        linear-gradient(137.48deg,
            var(--primary-color) 10%,
            var(--secondary-color) 45%,
            #8f51ea 67%,
            #0044ff 87%);
    background-origin: border-box;
    background-clip: content-box, border-box;
    text-decoration: none;
    margin: 1rem auto;
}

.cosmic-download-btn strong {
    z-index: 2;
    font-size: 1rem;
    letter-spacing: 2px;
    color: #ffffff;
    text-shadow: 0 0 4px white;
    transition: all 0.3s ease;
}

.cosmic-container {
    position: absolute;
    z-index: -1;
    width: 100%;
    height: 100%;
    overflow: hidden;
    transition: 0.5s;
    backdrop-filter: blur(1rem);
    border-radius: 5rem;
}

.cosmic-stars {
    position: relative;
    background: transparent;
    width: 200rem;
    height: 200rem;
}

.cosmic-stars::after {
    content: "";
    position: absolute;
    top: -10rem;
    left: -100rem;
    width: 100%;
    height: 100%;
    animation: cosmicStarRotate 120s linear infinite;
    background-image: radial-gradient(#ffffff 1px, transparent 1%);
    background-size: 50px 50px;
}

.cosmic-stars::before {
    content: "";
    position: absolute;
    top: 0;
    left: -50%;
    width: 170%;
    height: 500%;
    animation: cosmicStar 80s linear infinite;
    background-image: radial-gradient(#ffffff 1px, transparent 1%);
    background-size: 50px 50px;
    opacity: 0.5;
}

.cosmic-glow {
    position: absolute;
    display: flex;
    width: 14rem;
}

.cosmic-circle {
    width: 100%;
    height: 35px;
    filter: blur(2rem);
    animation: cosmicPulse 5s infinite;
    z-index: -1;
}

.cosmic-circle:nth-of-type(1) {
    background: rgba(37, 99, 235, 0.6);
}

.cosmic-circle:nth-of-type(2) {
    background: rgba(16, 185, 129, 0.6);
}

.cosmic-icon {
    color: #47a6ff;
    position: absolute;
    right: 1.5rem;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.5s ease;
    z-index: 3;
}

:root.light-mode .cosmic-icon {
    color: aquamarine;
}

/* Hover Effects */
.cosmic-download-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.5);
}

:root.light-mode .cosmic-download-btn:hover {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.cosmic-download-btn:hover .cosmic-container {
    z-index: 1;
    background-color: var(--background-dark);
}

:root.light-mode .cosmic-download-btn:hover .cosmic-container {
    z-index: 1;
    background-color: var(--background-light);
}

.cosmic-download-btn:hover strong {
    letter-spacing: 3px;
    transform: translateX(-15px);
}

.cosmic-download-btn:hover .cosmic-icon {
    opacity: 1;
    transform: translateX(0);
}

/* Active State */
.cosmic-download-btn:active {
    border: double 4px var(--primary-color);
    background-origin: border-box;
    background-clip: content-box, border-box;
    animation: none;
}

.cosmic-download-btn:active .cosmic-circle {
    background: var(--primary-color);
}

/* Animations */
@keyframes cosmicStar {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-135rem);
    }
}

@keyframes cosmicStarRotate {
    from {
        transform: rotate(360deg);
    }

    to {
        transform: rotate(0);
    }
}

@keyframes cosmic-gradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

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

@keyframes cosmicPulse {
    0% {
        transform: scale(0.75);
        opacity: 0.7;
    }

    70% {
        transform: scale(1);
        opacity: 0.3;
    }

    100% {
        transform: scale(0.75);
        opacity: 0.7;
    }
}

/* Light Mode Adjustments */
:root.light-mode .cosmic-download-btn {
    background-image: linear-gradient(var(--background-light), var(--secondary-color)),
        linear-gradient(137.48deg,
            var(--primary-color) 10%,
            var(--secondary-color) 45%,
            #8f51ea 67%,
            #0044ff 87%);
}

:root.light-mode .cosmic-download-btn strong {
    color: #ffffff;
}

/* Modal Styles */
#downloadFormModal .modal-dialog {
    max-width: min(720px, calc(100% - 2rem));
}

.modal-content {
    background: var(--card-bg-dark);
    color: var(--text-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

:root.light-mode .modal-content {
    background: white;
    color: var(--text-light);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.25rem 1.5rem;
}

#downloadFormModal .modal-header {
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem 0.85rem;
}

:root.light-mode .modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-title {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 1.25rem;
    margin: 0;
}

.cv-modal-subtitle {
    color: rgba(226, 232, 240, 0.76);
    font-size: 0.88rem;
    line-height: 1.25;
    margin: 0.15rem 0 0;
}

:root.light-mode .cv-modal-subtitle {
    color: rgba(30, 41, 59, 0.72);
}

:root.light-mode .modal-title {
    color: var(--text-dark);
}

.modal-body {
    padding: 1.5rem;
}

#downloadFormModal .modal-body {
    padding: 1rem 1.25rem;
}

.modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 1.5rem;
}

#downloadFormModal .modal-footer {
    gap: 0.65rem;
    padding: 0.85rem 1.25rem 1rem;
}

:root.light-mode .modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Form Elements */
.form-label {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

#downloadFormModal .form-label {
    font-size: 0.78rem;
    line-height: 1.1;
    margin-bottom: 0.28rem;
}

.cv-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem 0.8rem;
}

.cv-field {
    min-width: 0;
}

#downloadFormModal .invalid-feedback {
    font-size: 0.72rem;
    line-height: 1.15;
    margin-top: 0.2rem;
}

:root.light-mode .form-label {
    color: var(--text-dark);
}

.form-control,
.form-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-dark);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

#downloadFormModal .form-control,
#downloadFormModal .form-select {
    font-size: 0.92rem;
    min-height: 42px;
    padding: 0.52rem 0.8rem;
}

:root:not(.light-mode) #downloadFormModal .form-control,
:root:not(.light-mode) #downloadFormModal .form-select {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: none;
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
}

:root:not(.light-mode) #downloadFormModal .form-control::placeholder {
    color: rgba(255, 255, 255, 0.62);
    -webkit-text-fill-color: rgba(255, 255, 255, 0.62);
}

:root:not(.light-mode) #downloadFormModal .form-control:focus,
:root:not(.light-mode) #downloadFormModal .form-select:focus,
:root:not(.light-mode) #downloadFormModal .form-control.is-valid,
:root:not(.light-mode) #downloadFormModal .form-select.is-valid,
:root:not(.light-mode) #downloadFormModal .form-control.is-invalid,
:root:not(.light-mode) #downloadFormModal .form-select.is-invalid,
:root:not(.light-mode) #downloadFormModal .was-validated .form-control:valid,
:root:not(.light-mode) #downloadFormModal .was-validated .form-select:valid,
:root:not(.light-mode) #downloadFormModal .was-validated .form-control:invalid,
:root:not(.light-mode) #downloadFormModal .was-validated .form-select:invalid {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
}

:root:not(.light-mode) #downloadFormModal .form-control:focus,
:root:not(.light-mode) #downloadFormModal .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.18rem rgba(37, 99, 235, 0.24);
}

:root:not(.light-mode) #downloadFormModal .form-select option {
    color: #ffffff;
    background: var(--card-bg-dark);
}

#downloadFormModal input:-webkit-autofill,
#downloadFormModal input:-webkit-autofill:hover,
#downloadFormModal input:-webkit-autofill:focus {
    transition: background-color 9999s ease-in-out 0s;
}

:root:not(.light-mode) #downloadFormModal input:-webkit-autofill,
:root:not(.light-mode) #downloadFormModal input:-webkit-autofill:hover,
:root:not(.light-mode) #downloadFormModal input:-webkit-autofill:focus {
    caret-color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 1000px #263246 inset;
    -webkit-text-fill-color: #ffffff;
}

:root:not(.light-mode) #downloadFormModal input:-webkit-autofill:focus {
    border-color: var(--primary-color);
    box-shadow:
        0 0 0 1000px #263246 inset,
        0 0 0 0.18rem rgba(37, 99, 235, 0.24);
}

:root:not(.light-mode) #downloadFormModal .form-control,
:root:not(.light-mode) #downloadFormModal .form-select,
:root:not(.light-mode) #downloadFormModal .was-validated .form-control:valid,
:root:not(.light-mode) #downloadFormModal .was-validated .form-select:valid,
:root:not(.light-mode) #downloadFormModal .was-validated .form-control:invalid,
:root:not(.light-mode) #downloadFormModal .was-validated .form-select:invalid {
    background: #263246 !important;
    background-clip: padding-box;
    border-color: rgba(255, 255, 255, 0.18) !important;
    box-shadow: none !important;
    outline: 0 !important;
}

:root:not(.light-mode) #downloadFormModal .form-control:focus,
:root:not(.light-mode) #downloadFormModal .form-select:focus,
:root:not(.light-mode) #downloadFormModal .was-validated .form-control:focus,
:root:not(.light-mode) #downloadFormModal .was-validated .form-select:focus {
    border-color: rgba(96, 165, 250, 0.72) !important;
    box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.22) !important;
    outline: 0 !important;
}

:root:not(.light-mode) #downloadFormModal input.form-control:-webkit-autofill,
:root:not(.light-mode) #downloadFormModal input.form-control:-webkit-autofill:hover,
:root:not(.light-mode) #downloadFormModal input.form-control:-webkit-autofill:focus,
:root:not(.light-mode) #downloadFormModal input.form-control:autofill,
:root:not(.light-mode) #downloadFormModal input.form-control:autofill:hover,
:root:not(.light-mode) #downloadFormModal input.form-control:autofill:focus {
    background: #263246 !important;
    background-clip: padding-box;
    border-color: rgba(255, 255, 255, 0.18) !important;
    box-shadow: 0 0 0 1000px #263246 inset !important;
    caret-color: #ffffff;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

:root:not(.light-mode) #downloadFormModal input.form-control:-webkit-autofill:focus,
:root:not(.light-mode) #downloadFormModal input.form-control:autofill:focus {
    border-color: rgba(96, 165, 250, 0.72) !important;
    box-shadow:
        0 0 0 1000px #263246 inset,
        0 0 0 1px rgba(96, 165, 250, 0.22) !important;
}

#downloadFormModal .form-select {
    padding-right: 2.35rem;
    background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
}

:root.light-mode .form-control,
:root.light-mode .form-select {
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.2);
    color: var(--text-dark);
}

.form-select {
    padding-right: 2.75rem;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-dark) 50%),
        linear-gradient(135deg, var(--text-dark) 50%, transparent 50%);
    background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.form-select option {
    background: var(--card-bg-dark);
    color: var(--text-dark);
}

:root.light-mode .form-select option {
    background: #ffffff;
    color: var(--text-dark);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    color: var(--text-dark);
    box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.25);
    background: rgba(255, 255, 255, 0.1);
}

:root.light-mode .form-control:focus,
:root.light-mode .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(16, 185, 129, 0.25);
    background: white;
}

.form-check-label {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.cv-consent {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin-top: 0.75rem;
    padding: 0.72rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
}

:root.light-mode .cv-consent {
    border-color: rgba(0, 0, 0, 0.1);
    background: rgba(15, 23, 42, 0.035);
}

.cv-consent .form-check-input {
    flex: 0 0 auto;
    margin-left: 0;
    margin-top: 0.14rem;
}

.cv-consent .form-check-label {
    font-size: 0.82rem;
    line-height: 1.3;
    margin: 0;
}

#downloadFormModal .modal-footer .btn {
    min-height: 40px;
    padding: 0.48rem 0.95rem;
}

.form-check-input{
    border-color: var(--primary-color);
}
.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}


:root.light-mode .form-check-input {
    border-color: var(--primary-color);
}

:root.light-mode .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}



/* Validation States */
.was-validated .form-control:invalid,
.form-control.is-invalid,
.was-validated .form-select:invalid,
.form-select.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.was-validated .form-control:invalid:focus,
.form-control.is-invalid:focus,
.was-validated .form-select:invalid:focus,
.form-select.is-invalid:focus {
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);  
}

.was-validated .form-control:valid,
.form-control.is-valid,
.was-validated .form-select:valid,
.form-select.is-valid {
    border-color: var(--primary-color);
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23007bff'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M4.8 6l1.2 1.2L9.2 4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.was-validated .form-control:valid:focus,
.form-control.is-valid:focus,
.was-validated .form-select:valid:focus,
.form-select.is-valid:focus {
    box-shadow: 0 0 0 0.25rem rgba(32, 25, 135, 0.25);
    border-color: var(--primary-color);
}

:root.light-mode .was-validated .form-control:valid,
.form-control.is-valid,
:root.light-mode .was-validated .form-select:valid,
.form-select.is-valid {
    border-color: var(--primary-color);
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23198754'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M4.8 6l1.2 1.2L9.2 4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

:root.light-mode .was-validated .form-control:valid:focus,
.form-control.is-valid:focus,
:root.light-mode .was-validated .form-select:valid:focus,
.form-select.is-valid:focus {
    box-shadow: 0 0 0 0.25rem rgba(32, 135, 25, 0.25);
    border-color: var(--primary-color);
}

.invalid-feedback {
    display: none;
    color: #dc3545;
    font-size: 0.875em;
    margin-top: 0.25rem;
}

.was-validated .form-control:invalid ~ .invalid-feedback,
.form-control.is-invalid ~ .invalid-feedback,
.was-validated .form-select:invalid ~ .invalid-feedback,
.form-select.is-invalid ~ .invalid-feedback {
    display: block;
}

.was-validated .form-check-input:valid ~ .form-check-label,
.form-check-input.is-valid ~ .form-check-label {
    color: var(--text-dark);
}

.was-validated .form-check-input:valid:checked,
.form-check-input.is-valid:checked {
    background-color: var(--primary-color); /* Background when checked & valid */
    border-color: var(--primary-color);
}
.was-validated .form-check-input:valid:checked::before,
.form-check-input.is-valid:checked::before {
    color: white; /* Checkmark color (white for visibility on blue) */
}

:root.light-mode .was-validated .form-check-input:valid:checked,
.form-check-input.is-valid:checked {
    background-color: var(--primary-color); /* Background when checked & valid */
    border-color: var(--primary-color);
}
:root.light-mode .was-validated .form-check-input:valid:checked::before,
.form-check-input.is-valid:checked::before {
    color: white; /* Checkmark color (white for visibility on blue) */
}

/* Buttons */
.btn-close {
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    opacity: 0.8;
    transition: var(--transition);
}

:root.light-mode .btn-close {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e");
}

.btn-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.btn-outline-secondary {
    border: 1px solid var(--text-dark);
    color: var(--text-dark);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

:root.light-mode .btn-outline-secondary {
    border: 1px solid var(--text-dark);
    color: var(--text-dark);
}

:root.light-mode .btn-outline-secondary:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Loading State */
.btn .spinner-border {
    vertical-align: text-top;
}

.btn .submit-text {
    display: inline-block;
}

.btn .spinner-border {
    display: none;
}

.btn.loading .submit-text {
    display: none;
}

.btn.loading .spinner-border {
    display: inline-block;
}


/* Responsive */
@media (max-width: 576px) {
    #downloadFormModal .modal-dialog {
        max-width: calc(100% - 1rem);
        margin: 0.5rem auto;
    }

    #downloadFormModal .modal-header {
        padding: 0.85rem 1rem 0.7rem;
    }

    .modal-body {
        padding: 1rem;
    }

    #downloadFormModal .modal-body {
        padding: 0.8rem 1rem;
    }
    
    .modal-header,
    .modal-footer {
        padding: 1rem;
    }

    #downloadFormModal .modal-footer {
        display: grid;
        grid-template-columns: minmax(82px, 0.78fr) minmax(0, 1.22fr);
        padding: 0.7rem 1rem 0.85rem;
    }

    #downloadFormModal .modal-footer .btn {
        min-width: 0;
        width: 100%;
        padding-inline: 0.45rem;
        white-space: normal;
        line-height: 1.15;
    }

    .cv-modal-subtitle {
        font-size: 0.78rem;
    }

    .cv-form-grid {
        gap: 0.52rem 0.55rem;
    }

    #downloadFormModal .form-label {
        font-size: 0.72rem;
        margin-bottom: 0.22rem;
    }
    
    .form-control,
    .form-select {
        font-size: 16px;
        padding: 0.6rem 0.75rem;
    }

    #downloadFormModal .form-control,
    #downloadFormModal .form-select {
        font-size: 0.86rem;
        min-height: 38px;
        padding: 0.42rem 0.62rem;
    }

    #downloadFormModal .form-select {
        padding-right: 1.9rem;
        background-position: calc(100% - 15px) 50%, calc(100% - 9px) 50%;
    }

    .cv-consent {
        gap: 0.45rem;
        margin-top: 0.6rem;
        padding: 0.55rem 0.65rem;
    }

    .cv-consent .form-check-label {
        font-size: 0.72rem;
        line-height: 1.25;
    }
}

/* Activities & Achievements Section */
#activities {
    padding: 4.75rem 0;
    position: relative;
}

#activities h2 {
    margin-bottom: 2rem;
}

#activities .lead {
    font-size: 1.05rem;
    margin-bottom: 0;
}

#activities::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path fill="rgba(37, 99, 235, 0.03)" d="M0,0 L100,0 L100,100 L0,100 Z"></path></svg>');
    background-size: cover;
    z-index: -1;
    opacity: 0.5;
}

:root.light-mode #activities::before {
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path fill="rgba(16, 185, 129, 0.03)" d="M0,0 L100,0 L100,100 L0,100 Z"></path></svg>');
}

/* LinkedIn Post Container */
.linkedin-post {
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

:root.light-mode .linkedin-post {
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

:root:not(.light-mode) .linkedin-post {
    background: var(--card-bg-dark);
    border-color: rgba(255, 255, 255, 0.08);
}

.linkedin-post:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

:root:not(.light-mode) .linkedin-post:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Card Body */
.linkedin-post .card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Profile Header */
.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem !important;
}

.profile-pic-container {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    margin-right: 10px !important;
}

.profile-pic {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
}

.active-indicator {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 10px;
    height: 10px;
    background-color: #4BCE97;
    border: 2px solid var(--card-bg-dark);
    border-radius: 50%;
}

:root.light-mode .active-indicator {
    border-color: #fff;
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-meta {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.post-date {
    margin-right: 6px;
}

/* Post Content */
.post-content {
    margin-bottom: 0.75rem !important;
    flex-grow: 1;
}

.post-content p {
    margin-bottom: 0.55rem;
    line-height: 1.45;
    color: var(--text-dark);
    font-size: 0.86rem;
}

/* Tags */
.post-tags {
    margin-bottom: 0.75rem !important;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.post-tags .badge {
    font-weight: 500;
    padding: 0.32em 0.55em;
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--contact-icon-color);
    border-radius: 4px;
    font-size: 0.72rem;
}

:root.light-mode .post-tags .badge {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--primary-color);
}

/* Post Image */
.post-image-container {
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
}

.post-image {
    width: 100%;
    height: 210px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
}

.post-video iframe {
    width: 100%;
    height: 210px;
}

:root:not(.light-mode) .post-image {
    border-color: rgba(255, 255, 255, 0.08);
}

.post-image:hover {
    transform: scale(1.02);
}

.post-video,
#activities .post-image {
    margin-bottom: 0.75rem !important;
}

/* LinkedIn 4-Image Grid Layout */
.post-image-grid-4 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 155px 95px;
    gap: 4px;
    margin-bottom: 0.75rem !important;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

:root:not(.light-mode) .post-image-grid-4 {
    border-color: rgba(255, 255, 255, 0.08);
}

.post-image-grid-4 .grid-item-main {
    grid-column: 1 / -1;
    overflow: hidden;
    position: relative;
}

.post-image-grid-4 .grid-item-sub {
    overflow: hidden;
    position: relative;
}

.post-image-grid-4 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

.post-image-grid-4 img.img-portrait {
    object-position: center 25%;
}

.post-image-grid-4 img:hover {
    transform: scale(1.04);
}

/* Freeze scroll when popup/lightbox is open */
html.lightbox-open,
body.lightbox-open {
    overflow: hidden !important;
    touch-action: none;
}

/* Activities Lightbox Overlay */
.activity-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: background 0.3s;
    padding: 1.5rem;
    overscroll-behavior: contain;
    touch-action: none;
}

:root.light-mode .activity-lightbox {
    background: rgba(248, 250, 252, 0.65);
}

.activity-lightbox.active {
    display: flex;
}

.activity-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: default;
}

.activity-lightbox img {
    max-width: 90vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: lightboxZoomIn 0.25s ease-out;
}

:root.light-mode .activity-lightbox img {
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
}

.activity-lightbox iframe {
    width: min(880px, 92vw);
    height: min(580px, 80vh);
    border: none;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: lightboxZoomIn 0.25s ease-out;
    background: #000;
}

:root.light-mode .activity-lightbox iframe {
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
}

@keyframes lightboxZoomIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.activity-lightbox-close {
    position: absolute;
    top: -46px;
    right: 0;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    opacity: 0.8;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

:root.light-mode .activity-lightbox-close {
    color: #1e293b;
    background: rgba(0, 0, 0, 0.08);
}

.activity-lightbox-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.activity-lightbox-caption {
    margin-top: 12px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    background: rgba(0, 0, 0, 0.55);
    padding: 6px 18px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

:root.light-mode .activity-lightbox-caption {
    color: rgba(15, 23, 42, 0.85);
    background: rgba(255, 255, 255, 0.85);
}

#activities .post-image,
#activities .post-image-grid-4 img {
    cursor: zoom-in;
}

#activities .post-video {
    position: relative;
    cursor: zoom-in;
}

.post-video-click-trigger {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: zoom-in;
    z-index: 2;
}

/* Post Actions */
.post-actions {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding-top: 0.7rem;
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    justify-content: space-between;
}

:root:not(.light-mode) .post-actions {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.btn-action {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.78rem;
    padding: 0.45rem 0.45rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    border-radius: 4px;
}

.btn-action i {
    margin-right: 4px;
}

.btn-action:hover {
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

:root.light-mode .btn-action:hover {
    background: rgba(16, 185, 129, 0.05);
}

.btn-view {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 0.46rem 0.7rem;
    font-size: 0.78rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    border: 1px solid transparent;
    box-shadow: 0 7px 14px rgba(var(--project-cta-glow), 0.16);
    animation: post-view-lift 2.8s ease-in-out infinite;
}

.btn-view::before {
    content: '';
    position: absolute;
    inset: -55% auto -55% -60%;
    width: 30%;
    pointer-events: none;
    transform: skewX(-20deg);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.48), transparent);
    animation: post-view-shine 1.45s ease-in-out infinite;
}

.btn-view::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.52);
    border-radius: inherit;
    animation: post-view-ring 2.8s ease-in-out infinite;
}

.btn-view i {
    margin-right: 6px;
    transition: transform 0.25s ease;
}

.btn-view:hover,
.btn-view:focus-visible {
    animation-play-state: paused;
    transform: translateY(-2px);
    box-shadow: 0 12px 22px rgba(var(--project-cta-glow), 0.26);
}

.btn-view:hover::before,
.btn-view:focus-visible::before,
.btn-view:hover::after,
.btn-view:focus-visible::after {
    animation-play-state: paused;
}

.btn-view:hover i,
.btn-view:focus-visible i {
    transform: translate(2px, -2px);
}

@keyframes post-view-lift {
    0%,
    74%,
    100% {
        transform: translateY(0);
        box-shadow: 0 7px 14px rgba(var(--project-cta-glow), 0.16);
    }

    82% {
        transform: translateY(-3px);
        box-shadow: 0 12px 20px rgba(var(--project-cta-glow), 0.24);
    }
}

@keyframes post-view-shine {
    0%,
    36% {
        left: -60%;
    }

    76%,
    100% {
        left: 125%;
    }
}

@keyframes post-view-ring {
    0%,
    70% {
        opacity: 0;
        transform: scale(1);
    }

    80% {
        opacity: 0.9;
        transform: scale(0.98);
    }

    100% {
        opacity: 0;
        transform: scale(1.08);
    }
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .linkedin-post .card-body {
        padding: 1rem;
    }
    
    .profile-pic-container {
        width: 44px;
        height: 44px;
    }
    
    .post-image,
    .post-video iframe {
        height: 220px;
    }
}

@media (max-width: 768px) {
    #activities {
        padding: 4rem 0;
    }
    
    .post-content p {
        font-size: 0.88rem;
    }
    
    .post-image,
    .post-video iframe {
        height: 240px;
    }
}

@media (max-width: 576px) {
    #activities {
        padding: 3rem 0;
    }
    
    .linkedin-post .card-body {
        padding: 1rem;
    }
    
    .post-actions {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .btn-action, .btn-view {
        flex: 1 0 calc(50% - 3px);
        justify-content: center;
        padding: 0.5rem;
    }
    
    .post-image,
    .post-video iframe {
        height: 200px;
    }
    
    .profile-name {
        font-size: 0.95rem;
    }
}
/* Post Meta - Date and Globe Icon */
.post-meta {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
}

.post-date {
    margin-right: 6px;
    color: var(--text-muted); /* Default light mode color */
}

:root:not(.light-mode) .post-date,
:root.dark-mode .post-date {
    color: rgba(255, 255, 255, 0.8) !important; /* Force white in dark mode */
}

.post-meta .fa-globe-americas {
    color: var(--text-muted); /* Default light mode color */
}

:root:not(.light-mode) .post-meta .fa-globe-americas,
:root.dark-mode .post-meta .fa-globe-americas {
    color: rgba(255, 255, 255, 0.8) !important; /* Force white in dark mode */
}

:root:not(.light-mode) .di{
    color: var(--primary-color);
}

.di{
    color: var(--primary-color);
}

@media (max-width: 991.98px) {
    .navbar .container #navbarNav.navbar-collapse {
        bottom: 0 !important;
        box-sizing: border-box;
        height: auto !important;
        left: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        position: fixed !important;
        right: 0 !important;
        top: 0 !important;
    }

    .navbar .container #navbarNav.navbar-collapse.show,
    .navbar .container #navbarNav.navbar-collapse.collapsing,
    body.mobile-nav-open #navbarNav.navbar-collapse {
        height: auto !important;
        min-height: 0 !important;
    }
}
