/* Navigation Bar */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #3c3c3c;
  padding: 0.8rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.nav-left, .nav-right {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-icon {
  color: #d4d4d4;
  text-decoration: none;
  font-size: 1.3rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  opacity: 0.8;
}

.nav-icon:hover {
  color: #569cd6;
  opacity: 1;
  transform: translateY(-2px);
}

.nav-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Adjust body padding to account for fixed navbar */
body {
  padding-top: 5rem;
}

/* Base Typography & Colors - Jupyter Dark Theme */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: #1e1e1e;
  color: #d4d4d4;
  margin: 0;
  padding: 2rem 1.5rem;
  line-height: 1.65;
  font-size: 15px;
}

/* Layout */
main {
  max-width: 900px;
  margin: auto;
  background: #252526;
  padding: 2.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Header Styling */
header {
  border-bottom: 2px solid #3c3c3c;
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}

h1 {
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #ffffff;
  margin: 0 0 0.5rem 0;
  text-transform: uppercase;
  text-shadow: 0 0 20px rgba(86, 156, 214, 0.3);
  position: relative;
}

h1::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #569cd6, #4ec9b0);
  box-shadow: 0 0 10px rgba(86, 156, 214, 0.5);
}

h1 a {
  color: #ffffff;
  border: none;
  text-decoration: none;
  background: linear-gradient(135deg, #569cd6 0%, #4ec9b0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all 0.3s ease;
}

h1 a:hover {
  background: linear-gradient(135deg, #4ec9b0 0%, #569cd6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  border: none;
  text-shadow: 0 0 30px rgba(78, 201, 176, 0.4);
}

h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-size: 1.8rem;
  font-weight: 600;
  color: #ffffff;
  border-bottom: 1px solid #3c3c3c;
  padding-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

h3 {
  font-size: 1.4rem;
  font-weight: 500;
  color: #ffffff;
  margin: 2rem 0 1rem 0;
}

h4 {
  font-size: 1.15rem;
  font-weight: 600;
  color: #d4d4d4;
  margin-top: 2rem;
  margin-bottom: 0.8rem;
}

/* Paragraphs and Text */
p {
  margin: 1rem 0;
  color: #d4d4d4;
}

strong, b {
  color: #ffffff;
  font-weight: 600;
}

em, i {
  color: #ce9178;
}

/* Lists */
ul, ol {
  margin: 1rem 0;
  padding-left: 2rem;
}

li {
  margin: 0.6rem 0;
  color: #d4d4d4;
}

/* Links */
a {
  color: #569cd6;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

a:hover {
  color: #4ec9b0;
  border-bottom-color: #4ec9b0;
}

/* Research Post Display */
.research-post {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin: 2rem 0;
  padding: 1.5rem;
  background: #2d2d30;
  border: 1px solid #3c3c3c;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.research-post:hover {
  border-color: #569cd6;
  box-shadow: 0 4px 12px rgba(86, 156, 214, 0.2);
}

.post-content {
  flex: 1;
  min-width: 0;
}

.post-content h4 {
  margin-top: 0;
  margin-bottom: 0.6rem;
  font-size: 1.3rem;
}

.post-content h4 a {
  color: #ffffff;
  border: none;
}

.post-content h4 a:hover {
  color: #569cd6;
}

.post-content p {
  margin: 0.5rem 0 0.8rem 0;
  color: #b5b5b5;
  line-height: 1.5;
  font-size: 0.9rem;
}

/* Post Date */
.post-date {
  display: block;
  font-size: 0.85rem;
  color: #858585;
  margin-bottom: 0.5rem;
  font-style: italic;
}

.cve-date {
  display: inline-block;
  font-size: 0.75rem;
  color: #4ec9b0;
  background: #1e1e1e;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  border: 1px solid #3c3c3c;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.post-image {
  flex-shrink: 0;
  width: 300px;
  height: 150px;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid #3c3c3c;
}

.post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.research-post:hover .post-image img {
  transform: scale(1.05);
}

/* Post Tags */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.tag {
  display: inline-block;
  background: #1e1e1e;
  color: #4ec9b0;
  padding: 0.3rem 0.8rem;
  border-radius: 3px;
  font-size: 0.8rem;
  border: 1px solid #3c3c3c;
  transition: all 0.2s ease;
}

.tag:hover {
  background: #2d2d30;
  border-color: #4ec9b0;
}

/* Jupyter-Style Code Blocks */
code {
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
  font-size: 0.9em;
  background: #1e1e1e;
  color: #ce9178;
  padding: 0.2em 0.4em;
  border-radius: 3px;
  border: 1px solid #3c3c3c;
}

pre {
  background: #1e1e1e;
  border: 1px solid #3c3c3c;
  border-left: 3px solid #569cd6;
  border-radius: 4px;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  position: relative;
}

pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: #d4d4d4;
  font-size: 0.92em;
  line-height: 1.5;
}

/* Jupyter Input Cell Style */
pre::before {
  content: "In [" counter(code-counter) "]:";
  counter-increment: code-counter;
  position: absolute;
  left: -80px;
  top: 1rem;
  color: #569cd6;
  font-family: "SF Mono", Monaco, monospace;
  font-size: 0.85em;
  font-weight: 600;
}

body {
  counter-reset: code-counter;
}

/* Markdown Cell Style (for non-code content) */
.markdown-cell {
  background: #2d2d30;
  border: 1px solid #3c3c3c;
  border-left: 3px solid #4ec9b0;
  border-radius: 4px;
  padding: 1.2rem 1.5rem;
  margin: 1.5rem 0;
}

/* Blockquotes - Jupyter Markdown Style */
blockquote {
  background: #2d2d30;
  border-left: 4px solid #4ec9b0;
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  color: #b5cea8;
  font-style: italic;
}

blockquote p {
  margin: 0.5rem 0;
}

/* Disclaimer Styling - Jupyter Warning Cell */
.disclaimer {
  background: #2d2d30;
  border: 1px solid #d4a760;
  border-left: 4px solid #d4a760;
  border-radius: 4px;
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  color: #d4a760;
  display: block;
}

.disclaimer::before {
  content: "⚠ ";
  font-weight: bold;
  margin-right: 0.5rem;
}

/* Muted Text */
.muted {
  font-size: 0.9rem;
  color: #858585;
  font-style: italic;
}

/* Marginalia */
.marginalia {
  background: #2d2d30;
  border: 1px solid #3c3c3c;
  border-radius: 4px;
  padding: 1rem;
  margin: 2rem 0;
  font-size: 0.9rem;
  color: #858585;
  font-style: italic;
}

.marginalia::before {
  content: "📝 Note: ";
  font-weight: 600;
  color: #9cdcfe;
  font-style: normal;
}

/* Footer */
footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 2px solid #3c3c3c;
  font-size: 0.85rem;
  color: #858585;
  text-align: center;
}

/* Article Container */
article {
  padding: 1rem 0;
}

/* Post Header Image */
.post-header-image {
  width: 100%;
  max-width: 100%;
  margin: 2rem 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #3c3c3c;
}

.post-header-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Tables - Jupyter Style */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5rem 0;
  background: #2d2d30;
  border: 1px solid #3c3c3c;
}

