/* css file */

/* Navigation Bar Styles */
.navbar {
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid #e0e0e0;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-logo a {
    font-family: Georgia, serif;
    font-size: 1.0em;
    font-weight: normal;
    color: #316192cf;
    text-decoration: none;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    line-height: 1.0;
}

.terminal-prompt {
    font-family: Georgia, serif;
    color: #316192cf;
    font-weight: bold;
    font-size: 1.0em;
}

.cursor {
    font-family: 'Courier New', 'Monaco', monospace;
    color: #316192cf;
    font-weight: 900;
    font-size: 1.2em;
    margin-left: 2px;
    animation: blink 1s infinite;
    text-shadow: 0 0 2px rgba(49, 97, 146, 0.5);
}

@keyframes blink {
    0%, 45% {
        opacity: 1;
        transform: scaleY(1);
    }
    50%, 95% {
        opacity: 0;
        transform: scaleY(1.1);
    }
    100% {
        opacity: 1;
        transform: scaleY(1);
    }
}

@keyframes blink-hover {
    0%, 40% {
        opacity: 1;
        transform: scaleY(1.2) scaleX(1.1);
    }
    50%, 90% {
        opacity: 0.3;
        transform: scaleY(1.3) scaleX(1.2);
    }
    100% {
        opacity: 1;
        transform: scaleY(1.2) scaleX(1.1);
    }
}

.nav-logo a:hover {
    color: #007acc;
}

.nav-logo a:hover .terminal-prompt {
    color: #007acc;
}

.nav-logo a:hover .cursor {
    color: #007acc;
    text-shadow: 0 0 4px rgba(0, 122, 204, 0.7);
    animation: blink-hover 0.8s infinite;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin-left: 2rem;
}

.nav-link {
    font-family: Georgia, serif;
    color: #316192cf;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.0em;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
    position: relative;
    line-height: 1.0;
}

.nav-link:hover {
    color: #007acc;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #007acc;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 3px 0;
    transition: 0.3s;
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: 2px solid #316192cf;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    margin-left: 1rem;
}

.theme-toggle:hover {
    background-color: #316192cf;
    transform: rotate(180deg);
}

.theme-icon {
    font-size: 1.2em;
    transition: transform 0.3s ease;
}

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

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    .nav-container {
        padding: 0 20px;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 60px;
        flex-direction: column;
        background-color: #ffffff;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        margin: 1rem 0;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .theme-toggle {
        margin-left: 0.5rem;
        width: 35px;
        height: 35px;
    }
    
    /* Adjust body padding for mobile */
    body {
        padding-left: 20px;
        padding-right: 20px;
        padding-top: 120px;
    }
}

/* Tablet responsive */
@media screen and (max-width: 1024px) and (min-width: 769px) {
    .nav-container {
        max-width: 95%;
        padding: 0 30px;
    }
    
    body {
        max-width: 95%;
        padding-left: 30px;
        padding-right: 30px;
    }
}

/* Large screens optimization */
@media screen and (min-width: 1400px) {
    .nav-container {
        max-width: 1300px;
        padding: 0 60px;
    }
    
    body {
        max-width: 1300px;
        padding-left: 60px;
        padding-right: 60px;
    }
}

/* Adjust body padding to account for fixed navbar */
body { 
  font-family: Georgia, serif;
  color: #000;
  background-color: #ffffff; 
  text-align:left; /* for IE */
  margin-top: 30px; 
  margin-bottom: 30px;
  margin-left: auto;
  margin-right: auto;
  padding-left:  50px;
  padding-right: 50px;
  padding-top: 90px; /* Increased to prevent content blocking */
  padding-bottom: 30px;
  max-width: 1200px;
}

html {
  background-color: #ffffff; 
}

table#tlayout {
    border: none;
    border-collapse: separate;
    background: white;
}

#layout-menu {
	background: #f6f6f6;
	border: 1px solid #dddddd;
	padding-top: 0.5em;
	padding-left: 8px;
	padding-right: 8px;
	font-size: 1.0em;
	width: auto;
	white-space: nowrap;
    text-align: left;
    vertical-align: top;
}

#layout-menu td {
	background: #f4f4f4;
    vertical-align: top;
}

