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

/* Color Variables */
html {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --text-primary: #333;
    --text-secondary: #7f8c8d;
    --accent-color: #286983;
    --accent-dark: #1f5362;
    --link-color: #907aa9;
    --nav-text: #bdc3c7;
    --nav-text-light: #ecf0f1;
    --section-bg: #ffffff;
    --border-color: rgba(0, 0, 0, 0.1);
}

html[data-theme="dark"] {
    --bg-primary: #232136;
    --bg-secondary: #232136;
    --text-primary: #e0def4;
    --text-secondary: #6e6a86;
    --accent-color: #908caa;
    --accent-dark: #797593;
    --link-color: #c4a7e7;
    --nav-text: #e0def4;
    --nav-text-light: #e0def4;
    --section-bg: #2a273f;
    --border-color: rgba(255, 255, 255, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

a:hover {
    text-decoration: underline;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Navigation */
.sidebar {
    position: static;
    width: 100%;
    height: auto;
    background-color: var(--accent-color);
    padding: 1rem 0;
    box-shadow: 0 2px 5px var(--border-color);
    transition: background-color 0.3s ease;
}

.nav-content {
    padding: 0 1.5rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.nav-title {
    color: #ecf0f1;
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.nav-list {
    list-style: none;
    display: flex;
    gap: 0;
}

/* Navigation Right Section */
.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    display: block;
    color: #ffffff;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    margin-bottom: 0;
    border-radius: 0;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    font-size: 1.1em;
    font-weight: bold;
}

.nav-link:hover {
    background-color: transparent;
    color: #ffffff;
    padding-left: 1.5rem;
    border-bottom-color: #ffffff;
    text-decoration: none;
}

/* Main Content */
.content {
    flex: 1;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Social Media Icons */
.social-icons {
    display: flex;
    gap: 0.75rem;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    justify-content: center;
    align-items: center;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(33, 32, 46, 0.15);
    transition: transform 0.3s ease, background-color 0.3s ease;
    border: none;
    cursor: pointer;
}

.social-link:hover {
    transform: scale(1.1);
    background-color: rgba(33, 32, 46, 0.25);
    text-decoration: none;
}

.social-link img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

/* Theme Toggle Button */
.theme-toggle {
    display: flex;
    align-items: center;
    width: 60px;
    height: 32px;
    border-radius: 16px;
    background-color: #191724;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.3s ease;
    position: relative;
}

.toggle-circle {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #ffffff;
    left: 2px;
    transition: left 0.3s ease, background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-icon {
    width: 16px;
    height: 16px;
    transition: opacity 0.3s ease;
    position: absolute;
}

.theme-icon-sun {
    opacity: 1;
    filter: brightness(0);
}

.theme-icon-moon {
    opacity: 0;
    filter: brightness(0) invert(1);
}

html[data-theme="dark"] .theme-icon-sun {
    opacity: 0;
}

html[data-theme="dark"] .theme-icon-moon {
    opacity: 1;
}

html[data-theme="dark"] .theme-toggle {
    background-color: #ffffff;
}

html[data-theme="dark"] .toggle-circle {
    background-color: #232136;
    left: calc(100% - 30px);
}

.section {
    background-color: var(--section-bg);
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 16px;
    box-shadow: 0 2px 4px var(--border-color);
    width: 100%;
    max-width: 900px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.section h2 {
    color: var(--accent-color);
    font-size: 2rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 0.5rem;
    transition: color 0.3s ease, border-color 0.3s ease;
}

/* About Section */
.about-content {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.profile-pic {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.3s ease;
}

.about-text {
    flex: 1;
}

.section p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

/* Publications Section */
.publication-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.publication {
    padding: 0;
    padding-left: 1.5rem;
    position: relative;
}

.publication::before {
    content: "•";
    color: var(--accent-color);
    font-weight: bold;
    font-size: 1.2em;
    position: absolute;
    left: 0;
    transition: color 0.3s ease;
}

.publication h3 {
    color: var(--accent-color);
    margin-bottom: 0.25rem;
    margin-top: 0;
    transition: color 0.3s ease;
}

.publication-meta {
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 0;
    margin-top: 0;
    transition: color 0.3s ease;
}

/* Publication buttons */
.pub-buttons {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 0.35rem 0.6rem;
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
}

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

.bibtex {
    white-space: pre-wrap;
    font-family: monospace;
    font-size: 0.85rem;
}

/* Contact Section */
.contact-info {
    background-color: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.contact-info p {
    margin-bottom: 0.75rem;
}

/* Blog Styles */
.blog-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.blog-entry {
    padding: 0;
    padding-left: 1.5rem;
    position: relative;
    border-left: 3px solid var(--accent-color);
    padding-left: 1.5rem;
}

.blog-entry::before {
    content: "•";
    color: var(--accent-color);
    font-weight: bold;
    font-size: 1.2em;
    position: absolute;
    left: -1.35rem;
    transition: color 0.3s ease;
}

.blog-entry h3 {
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    margin-top: 0;
    transition: color 0.3s ease;
}

.blog-entry h3 a {
    color: var(--accent-color);
    text-decoration: none;
}

.blog-entry h3 a:hover {
    text-decoration: underline;
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.blog-date {
    color: var(--text-secondary);
    font-style: italic;
}

.blog-tags {
    display: flex;
    gap: 0.5rem;
}

.blog-tag {
    display: inline-block;
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: background-color 0.3s ease, color 0.3s ease;
    text-decoration: none;
    cursor: pointer;
}

.blog-tag:hover {
    background-color: var(--accent-color);
    color: #fff;
    text-decoration: none;
}

.blog-excerpt {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.read-more {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.read-more:hover {
    text-decoration: underline;
}

/* Blog Post Page Styles */
.blog-post {
    max-width: 800px;
}

.blog-post-header {
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 1rem;
}

.blog-post h1 {
    color: var(--accent-color);
    font-size: 2.5rem;
    margin: 0 0 1rem 0;
    transition: color 0.3s ease;
}

.blog-post-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.blog-post-content {
    font-size: 1.05rem;
    line-height: 1.8;
}

.blog-post-content h2 {
    color: var(--accent-color);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    transition: color 0.3s ease;
}

.blog-post-content p {
    margin-bottom: 1rem;
}

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

.back-to-blog {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.back-to-blog:hover {
    text-decoration: underline;
}

/* Blog post images — responsive + zoom */
.blog-post-content img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
}

.blog-img-wrap {
    position: relative;
    display: inline-block;
    max-width: 100%;
    line-height: 0;
    cursor: zoom-in;
}

.zoom-btn {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.blog-img-wrap:hover .zoom-btn {
    opacity: 1;
}

.zoom-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: #ffffff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.lightbox.open {
    display: flex;
}

.lightbox img {
    max-width: 92vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    cursor: default;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-content {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-list {
        flex-direction: column;
        gap: 0;
    }

    .nav-link {
        padding: 0.5rem 1rem;
        border-bottom: none;
        border-left: 3px solid transparent;
        padding-left: 1rem;
    }

    .nav-link:hover {
        border-bottom-color: transparent;
        border-left-color: #ecf0f1;
    }

    .content {
        padding: 1.5rem;
    }

    .section {
        padding: 1.5rem;
    }

    .section h2 {
        font-size: 1.5rem;
    }

    .about-content {
        flex-direction: column;
        align-items: center;
    }

    .profile-pic {
        width: 150px;
        height: 150px;
    }
}

/* Tags page */
.tags-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tag-search-input {
    width: 100%;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s ease, background-color 0.3s ease;
    outline: none;
}

.tag-search-input:focus {
    border-color: var(--accent-color);
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-filter-btn {
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    border: 1px solid var(--accent-color);
    background-color: transparent;
    color: var(--accent-color);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.tag-filter-btn:hover,
.tag-filter-btn.active {
    background-color: var(--accent-color);
    color: #fff;
}

.active-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.active-tag-label {
    font-weight: 600;
    color: var(--accent-color);
}

.clear-filter {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.clear-filter:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.no-results {
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 1rem;
}

/* News list helpers */
.news-list .news-item.hidden {
    display: none;
}

.news-more-btn {
    margin-top: 0.75rem;
}
