@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    --background-color: #fff;
    --text-color: #333;
    --link-color: #0066cc;
    --border-color: #e0e0e0;
    --code-bg-color: #f6f8fa;
    --blockquote-color: #666;
    --meta-text-color: #777;
    --card-bg-color: #fff;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.05);
    --card-hover-shadow: 0 4px 12px rgba(0,0,0,0.08);
    --accent-color: #f0f7ff;
    --header-bg: #fff;
    --active-link: #0066cc;
    
    /* VSCode theme colors */
    --vscode-bg: #1e1e1e;
    --vscode-fg: #d4d4d4;
    --vscode-keyword: #569cd6;
    --vscode-function: #dcdcaa;
    --vscode-comment: #6a9955;
    --vscode-string: #ce9178;
    --vscode-number: #b5cea8;
    --vscode-class: #4ec9b0;
    --vscode-variable: #9cdcfe;
    --vscode-property: #9cdcfe;
    --vscode-operator: #d4d4d4;
    --vscode-punctuation: #d4d4d4;
}

[data-theme="dark"] {
    --background-color: #1a1a1a;
    --text-color: #eaeaea;
    --link-color: #7db3fa;
    --border-color: #444;
    --code-bg-color: #2d2d2d;
    --blockquote-color: #aaa;
    --meta-text-color: #999;
    --card-bg-color: #252525;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.2);
    --card-hover-shadow: 0 4px 12px rgba(0,0,0,0.3);
    --accent-color: #1f2937;
    --header-bg: #1a1a1a;
    --active-link: #7db3fa;
    
    /* VSCode theme colors (these don't change in dark mode) */
    --vscode-bg: #1e1e1e;
    --vscode-fg: #d4d4d4;
    --vscode-keyword: #569cd6;
    --vscode-function: #dcdcaa;
    --vscode-comment: #6a9955;
    --vscode-string: #ce9178;
    --vscode-number: #b5cea8;
    --vscode-class: #4ec9b0;
    --vscode-variable: #9cdcfe;
    --vscode-property: #9cdcfe;
    --vscode-operator: #d4d4d4;
    --vscode-punctuation: #d4d4d4;
}

body {
	font-family: "Source Sans 3", sans-serif;
	font-optical-sizing: auto;
	background: var(--background-color);
	color: var(--text-color);
	font-weight: 400;
	max-width: 860px;
	margin: 0 auto;
	padding: 0;
	line-height: 1.7;
	font-size: 18px;
	transition: background-color 0.3s ease, color 0.3s ease;
	letter-spacing: 0.01em;
}

/* Header styles */
.site-header {
	background: var(--header-bg);
	padding: 12px 32px;
	margin-bottom: 32px;
	border-bottom: 1px solid var(--border-color);
}

.header-content {
	max-width: 860px;
	margin: 0 auto;
}

.site-title {
	font-family: "Source Sans 3", sans-serif;
	font-weight: 700;
	font-size: 1.8rem;
	margin-bottom: 10px;
}

.site-title a {
	color: var(--text-color);
	text-decoration: none;
}

.site-title a:hover {
	color: var(--link-color);
}

/* Navigation styles */
.main-nav {
	display: flex;
	justify-content: center;
}

.main-nav ul {
	list-style-type: none;
	padding: 0;
	margin: 0;
	display: flex;
	gap: 24px;
	flex-wrap: wrap;
}

.main-nav ul li a {
	color: var(--text-color);
	text-decoration: none;
	padding: 5px 0;
	font-family: "Source Sans 3", sans-serif;
	font-weight: 500;
	font-size: 1rem;
	position: relative;
	transition: color 0.2s ease;
}

.main-nav ul li a:hover {
	color: var(--link-color);
}

.main-nav ul li a.active {
	color: var(--active-link);
	font-weight: 600;
}

.main-nav ul li a.active:after {
	content: '';
	position: absolute;
	bottom: -2px;
	left: 0;
	width: 100%;
	height: 2px;
	background-color: var(--active-link);
}

main {
	padding: 0 32px 32px 32px;
}

/* Dark mode toggle styles */
.theme-toggle {
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	margin-left: 10px;
	font-size: 1.2em;
	color: var(--text-color);
}

.theme-toggle:hover {
	opacity: 0.8;
}

