/* Global Reset */
:root {
  --bg-color: #000;
  --text-color: #e0e0e0;
  --accent-color: #ccccff;
  --glass-bg: rgba(20, 20, 30, 0.4);
  --glass-border: rgba(255, 255, 255, 0.1);
  --sidebar-width: 250px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: "Pretendard", "Inter", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

/* Hide Tistory Injected UI */
[data-tistory-react-app="Namecard"] {
  display: none !important;
}

a:hover {
  color: var(--accent-color);
}

/* Background Effect Canvas */
#shootingstar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

/* Layout */
.layout-container {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 20px;
  gap: 20px;
}

/* Glassmorphism Panel */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 20px;
}

/* Sidebar */
#sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  height: fit-content;
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.profile-area h1 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.profile-area .desc {
  font-size: 0.9rem;
  color: #aaa;
}

/* Sidebar Navigation (Category) */
.sidebar-nav ul {
  list-style: none;
}

.sidebar-nav ul li {
  margin-bottom: 8px;
}

.sidebar-nav .tt_category li a {
  display: block;
  padding: 5px 0;
  font-size: 0.95rem;
}

/* Sub-category styling (2-depth) */
.sidebar-nav .tt_category li ul {
  margin-left: 15px;
  margin-top: 5px;
  border-left: 1px solid var(--glass-border);
  padding-left: 10px;
}

.sidebar-nav .tt_category li ul li a {
  font-size: 0.85rem;
  color: #bbb;
}

/* Search */
.search-area input {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  outline: none;
}

.search-area input:focus {
  border-color: var(--accent-color);
}

/* Main Content */
#content {
  flex-grow: 1;
  /* Ensure content is readable */
  background: rgba(10, 10, 15, 0.6);
}

/* List View */
.post-list h3 {
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 10px;
  margin-bottom: 20px;
}

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

.post-item h2 {
  font-size: 1.5rem;
  margin-bottom: 5px;
}

.post-item .date {
  font-size: 0.85rem;
  color: #888;
}

/* Detail View */
.post-header {
  margin-bottom: 30px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 20px;
}

.post-title {
  font-size: 2rem;
  margin-bottom: 10px;
  line-height: 1.3;
}

.post-meta {
  font-size: 0.9rem;
  color: #aaa;
}

.post-meta .category {
  color: var(--accent-color);
  margin-right: 10px;
}

/* Content Body */
.post-body {
  font-size: 1.05rem;
  line-height: 1.8;
}

.post-body p {
  margin-bottom: 2em; /* Increased margin */
  line-height: 2; /* Improved readability */
}

.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Markdown Styling Enhancements */
.post-body h1,
.post-body h2,
.post-body h3 {
  margin-top: 3em;
  margin-bottom: 0.8em;
  background: rgba(204, 204, 255, 0.1);
  padding: 10px 15px;
  border-radius: 8px;
  color: var(--accent-color);
  width: fit-content;
}

.post-body h1 {
  font-size: 2em;
}
.post-body h2 {
  font-size: 1.5em;
}
.post-body h3 {
  font-size: 1.1em;
}

.post-body blockquote,
.post-body blockquote[data-ke-style] {
  border-left: 4px solid var(--accent-color) !important;
  padding-left: 15px !important;
  margin: 1.5em 0 !important;
  color: #ccc !important;
  background: rgba(255, 255, 255, 0.05) !important;
  padding: 15px !important;
  border-radius: 0 8px 8px 0 !important;
  font-family: inherit !important;
  font-size: inherit !important;
  text-align: left !important;
}

blockquote p {
  color: #ccc !important;
}

.post-body pre {
  background: #3a3847;
  padding: 15px;
  border-radius: 8px;
  overflow-x: auto;
  font-family: "JetBrains Mono", monospace;
  margin: 1.5em 0;
}

.post-body pre code {
  background: none !important;
  padding: 0;
  color: inherit !important;
}

.post-body ul,
.post-body ol {
  margin-bottom: 2em;
  padding-left: 20px;
}

.post-body li {
  margin-bottom: 0.5em;
}

