/* CSS Variables for Theme */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-nav-active: rgba(217, 217, 217, 0.833);
    --text-primary: #000000;
    --text-secondary: #555555;
    --text-tertiary: #575757;
    --text-inactive: rgb(122, 121, 121);
    --border-color: #000000;
    --divider-color: #afafaf;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --shadow-text: rgba(0, 0, 0, 0.3);
    --link-color: #000000;
    --link-hover: #313131;
}

/* Dark Theme */
body.dark-theme {
    --bg-primary: #1e1e1e;
    --bg-secondary: #2d2d2d;
    --bg-nav-active: rgba(60, 60, 60, 0.833);
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --text-tertiary: #a0a0a0;
    --text-inactive: rgb(160, 160, 160);
    --border-color: #505050;
    --divider-color: #505050;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --shadow-text: rgba(0, 0, 0, 0.6);
    --link-color: #ffffff;
    --link-hover: #bdbec0;
}

/* Global styles */
* {
    font-family: 'Georgia', serif;
}

body {
    font-family: 'Georgia', serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.link {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0.5rem 0;
    transition: color 0.3s ease;
}

.link a {
    color: var(--link-color);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.link a:hover {
    color: var(--link-hover);
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.in-text-link {
    color: var(--text-secondary);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.in-text-link:hover {
    color: var(--text-tertiary);
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

/* Main container with left-right layout */
.container {
    display: flex;
    width: 100%;
    height: 100vh;
}

/* Navigation bar styling */
.nav-bar {
    position: relative;
    background-color: var(--bg-primary);
}

.nav-btn {
    margin: 0 0.5rem;
    padding: 0.8rem 1.5rem;
    border: none;
    background-color: var(--bg-primary);
    cursor: pointer;
    display: inline-block;
    color: var(--text-inactive);
    font-weight: bold;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.nav-btn:hover {
    background-color: var(--bg-nav-active);
    color: var(--text-primary);
}

.nav-btn.active {
    background-color: var(--bg-nav-active);
    color: var(--text-primary);
}

.nav-seperator {
    border: none;
    border-top: 1px solid var(--border-color);
    width: 100%;
    margin: 5px 0;
}

/* Theme Toggle Button */
.theme-toggle {
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background-color: var(--bg-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* Left sidebar - fixed at 30% width */
.sidebar {
    width: 200px;
    padding: 2rem;
    background-color: var(--bg-secondary);
    overflow-y: auto;
    transition: background-color 0.3s ease;
}

.avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
    display: block;
    margin: 0 auto;
}

/* Profile Section Styles */
.profile-section {
    text-align: left;
    padding: 1rem 0;
}

.profile-name {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--text-primary);
    margin: 0.5rem 0;
    transition: color 0.3s ease;
    text-align: center;
}

.profile-name-zh {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0.3rem 0;
    transition: color 0.3s ease;
    text-align: center;
}

.profile-title {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0.5rem 0;
    transition: color 0.3s ease;
    text-align: center;
}

.profile-introduction {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 1rem 0;
    padding: 0 0.5rem;
    transition: color 0.3s ease;
}

.profile-location {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    margin: 0.5rem 0;
    transition: color 0.3s ease;
}

/* Right content area - 65% width */
.content-area {
    width: 75%;
    padding: 2rem;
    overflow-y: auto;
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease;
}

/* Projects Page Styles */

/* Project title link */
.project-title {
    color: var(--text-primary);
    text-decoration: underline;
    font-weight: bold;
    text-shadow: 2px 2px 4px var(--shadow-text);
    transition: color 0.3s ease;
}

.project-title:hover {
    color: var(--link-hover);
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

/* Author information */
.project-author {
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

/* Conference/venue information */
.project-venue {
    color: var(--text-secondary);
    font-style: italic;
    transition: color 0.3s ease;
}

/* Project images */
.project-image {
    max-width: 300px;
    width: 100%;
    height: auto;
    box-shadow: 0 4px 8px var(--shadow-color);
    transition: box-shadow 0.3s ease;
}

/* Project Divider */
.project-divider {
    border: none;
    border-top: 2px dotted var(--divider-color);
    margin: 2rem 0;
    transition: border-color 0.3s ease;
}

/* Project flex container */
.project-flex-container {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 30px;
}

/* Project image in flex layout - fixed width */
.project-image-fixed {
    flex: 0 0 300px;
    max-width: 300px;
}

/* Project content area in flex layout */
.project-content {
    flex: 1;
}

/* Blog/Insights & Ideas Page Styles */

/* Blog introduction text */
.blog-intro {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 2rem;
    line-height: 1.6;
    transition: color 0.3s ease;
}

/* Blog introduction signature */
.blog-intro-signature {
    font-size: 1rem;
    color: var(--text-primary);
    margin-top: 1rem;
    text-align: right;
    transition: color 0.3s ease;
}

/* Tag filter container */
.tag-filter-container {
    margin: 2rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: center;
}

/* Individual tag button */
.tag-button {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    background-color: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tag-button:hover {
    background-color: var(--bg-nav-active);
    transform: translateY(-2px);
}

.tag-button.active {
    background-color: var(--bg-nav-active);
    color: var(--text-primary);
    border-color: var(--text-primary);
}

/* Clear all tags button */
.clear-tags-button {
    padding: 0.5rem 1rem;
    border: 2px solid var(--divider-color);
    background-color: transparent;
    color: var(--text-tertiary);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.clear-tags-button:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* Blog cards container */
.blog-cards-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

/* Individual blog card */
.blog-card {
    padding: 1.5rem;
    border: 1px solid var(--divider-color);
    border-radius: 8px;
    background-color: var(--bg-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px var(--shadow-color);
    border-color: var(--link-color);
}

.blog-card-date {
    font-size: 1rem;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.blog-card-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 0.8rem;
    transition: color 0.3s ease;
}

.blog-card-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

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

.blog-card-tag {
    padding: 0.3rem 0.7rem;
    background-color: var(--bg-primary);
    color: var(--text-tertiary);
    border-radius: 12px;
    font-size: 0.8rem;
    border: 1px solid var(--divider-color);
    transition: all 0.3s ease;
}

/* About Me Page Styles */

/* Section heading style */
.aboutme-section-title {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: bold;
    margin: 1.5rem 0 0.5rem 0;
    transition: color 0.3s ease;
}

/* Biography item with advisor link */
.bio-item-right {
    float: right;
}

.bio-item-right .link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: bold;
}

.bio-item-right .link:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Blog Viewer Page Styles */

.blog-viewer-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    background-color: var(--bg-primary);
    min-height: 100vh;
}

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

.blog-nav {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-button {
    padding: 0.6rem 1.2rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.back-button:hover {
    background-color: var(--bg-secondary);
    transform: translateX(-4px);
}

.blog-title {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.blog-meta {
    display: flex;
    gap: 1.5rem;
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

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

.blog-tag-display {
    padding: 0.3rem 0.8rem;
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 14px;
    font-size: 0.85rem;
    border: 1px solid var(--divider-color);
}

.blog-content {
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 1.05rem;
    text-align: left;
}

.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4 {
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
    text-align: left;
}

.blog-content h1 {
    font-size: 1.8rem;
    border-bottom: 2px solid var(--divider-color);
    padding-bottom: 0.5rem;
}

.blog-content h2 {
    font-size: 1.5rem;
}

.blog-content h3 {
    font-size: 1.3rem;
}

.blog-content p {
    margin-bottom: 1.2rem;
    text-align: left;
}

.blog-content a {
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px solid var(--link-color);
}

.blog-content a:hover {
    color: var(--link-hover);
    border-bottom-color: var(--link-hover);
}

.blog-content code {
    background-color: var(--bg-secondary);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
}

.blog-content pre {
    background-color: var(--bg-secondary);
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    border: 1px solid var(--divider-color);
    text-align: left;
}

.blog-content pre code {
    background-color: transparent;
    padding: 0;
}

.blog-content ul,
.blog-content ol {
    margin-left: 2rem;
    margin-bottom: 1.2rem;
    text-align: left;
}

.blog-content li {
    margin-bottom: 0.5rem;
}

.blog-content blockquote {
    border-left: 4px solid var(--link-color);
    padding-left: 1rem;
    margin-left: 0;
    color: var(--text-secondary);
    font-style: italic;
    text-align: left;
}

.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 1.5rem 0;
    box-shadow: 0 4px 8px var(--shadow-color);
}

.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-tertiary);
}

.error {
    text-align: center;
    padding: 3rem;
    color: #d32f2f;
}
