/*
 * General Styling
 */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap');

:root {
    /* Light mode (default) */
    --bg-color: #ffffff;
    --bg-color-rgb: 255, 255, 255;
    --text-color: #000000;
    --text-secondary: rgb(85, 85, 85);
    --accent-color: rgb(53, 53, 53);
    --accent-color-rgb: 53, 53, 53;
    --accent-hover: rgb(0, 0, 0);
    --card-bg: #ffffff;
    --card-border: rgb(53, 53, 53);
    --nav-bg: #ffffff;
    --tech-stack-bg: lightgrey;
    --tech-stack-text: darkslategrey;
    --contact-bg: rgb(250, 250, 250);
    --hamburger-bg: #000000;
    --nav-height: 60px;
}

/* System theme detection - Dark mode */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-color: #121212;
        --bg-color-rgb: 18, 18, 18;
        --text-color: #ffffff;
        --text-secondary: rgb(200, 200, 200);
        --accent-color: rgb(180, 180, 180);
        --accent-color-rgb: 180, 180, 180;
        --accent-hover: rgb(220, 220, 220);
        --card-bg: #1e1e1e;
        --card-border: rgb(100, 100, 100);
        --nav-bg: #121212;
        --tech-stack-bg: #2d2d2d;
        --tech-stack-text: rgb(200, 200, 200);
        --contact-bg: #1e1e1e;
        --hamburger-bg: #ffffff;
    }
}

/* System theme detection - Light mode */
@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --bg-color: #ffffff;
        --bg-color-rgb: 255, 255, 255;
        --text-color: #000000;
        --text-secondary: rgb(85, 85, 85);
        --accent-color: rgb(53, 53, 53);
        --accent-color-rgb: 53, 53, 53;
        --accent-hover: rgb(0, 0, 0);
        --card-bg: #ffffff;
        --card-border: rgb(53, 53, 53);
        --nav-bg: #ffffff;
        --tech-stack-bg: lightgrey;
        --tech-stack-text: darkslategrey;
        --contact-bg: rgb(250, 250, 250);
        --hamburger-bg: #000000;
    }
}

[data-theme="dark"] {
    --bg-color: #121212;
    --bg-color-rgb: 18, 18, 18;
    --text-color: #ffffff;
    --text-secondary: rgb(200, 200, 200);
    --accent-color: rgb(180, 180, 180);
    --accent-color-rgb: 180, 180, 180;
    --accent-hover: rgb(220, 220, 220);
    --card-bg: #1e1e1e;
    --card-border: rgb(100, 100, 100);
    --nav-bg: #121212;
    --tech-stack-bg: #2d2d2d;
    --tech-stack-text: rgb(200, 200, 200);
    --contact-bg: #1e1e1e;
    --hamburger-bg: #ffffff;
}

* {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Poppins", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

p {
    color: var(--text-secondary);
}

/*
 * Transition
 */
a,
.btn {
    transition: all 300ms ease;
}

/* Theme Toggle */
#theme-toggle, #mobile-theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#mobile-theme-toggle {
    padding: 8px;
    margin-right: 15px;
    height: 40px;
    width: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    transition: all 0.3s ease;
}

.toggle-icon {
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.heroicon {
    width: 24px;
    height: 24px;
}

#theme-toggle .light-icon .heroicon {
    color: #f59e0b;
    stroke: #f59e0b;
}

#theme-toggle .dark-icon .heroicon {
    color: #3b82f6;
    stroke: #3b82f6;
}

#mobile-theme-toggle .light-icon .heroicon {
    color: #e67e00;
    stroke: #e67e00;
    stroke-width: 2;
    width: 26px;
    height: 26px;
}

#mobile-theme-toggle .dark-icon .heroicon {
    color: #2563eb;
    stroke: #2563eb;
    stroke-width: 2;
    width: 26px;
    height: 26px;
}

