/* Modern CSS Reset & Variables */
:root {
    /* Color Palette - Dark Premium Theme */
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-color: #3b82f6;
    /* Blue for trust/tech */
    --accent-glow: rgba(59, 130, 246, 0.5);

    /* Typography */
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;

    /* Spacing */
    --container-width: 1200px;
    --section-padding: 80px 20px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-medium: 0.4s ease;

    /* Component Variables (Dark Default) */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.05);
    --nav-bg: rgba(10, 10, 10, 0.8);
    --line-color: rgba(255, 255, 255, 0.1);

    /* Gradients */
    --gradient-start: #ffffff;
    --gradient-end: #a0a0a0;
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #374151;
    /* Darker for better contrast */
    --accent-color: #2563eb;
    --accent-glow: rgba(37, 99, 235, 0.3);

    /* Component Variables (Light Mode) */
    --glass-bg: rgba(0, 0, 0, 0.05);
    --glass-border: rgba(0, 0, 0, 0.1);
    --nav-bg: rgba(255, 255, 255, 0.8);
    --line-color: rgba(0, 0, 0, 0.1);

    /* Gradients */
    --gradient-start: #111827;
    --gradient-end: #4b5563;
}

/* Theme Switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
}

.theme-switch {
    display: inline-block;
    height: 34px;
    position: relative;
    width: 60px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
}

.slider:before {
    background-color: #fff;
    bottom: 4px;
    content: "";
    height: 26px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 26px;
    border-radius: 50%;
    z-index: 2;
}

input:checked+.slider {
    background-color: var(--accent-color);
}

input:checked+.slider:before {
    transform: translateX(26px);
}

.slider .fa-sun {
    color: #f39c12;
    font-size: 14px;
    z-index: 1;
    margin-left: 5px;
}

.slider .fa-moon {
    color: #f1c40f;
    font-size: 14px;
    z-index: 1;
    margin-right: 5px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
    background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-fast);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

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

.btn-outline:hover {
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

nav.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    background: rgba(10, 10, 10, 0.95);
}

[data-theme="light"] nav {
    background: rgba(255, 255, 255, 0.85);
}

[data-theme="light"] nav.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    padding: 0 30px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    flex-shrink: 0;
    margin-right: 20px;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    gap: 20px;
    list-style: none;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    padding: 5px 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a:hover {
    color: var(--accent-color);
}

.nav-links a.active {
    color: var(--accent-color);
    font-weight: 600;
}

/* Scroll Progress Bar */
.scroll-progress-bar {
    position: fixed;
    top: 70px;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), #60a5fa);
    z-index: 1001;
    transition: width 0.1s ease;
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Responsive Navigation */
@media screen and (max-width: 1024px) {
    .nav-links {
        gap: 15px;
    }

    .nav-links a {
        font-size: 0.85rem;
    }
}

@media screen and (max-width: 768px) {
    .nav-content {
        padding: 0 15px;
        height: 60px;
    }

    .nav-links {
        gap: 10px;
    }

    .nav-links a {
        font-size: 0.8rem;
    }

    .logo {
        font-size: 1.3rem;
    }

    .scroll-progress-bar {
        top: 60px;
    }
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 100px 20px 50px;
}

/* Background Animation */
.bg-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
            rgba(59, 130, 246, 0.1) 0%,
            rgba(147, 51, 234, 0.05) 50%,
            rgba(59, 130, 246, 0.1) 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    z-index: 0;
}

