:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --social-color: #f1aaaa;
    --social-color-accent: #b33b3b;
    --text-color: #333;
    --light-bg: #f4f4f4;
    --white: #ffffff;
    --footer-bg: #2c3e50;
    --footer-text: #ecf0f1;
    --border-color: #ddd;
    --nav-dropdown-color: #6b7280;
}

/* Dark mode theme */
body.dark-mode {
    background-color: #171717;
    color: #d6d6d6;
    color-scheme: dark;
    --primary-color: #d8d8d8;
    --secondary-color: #a3a3a3;
    --accent-color: #8f8f8f;
    --social-color: #d08a8a;
    --social-color-accent: #b26a6a;
    --text-color: #d6d6d6;
    --light-bg: #2b2b2b;
    --white: #222222;
    --footer-bg: #0f0f0f;
    --footer-text: #b0b0b0;
    --border-color: #3a3a3a;
    --nav-dropdown-color: #a8a8a8;
}

body.dark-mode .btn-secondary {
    background-color: #4a4a4a;
}

body.dark-mode .btn-secondary:hover {
    background-color: #565656;
}

body.dark-mode .btn-primary:hover {
    background-color: #7d7d7d;
}

body.dark-mode .toggle-abstract:hover {
    color: #c0c0c0;
}

body.dark-mode .btn-primary,
body.dark-mode .btn-secondary,
body.dark-mode .filter-button.active {
    color: #ffffff;
}

body.dark-mode .profile-img {
    border-color: var(--secondary-color);
}

/* Theme toggle switch (header, left of the navigation bar) */
.theme-switch {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    margin-right: 1.25rem;
    cursor: pointer;
    user-select: none;
}

.theme-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.theme-switch-track {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    background: var(--border-color);
    border-radius: 999px;
    transition: background 0.3s ease;
    flex-shrink: 0;
    overflow: hidden;
}

.theme-switch-track::before {
    content: "\2600";
    position: absolute;
    left: 7px;
    top: 50%;
    transform: translateY(-46%);
    font-size: 12px;
    line-height: 1;
    color: #f6c344;
}

.theme-switch-track::after {
    content: "\263E";
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-46%);
    font-size: 12px;
    line-height: 1;
    color: #9aa7bf;
}

.theme-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
}

.theme-switch input:checked + .theme-switch-track {
    background: var(--accent-color);
}

.theme-switch input:checked + .theme-switch-track .theme-switch-thumb {
    transform: translateX(24px);
}

.theme-switch input:focus-visible + .theme-switch-track {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--white);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}

