/* --- Basic Setup & Variables --- */
:root {
    --bg-color: #0a0e14;
    --primary-color: #00d4ff;
    --card-bg-color: #1a1f29;
    --text-color: #e6f1ff;
    --text-muted-color: #8fa2b7;
    --border-color: #2d3748;
    --header-height: 70px;
}

html {
    scroll-padding-top: var(--header-height);
}

.tech-tags {
    margin-top: 15px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
}

#robotics-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    background:
        /* Technical grid pattern */
        linear-gradient(90deg, rgba(0, 212, 255, 0.025) 1px, transparent 1px),
        linear-gradient(0deg, rgba(0, 212, 255, 0.025) 1px, transparent 1px),
        /* Professional steel gradient */
        linear-gradient(135deg, #050810 0%, #0f1419 30%, #050810 100%);
    background-size: 50px 50px, 50px 50px, 100% 100%;
    pointer-events: none;
}

main,
header,
footer,
#chatbot-container {
    position: relative;
    z-index: 1;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--primary-color);
}

/* Project features styling */
.project-features {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(0, 212, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.project-features h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.project-features ul {
    list-style: none;
    padding-left: 0;
}

.project-features li {
    padding: 0.3rem 0;
    position: relative;
    padding-left: 1.5rem;
}

.project-features li::before {
    content: '▶';
    color: var(--primary-color);
    position: absolute;
    left: 0;
}

/* --- Header & Navigation --- */
header {
    position: sticky;
    -webkit-position: sticky;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 100;
    background-color: rgba(10, 14, 20, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
}

.nav-logo {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
}

header ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

header .nav-link {
    color: var(--text-muted-color);
    text-decoration: none;
    font-weight: 400;
    transition: color 0.3s ease;
}

header .nav-link:hover {
    color: var(--primary-color);
}

header .nav-link.active {
    color: var(--primary-color);
    font-weight: 600;
}

#nav-toggle {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-color);
}


/* --- personal photo settings --- */
.profile-photo-holder {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 20px;
    border: 4px solid #f0f0f0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.profile-photo-holder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


/* --- tab page logic --- */
main {
    padding-top: var(--header-height);
}

.page-section {
    display: none;
    padding: 6rem 0;
    min-height: calc(90vh - var(--header-height));
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.page-section.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/** --- home page layout --- **/
.home-layout {
    display: flex;
    width: 100%;
    gap: 4rem;
    align-items: flex-start;
}

.home-bio {
    flex-basis: 45%;
    text-align: left;
}

.name-logo {
    display: inline-block;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 50px;
    padding: 4px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.home-bio h1 {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.1;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.home-bio .title {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.home-bio .summary {
    font-size: 1rem;
    color: var(--text-muted-color);
    margin-bottom: 2rem;
    max-width: 450px;
}

.social-links-main {
    display: flex;
    justify-content: flex-start;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.social-links-main a {
    color: var(--text-muted-color);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.social-links-main a:hover {
    color: var(--primary-color);
}

.btn-cv {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background-color: var(--primary-color);
    color: var(--bg-color);
    text-decoration: none;
    font-weight: 600;
    border-radius: 6px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-cv:hover {
    background-color: #00e0a8;
    transform: translateY(-3px);
}

.home-details {
    flex-basis: 55%;
    padding-top: 1rem;
}

.home-block {
    margin-bottom: 2.5rem;
}

.home-block:last-child {
    margin-bottom: 0;
}

.home-block > h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tech-tag {
    background-color: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.2);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: rgba(0, 212, 255, 0.9);
    transition: all 0.2s ease;
}

.tech-tag:hover {
    background-color: rgba(0, 212, 255, 0.12);
    border-color: rgba(0, 212, 255, 0.4);
    color: var(--primary-color);
}

.snapshot-item {
    margin-bottom: 1.5rem;
}

.snapshot-item:last-child {
    margin-bottom: 0;
}

.snapshot-title {
    font-weight: 600;
    color: var(--text-color);
}

.snapshot-company {
    color: var(--text-muted-color);
    font-size: 0.9rem;
}

/** --- Pages style --- **/
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -38px;
    top: 8px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 2px solid var(--bg-color);
    z-index: 1;
}

.timeline-item h3 {
    font-size: 1.25rem;
}

.timeline-item .company {
    color: var(--text-muted-color);
    font-weight: 600;
    margin-right: 1rem;
}

.timeline-item .date {
    color: var(--text-muted-color);
}

.timeline-item .description {
    margin-top: 8px;
    color: var(--text-muted-color);
}

.section-divider {
    text-align: center;
    margin-top: 4rem;
}

.btn-thesis {
    display: inline-block;
    margin-top: 1rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.btn-thesis:hover {
    text-decoration: underline;
}

.project-list {
    display: flex;
    flex-direction: column;
    gap: 5rem;
}

.project-entry {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.project-entry:nth-child(even) {
    flex-direction: row-reverse;
}

.project-image-container {
    flex: 1.2;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px -15px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease-in-out;
}

.project-image-container:hover {
    transform: translateY(-5px);
}

.project-image {
    width: 100%;
    display: block;
}

.project-details {
    flex: 1;
}

.project-entry:nth-child(even) .project-details {
    text-align: right;
}

.project-title {
    font-size: 1.75rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.project-description {
    background-color: var(--card-bg-color);
    padding: 1.5rem;
    border-radius: 5px;
    line-height: 1.7;
    color: #cfd8dc;
    margin-bottom: 1.5rem;
}

.project-tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.project-entry:nth-child(even) .project-tech-stack {
    justify-content: flex-end;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-entry:nth-child(even) .project-links {
    justify-content: flex-end;
}

.btn-project {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #b0c4de;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

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

.publication-item {
    background-color: var(--card-bg-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary-color);
}

.publication-item h3 {
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.publication-item .meta {
    color: var(--text-muted-color);
    font-size: 0.9rem;
}

.publication-item .meta strong {
    font-weight: 600;
    color: var(--text-color);
}

.btn-publication {
    display: inline-block;
    margin-top: 1rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.btn-publication:hover {
    text-decoration: underline;
}

.btn-publication i {
    margin-right: 8px;
}

/* --- Responsive Design --- */
@media (max-width: 900px) {

    .home-layout,
    .project-entry,
    .project-entry:nth-child(even) {
        flex-direction: column;
    }

    .project-entry:nth-child(even) .project-details,
    .project-entry:nth-child(even) .project-tech-stack,
    .project-entry:nth-child(even) .project-links {
        justify-content: flex-start;
        text-align: left !important;
    }

    /* --- Mobile Navigation Styles --- */
    #nav-toggle {
        display: block;
        z-index: 101;
    }

    header ul#nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 250px;
        height: 100vh;
        background-color: rgba(25, 37, 61, 0.9);
        backdrop-filter: blur(15px);
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 5rem;
        align-items: center;
        gap: 2.5rem;
        transition: right 0.4s ease-in-out;
        border-left: 1px solid var(--border-color);
    }

    header ul#nav-menu.show-menu {
        right: 0;
    }

    header .nav-link {
        font-size: 1.2rem;
    }
}

/* --- Interactive Particle Canvas Background --- */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* --- Page Transition Animations --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

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

.page-exit {
    display: block !important;
    animation: pageOut 0.3s ease-out forwards;
}

.page-enter {
    display: block !important;
    animation: pageIn 0.4s ease-out forwards;
    opacity: 0;
}

@keyframes pageOut {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

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

@keyframes pageIn {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/** --- Chatbot Styles --- **/
#chatbot-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 1000;
}

#chat-toggle {
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: var(--bg-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.6);
}

#chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    max-height: 500px;
    background-color: var(--card-bg-color);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

#chat-window.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.chat-header {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
}

.chat-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

#chat-close {
    background: none;
    border: none;
    color: var(--text-muted-color);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

#chat-messages {
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 80%;
    line-height: 1.5;
}

.bot-message {
    background-color: #2c3a4f;
    color: var(--text-color);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.user-message {
    background-color: var(--primary-color);
    color: var(--bg-color);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.typing-indicator {
    display: flex;
    align-items: center;
    padding: 10px;
}

.typing-indicator span {
    height: 8px;
    width: 8px;
    margin: 0 2px;
    background-color: var(--text-muted-color);
    border-radius: 50%;
    display: inline-block;
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1.0);
    }
}

#chat-options {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-option-btn {
    width: 100%;
    padding: 12px;
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.chat-option-btn:hover {
    background-color: var(--primary-color);
    color: var(--bg-color);
}

/* Target only the timeline inside the home page layout */
.home-block .timeline {
    padding-left: 25px;
    /* Bring it in a little */
    position: relative;
}

/* Make the vertical line shorter to fit the compact design */
.home-block .timeline::before {
    top: 5px;
    bottom: 5px;
}

/* Reduce the space between the update items */
.home-block .timeline-item {
    margin-bottom: 1.25rem;
    /* Was 2.5rem */
}

/* Adjust the dot's position and size to match the smaller text */
.home-block .timeline-item::before {
    left: -31px;
    /* Adjust for new padding */
    top: 5px;
    /* Align better with the smaller title */
    width: 12px;
    height: 12px;
}

/* Make the title smaller and less bold */
.home-block .timeline-item h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 3px;
}

/* Style the link inside the title */
.home-block .timeline-item h3 a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.home-block .timeline-item h3 a:hover {
    color: var(--primary-color);
}

/* Make the description text smaller and tighter */
.home-block .timeline-item .description {
    font-size: 0.85rem;
    line-height: 1.4;
    margin-top: 4px;
}

/* Make the metadata (company, date) smaller */
.home-block .timeline-item .company,
.home-block .timeline-item .date {
    font-size: 0.8rem;
}