[data-theme="light"] .dark-icon,
[data-theme="dark"] .light-icon {
    display: none;
}

[data-theme="light"] .light-icon,
[data-theme="dark"] .dark-icon {
    display: flex;
}

/* System theme icon visibility */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .light-icon {
        display: none;
    }
    :root:not([data-theme="light"]) .dark-icon {
        display: flex;
    }
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) .light-icon {
        display: flex;
    }
    :root:not([data-theme="dark"]) .dark-icon {
        display: none;
    }
}

/*
 * Desktop Navigation
 */
nav,
.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    font-size: 1rem;
}

nav {
    justify-content: space-around;
    align-items: center;
    height: 80px;
}

/* Sticky Navigation */
#desktop-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--bg-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

[data-theme="dark"] #desktop-nav {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* System theme navigation styles */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) #desktop-nav {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }
}

#desktop-nav.scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    height: 70px; /* Slightly smaller when scrolled */
}

[data-theme="dark"] #desktop-nav.scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

a {
    color: var(--text-color);
    text-decoration: none;
    text-decoration-color: var(--bg-color);
}

a:hover {
    color: var(--accent-color);
    text-decoration: underline;
    text-underline-offset: 0.5rem;
    text-decoration-color: var(--accent-color);
}

.logo {
    font-size: 2rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-color);
}

.logo-hover {
    cursor: default;
}

.img_center {
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: 50%;
}

/*
 * Hamburger Menu
 */
#hamburger-nav {
    display: none; /* Hidden by default, shown in media query */
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--bg-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    padding: 5px 15px; /* Added horizontal padding */
    box-sizing: border-box;
    justify-content: space-between;
    align-items: center;
}

[data-theme="dark"] #hamburger-nav {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Mobile navbar scroll effect */
#hamburger-nav.scrolled {
    background-color: rgba(var(--bg-color-rgb), 0.85);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 5px 15px; /* Keep consistent with non-scrolled state */
    -webkit-backdrop-filter: blur(15px) !important;
    backdrop-filter: blur(15px) !important;
    /* Force hardware acceleration */
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    will-change: backdrop-filter, background-color;
}

[data-theme="dark"] #hamburger-nav.scrolled {
    background-color: rgba(var(--bg-color-rgb), 0.8);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    -webkit-backdrop-filter: blur(15px) !important;
    backdrop-filter: blur(15px) !important;
    /* Force hardware acceleration */
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    will-change: backdrop-filter, background-color;
}

/* Styling for hamburger menu when scrolled */
#hamburger-nav.scrolled .hamburger-menu {
    background-color: rgba(var(--bg-color-rgb), 0.3);
}

/* No special styling needed for theme toggle when navbar is blurred */

/* No special styling needed for logo when scrolled */

.hamburger-menu {
    position: relative;
    display: block;
    width: 100%;
    padding: 8px;
}

.hamburger-container-logo {
    display: flex;
    padding: 0 10px 0 0;
    flex-grow: 1;
    align-items: center;
}

.nav-controls {
    display: flex;
    align-items: center;
    position: relative;
    justify-content: flex-end;
}

.hamburger-text-logo {
    font-size: 1.5rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-color);
}

/* Cursor animation for typing text in profile section */
@keyframes cursor {
    50% {
        border-color: transparent
    }
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 18px;
    width: 24px;
    cursor: pointer;
    position: relative;
    z-index: 1002; /* Higher than the menu to stay on top */
    margin: 4px;
}

.hamburger-icon span {
    width: 100%;
    height: 1.8px;
    background-color: var(--hamburger-bg);
    transition: all 0.3s ease-in-out;
}

/* Make hamburger icon more visible when navbar is semi-transparent */
#hamburger-nav.scrolled .hamburger-icon span {
    height: 2px;
}