#layout-content {
	padding-top: 0.0em;
	padding-left: 1.0em;
	padding-right: 1.0em;
    border: none;
    background: white;
    text-align: left;
    vertical-align: top;
}

#layout-menu a {
	line-height: 1.5em;
	margin-left: 0.5em;
}

tt {
    background: #ffffdd;
}

pre, tt {
	font-size: 90%;
	font-family: monaco, monospace;
}

a, a > tt {
	color: #224b8d;
	text-decoration: none;
}

a:hover {
	border-bottom: 1px gray dotted;
}

#layout-menu a.current:link, #layout-menu a.current:visited {
	color: #022b6d;
	border-bottom: 1px gray solid;
}
#layout-menu a:link, #layout-menu a:visited, #layout-menu a:hover {
	color: #527bbd;
	text-decoration: none;
}
#layout-menu a:hover {
	text-decoration: none;
}

div.menu-category {
	border-bottom: 1px solid gray;
	margin-top: 0.8em;
	padding-top: 0.2em;
	padding-bottom: 0.1em;
	font-weight: bold;
}

div.menu-item {
	padding-left: 16px;
	text-indent: -16px;
}

div#toptitle {
	padding-bottom: 0.2em;
	margin-bottom: 1.5em;
	/*border-bottom: 3px double gray;*/
}

/* Reduce space if we begin the page with a title. */
div#toptitle + h2, div#toptitle + h3 {
	margin-top: 0em;
}

div#subtitle {
	margin-top: 0.0em;
	margin-bottom: 0.0em;
	padding-top: 0em;
	padding-bottom: 0.1em;
}

em {
	font-style: italic;
}

strong {
	font-weight: bold;
}


h1, h2, h3 {
	color: #316192cf;
	margin-top: 0.7em;
	margin-bottom: 0.5em;
	padding-bottom: 0.2em;
	line-height: 1.0;
	padding-top: 2.0em; /* Increased to prevent navbar blocking */
	border-bottom: 1px solid #aaaaaa;
	scroll-margin-top: 80px; /* Add scroll margin to prevent navbar blocking during navigation */
}

/* Specific scroll margin for navigation targets */
#biography, #news, #publications, #awards, #misc {
	scroll-margin-top: 80px;
}

h1 {
	font-size: 165%;
	padding-bottom: 0.2em;
}

h2 {
	padding-top: 0.8em;
	font-size: 125%;
}

h2 + h3 {
    padding-top: 0.2em;
}

h3 {
	font-size: 110%;
	border-bottom: none;
}

p {
	margin-top: 0.0em;
	margin-bottom: 0.8em;
	padding: 0;
	line-height: 1.3;
}

pre {
	padding: 0;
	margin: 0;
}

div#footer {
	font-size: small;
	border-top: 1px solid #c0c0c0;
	padding-top: 0.1em;
	margin-top: 4.0em;
	color: #c0c0c0;
}

div#footer a {
	color: #80a0b0;
}

div#footer-text {
	float: left;
	padding-bottom: 8px;
}

ul, ol, dl {
	margin-top: 0.2em;
	padding-top: 0;
	margin-bottom: 0.8em;
}

dt {
	margin-top: 0.5em;
	margin-bottom: 0;
}

dl {
	margin-left: 20px;
}

dd {
	color: #222222;
}

dd > *:first-child {
	margin-top: 0;
}

ul {
	list-style-position: outside;
	list-style-type: square;
}

p + ul, p + ol {
	margin-top: -0.5em;
}

li {
	margin-top:0.9em;
}

ol {
	list-style-position: outside;
	list-style-type: decimal;
}

li p, dd p {
	margin-bottom: 0.3em;
}


ol ol {
	list-style-type: lower-alpha;
}

ol ol ol {
	list-style-type: lower-roman;
}

p + div.codeblock {
	margin-top: -0.6em;
}

div.codeblock, div.infoblock {
	margin-right: 0%;
	margin-top: 1.2em;
	margin-bottom: 1.3em;
}

div.blocktitle {
	font-weight: bold;
	color: #cd7b62;
	margin-top: 1.2em;
	margin-bottom: 0.1em;
}

