/* TeX Gyre Termes (Times-like) font */
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,700;1,400&display=swap');

/* Base typography and colors following Jon Barron's style */
body, td, th, tr, p, a {
  font-family: 'EB Garamond', 'TeX Gyre Termes', Georgia, serif;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
  color: #333;
}

body {
  margin: 0;
  padding: 0;
  background: white;
}

/* Links - Jon Barron's signature blue */
a {
  color: #1772d0;
  text-decoration: none;
  cursor: pointer;
}

a:hover, a:focus {
  text-decoration: underline;
}

/* Tables - Main layout structure */
table {
  width: 100%;
  max-width: 900px;
  border: 0px;
  border-spacing: 0px;
  border-collapse: separate;
  margin-right: auto;
  margin-left: auto;
}

/* Text elements */
strong {
  font-weight: 700;
}

em {
  font-style: italic;
}

/* Name heading */
name {
  font-size: 32px;
  font-weight: 400;
  display: block;
  margin: 0;
  padding: 0;
}

/* Section headings */
heading {
  font-size: 24px;
  font-weight: 400;
  display: block;
  margin: 20px 0 10px 0;
}

/* Paper titles */
papertitle {
  font-weight: 700;
  font-size: 16px;
}

/* Highlighted papers */
.highlight {
  background-color: #ffffd0;
}

tr.highlight-row {
  background-color: #ffffd0;
}

/* Profile image */
img {
  max-width: 100%;
  height: auto;
}

/* Hover effects for images */
.one {
  position: relative;
}