.menu-links {
    position: fixed;
    top: var(--nav-height, 60px);
    left: 0;
    right: 0;
    background-color: var(--bg-color);
    width: 100vw;
    height: auto; /* Auto height based on content */
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 0;
    margin: 0;
    box-sizing: border-box;
    visibility: hidden;
    opacity: 0;
}

[data-theme="dark"] .menu-links {
    background-color: var(--bg-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Style the menu when navbar is semi-transparent */
#hamburger-nav.scrolled .menu-links {
    background-color: var(--bg-color);
}

[data-theme="dark"] #hamburger-nav.scrolled .menu-links {
    background-color: var(--bg-color);
}

/* Additional styling when menu is open */
#hamburger-nav.scrolled .menu-links.open {
    max-height: 1000px;
}

[data-theme="dark"] #hamburger-nav.scrolled .menu-links.open {
    max-height: 1000px;
}

.menu-links a {
    display: block;
    padding: 15px 7%;
    text-align: left;
    font-size: 1.75rem;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease-in-out;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 1002;
}

.menu-links a:hover {
    background-color: rgba(var(--accent-color-rgb), 0.05);
}

.menu-links li {
    list-style: none;
    width: 100%;
    text-align: left;
    border-bottom: 1px solid rgba(var(--accent-color-rgb), 0.1);
    margin: 0;
    max-width: 100%;
}

.menu-links li:last-child {
    border-bottom: none;
}

.menu-links.open {
    max-height: 1000px; /* Large value to accommodate any content */
    visibility: visible;
    opacity: 1;
    padding-top: 10px;
    padding-bottom: 10px;
}

.hamburger-icon.open span:first-child {
    transform: rotate(45deg) translate(6px, 6px);
    width: 100%;
}

.hamburger-icon.open span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.hamburger-icon.open span:last-child {
    transform: rotate(-45deg) translate(5.5px, -5.5px);
    width: 100%;
}

/* Sections */

section {
    padding-top: 4vh;
    height: auto;
    margin: 0 10rem;
    box-sizing: border-box;
    min-height: fit-content;
}

.section-container {
    display: flex;
}

/* Profile Section */

#profile {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem 5%;
    padding-top: calc(2rem + var(--nav-height));
}

.profile-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1980px;
    gap: 4rem;
}

.profile-text {
    flex: 1;
    max-width: 600px;
}

.profile-title {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    display: inline-block;
}

.static-text {
    color: var(--text-color);
}