.header-container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Header & Nav */
header {
    background: var(--white);
    color: var(--text-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    font-size: 1rem;
}

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

header .logo {
    font-size: 1.5rem;
    font-weight: bold;
}

header .logo a {
    display: inline-block;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

header nav ul {
    display: flex;
    list-style: none;
    justify-content: flex-end;
    background-color: var(--white);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    display: inline-flex;
}

header nav ul li {
    margin-left: 1rem;
    position: relative;
}

header nav ul li a:hover {
    color: var(--accent-color);
}

/* Dropdown Menu */
.dropdown-menu::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 0;
    width: 100%;
    height: 10px;
    background: transparent;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 110%;
    left: 0;
    background-color: var(--white);
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.1);
    z-index: 1001;
    list-style: none;
    padding: 0.5rem 0;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu li a {
    color: var(--text-color);
    padding: 10px 20px;
    text-decoration: none;
    display: block;
    white-space: nowrap;
}

.dropdown-menu li a:hover {
    background-color: var(--light-bg);
}

.dropdown:hover .dropdown-menu {
    display: block;
}

/* Hamburger navigation (mobile) */
.nav-toggle {
    display: none;
    padding: 0.5rem;
    margin-left: 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-toggle-icon {
    display: block;
    width: 26px;
    height: 3px;
    border-radius: 2px;
    background-color: var(--text-color);
    position: relative;
    transition: background-color 0.3s ease;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
    content: "";
    position: absolute;
    left: 0;
    width: 26px;
    height: 3px;
    border-radius: 2px;
    background-color: var(--text-color);
    transition: transform 0.3s ease, top 0.3s ease;
}

.nav-toggle-icon::before {
    top: -8px;
}

.nav-toggle-icon::after {
    top: 8px;
}

header.nav-open .nav-toggle-icon {
    background-color: transparent;
}

header.nav-open .nav-toggle-icon::before {
    top: 0;
    transform: rotate(45deg);
}

header.nav-open .nav-toggle-icon::after {
    top: 0;
    transform: rotate(-45deg);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 1rem;
    background-color: var(--light-bg);
    margin-bottom: 2rem;
    border-radius: 8px;
}

.profile-container {
    margin-bottom: 1.5rem;
}

.profile-img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #f4f4f4;
    border: 4px solid var(--white);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

/* Buttons */
.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s ease;
    cursor: pointer;
}

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

.btn-primary:hover {
    background-color: #2980b9;
}

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

.btn-secondary:hover {
    background-color: #2c3e50;
}

/* Content Sections */
main {
    flex: 1;
    min-height: 80vh;
    padding: 2rem 0;
}

/* Blog Section */
.blog-section {
    margin-top: 2rem;
}

.blog-section h1 {
    margin-bottom: 2rem;
    font-size: 2.5rem;
}

.blog-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.blog-card {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 1.5rem;
    background-color: var(--light-bg);
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.blog-card:hover {
    background-color: var(--white);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.blog-card-title {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.blog-card-date {
    margin: 0;
    color: var(--secondary-color);
}

.post-content {
    text-align: justify;
    font-size: 1.1rem;
    line-height: 1.8;
}

.post-content ul,
.post-content ol {
    padding-left: 1.75rem;
    margin-bottom: 1rem;
    text-align: left;
}

.post-content li {
    margin-bottom: 0.25rem;
}

.post-footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.post-content img {
    display: block;
    max-width: 90%;
    height: auto;
    margin: 1rem auto;
}

.post-content pre {
    background-color: var(--light-bg);
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-content pre code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.5;
}

.post-content code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    background-color: var(--light-bg);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.95rem;
}

.bio-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.bio-section h2 {
    margin-bottom: 1rem;
}

/* Publications */
.controls {
    margin-bottom: 1rem;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
}

.controls span {
    font-weight: bold;
    font-size: 0.95rem;
}

.sort-btn {
    padding: 0.5rem 1.1rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background-color: var(--white);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
}

.sort-btn:hover {
    background-color: var(--light-bg);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.sort-btn.active {
    background-color: var(--accent-color);
    color: #ffffff;
    border-color: var(--accent-color);
}

.publication-item {
    margin-bottom: 2rem;
    padding: 1.75rem;
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.publication-text h2 {
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
    line-height: 1.3;
    color: var(--primary-color);
}

.publication-meta {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--secondary-color);
}

.publication-doi {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.publication-doi a {
    color: var(--accent-color);
    text-decoration: none;
}

.publication-doi a:hover {
    text-decoration: underline;
}

.btn-read-full {
    display: inline-block;
    margin-left: 0.75rem;
    padding: 0.15rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    vertical-align: middle;
    color: var(--accent-color);
    background-color: transparent;
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-read-full:hover {
    background-color: var(--accent-color);
    color: #ffffff;
}

.toggle-abstract {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0;
    margin: 0 0 0.5rem;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent-color);
    background: none;
    border: none;
    cursor: pointer;
}

.toggle-abstract:hover {
    color: #2980b9;
}

.toggle-triangle {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid currentColor;
    transition: transform 0.2s ease;
}

.toggle-abstract.open .toggle-triangle {
    transform: rotate(180deg);
}

.publication-abstract {
    margin-top: 0.5rem;
    padding: 1rem;
    font-size: 0.95rem;
    color: var(--text-color);
    background-color: var(--white);
    border-left: 3px solid var(--accent-color);
    border-radius: 4px;
}

/* Contact Info Section */

.about-content p {
    text-align: justify;
    width: 100%;
    margin-top: 1.5rem;
}

/* Research Interests */
.research-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.research-heading h1 {
    margin: 0;
}

.research-interests {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.research-pill {
    display: inline-block;
    padding: 0.4rem 1.1rem;
    border-radius: 20px;
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    color: var(--secondary-color);
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.contact-info {
    text-align: center;
    margin-top: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.contact-item i {
    width: 30px;
}

.contact-item a {
    color: inherit;
    text-decoration: none;
}

.contact-item a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Footer */
footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 2rem;
}

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

footer .footer-genai {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    opacity: 0.8;
}


/* Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
    }
    
    .theme-switch {
        margin-right: 0.25rem;
    }
    
    .nav-toggle {
        display: block;
        margin-left: 0.75rem;
    }
    
    header nav {
        order: 10;
        width: 100%;
    }
    
    #nav-list {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        width: 100%;
        margin: 0.75rem 0 0;
        padding: 0.5rem 1.25rem;
        border-radius: 8px;
    }
    
    header.nav-open #nav-list {
        display: flex;
    }
    
    header nav ul li {
        margin: 0.25rem 0;
    }
    
    header nav ul li > a {
        font-weight: bold;
    }
    
    .dropdown-menu {
        position: static;
        display: block;
        box-shadow: none;
        border: none;
        min-width: 0;
        padding: 0;
        background-color: transparent;
    }
    
    .dropdown-menu li a {
        font-weight: normal;
        padding: 0.4rem 0;
        white-space: normal;
        color: var(--nav-dropdown-color);
    }
    
    .dropdown-menu li a:hover {
        background-color: transparent;
        color: var(--accent-color);
    }
    
    header .logo {
        width: 100%;
        max-width: 70%;
        font-size: 1.2rem;
        margin-bottom: 0.25rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 250px;
    }
}

.social-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.social-grid {
    flex-wrap: wrap;
    max-width: 228px;
    margin: 0 auto 1rem;
}

.btn-social {
    background-color: transparent;
    color: var(--social-color);
    padding: 0.75rem;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1.5rem;
}

.btn-social:hover {
    /* background-color: var(--social-color); */
    color: var(--social-color-accent);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 2rem;
    padding: 10px;
    border: none;
    cursor: pointer;
    z-index: 10;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.carousel-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.prev {
    left: 10px;
}

.next {
    right: 10px;
}

.carousel-section h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.carousel-container {
    position: relative;
    max-width: 100%;
    margin: auto;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.carousel-wrapper {
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: 100%;
}

.carousel-slide {
    min-width: 100%;
    box-sizing: border-box;
    padding: 10px;
    background: var(--white);
}

.carousel-img {
    width: 100%;
    height: 400px;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

.carousel-abstract {
    padding: 1.5rem;
    font-style: italic;
    color: var(--secondary-color);
    text-align: center;
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .carousel-img {
        height: 250px;
    }
}

.photography-filters {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-button {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background-color: var(--white);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.filter-button:hover {
    background-color: var(--light-bg);
    border-color: var(--accent-color);
}

.filter-button.active {
    background-color: var(--accent-color);
    color: var(--white);
    border-color: var(--accent-color);
}