.post-body code {
  font-family: "JetBrains Mono", monospace;
  background: rgba(204, 204, 255, 0.15) !important;
  color: #e0e0ff !important;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* Post Tags */
.post-tags {
  margin-top: 50px;
  padding-top: 20px;
  border-top: 1px solid var(--glass-border);
  font-size: 0.9rem;
  color: #aaa;
}

.post-tags a {
  display: inline-block;
  margin-left: 5px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  color: #fff;
  transition: all 0.2s;
  text-decoration: none;
}

.post-tags a:hover {
  background: var(--accent-color);
  color: #000;
}

/* TOC (Table of Contents) */
.toc {
  margin: 30px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05); /* Subtle glass effect */
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  max-width: 400px;
}

.toc-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--accent-color);
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 5px;
}

.toc-list {
  list-style: none;
  padding-left: 0;
}

.toc-list li {
  margin-bottom: 5px;
}

.toc-list li a {
  color: #ccc;
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 0.2s;
  display: block;
}

.toc-list li a:hover {
  color: #fff;
}

/* Depth Indentation */
.toc-list li[data-depth="1"] {
  padding-left: 0;
  font-weight: 600;
}
.toc-list li[data-depth="2"] {
  padding-left: 20px;
  font-size: 0.9rem;
}
.toc-list li[data-depth="3"] {
  padding-left: 40px;
  font-size: 0.85rem;
  color: #aaa;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 40px;
}

/* Container for numbers - reset style */
.pagination .num {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* All Buttons (Prev, Next, Page Links, Selected Page) */
.pagination a.prev,
.pagination a.next,
.pagination .num a span {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  box-sizing: border-box;

  /* Visuals */
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-color);
  text-decoration: none;
  line-height: 1;
  transition: all 0.2s ease;
  cursor: pointer;
}

/* Hover Effects */
.pagination a.prev:hover,
.pagination a.next:hover,
.pagination .num a span:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--accent-color);
  color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Selected Page Active State */
.pagination .num a span.selected {
  background: var(--accent-color) !important;
  color: #000 !important;
  font-weight: 700;
  border: 1px solid var(--accent-color) !important;
  box-shadow: 0 0 10px rgba(204, 204, 255, 0.4);
  cursor: default;
  pointer-events: none;
  transform: none; /* No movement for active item */
}

/* Previous/Next adjustments if needed */
.pagination .prev,
.pagination .next {
  font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
  .layout-container {
    flex-direction: column;
  }

  #sidebar {
    width: 100%;
    position: static;
    margin-bottom: 20px;
  }
}

/* Comments Section */
.comments-section {
  margin-top: 50px;
  padding: 30px;
}

.comments-section h3 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 10px;
  color: var(--accent-color);
}

.comment-list {
  list-style: none;
  margin-bottom: 30px;
}

.comment-item {
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid var(--glass-border);
}

.comment-author .name {
  font-weight: 700;
  margin-right: 10px;
}

.comment-author .date {
  font-size: 0.8rem;
  color: #888;
}

.comment-content {
  margin: 10px 0;
  line-height: 1.6;
  font-size: 0.95rem;
  color: #ddd;
}

.comment-actions a {
  font-size: 0.8rem;
  margin-right: 10px;
  color: #aaa;
}

.comment-actions a:hover {
  text-decoration: underline;
  color: var(--accent-color);
}

/* Reply Styling */
.reply-list {
  list-style: none;
  margin-left: 20px;
  margin-top: 10px;
  border-left: 2px solid var(--glass-border);
  padding-left: 20px;
}

.reply-item {
  background: rgba(255, 255, 255, 0.05); /* Slightly lighter for distinction */
}

/* Comment Form */
.comment-form {
  padding-top: 20px;
  border-top: 1px solid var(--glass-border);
}

.guest-info {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.guest-info input {
  flex: 1;
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 5px;
  color: #fff;
  outline: none;
}

.guest-info input:focus {
  border-color: var(--accent-color);
}

.secret-check {
  margin-bottom: 10px;
  font-size: 0.9rem;
  color: #aaa;
  display: flex;
  align-items: center;
  gap: 5px;
}

.comment-input-area textarea {
  width: 100%;
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: #fff;
  outline: none;
  margin-bottom: 10px;
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

.comment-input-area textarea:focus {
  border-color: var(--accent-color);
}

.comment-input-area input[type="submit"] {
  padding: 8px 20px;
  background: var(--accent-color);
  color: #000;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 600;
  transition: opacity 0.2s;
}

.comment-input-area input[type="submit"]:hover {
  opacity: 0.9;
}