h1, h2, h3, h4, h5, h6 {
	font-family: "Source Sans 3", sans-serif;
	font-weight: 600;
	margin-top: 36px;
	margin-bottom: 20px;
	line-height: 1.3;
	color: var(--text-color);
}

h1 {
	font-size: 2.4em;
	margin-top: 0.5em;
	margin-bottom: 0.7em;
	font-weight: 700;
}

h2 {
	font-size: 1.8em;
	border-bottom: 1px solid var(--border-color);
	padding-bottom: 0.2em;
	font-weight: 600;
}

h3 {
	font-size: 1.4em;
	font-weight: 600;
}

h4 {
	font-size: 1.2em;
	font-weight: 500;
}

a {
	color: var(--link-color);
	text-decoration: none;
	transition: color 0.2s ease;
}

a:hover {
	text-decoration: underline;
}

img {
	max-width: 100%;
	margin: 20px 0;
}

footer {
	text-align: center;
	margin-top: 40px;
	padding-top: 15px;
	border-top: 1px solid var(--border-color);
}

footer a {
	margin: 0 10px;
}

ul {
	padding-left: 20px;
}

ul li {
	margin-bottom: 10px;
}

/* Article meta information */
.article-meta {
	color: var(--meta-text-color);
	font-size: 0.9em;
	margin-bottom: 30px;
}

/* Post list styling - Simple list design */
.post-list {
	margin-bottom: 48px;
}

.post-item {
	margin-bottom: 32px;
	padding-bottom: 32px;
	border-bottom: 1px solid var(--border-color);
}

.post-item:last-child {
	border-bottom: none;
}

.post-item h2 {
	margin-top: 0;
	margin-bottom: 10px;
	font-size: 1.6em;
	line-height: 1.3;
	border-bottom: none;
}

.post-item h2 a {
	text-decoration: none;
	color: var(--link-color);
	transition: color 0.2s;
}

.post-item h2 a:hover {
	text-decoration: underline;
}

.post-item .article-meta {
	margin-bottom: 14px;
	font-size: 0.85em;
	color: var(--meta-text-color);
}

.summary {
	margin-top: 14px;
	font-size: 0.95em;
	line-height: 1.6;
}

/* News list styling - Condensed version */
.news-list {
	margin-bottom: 32px;
}

.news-item {
	margin-bottom: 20px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--border-color);
}

.news-item:last-child {
	border-bottom: none;
}

.news-item h3 {
	margin-top: 0;
	margin-bottom: 6px;
	font-size: 1.2em;
	line-height: 1.3;
	border-bottom: none;
}

.news-item h3 a {
	text-decoration: none;
	color: var(--link-color);
	transition: color 0.2s;
}

.news-item h3 a:hover {
	text-decoration: underline;
}

.news-meta {
	margin-bottom: 8px;
	font-size: 0.8em;
	color: var(--meta-text-color);
}

.news-summary {
	margin-bottom: 8px;
	font-size: 0.9em;
	line-height: 1.5;
	color: var(--text-color);
}

.read-more {
	margin-bottom: 0;
	font-size: 0.85em;
}

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

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

/* Code blocks with improved styling */
pre, code {
	font-family: "JetBrains Mono", "Fira Code", monospace;
	background-color: var(--code-bg-color);
	border-radius: 4px;
	padding: 2px 5px;
	font-size: 0.9em;
}

pre {
	padding: 16px;
	overflow: auto;
	line-height: 1.45;
	margin-bottom: 20px;
	border: 1px solid var(--border-color);
}

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

blockquote {
	margin-left: 0;
	padding: 1em 1.5em;
	border-left: 4px solid var(--link-color);
	background-color: var(--accent-color);
	border-radius: 0 4px 4px 0;
	margin-bottom: 1.5em;
}

/* Math rendering styles */
.katex {
	font-size: 1.1em !important;
}

.math-block {
	overflow-x: auto;
	margin: 1em 0;
	text-align: center;
}

/* For TAGLIST.HTML */
.taglist {
	text-align: center;
	clear: both;
}

/* For NEXTPREV.HTML */
#nextprev {
	/* The container for both the previous and next articles. */
}
#prevart {
	float: left;
	text-align: left;
}
#nextart {
	float: right;
	text-align: right;
}
#nextart, #prevart {
	max-width: 33%;
}

