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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #0f1419;
  color: #e7e9ea;
  padding: 4rem 2rem 2rem;
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
}

header {
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: start;
  width: 100%;
}

h1 {
  font-size: 1.75rem;
  color: #fff;
  font-weight: 600;
  margin: 0;
}

.logo-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  transition: opacity 0.2s;
  cursor: pointer;
}

.logo-link:hover {
  opacity: 0.8;
}

.stats {
  color: #71767b;
  font-size: 0.8rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.view-btn {
  background: #2f3336;
  color: #e7e9ea;
  border: 1px solid #4a4e54;
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s;
  text-decoration: none;
  line-height: 1;
}

.view-btn:hover {
  background: #3a3e42;
  border-color: #5a5e64;
}

.button-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.error {
  background: #3a0f0f;
  border: 1px solid #ff6b6b;
  color: #ff6b6b;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.posts-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #16181c;
  border: 1px solid #2f3336;
  border-radius: 8px;
  overflow: hidden;
  table-layout: fixed;
}

thead {
  background: #1e2328;
  border-bottom: 2px solid #2f3336;
}

th {
  padding: 0.75rem 0.5rem;
  text-align: left;
  font-weight: 600;
  color: #fff;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

th.checkbox-col {
  width: 4%;
  text-align: center;
}

th.subreddit-col {
  width: 11%;
}

th.title-col {
  width: 18%;
}

th.author-col {
  width: 9%;
}

th.comment-col {
  width: 40%;
}

th.time-col {
  width: 11%;
}

th.indexed-col {
  width: 7%;
  text-align: center;
}

tbody tr {
  border-bottom: 1px solid #2f3336;
  transition: background-color 0.2s;
}

tbody tr:hover {
  background: #1a1d23;
}

tbody tr.read {
  opacity: 0.6;
}

tbody tr.read:hover {
  opacity: 0.8;
}

td {
  padding: 0.5rem;
  vertical-align: top;
  font-size: 0.85rem;
}

td.checkbox-cell {
  text-align: center;
}

.read-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #1d9bf0;
}

.indexed-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #10a37f;
}

.indexed-link {
  margin-left: 0.3rem;
  text-decoration: none;
  font-size: 0.9rem;
}

.indexed-link:hover {
  opacity: 0.8;
}

.indexed-cell {
  text-align: center;
}

.indexed-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  white-space: nowrap;
}

.subreddit-cell {
  white-space: nowrap;
  overflow: hidden;
}

.subreddit {
  font-weight: 600;
  color: #fff;
  display: inline-block;
  margin-right: 0.5rem;
}

.nsfw-badge {
  background: #3a3e42;
  color: #a8a8a8;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  display: inline-block;
}

.post-title {
  white-space: nowrap;
  overflow: hidden;
}

.post-title a {
  color: #1d9bf0;
  text-decoration: none;
}

.post-title a:hover {
  text-decoration: underline;
}

.comment-author {
  color: #71767b;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
}

.comment-text {
  color: #e7e9ea;
  white-space: nowrap;
  overflow: hidden;
  line-height: 1.4;
}

.timestamp {
  color: #71767b;
  font-size: 0.8rem;
  white-space: nowrap;
}

.extra-comment-details {
  margin-top: 0.4rem;
}

.extra-comment-details summary {
  color: #1d9bf0;
  cursor: pointer;
  font-size: 0.8rem;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  user-select: none;
}

.extra-comment-details summary::-webkit-details-marker {
  display: none;
}

.extra-comment-details summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 0.4rem;
  transition: transform 0.2s;
}

.extra-comment-details[open] summary::before {
  transform: rotate(90deg);
}

.extra-comments-inline {
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.extra-comment {
  background: #14171a;
  border: 1px solid #2a2e33;
  border-radius: 6px;
  padding: 0.6rem;
}

.extra-comment-meta {
  display: flex;
  justify-content: space-between;
  color: #9ca0a6;
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
}

.extra-comment-text {
  color: #e7e9ea;
  font-size: 0.8rem;
  line-height: 1.4;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #71767b;
}

.empty-state h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #fff;
}

.filter-controls {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-btn {
  background: #2f3336;
  color: #e7e9ea;
  border: 1px solid #4a4e54;
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-block;
  line-height: 1;
}

.filter-btn:hover {
  background: #3a3e42;
  border-color: #5a5e64;
}

.filter-btn.active {
  background: #1d9bf0;
  border-color: #1d9bf0;
  color: #fff;
}

.subreddit-row {
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s;
}

.subreddit-row:hover {
  background: #1e2328;
}

@media (max-width: 768px) {
  body {
    padding: 1rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  th, td {
    padding: 0.4rem 0.3rem;
    font-size: 0.75rem;
  }

  th.subreddit-col,
  th.author-col {
    width: auto;
  }
}

.see-more-row {
  background: #1e2328;
}

.see-more-cell {
  padding: 1rem !important;
  text-align: center;
  border-top: 2px solid #2f3336 !important;
}

.see-more-btn {
  background: #2f3336;
  color: #e7e9ea;
  border: 1px solid #4a4e54;
  padding: 0.5rem 1.5rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}

.see-more-btn:hover {
  background: #3a3e42;
  border-color: #5a5e64;
}

.see-more-btn:active {
  transform: scale(0.98);
}

.see-more-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