@keyframes gradientShift {

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

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

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-text h1 {
    font-size: 3.5rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 0.8s ease;
}

.hero-text h2 {
    font-size: 1.8rem;
    color: var(--accent-color);
    margin-bottom: 20px;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-text p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
    line-height: 1.8;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease 0.6s both;
}

/* Typing Animation */
.typing-container {
    min-height: 120px;
}

.typing-cursor {
    display: inline-block;
    width: 2px;
    margin-left: 2px;
    color: var(--accent-color);
    font-weight: bold;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

/* Experience Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background-color: var(--line-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    right: -8px;
    background-color: var(--bg-secondary);
    border: 2px solid var(--accent-color);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
    transition: var(--transition-fast);
}

.timeline-item:hover::after {
    background-color: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-glow);
}

.left {
    left: 0;
}

.right {
    left: 50%;
}

.left::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 18px;
    width: 0;
    z-index: 1;
    right: 30px;
    right: 30px;
    border: medium solid var(--glass-border);
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent var(--glass-border);
}

.right::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 18px;
    width: 0;
    z-index: 1;
    left: 30px;
    left: 30px;
    border: medium solid var(--glass-border);
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--glass-border) transparent transparent;
}

.right::after {
    left: -8px;
}

.content {
    padding: 20px 30px;
    padding: 20px 30px;
    background-color: var(--glass-bg);
    position: relative;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    transition: var(--transition-fast);
}

.content:hover {
    transform: translateY(-5px);
    background-color: var(--glass-border);
    border-color: var(--line-color);
}

.content h3 {
    color: var(--accent-color);
    margin-bottom: 5px;
}

.content h4 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

/* Job Details Hover Effect */
.job-details {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s ease-out, opacity 0.3s ease-out;
    margin-top: 0;
}

.timeline-item:hover .job-details {
    max-height: 1000px;
    /* Increased to accommodate more content */
    opacity: 1;
    margin-top: 15px;
    transition: max-height 0.5s ease-in, opacity 0.3s ease-in;
    overflow-y: auto;
    /* Allow scrolling if content exceeds height */
}

.job-details p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.5;
}

.job-details ul {
    list-style-type: none;
    padding-left: 0;
}

.job-details ul li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
    padding-left: 15px;
    position: relative;
}

.job-details ul li::before {
    content: "›";
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

/* Responsive Timeline */
@media screen and (max-width: 600px) {
    .timeline::after {
        left: 31px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }

    .timeline-item::before {
        left: 60px;
        border: medium solid white;
        border-width: 10px 10px 10px 0;
        border-color: transparent white transparent transparent;
    }

    .left::after,
    .right::after {
        left: 23px;
    }

    .right {
        left: 0%;
    }
}

/* Skills Section */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.skill-category h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--accent-color);
    padding-bottom: 10px;
    display: inline-block;
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skill-tags span {
    background: var(--glass-bg);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    transition: var(--transition-fast);
}

.skill-tags span:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-2px);
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--glass-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(147, 51, 234, 0.1));
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.project-card:hover::before {
    opacity: 1;
}

.project-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--accent-color);
    box-shadow: 0 20px 40px -10px rgba(59, 130, 246, 0.3),
        0 0 0 1px rgba(59, 130, 246, 0.1);
}

.project-content {
    padding: 25px;
    position: relative;
    z-index: 1;
}

.project-content h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.project-content p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.project-tags {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.project-tags span {
    font-size: 0.8rem;
    color: var(--accent-color);
    background: rgba(59, 130, 246, 0.1);
    padding: 4px 10px;
    border-radius: 4px;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-fast);
}

.project-link:hover {
    color: var(--accent-color);
    gap: 12px;
}

/* Hero Image Updates */
.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    gap: 40px;
}

.hero-text {
    flex: 1;
}

.hero-image {
    flex: 0 0 300px;
    height: 300px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--accent-color);
    box-shadow: 0 0 30px var(--accent-glow);
    position: relative;
    z-index: 10;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-buttons {
    justify-content: flex-start;
}

/* Certifications Section */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.education-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.education-grid .cert-card {
    flex: 0 1 45%;
    min-width: 300px;
}

.cert-card {
    background: var(--glass-bg);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    transition: var(--transition-fast);
}

.cert-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-5px);
}

.cert-card h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.cert-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.cert-link {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--accent-color);
    text-decoration: none;
    margin-top: 5px;
}

.cert-link:hover {
    text-decoration: underline;
}

/* Responsive Updates */

/* Medium Screens - Tablet/Small Desktop */
@media screen and (max-width: 1024px) and (min-width: 769px) {
    .hero-content {
        gap: 30px;
    }

    .hero-image {
        flex: 0 0 250px;
        height: 250px;
    }

    .hero-text h1 {
        font-size: 3rem;
    }

    .hero-text h2 {
        font-size: 1.5rem;
    }

    .chat-widget {
        bottom: 20px;
        right: 20px;
    }
}