/* About page styles */
.about-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.profile-container {
    flex: 0 0 175px;
}

.profile-image {
    width: 205px;
    height: 205px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.bio-container {
    flex: 1;
    min-width: 300px;
}

.bio-container h1 {
    margin-top: 0;
}

.social-links {
    display: flex;
    gap: 1.2rem;
    justify-content: center;
}

.social-links a {
    color: #666;
    font-size: 1.5rem;
    transition: color 0.3s ease;
    opacity: 0.7;
}

.social-links a:hover {
    color: var(--link-color);
    text-decoration: none;
    opacity: 1;
}

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

.timeline-item {
    margin-bottom: 1rem;
}

.timeline-date {
    font-weight: bold;
    color: var(--meta-text-color);
}

/* VSCode theme for code blocks */
.vscode-theme {
    background-color: var(--vscode-bg);
    color: var(--vscode-fg);
    border-radius: 8px;
    font-family: "JetBrains Mono", "Fira Code", monospace;
    line-height: 1.5;
    padding: 16px;
    margin: 20px 0;
    overflow-x: auto;
    border: none;
}

.vscode-theme .keyword {
    color: var(--vscode-keyword);
}

.vscode-theme .function {
    color: var(--vscode-function);
}

.vscode-theme .comment {
    color: var(--vscode-comment);
    font-style: italic;
}

.vscode-theme .string {
    color: var(--vscode-string);
}

.vscode-theme .number {
    color: var(--vscode-number);
}

.vscode-theme .class {
    color: var(--vscode-class);
}

.vscode-theme .variable {
    color: var(--vscode-variable);
}

.vscode-theme .property {
    color: var(--vscode-property);
}

.vscode-theme .operator, .vscode-theme .punctuation {
    color: var(--vscode-punctuation);
}

.vscode-theme .linenumber {
    color: #858585;
    display: inline-block;
    text-align: right;
    margin-right: 16px;
    width: 40px;
    user-select: none;
}

/* Jupyter notebook-style code blocks */
.jupyter-notebook {
    border: 1px solid #cfcfcf;
    border-radius: 4px;
    margin: 20px 0;
    overflow: hidden;
    font-family: "JetBrains Mono", "Fira Code", monospace;
    font-size: 0.9em;
    line-height: 1.45;
    background: white;
}

[data-theme="dark"] .jupyter-notebook {
    border-color: #444;
    background: #111;
}

.jupyter-cell {
    position: relative;
}

.jupyter-input {
    background-color: #f7f7f7;
    border-left: 5px solid #2196F3;
    padding: 12px 10px 12px 40px;
    position: relative;
}

[data-theme="dark"] .jupyter-input {
    background-color: #1e1e1e;
    border-left-color: #2196F3;
}

.jupyter-output {
    background-color: white;
    padding: 10px 10px 10px 50px;
    position: relative;
}

[data-theme="dark"] .jupyter-output {
    background-color: #111;
}

.jupyter-input::before {
    content: "In [1]:";
    position: absolute;
    left: 8px;
    color: #2196F3;
    font-weight: bold;
    user-select: none;
}

.jupyter-output::before {
    content: "Out[1]:";
    position: absolute;
    left: 8px;
    color: #E91E63;
    font-weight: bold;
    user-select: none;
}

.jupyter-input pre, .jupyter-output pre {
    margin: 0;
    border: none;
    background: transparent;
    overflow-x: auto;
    padding: 0;
}

.jupyter-input code {
    background: transparent;
    padding: 0;
}

.jupyter-output code {
    background: transparent;
    padding: 0;
}

.jupyter-output img {
    max-width: 100%;
    margin: 0;
}

.jupyter-output table {
    border-collapse: collapse;
    margin: 10px 0;
}

.jupyter-output th, .jupyter-output td {
    border: 1px solid #e0e0e0;
    padding: 8px;
    text-align: left;
}

[data-theme="dark"] .jupyter-output th, [data-theme="dark"] .jupyter-output td {
    border-color: #444;
}

.jupyter-output th {
    background-color: #f0f0f0;
}

[data-theme="dark"] .jupyter-output th {
    background-color: #2a2a2a;
}

/* For interactive buttons (placeholders for now) */
.jupyter-buttons {
    padding: 5px 10px;
    background-color: #f0f0f0;
    border-bottom: 1px solid #cfcfcf;
    display: flex;
    align-items: center;
}

[data-theme="dark"] .jupyter-buttons {
    background-color: #2a2a2a;
    border-bottom-color: #444;
}

.jupyter-btn {
    background: #f0f0f0;
    border: 1px solid #cfcfcf;
    border-radius: 3px;
    padding: 4px 8px;
    margin-right: 5px;
    font-size: 0.8em;
    cursor: pointer;
    color: #555;
}

[data-theme="dark"] .jupyter-btn {
    background: #333;
    border-color: #555;
    color: #eee;
}

.jupyter-btn:hover {
    background-color: #e0e0e0;
}

[data-theme="dark"] .jupyter-btn:hover {
    background-color: #444;
}

/* Tags styling */
.post-tags {
    margin-top: 10px;
}

.post-tag {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--link-color);
    padding: 3px 8px;
    margin-right: 6px;
    border-radius: 4px;
    font-size: 0.85em;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

[data-theme="dark"] .post-tag {
    background-color: #2a2a2a;
}

.post-tag:hover {
    background-color: var(--link-color);
    color: white;
    text-decoration: none;
}

/* Conference location maps */
.conference-location {
    margin: 2rem 0;
    background-color: var(--accent-color);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .conference-location {
    background-color: var(--accent-color);
}

.location-maps {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.map-container {
    flex: 1;
    min-width: 300px;
}

.map-container h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: var(--text-color);
}

.location-map-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease;
}

.location-map-img:hover {
    transform: scale(1.02);
}

.map-caption {
    font-size: 0.9em;
    color: var(--text-color);
}

/* Tags List Page */
.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 2rem 0;
}