.two {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

/* Navigation styles */
p a {
  margin: 0 5px;
}

/* Code and preformatted text */
pre {
  font-family: 'Courier New', Courier, monospace;
  background: #f5f5f5;
  padding: 10px;
  border-radius: 3px;
  overflow-x: auto;
}

code {
  font-family: 'Courier New', Courier, monospace;
  background: #f5f5f5;
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 14px;
}

/* Mobile responsiveness - iPhone and small screens */
@media screen and (max-width: 768px) {
  body, td, th, tr, p, a {
    font-size: 15px;
    line-height: 1.6;
  }
  
  name {
    font-size: 26px;
  }
  
  heading {
    font-size: 20px;
    margin: 15px 0 10px 0;
  }
  
  /* Main table container */
  table {
    max-width: 100%;
    width: 100%;
  }
  
  /* Adjust all table cells padding for mobile */
  td {
    padding: 10px !important;
  }
  
  /* Navigation links */
  p[style*="text-align:center;font-size:18px"] {
    font-size: 14px !important;
  }
  
  /* Stack profile section on mobile */
  tr[style*="padding:0px"] td[style*="width:63%"],
  tr[style*="padding:0px"] td[style*="width:40%"] {
    width: 100% !important;
    display: block;
  }
  
  /* Center profile image on mobile */
  td[style*="width:40%"] {
    text-align: center;
    padding-bottom: 20px !important;
  }
  
  /* Publication rows - stack image above content */
  tr td[style*="width:25%"],
  tr td[style*="width:75%"] {
    width: 100% !important;
    display: block;
    text-align: left;
  }
  
  /* Center publication images */
  td[style*="width:25%"] {
    text-align: center;
    padding-bottom: 10px !important;
  }
  
  /* Project grid - single column on mobile */
  tr td[style*="width:33%"] {
    width: 100% !important;
    display: block;
    margin-bottom: 15px;
  }
  
  /* Blog cards responsive */
  .blog-card {
    margin: 10px 0;
  }
  
  /* Code blocks - allow horizontal scroll */
  .code-block, pre {
    overflow-x: auto;
    font-size: 12px;
  }
  
  /* Assignment navigation on CS400 page */
  .assignment-nav {
    padding: 10px 5px;
  }
  
  .assignment-nav a {
    margin: 5px;
    padding: 6px 10px;
    font-size: 13px;
  }
}

/* Very small screens (older iPhones, etc) */
@media screen and (max-width: 375px) {
  body, td, th, tr, p, a {
    font-size: 14px;
  }
  
  name {
    font-size: 22px;
  }
  
  heading {
    font-size: 18px;
  }
  
  /* Even smaller padding on very small screens */
  td {
    padding: 8px !important;
  }
  
  /* Reduce navigation spacing */
  p[style*="text-align:center;font-size:18px"] a {
    margin: 0 2px;
  }
}

/* Print styles */
@media print {
  body {
    font-size: 12pt;
  }
  
  a {
    text-decoration: none;
    color: black;
  }
  
  .highlight {
    background-color: #f0f0f0 !important;
    -webkit-print-color-adjust: exact;
  }
}

/* Utility classes */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.mt-10 {
  margin-top: 10px;
}

.mt-20 {
  margin-top: 20px;
}

.mb-10 {
  margin-bottom: 10px;
}

.mb-20 {
  margin-bottom: 20px;
}

/* BibTeX display */
.bibtex {
  display: none;
  background: #f0f0f0;
  padding: 10px;
  margin-top: 10px;
  border-radius: 5px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
}

.bibtex.show {
  display: block;
}

/* Form elements for contact/bot page */
input[type="text"],
input[type="email"],
textarea {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 16px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 3px;
  width: 100%;
  box-sizing: border-box;
}

input[type="submit"],
button {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 16px;
  padding: 8px 20px;
  background: #1772d0;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s ease;
}

input[type="submit"]:hover,
button:hover {
  background: #1258a0;
  text-decoration: none;
}

/* Blog post styles */
.blog-post {
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

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

.blog-date {
  color: #666;
  font-size: 14px;
  margin-bottom: 5px;
}

.blog-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
}

.blog-excerpt {
  color: #555;
  line-height: 1.6;
}

/* Demo page styles */
.demo-container {
  padding: 20px;
  background: #f9f9f9;
  border-radius: 5px;
  margin: 20px 0;
}

.demo-controls {
  margin-bottom: 20px;
  padding: 15px;
  background: white;
  border-radius: 5px;
}

.demo-visualization {
  background: white;
  padding: 20px;
  border-radius: 5px;
  min-height: 300px;
}

/* Filter buttons - minimal style like Jon Barron */
.filter-btn {
  background: white;
  border: 1px solid #ddd;
  padding: 5px 12px;
  margin: 3px;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 14px;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: #f5f5f5;
  border-color: #1772d0;
}

.filter-btn.active {
  background: #1772d0;
  color: white;
  border-color: #1772d0;
}

/* BibTeX Modal - simple and clean */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.4);
}

.modal-content {
  background-color: white;
  margin: 10% auto;
  padding: 0;
  border: 1px solid #ddd;
  border-radius: 5px;
  width: 80%;
  max-width: 600px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.modal-header {
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  font-size: 28px;
  font-weight: 400;
  line-height: 20px;
  cursor: pointer;
  color: #999;
  transition: color 0.2s;
}

.modal-close:hover,
.modal-close:focus {
  color: #333;
  text-decoration: none;
}

.modal-body {
  padding: 20px;
}

.modal-body pre {
  background: #f5f5f5;
  padding: 15px;
  border-radius: 3px;
  overflow-x: auto;
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  line-height: 1.4;
  margin: 0 0 15px 0;
}

.copy-btn {
  background: #1772d0;
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 3px;
  cursor: pointer;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 16px;
  transition: background 0.2s ease;
}

.copy-btn:hover {
  background: #1258a0;
}

/* Bot styles - minimal and clean */
#chat-container {
  background: #fafafa;
  font-family: 'EB Garamond', Georgia, serif;
  border-radius: 3px;
}

#messages {
  min-height: 350px;
}

.user-message {
  margin: 10px 0;
  padding: 8px;
  text-align: right;
}

.bot-message {
  margin: 10px 0;
  padding: 8px;
  text-align: left;
  color: #333;
}

#message-input {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 10px;
}

#message-input:focus {
  outline: none;
  border-color: #1772d0;
}