/* Mobile Styles */
@media screen and (max-width: 768px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
        padding-top: 100px;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-image {
        width: 200px;
        height: 200px;
        flex: 0 0 200px;
        order: -1;
        /* Move image to top */
        margin-bottom: 30px;
        margin-top: 0;
    }

    .carousel-slide {
        min-width: 85vw;
        /* Show almost full width on mobile */
    }

    /* Mobile Typography & Spacing */
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    /* Mobile Navigation */
    .nav-content {
        flex-direction: column;
        height: auto;
        padding: 15px 0;
        gap: 15px;
    }

    .nav-links {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
        font-size: 0.9rem;
    }

    /* Mobile Contact Icons */
    .contact-links {
        gap: 20px;
        font-size: 2rem;
    }

    /* Fix Hero Scroll & Visibility */
    .hero {
        height: auto;
        min-height: 100vh;
        align-items: flex-start;
        padding-top: 180px;
        /* Space for nav + extra */
        padding-bottom: 50px;
        overflow: visible;
    }
}

/* Contact Section */
.contact-links {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
    font-size: 3rem;
}

/* Badge Wallet */
.badge-wallet-container {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding: 20px 0;
    /* scroll-behavior: smooth; Removed to fix JS auto-scroll */
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
    cursor: grab;
}

.badge-wallet-container::-webkit-scrollbar {
    display: none;
}

.badge-wallet-container:active {
    cursor: grabbing;
}

.badge-item {
    flex: 0 0 150px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transition: var(--transition-fast);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.badge-item:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
}

.badge-item img {
    width: 100%;
    height: auto;
    display: block;
}

.contact-links a {
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.contact-links a:hover {
    color: var(--accent-color);
    transform: translateY(-5px);
}

/* Testimonials Section (Flashcards) */
.testimonial-container {
    display: flex;
    overflow-x: auto;
    gap: 30px;
    padding: 20px 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
    cursor: grab;
    perspective: 1000px;
    /* Essential for 3D flip */
}

.testimonial-container::-webkit-scrollbar {
    display: none;
}

.testimonial-container:active {
    cursor: grabbing;
}

.testimonial-card {
    flex: 0 0 350px;
    height: 450px;
    /* Increased height */
    background-color: transparent;
    perspective: 1000px;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.testimonial-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
}

.flip-card-front {
    color: var(--text-primary);
}

.flip-card-front h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--accent-color);
}

.flip-card-front p {
    color: var(--text-secondary);
}

.click-icon {
    margin-top: 20px;
    font-size: 1.2rem;
    color: var(--accent-color);
    opacity: 0.8;
    animation: spin 4s linear infinite;
}

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

.flip-card-back {
    transform: rotateY(180deg);
    overflow-y: auto;
    justify-content: flex-start;
    /* Align text to top */
    align-items: flex-start;
    /* Align text to left */
    text-align: left;
    z-index: 1;
}

.flipped .flip-card-front {
    z-index: 1;
}

.flipped .flip-card-back {
    z-index: 2;
}

.testimonial-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-style: italic;
    text-align: left;
    margin: 0;
    /* Remove default margins */
}

/* Publication Card */
.publication-card {
    background-color: transparent;
    width: 100%;
    max-width: 800px;
    height: 450px;
    perspective: 1000px;
    cursor: pointer;
    margin: 0 auto;
}

.publication-card .flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}

.publication-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.publication-card .flip-card-front,
.publication-card .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 15px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
}

.publication-card .flip-card-front {
    background: var(--glass-bg);
}

.publication-card .flip-card-back {
    background: var(--bg-secondary);
    color: var(--text-primary);
    transform: rotateY(180deg);
    overflow-y: auto;
}

.publication-abstract {
    font-size: 0.95rem;
    line-height: 1.6;
    text-align: justify;
    color: var(--text-secondary);
}

/* Featured Project Styles */
.featured-project {
    border: 2px solid var(--accent-color);
    position: relative;
    overflow: visible;
}

.featured-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: var(--accent-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    box-shadow: 0 4px 10px var(--accent-glow);
}

.client-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.project-details ul {
    padding-left: 20px;
}

.project-details li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.project-tags span {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    border: 1px solid var(--glass-border);
}

.publication-abstract {
    font-size: 0.95rem;
    line-height: 1.6;
    text-align: justify;
    color: var(--text-secondary);
}

.project-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 20px;
    gap: 15px;
}

.project-footer .project-tags {
    margin-top: 0;
    width: 100%;
}

.project-footer .btn {
    margin-top: 0 !important;
    align-self: flex-start;
}

