:root {
  --bg: #0d0d0d;
  --surface: #141414;
  --surface-hover: #1f1f1f;
  --text-primary: #f0f0f0;
  --text-secondary: #9aa0a6;
  --accent: #d22b2b;
  --border-color: #2b2b2b;
  --scrollbar-bg: #0d0d0d;
  --scrollbar-thumb: #333;
}

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

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

.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--scrollbar-bg);
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Sidebar Navigation */
.sidebar {
  width: 350px;
  background-color: var(--surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 100;
  height: 100%;
}

.sidebar-header {
  padding: 30px 20px 20px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-header h1 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.sidebar-header p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 300;
  letter-spacing: 0.5px;
}

.search-container {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
}

#search-input {
  width: 100%;
  padding: 10px 14px;
  background-color: var(--bg);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s;
}

#search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.article-list {
  list-style: none;
  overflow-y: auto;
  flex-grow: 1;
  padding: 10px 0;
}

.article-list li {
  padding: 12px 20px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background-color 0.2s, border-left-color 0.2s;
}

.article-list li:hover {
  background-color: var(--surface-hover);
}

.article-list li.active {
  background-color: var(--surface-hover);
  border-left-color: var(--accent);
}

.article-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.article-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Main Content Area */
.content-area {
  flex-grow: 1;
  height: 100%;
  overflow-y: auto;
  position: relative;
  background-color: var(--bg);
}

.menu-toggle {
  display: none;
  position: fixed;
  top: 15px;
  right: 15px;
  background: var(--surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 4px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
}

.article-wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 60px 40px;
}

.welcome-screen {
  text-align: center;
  color: var(--text-secondary);
  margin-top: 20vh;
  font-weight: 300;
}

/* Typography for the article rendering */
.article-header {
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.article-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.8rem;
  line-height: 1.2;
  margin-bottom: 15px;
  letter-spacing: -0.5px;
}

.article-meta {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.article-body {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  line-height: 1.8;
  color: #ddd;
}

.article-body p {
  margin-bottom: 25px;
}

.article-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-bottom-color 0.2s;
}

.article-body a:hover {
  border-bottom-color: var(--accent);
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 30px 0;
}

/* Back to Top */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.8rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, background-color 0.2s;
  z-index: 150;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--surface-hover);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .app-container {
    position: relative;
  }
  
  .sidebar {
    position: absolute;
    left: 0;
    top: 0;
    width: 300px;
    transform: translateX(-100%);
    box-shadow: 2px 0 15px rgba(0,0,0,0.5);
  }

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

  .menu-toggle {
    display: flex;
  }

  .article-wrapper {
    padding: 80px 20px 40px;
  }

  .article-header h1 {
    font-size: 2.2rem;
  }

  .article-body {
    font-size: 1.05rem;
  }
}

.fade-in { animation: fadeIn 0.4s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