.tag-item {
  flex: 0 0 auto;
}

.tag-link {
  display: flex;
  align-items: center;
  background: var(--tag-bg);
  color: var(--tag-color);
  padding: 0.5rem 1rem;
  border-radius: 2rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.tag-link:hover {
  background: var(--tag-bg-hover);
  transform: translateY(-2px);
}

.tag-name {
  font-weight: 500;
}

.tag-count {
  margin-left: 0.5rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  padding: 0.1rem 0.5rem;
  font-size: 0.8rem;
}

.tags-info {
  margin-top: 3rem;
  padding: 1.5rem;
  background: var(--card-bg);
  border-radius: 0.5rem;
}

.special-tag {
  margin-top: 1rem;
}

.tag-description {
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--card-bg);
  border-radius: 0.5rem;
}

.mini-location {
  margin-top: 1rem;
  padding: 0.5rem;
  background: var(--card-bg);
  border-radius: 0.5rem;
  display: flex;
  flex-direction: column;
}

.mini-map-img {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: 0.25rem;
  margin-top: 0.5rem;
  transition: transform 0.2s ease;
}

.mini-map-img:hover {
  transform: scale(1.02);
}

@media (prefers-color-scheme: dark) {
  .tags-info, .tag-description, .mini-location {
    background: rgba(255, 255, 255, 0.05);
  }
}

/* Mermaid Diagram Styling */
.mermaid-diagram-wrapper {
  margin: 2em auto; /* Center the diagram block with some vertical space */
  text-align: center; /* Center the SVG within the wrapper */
  overflow-x: auto; /* Add horizontal scroll for very wide diagrams on small screens */
}

.mermaid-diagram-wrapper svg {
  max-width: 100%; /* Ensure SVG scales down */
  height: auto; /* Maintain aspect ratio */
  display: block; /* Better layout control */
  margin: 0 auto; /* Center SVG if wrapper is wider */
}

/* Optional: Style for sequence diagrams which can get wide */
.mermaid-diagram-wrapper .sequenceDiagram text {
    /* Adjust font size if needed for sequence diagrams */
    /* font-size: 12px; */ 
}

/* Ensure mermaid background matches site (if needed) */
[data-theme="light"] .mermaid-diagram-wrapper svg {
    /* background-color: #ffffff; /* Or your light theme background */
}

[data-theme="dark"] .mermaid-diagram-wrapper svg {
     /* background-color: #282c34; /* Or your dark theme background */
}