.typing-text {
    position: relative;
    background: linear-gradient(90deg, var(--text-color) 0%, #9c27b0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    white-space: nowrap;
    overflow: visible;
    display: inline-block;
}

[data-theme="dark"] .typing-text {
    background: linear-gradient(90deg, var(--text-color) 0%, #bb86fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Cursor styling */
.cursor {
    display: inline-block;
    margin-left: 2px;
    color: #9c27b0;
    font-weight: bold;
    animation: blink 0.7s infinite;
}

[data-theme="dark"] .cursor {
    color: #bb86fc;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

.profile-description {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.profile-image-container {
    position: relative;
}

.neon-border {
    position: relative;
    width: 350px;
    height: 350px;
    border-radius: 8px;
    overflow: hidden;
}

.neon-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #9c27b0, #673ab7);
    z-index: -1;
    border-radius: 10px;
    animation: neon-glow 3s ease-in-out infinite alternate;
}

@keyframes neon-glow {
    0% {
        box-shadow: 0 0 5px #9c27b0, 0 0 10px #9c27b0, 0 0 15px #9c27b0;
    }
    100% {
        box-shadow: 0 0 10px #9c27b0, 0 0 20px #9c27b0, 0 0 30px #9c27b0;
    }
}

@keyframes neon-glow-dark {
    0% {
        box-shadow: 0 0 5px #bb86fc, 0 0 10px #bb86fc, 0 0 15px #bb86fc;
    }
    100% {
        box-shadow: 0 0 10px #bb86fc, 0 0 20px #bb86fc, 0 0 30px #bb86fc;
    }
}

[data-theme="dark"] .neon-border::before {
    background: linear-gradient(45deg, #bb86fc, #3700b3);
    animation: neon-glow-dark 3s ease-in-out infinite alternate;
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.section__pic-container {
    display: flex;
    height: 400px;
    width: 400px;
    margin: auto 0;
}

.section__text {
    align-self: center;
    text-align: center;
}

.section__text p {
    font-weight: 600;
}

.section__text__p1 {
    text-align: center;
}

.section__text__p2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.section__text__p3 {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    color: var(--text-color);
}

.position-company .company-name {
    color: #7209b7;
}

[data-theme="dark"] .position-company .company-name {
    color: #bb86fc;
}

.position-company .separator {
    margin: 0 0.3rem;
    font-weight: normal;
    opacity: 0.7;
}

.section__text__p4 {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.title {
    font-size: 2.5rem;
    text-align: center;
    margin: 0 0 2rem 0; /* Consistent gap below titles across sections */
}

#socials-container {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    gap: 1rem;
}

/* Social Icons */
.social-icons {
    display: flex;
    justify-content: flex-end;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.social-icon {
    color: var(--text-color);
    transition: all 0.3s ease;
}

.social-icon:hover {
    color: #9c27b0;
    transform: translateY(-3px);
}

[data-theme="dark"] .social-icon:hover {
    color: #bb86fc;
}

/* Icons */
.icon {
    cursor: pointer;
    height: 2rem;
}

/* Buttons */
.btn-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.btn {
    font-weight: 600;
    transition: all 300ms ease;
    padding: 1rem;
    width: 8rem;
    border-radius: 2rem;
}

.btn-color-1,
.btn-color-2 {
    border: var(--accent-color) 0.1rem solid;
}

.btn-color-1:hover,
.btn-color-2:hover {
    cursor: pointer;
}

.btn-color-1,
.btn-color-2:hover {
    background: var(--accent-color);
    color: var(--bg-color);
}

.btn-color-1:hover {
    background: var(--accent-hover);
}

.btn-color-2 {
    background: none;
}

.btn-color-2:hover {
    border: var(--bg-color) 0.1rem solid;
}

.btn-container {
    gap: 1rem;
}

/* About Section */
#about {
    position: relative;
}

.about-containers {
    gap: 2rem;
    margin-bottom: 2rem;
    margin-top: 2rem;
}

.about-details-container {
    justify-content: center;
    flex-direction: column;
}

.about-containers,
.about-details-container {
    display: flex;
}

.about-pic {
    border-radius: 2rem;
}

.arrow {
    position: absolute;
    right: -5rem;
    bottom: 2.5rem;
}

.details-container {
    padding: 1.5rem;
    flex: 1;
    background: var(--card-bg);
    border-radius: 2rem;
    border: var(--card-border) 0.1rem solid;
    text-align: center;
}

.section-container {
    gap: 4rem;
    height: 80%;
}

/* Experience Section */
#experience {
    position: relative;
}

.experience-sub-title {
    color: rgb(85, 85, 85);
    font-weight: 600;
    font-size: 1.75rem;
    margin-bottom: 2rem;
}

.experience-details-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
    max-width: 1980px;
    margin: 0;
}

/* Timeline line */
.experience-details-container::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, #4cc9f0 0%, #f72585 100%);
    z-index: 1;
}

[data-theme="dark"] .experience-details-container::before {
    background: linear-gradient(180deg, #4cc9f0 0%, #f72585 100%);
    opacity: 0.9;
}

.company-details {
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
    position: relative;
    margin-left: 50px;
    border-radius: 0.5rem;
    background-color: rgba(var(--bg-color-rgb), 0.7);
    border: 1px solid rgba(var(--accent-color-rgb), 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    padding: 1.5rem;
}

[data-theme="dark"] .company-details {
    background-color: rgba(30, 30, 30, 0.7);
    border-color: rgba(var(--accent-color-rgb), 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Timeline dots */
.company-details::before {
    content: '';
    position: absolute;
    left: -41px;
    top: 50px; /* Aligned with title and company */
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #4cc9f0;
    border: 3px solid var(--bg-color);
    z-index: 2;
}

[data-theme="dark"] .company-details::before {
    border-color: #121212;
}

/* Timeline dot for last item */
.company-details:last-child::before {
    background-color: #f72585;
}

/* Timeline dot for middle items */
.company-details:not(:first-child):not(:last-child)::before {
    background-color: #7209b7;
}

.company-details:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .company-details:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.section__text__p4 {
    font-size: 0.8rem;
    color: #000000; /* Black text */
    background-color: rgba(20, 20, 20, 0.1); /* Dark semi-transparent background */
    display: inline-block;
    padding: 0.4rem 0.8rem;
    font-weight: 500;
    position: absolute;
    top: 15px;
    right: 15px;
    border-radius: 20px; /* Pill shape */
}

/* This will be overridden by media queries for mobile */
@media screen and (min-width: 601px) {
    .section__text__p4 {
        position: absolute;
        top: 15px;
        right: 15px;
    }
}

[data-theme="dark"] .section__text__p4 {
    color: #ffffff; /* White text */
    background-color: rgba(50, 50, 50, 0.8); /* Slightly darker for dark mode */
}

.position-company {
    display: flex;
    cursor: pointer;
    margin-bottom: 1rem;
    padding-right: 150px; /* Space for the date */
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tech-stack li {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 30px;
    background: var(--tech-stack-bg);
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    color: var(--tech-stack-text);
}

/* Projects Section */
#projects {
    position: relative;
}

.projects-container {
    max-width: 1980px;
    margin: 0 auto;
    width: 100%;
    padding: 1rem;
}

.color-container {
    border-color: rgb(163, 163, 163);
    background-color: rgb(250, 250, 250);
}

.project-img {
    border-radius: 2rem;
    width: 90%;
    height: 90%;
}

.project-title {
    margin: 1rem;
    color: var(--text-color);
}

.project-btn {
    color: var(--text-color);
    border-color: var(--accent-color);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    align-items: stretch; /* Ensure items can stretch to equal height */
    grid-auto-rows: 1fr;  /* Make each row's tracks equal height */
}

@media (max-width: 1100px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .projects-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto; /* Don't force equal heights on single column */
        gap: 2rem; /* Match Technical Skills card spacing on mobile */
    }
}

/* Card - shared style with Skills and Education */
.skills-category,
.education-card,
.project-card {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Project card specifics */
.project-card {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Dark theme shadows consistent across cards */
[data-theme="dark"] .skills-category,
[data-theme="dark"] .education-card,
[data-theme="dark"] .project-card {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.project-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.project-title {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-color);
}

.project-pill {
    background: rgba(var(--accent-color-rgb), 0.06);
    color: var(--text-color);
    border: 1px solid rgba(var(--accent-color-rgb), 0.12);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.85rem;
    cursor: pointer;
}

[data-theme="dark"] .project-pill {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.12);
}

.project-period {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 0.75rem 0;
}

.project-points {
    margin: 0 0 1rem 1rem;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

.project-points li {
    color: var(--text-secondary);
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 10px;
    background: var(--tech-stack-bg);
    color: var(--tech-stack-text);
    font-size: 0.8rem;
    border: 1px solid rgba(var(--accent-color-rgb), 0.12);
}

[data-theme="dark"] .tag {
    border-color: rgba(255,255,255,0.08);
}

.project-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.9rem;
    margin-top: auto; /* Push actions to the bottom for consistent bottoms */
    border-top: 1px solid rgba(var(--accent-color-rgb), 0.12);
}

[data-theme="dark"] .project-actions {
    border-top-color: rgba(255, 255, 255, 0.08);
}

/* Code & Live buttons (Projects only) */
#projects .project-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    border-radius: 0;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1;
    color: var(--text-color);
    background: transparent;
    border: none;
    box-shadow: none;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
    white-space: nowrap; /* Keep icon+text on one line on mobile */
}

[data-theme="dark"] #projects .project-btn {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

#projects .project-btn:hover {
    color: var(--accent-color);
    text-decoration: underline;
    text-underline-offset: 3px;
}

[data-theme="dark"] #projects .project-btn:hover {
    color: var(--accent-hover);
}

#projects .project-btn:focus-visible {
    outline: none;
    text-decoration: underline;
}

/* Left icons via mask SVGs so they inherit text color */
#projects .project-btn::before {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    background-color: currentColor;
    -webkit-mask-size: 18px 18px;
    mask-size: 18px 18px;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

/* Code icon for first action */
#projects .project-actions .project-btn:first-child::before {
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>');
}

/* External link icon for second action */
#projects .project-actions .project-btn:last-child::before {
    -webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>');
    mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>');
}

/* Responsive: stack buttons on narrow cards */
@media (max-width: 520px) {
    #projects .project-actions {
        flex-direction: row; /* Keep inline */
        align-items: center;
        justify-content: space-between; /* Separate left/right */
        gap: 1rem;
        width: 100%;
    }
}