th {
  background: #1e1e1e;
  color: #569cd6;
  font-weight: 600;
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 2px solid #3c3c3c;
}

td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #3c3c3c;
  color: #d4d4d4;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover {
  background: #323233;
}

/* Horizontal Rule */
hr {
  border: none;
  border-top: 2px solid #3c3c3c;
  margin: 2.5rem 0;
}

/* Selection */
::selection {
  background: #264f78;
  color: #ffffff;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
  background: #3c3c3c;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #4c4c4c;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #d4d4d4;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding: 1rem;
    padding-top: 5rem;
  }
  
  main {
    padding: 1.5rem;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  pre::before {
    position: static;
    display: block;
    margin-bottom: 0.5rem;
  }
  
  .top-nav {
    padding: 0.8rem 1rem;
  }
  
  .nav-left, .nav-right {
    gap: 1rem;
  }
  
  .nav-icon {
    font-size: 1.1rem;
  }
  
  .nav-icon svg {
    width: 18px;
    height: 18px;
  }
  
  /* Mobile Research Post Layout */
  .research-post {
    flex-direction: column;
  }
  
  .post-image {
    width: 100%;
    height: 200px;
  }
  
  /* Mobile Menu */
  .menu-toggle {
    display: block;
  }
  
  .nav-right {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(30, 30, 30, 0.98);
    border: 1px solid #3c3c3c;
    border-top: none;
    flex-direction: column;
    padding: 1rem;
    display: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  }
  
  .nav-right.active {
    display: flex;
  }
}
