/* ============================================
   Hacker Theme - Custom Sidebar Layout
   ============================================ */

/* Reset & Base */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background-color: #1a1a2e;
  color: #b5e853;
  font-family: 'Monaco', 'Menlo', 'Lucida Console', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.7;
  overflow-x: hidden;
}

a {
  color: #63c0f5;
  text-decoration: none;
}

a:hover {
  color: #b5e853;
  text-decoration: underline;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: #0d1117;
  border-right: 1px solid #30363d;
  overflow-y: auto;
  z-index: 1000;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid #30363d;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0a0e14;
}

.sidebar-title {
  color: #b5e853;
  font-size: 16px;
  font-weight: bold;
  letter-spacing: 1px;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: #b5e853;
  font-size: 24px;
  cursor: pointer;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid #30363d;
  color: #484f58;
  text-align: center;
}

/* Navigation */
.nav-list {
  list-style: none;
  padding: 8px 0;
}

.nav-item {
  border-bottom: 1px solid rgba(48, 54, 61, 0.5);
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  color: #c9d1d9;
  text-decoration: none !important;
  transition: background 0.2s, color 0.2s;
  cursor: pointer;
  gap: 8px;
}

.nav-link:hover {
  background: #161b22;
  color: #b5e853;
}

.nav-icon {
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.nav-arrow {
  margin-left: auto;
  font-size: 10px;
  color: #484f58;
  transition: transform 0.3s ease;
}

.nav-arrow.expanded {
  transform: rotate(90deg);
}

/* Collapsible children */
.nav-children {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  background: rgba(13, 17, 23, 0.5);
}

.nav-children.expanded {
  max-height: 1000px;
}

.nav-children .nav-link {
  padding-left: 40px;
  font-size: 13px;
}

.nav-children .nav-sub {
  background: rgba(13, 17, 23, 0.3);
}

.nav-children .nav-sub .nav-link {
  padding-left: 56px;
  font-size: 12px;
  color: #8b949e;
}

.nav-children .nav-sub .nav-link:hover {
  color: #b5e853;
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
  margin-left: 280px;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

.page-header {
  background: linear-gradient(135deg, #0d1117 0%, #161b22 50%, #1a1a2e 100%);
  padding: 30px 40px;
  border-bottom: 2px solid #b5e853;
}

.page-header h1 {
  color: #b5e853;
  font-size: 28px;
  margin-bottom: 4px;
  text-shadow: 0 0 10px rgba(181, 232, 83, 0.3);
}

.project-tagline {
  color: #8b949e;
  font-size: 14px;
  margin-top: 4px;
}

.main-body {
  padding: 30px 40px;
  max-width: 900px;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4 {
  color: #b5e853;
  margin-top: 24px;
  margin-bottom: 12px;
}

h1 { font-size: 24px; }
h2 { font-size: 20px; border-bottom: 1px solid #30363d; padding-bottom: 6px; }
h3 { font-size: 16px; }

p {
  margin-bottom: 16px;
  color: #c9d1d9;
}

strong, b {
  color: #b5e853;
}

em, i {
  color: #8b949e;
}

hr {
  border: none;
  border-top: 1px solid #30363d;
  margin: 24px 0;
}

/* ============================================
   Code Blocks
   ============================================ */
pre {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
  margin: 16px 0;
  font-size: 13px;
  line-height: 1.5;
}

code {
  font-family: 'Monaco', 'Menlo', 'Lucida Console', monospace;
  color: #b5e853;
}

pre code {
  color: #e6edf3;
  background: none;
  padding: 0;
}

:not(pre) > code {
  background: #161b22;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 13px;
}

/* ============================================
   Images
   ============================================ */
img {
  max-width: 100%;
  height: auto;
  border: 1px solid #30363d;
  border-radius: 6px;
  margin: 12px 0;
}

/* ============================================
   Lists
   ============================================ */
ul, ol {
  padding-left: 24px;
  margin-bottom: 16px;
  color: #c9d1d9;
}

li {
  margin-bottom: 6px;
}

/* ============================================
   Post Lists (Category Pages)
   ============================================ */
.post-list {
  list-style: none;
  padding: 0;
}

.post-list li {
  padding: 12px 0;
  border-bottom: 1px solid #30363d;
}

.post-list a {
  color: #63c0f5;
  font-size: 15px;
}

.post-list a:hover {
  color: #b5e853;
}

.post-list .post-date {
  color: #484f58;
  font-size: 12px;
  display: block;
  margin-top: 2px;
}

.post-list .post-tags {
  margin-top: 4px;
}

.post-list .post-tags span {
  display: inline-block;
  background: #161b22;
  color: #8b949e;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  margin-right: 4px;
  border: 1px solid #30363d;
}

/* Category section headers */
.category-section h3 {
  margin-top: 30px;
  padding: 8px 0;
  border-bottom: 1px solid #b5e853;
  color: #b5e853;
}

/* ============================================
   Tables
   ============================================ */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 16px 0;
}

th, td {
  padding: 8px 12px;
  border: 1px solid #30363d;
  text-align: left;
}

th {
  background: #161b22;
  color: #b5e853;
}

td {
  color: #c9d1d9;
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
  padding: 20px 40px;
  border-top: 1px solid #30363d;
  margin-top: 40px;
  color: #484f58;
  font-size: 12px;
}

.site-footer a {
  color: #484f58;
}

/* ============================================
   Hamburger Menu (Mobile)
   ============================================ */
.hamburger {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 999;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 4px;
  padding: 8px 10px;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: #b5e853;
  transition: all 0.3s;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 998;
}

.sidebar-overlay.open {
  display: block;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .sidebar-close {
    display: block;
  }

  .sidebar {
    width: 260px;
  }

  .main-content {
    margin-left: 0;
  }

  .page-header {
    padding: 20px;
    padding-top: 50px;
  }

  .main-body {
    padding: 20px;
  }

  .page-header h1 {
    font-size: 22px;
  }

  pre {
    font-size: 11px;
  }
}

@media (min-width: 769px) {
  .sidebar {
    transform: translateX(0);
  }

  .hamburger {
    display: none;
  }

  .sidebar-overlay {
    display: none !important;
  }
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #0d1117;
}

::-webkit-scrollbar-thumb {
  background: #30363d;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #484f58;
}

/* ============================================
   Post meta
   ============================================ */
.post-meta {
  color: #484f58;
  font-size: 13px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid #30363d;
}

.back-link {
  display: inline-block;
  margin-top: 24px;
  padding: 8px 16px;
  border: 1px solid #30363d;
  border-radius: 4px;
  color: #8b949e;
  font-size: 13px;
}

.back-link:hover {
  border-color: #b5e853;
  color: #b5e853;
  text-decoration: none;
}

/* ============================================
   Terminal cursor blink effect
   ============================================ */
.page-header h1::after {
  content: '█';
  animation: blink 1s step-end infinite;
  color: #b5e853;
  font-weight: normal;
}

@keyframes blink {
  50% { opacity: 0; }
}