div.blockcontent {
	border: 1px solid silver;
	padding: 0.3em 0.5em;
}

div.infoblock > div.blockcontent {
	background: #ffffee;
}

div.blockcontent p + ul, div.blockcontent p + ol {
	margin-top: 0.4em;
}

div.infoblock p {
	margin-bottom: 0em;
}

div.infoblock li p, div.infoblock dd p {
	margin-bottom: 0.5em;
}

div.infoblock p + p {
	margin-top: 0.8em;
}

div.codeblock > div.blockcontent {
	background: #f6f6f6;
}

span.pycommand {
	color: #000070;
}

span.statement {
	color: #008800;
}
span.builtin {
	color: #000088;
}
span.special {
	color: #990000;
}
span.operator {
	color: #880000;
}
span.error {
	color: #aa0000;
}
span.comment, span.comment > *, span.string, span.string > * {
	color: #606060;
}

@media print {
	#layout-menu { display: none; }
}

#fwtitle {
	margin: 2px;
}

#fwtitle #toptitle {
	padding-left: 0.5em;
	margin-bottom: 0.5em;
}

#layout-content h1:first-child, #layout-content h2:first-child, #layout-content h3:first-child {
	margin-top: -0.7em;
}

div#toptitle h1, #layout-content div#toptitle h1 {
	margin-bottom: 0.0em;
	padding-bottom: 0.1em;
	padding-top: 0;
	margin-top: 0.5em;
	border-bottom: none;
}

img.eq {
	padding: 0;
	padding-left: 0.1em;
	padding-right: 0.1em;
	margin: 0;
}

img.eqwl {
	padding-left: 2em;
	padding-top: 0.6em;
	padding-bottom: 0.2em;
	margin: 0;
}

table + table {
    margin-top: 1em;
}

tr.heading {
    font-weight: bold;
    border-bottom: 2px solid black;
}

img {
    border: none;
}

table.imgtable, table.imgtable td {
    border: none;
    text-align: left;
}

/* Dark Theme Styles */
[data-theme="dark"] {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

[data-theme="dark"] html {
    background-color: #0d1117;
}

[data-theme="dark"] body {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

[data-theme="dark"] .navbar {
    background-color: #161b22;
    border-bottom: 1px solid #30363d;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

[data-theme="dark"] .terminal-prompt,
[data-theme="dark"] .cursor,
[data-theme="dark"] .nav-link {
    color: #7dd3fc;
}

[data-theme="dark"] .nav-logo a:hover,
[data-theme="dark"] .nav-logo a:hover .terminal-prompt,
[data-theme="dark"] .nav-logo a:hover .cursor,
[data-theme="dark"] .nav-link:hover {
    color: #38bdf8;
}

[data-theme="dark"] .nav-link::after {
    background-color: #38bdf8;
}

[data-theme="dark"] .theme-toggle {
    border-color: #7dd3fc;
    color: #7dd3fc;
}

[data-theme="dark"] .theme-toggle:hover {
    background-color: #7dd3fc;
    color: #1a1a1a;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3 {
    color: #7dd3fc;
    border-bottom-color: #30363d;
}

[data-theme="dark"] a {
    color: #58a6ff;
}

[data-theme="dark"] a:hover {
    border-bottom-color: #7dd3fc;
}

[data-theme="dark"] table {
    background-color: transparent;
}

[data-theme="dark"] #layout-menu {
    background: #161b22;
    border-color: #30363d;
}

[data-theme="dark"] #layout-menu td {
    background: #161b22;
}

[data-theme="dark"] #layout-content {
    background: #1a1a1a;
}

[data-theme="dark"] div#footer {
    border-top-color: #30363d;
    color: #8b949e;
}

[data-theme="dark"] div#footer a {
    color: #7dd3fc;
}

[data-theme="dark"] .nav-menu {
    background-color: #161b22;
    box-shadow: 0 10px 27px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] tt {
    background: #21262d;
}

[data-theme="dark"] div.codeblock > div.blockcontent {
    background: #161b22;
}

[data-theme="dark"] div.infoblock > div.blockcontent {
    background: #21262d;
}

/* Dark theme transition for smooth switching */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}