/* Contact */
#contact {
    display: flex;
    justify-content: center;
    flex-direction: column;
    min-height: 70vh;
    background-color: var(--bg-color);
    position: relative;
}

.contact-container {
    max-width: 1980px;
    margin: 0;
    width: 100%;
}

.contact-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.contact-text {
    margin-bottom: 3rem;
}

.contact-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
    margin-bottom: 2rem;
    max-width: 600px;
}

.contact-btn {
    display: inline-block;
    background-color: #2d2d2d;
    color: #fdfdfd;
    padding: 0.8rem 2rem;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.contact-btn:hover {
    color: #fdfdfd;
    text-decoration: underline;
    text-decoration-color: #ffffff;
    text-underline-offset: 4px;
}

[data-theme="dark"] .contact-btn {
    background-color: #ffffff;
    color: #121212;
}

[data-theme="dark"] .contact-btn:hover {
    text-decoration: underline;
    text-decoration-color: #ffffff;
    text-underline-offset: 4px;
}

.contact-social {
    margin-top: 2rem;
}

.contact-social-icons {
    justify-content: center;
    gap: 2rem;
}

.contact-social-icons .social-icon {
    width: 28px;
    height: 28px;
}

.email-icon {
    height: 2.5rem;
}

/*Footer Section*/

footer {
    height: 3rem;
}

footer p {
    text-align: center;
}

/*Fade In*/
.fade-in-section {
    opacity: 0; /* Start invisible */
    transform: translateY(100px); /* Optional: start a bit lower */
    transition: opacity 1.5s ease-out, transform 1.5s ease-out;
    margin: 2.5rem 0; /* Consistent vertical spacing between sections */
}

.fade-in-section.visible {
    opacity: 1; /* Fade in */
    transform: translateY(0); /* Reset the position */
}

/* Education Section */
#education {
    background-color: var(--bg-color);
    position: relative;
}