/* Floating Chat Button Wrapper */
.chat-widget,
.chat-fab-wrapper {
    position: fixed !important;
    bottom: calc(25px + env(safe-area-inset-bottom, 0px)) !important;
    right: calc(25px + env(safe-area-inset-right, 0px)) !important;
    z-index: 99999 !important;
    font-family: 'Inter', sans-serif;
    display: block !important;
}

body.chat-open .chat-widget,
body.chat-open .chat-fab-wrapper {
    display: none !important;
}

.chat-fab {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), #00d2ff);
    color: white;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--accent-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: floatRobot 3s ease-in-out infinite, pulse 2s ease-in-out infinite;
    position: relative;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    z-index: 99999;
}

@keyframes floatRobot {

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

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

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 4px 15px var(--accent-glow);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0.3), 0 0 0 20px rgba(59, 130, 246, 0.1);
    }
}

.chat-fab:hover {
    animation-play-state: paused;
    transform: scale(1.1);
}

/* Chat Tooltip */
.chat-tooltip {
    position: absolute;
    right: 75px;
    background: var(--card-bg);
    color: var(--text-primary);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.chat-fab:hover .chat-tooltip {
    opacity: 1;
}

.chat-container {
    position: fixed;
    bottom: calc(100px + env(safe-area-inset-bottom, 0px));
    right: calc(25px + env(safe-area-inset-right, 0px));
    width: 380px;
    height: 540px;
    max-height: 80vh;
    background: var(--bg-secondary);
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    display: none;
    /* Hidden by default */
    flex-direction: column;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
    transition: width 0.3s ease, height 0.3s ease;
    z-index: 100000;
}

.chat-container.maximized {
    width: 80vw;
    height: 80vh;
    max-width: none;
    bottom: 10vh;
    right: 5vw;
    border-radius: 20px;
    z-index: 100002;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* Hide top navbar and progress bar when mobile chat is open */
body.chat-open nav,
body.chat-open .scroll-progress-bar {
    display: none !important;
}

.chat-header {
    background: var(--accent-color);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    z-index: 1000005;
}

.chat-back-btn {
    display: none;
    background: rgba(255, 255, 255, 0.22);
    border: none;
    color: white;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 20px;
    align-items: center;
    gap: 6px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
}

.chat-back-btn:active {
    background: rgba(255, 255, 255, 0.45);
    transform: scale(0.95);
}

.chat-title {
    font-weight: 600;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-maximize-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    touch-action: manipulation;
    transition: background 0.2s ease;
}

.chat-close-btn {
    background: rgba(255, 255, 255, 0.22);
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}

.chat-close-btn:active {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0.92);
}

.chat-maximize-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-messages {
    flex: 1 1 auto;
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 0;
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 15px;
    font-size: 0.95rem;
    line-height: 1.55;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

.bot-message {
    background: rgba(59, 130, 246, 0.15);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 5px;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

[data-theme="light"] .bot-message {
    background: rgba(59, 130, 246, 0.1);
    color: #1a1a1a;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

.user-message {
    background: var(--accent-color);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

[data-theme="light"] .user-message {
    background: var(--accent-color);
    color: white;
}

/* Chat Message Formatting */
.message strong {
    font-weight: 700;
    color: inherit;
}

.message em {
    font-style: italic;
}

.message code {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
}

/* Suggested Questions */
.suggested-questions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 5px;
    margin-top: 10px;
}

.suggestion-btn {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
    touch-action: manipulation;
}

.suggestion-btn:hover,
.suggestion-btn:active {
    background: var(--accent-color);
    color: white;
    transform: translateX(4px);
}

.chat-input-area {
    padding: 12px 15px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 10px;
    background: var(--bg-secondary);
    flex-shrink: 0;
    align-items: center;
}

#chat-input {
    flex: 1;
    padding: 12px 16px;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
    outline: none;
    font-size: 16px; /* 16px is required to prevent iOS Safari from zooming */
    -webkit-appearance: none;
    touch-action: manipulation;
}

#chat-input:focus {
    border-color: var(--accent-color);
}

.send-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    flex-shrink: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.send-btn:active {
    transform: scale(0.92);
}

/* Mobile Responsiveness for Chat (Phones & iPhone) */
@media screen and (max-width: 768px) {
    .chat-widget,
    .chat-fab-wrapper {
        position: fixed !important;
        bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important;
        right: calc(18px + env(safe-area-inset-right, 0px)) !important;
        z-index: 99999 !important;
        display: block !important;
    }

    body.chat-open .chat-widget,
    body.chat-open .chat-fab-wrapper {
        display: none !important;
    }

    .chat-fab {
        width: 60px !important;
        height: 60px !important;
        font-size: 1.6rem !important;
        display: flex !important;
    }

    .chat-container {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        width: 100vw !important;
        width: 100dvw !important;
        height: 100% !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: none !important;
        border-radius: 0 !important;
        border: none !important;
        margin: 0 !important;
        z-index: 2147483647 !important; /* Max CSS z-index */
    }

    .chat-back-btn {
        display: inline-flex !important;
    }

    .chat-header {
        position: relative !important;
        z-index: 2147483647 !important;
        padding-top: calc(15px + env(safe-area-inset-top, 0px)) !important;
        padding-bottom: 15px !important;
        padding-left: 18px !important;
        padding-right: 18px !important;
    }

    .chat-messages {
        padding: 15px !important;
    }

    .chat-input-area {
        padding-top: 10px !important;
        padding-bottom: calc(15px + env(safe-area-inset-bottom, 0px)) !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        background: var(--bg-primary) !important;
        border-top: 1px solid var(--border-color) !important;
    }

    .chat-maximize-btn {
        display: none !important;
    }
}

/* Hobbies Section */
.hobbies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.hobby-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

.hobby-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
}

.recognition-cert img:hover {
    transform: scale(1.8);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    z-index: 100;
    position: relative;
}

/* Many More Card */
.many-more-card {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-color) 0%, rgba(59, 130, 246, 0.6) 100%);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    min-height: 200px;
    transition: all 0.3s ease;
}