.education-container {
    max-width: 1980px;
    margin: 0;
    width: 100%;
}

.education-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    padding: 2rem 1rem;
    max-width: 1000px;
    margin: 0 auto;
}

.education-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.education-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .education-card {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .education-card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.education-icon {
    color: #7209b7;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

[data-theme="dark"] .education-icon {
    color: #bb86fc;
}

.education-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.institution {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.degree {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
}

.duration {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Skills Section */
#skills {
    position: relative;
    padding-bottom: 2rem; /* Ensure consistent bottom spacing */
}

.skills-container {
    max-width: 1980px;
    margin: 0;
    padding: 0 1rem;
}

.skills-grid-container {
    display: flex;
    flex-direction: column;
    gap: 5rem;
    margin-bottom: 2rem; /* Ensure consistent bottom spacing */
}

.skills-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.skills-category {
    background-color: var(--card-bg);
    border-radius: 10px;
    margin-bottom: 0;
    padding: 1.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    height: 100%;
}

.skills-header {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid;
    border-image-slice: 1;
    border-image-source: linear-gradient(to right, #7209b7, #3a0ca3);
    padding-bottom: 0.5rem;
}

.skills-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
}

.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.skill-icon {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    background-color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .skill-icon {
    box-shadow: 0 4px 8px rgba(0, 191, 255, 0.2);
}

[data-theme="dark"] .skill-item:hover .skill-icon {
    box-shadow: 0 4px 8px rgba(0, 191, 255, 0.3);
}

.skill-icon > * {
    position: relative;
    z-index: 1;
}

.skill-item:hover .skill-icon {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.skill-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
    margin: 0;
}

/* Specific skill icons */
.js-icon {
    background: url('https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/javascript/javascript-plain.svg') center/60% no-repeat;
}

.java-icon {
    background: url('https://cdn.jsdelivr.net/gh/devicons/devicon/icons/java/java-original.svg') center/60% no-repeat;
}

.kt-icon {
    background: url('https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/kotlin/kotlin-original.svg') center/60% no-repeat;
}

.python-icon {
    background: url('https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/python/python-original.svg');
}

.sql-icon {
    background: url('https://cdn.jsdelivr.net/gh/devicons/devicon/icons/mysql/mysql-original.svg') center/60% no-repeat;
}

.rabbitmq-icon {
    background: url('https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/rabbitmq/rabbitmq-original.svg') center/60% no-repeat;
}

.spring-icon {
    background: url('https://cdn.jsdelivr.net/gh/devicons/devicon/icons/spring/spring-original.svg') center/60% no-repeat;
}

.postgres-icon {
    background: url('https://cdn.jsdelivr.net/gh/devicons/devicon/icons/postgresql/postgresql-original.svg') center/60% no-repeat;
}

.mongodb-icon {
    background: url('https://cdn.jsdelivr.net/gh/devicons/devicon/icons/mongodb/mongodb-original.svg') center/60% no-repeat;
}

.hibernate-icon {
    background: url('https://hibernate.org/images/hibernate-logo.svg') center/60% no-repeat;
}

.rest-icon {
    color: #0096d6;
}
.rest-icon::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0096d6;
    opacity: 0.1;
    z-index: 0;
}

.docker-icon {
    background: url('https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/docker/docker-original.svg') center/60% no-repeat;
}

.react-icon {
    background: url('https://cdn.jsdelivr.net/gh/devicons/devicon/icons/react/react-original.svg') center/60% no-repeat;
}

.vue-icon {
    background: url('https://cdn.jsdelivr.net/gh/devicons/devicon/icons/vuejs/vuejs-original.svg') center/60% no-repeat;
}

.html-icon {
    background: url('https://cdn.jsdelivr.net/gh/devicons/devicon/icons/html5/html5-original.svg') center/60% no-repeat;
}

.css-icon {
    background: url('https://cdn.jsdelivr.net/gh/devicons/devicon/icons/css3/css3-original.svg') center/60% no-repeat;
}

.redux-icon {
    background: url('https://cdn.jsdelivr.net/gh/devicons/devicon/icons/redux/redux-original.svg') center/60% no-repeat;
}

.jest-icon {
    background: url('https://cdn.jsdelivr.net/gh/devicons/devicon/icons/jest/jest-plain.svg') center/60% no-repeat;
}

.git-icon {
    background: url('https://cdn.jsdelivr.net/gh/devicons/devicon/icons/git/git-original.svg') center/60% no-repeat;
}

.github-icon {
    background: url('https://cdn.jsdelivr.net/gh/devicons/devicon/icons/github/github-original.svg') center/60% no-repeat;
}

.azure-icon {
    background: url('https://cdn.jsdelivr.net/gh/devicons/devicon/icons/azure/azure-original.svg') center/60% no-repeat;
}

.aws-icon {
    background: url('https://cdn.jsdelivr.net/gh/devicons/devicon@latest/icons/amazonwebservices/amazonwebservices-plain-wordmark.svg') center/60% no-repeat;
}

.vscode-icon {
    background: url('https://cdn.jsdelivr.net/gh/devicons/devicon/icons/vscode/vscode-original.svg') center/60% no-repeat;
}

.intellij-icon {
    background: url('https://cdn.jsdelivr.net/gh/devicons/devicon/icons/intellij/intellij-original.svg') center/60% no-repeat;
}

/* ========================================
   SYSTEM THEME STYLES
   ======================================== */

/* System theme - Dark mode styles */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        /* Navigation */
        #desktop-nav {
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
        }
        
        #desktop-nav.scrolled {
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
        }
        
        #hamburger-nav {
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
        }
        
        #hamburger-nav.scrolled {
            background-color: rgba(var(--bg-color-rgb), 0.8);
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
        }
        
        .menu-links {
            background-color: var(--bg-color);
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
        }
        
        #hamburger-nav.scrolled .menu-links {
            background-color: var(--bg-color);
        }
        
        /* Typing text and cursor */
        .typing-text {
            background: linear-gradient(90deg, var(--text-color) 0%, #bb86fc 100%);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
        }
        
        .cursor {
            color: #bb86fc;
        }
        
        /* Neon border */
        .neon-border::before {
            background: linear-gradient(45deg, #bb86fc, #3700b3);
            animation: neon-glow-dark 3s ease-in-out infinite alternate;
        }
        
        /* Company name */
        .position-company .company-name {
            color: #bb86fc;
        }
        
        /* Social icons */
        .social-icon:hover {
            color: #bb86fc;
        }
        
        /* Experience section */
        .experience-details-container::before {
            background: linear-gradient(180deg, #4cc9f0 0%, #f72585 100%);
            opacity: 0.9;
        }
        
        .company-details {
            background-color: rgba(30, 30, 30, 0.7);
            border-color: rgba(var(--accent-color-rgb), 0.3);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
        }
        
        .company-details::before {
            border-color: #121212;
        }
        
        .company-details:hover {
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
        }
        
        .section__text__p4 {
            color: #ffffff;
            background-color: rgba(50, 50, 50, 0.8);
        }
        
        /* Cards */
        .skills-category,
        .education-card,
        .project-card {
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
        }
        
        .project-pill {
            background: rgba(255,255,255,0.06);
            border-color: rgba(255,255,255,0.12);
        }
        
        .tag {
            border-color: rgba(255,255,255,0.08);
        }
        
        .project-actions {
            border-top-color: rgba(255, 255, 255, 0.08);
        }
        
        #projects .project-btn {
            background: transparent;
            border-color: transparent;
            box-shadow: none;
        }
        
        #projects .project-btn:hover {
            color: var(--accent-hover);
        }
        
        /* Contact */
        .contact-btn {
            background-color: #ffffff;
            color: #121212;
        }
        
        .contact-btn:hover {
            text-decoration: underline;
            text-decoration-color: #ffffff;
            text-underline-offset: 4px;
        }
        
        /* Education */
        .education-card {
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
        }
        
        .education-card:hover {
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
        }
        
        .education-icon {
            color: #bb86fc;
        }
        
        /* Skills */
        .skill-icon {
            box-shadow: 0 4px 8px rgba(0, 191, 255, 0.2);
        }
        
        .skill-item:hover .skill-icon {
            box-shadow: 0 4px 8px rgba(0, 191, 255, 0.3);
        }
    }
}