.many-more-card:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.6);
}

.many-more-content {
    text-align: center;
}

.many-more-content i {
    font-size: 3rem;
    color: white;
    margin-bottom: 1rem;
    opacity: 0.8;
}

.many-more-content h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.many-more-content p {
    color: rgba(255, 255, 255, 0.9) !important;
    font-style: italic;
}

.hobby-icon {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.hobby-card h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.hobby-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.hobby-images {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 1rem;
}

.hobby-images img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.hobby-images img:hover {
    transform: scale(1.5);
    z-index: 10;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

/* Video Profile Container */
.video-profile-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.profile-photo,
.profile-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-video {
    border-radius: 20px;
}

.video-play-btn {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.95);
    border: 3px solid white;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6);
    transition: all 0.3s ease;
    z-index: 10;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6);
    }

    50% {
        box-shadow: 0 8px 35px rgba(59, 130, 246, 0.9), 0 0 0 10px rgba(59, 130, 246, 0.2);
    }
}

.video-play-btn:hover {
    transform: translateX(-50%) scale(1.15);
    background: rgba(59, 130, 246, 1);
    box-shadow: 0 12px 40px rgba(59, 130, 246, 0.8);
}

.video-play-btn i {
    margin-left: 4px;
}

.video-play-btn.close-btn {
    background: rgba(239, 68, 68, 0.95);
    border-color: white;
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.6);
    animation: none;
    /* Keep same position as play button */
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.video-play-btn.close-btn:hover {
    transform: translateX(-50%) scale(1.1);
    background: rgba(239, 68, 68, 1);
    box-shadow: 0 12px 40px rgba(239, 68, 68, 0.8);
}

.video-play-btn.close-btn i {
    margin-left: 0;
}

@media screen and (max-width: 768px) {
    .video-play-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        bottom: 5px;
    }

    .video-play-btn.close-btn {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
}

/* Image Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.1);
    animation: zoomIn 0.3s ease;
    pointer-events: none;
    /* Prevent right-click */
    user-select: none;
    /* Prevent selection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    transition: opacity 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    transition: all 0.3s ease;
    user-select: none;
    z-index: 10000;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(59, 130, 246, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 50px;
    color: white;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 10000;
}

.lightbox-close:hover {
    color: var(--accent-color);
}

@media screen and (max-width: 768px) {
    .lightbox-close {
        top: 20px;
        right: 30px;
        font-size: 40px;
    }

    .lightbox-prev,
    .lightbox-next {
        font-size: 35px;
        padding: 15px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-content {
        max-width: 95%;
        max-height: 95%;
    }
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--accent-glow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 899;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px var(--accent-glow);
}

/* Scroll Animation Classes */
section.fade-in-up {
    animation: sectionFadeIn 0.8s ease forwards;
}

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