@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700;900&family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
  --font-sans: "Noto Sans SC", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

body {
  font-family: var(--font-sans);
  background: white;
  color: black;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: white;
  border-bottom: 1px solid black;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
}

.nav-icon {
  width: 2rem;
  height: 2rem;
  background: black;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.nav-title {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.05em;
  text-transform: uppercase;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.search-box {
  position: relative;
}

.search-input {
  padding-left: 0.5rem;
  padding-right: 1rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  border: none;
  border-bottom: 1px solid black;
  font-size: 0.875rem;
  outline: none;
  width: 12rem;
  font-family: var(--font-sans);
}

.user-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.2s;
}

.user-btn:hover {
  opacity: 0.5;
}

@media (max-width: 768px) {
  .search-box {
    display: none;
  }
}

/* Main Container */
.main-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.view {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Header Section */
.header-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 4rem;
  border-bottom: 2px solid black;
  padding-bottom: 2rem;
}

@media (min-width: 768px) {
  .header-section {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.main-title {
  font-size: 3.75rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  animation: titleSlide 0.3s ease-out;
}

@keyframes titleSlide {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.subtitle {
  color: #a1a1aa;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.create-btn {
  padding: 1rem 2rem;
  background: black;
  color: white;
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 8px 8px 0px 0px rgba(0,0,0,0.2);
}

.create-btn:hover {
  background: #27272a;
}

.create-btn:active {
  transform: scale(0.95);
}

/* Category Tabs */
.category-tabs {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3rem;
  overflow-x: auto;
  padding-bottom: 1rem;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  padding: 0.5rem 1.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid #e4e4e7;
  background: white;
  color: #a1a1aa;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.category-tab:hover {
  border-color: black;
  color: black;
}

.category-tab.active {
  background: black;
  color: white;
  border-color: black;
}

/* Thread Grid */
.thread-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  animation: gridFade 0.3s ease-in-out;
}

@media (min-width: 768px) {
  .thread-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@keyframes gridFade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Thread Card */
.thread-card {
  padding: 1.5rem;
  border: 1px solid black;
  cursor: pointer;
  transition: background-color 0.2s;
  animation: cardAppear 0.3s ease-out;
}

@keyframes cardAppear {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.thread-card:hover {
  background: #fafafa;
}

.thread-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.thread-category {
  font-size: 0.625rem;
  font-weight: 700;
  border: 1px solid black;
  padding: 0.125rem 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.thread-time {
  font-size: 0.625rem;
  color: #a1a1aa;
  font-family: var(--font-mono);
}

.thread-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.thread-content {
  color: #71717a;
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.thread-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid rgba(0,0,0,0.1);
}

.thread-author {
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.thread-replies {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #a1a1aa;
  font-size: 0.75rem;
  font-family: var(--font-mono);
}

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  padding: 8rem 0;
  text-align: center;
  border: 1px dashed #d4d4d8;
}

.empty-text {
  font-size: 0.75rem;
  font-weight: 700;
  color: #a1a1aa;
  text-transform: uppercase;
  letter-spacing: 0.3em;
}

/* Thread Detail */
.back-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: black;
  margin-bottom: 3rem;
  background: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.back-btn:hover {
  opacity: 0.5;
}

.detail-container {
  max-width: 48rem;
  margin: 0 auto;
  animation: fadeIn 0.3s ease-in-out;
}

.detail-main {
  border: 1px solid black;
  padding: 2rem;
  margin-bottom: 3rem;
}

.detail-category {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 700;
  border: 1px solid black;
  padding: 0.125rem 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 1.5rem;
}

.detail-title {
  font-size: 2.25rem;
  font-weight: 900;
  margin-bottom: 2rem;
  line-height: 1;
  letter-spacing: -0.05em;
}

.detail-author-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.author-avatar {
  width: 2.5rem;
  height: 2.5rem;
  background: black;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
}

.author-name {
  font-weight: 700;
  font-size: 0.875rem;
}

.author-time {
  font-size: 0.625rem;
  color: #a1a1aa;
  font-family: var(--font-mono);
}

.detail-content {
  margin-bottom: 2.5rem;
  line-height: 1.6;
}

/* Replies Section */
.replies-section {
  margin-bottom: 4rem;
}

.replies-title {
  font-size: 1.125rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.05em;
  margin-bottom: 2rem;
}

.reply-card {
  border: 1px solid black;
  padding: 1.5rem;
  margin-bottom: 2rem;
  animation: cardAppear 0.3s ease-out;
}

.reply-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.reply-avatar {
  width: 2rem;
  height: 2rem;
  border: 1px solid black;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.625rem;
}

.reply-author {
  font-size: 0.75rem;
  font-weight: 700;
}

.reply-time {
  font-size: 0.625rem;
  color: #a1a1aa;
  font-family: var(--font-mono);
}

.reply-content {
  font-size: 0.875rem;
  line-height: 1.6;
}

/* Reply Form */
.reply-form-container {
  position: sticky;
  bottom: 2rem;
  background: white;
  border: 1px solid black;
  padding: 1.5rem;
  box-shadow: 6px 6px 0px 0px rgba(0,0,0,1);
}

.reply-form {
  display: flex;
  gap: 1rem;
}

.reply-input {
  flex: 1;
  border: none;
  border-bottom: 1px solid black;
  font-size: 0.875rem;
  outline: none;
  padding: 0.5rem 0;
  font-family: var(--font-sans);
}

.reply-submit {
  padding: 0 1.5rem;
  background: black;
  color: white;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.reply-submit:hover {
  background: #27272a;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease-in-out;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  position: relative;
  background: white;
  width: 100%;
  max-width: 36rem;
  border: 1px solid black;
  padding: 2rem;
  box-shadow: 10px 10px 0px 0px rgba(0,0,0,1);
  animation: modalSlide 0.3s ease-out;
}

@keyframes modalSlide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 900;
  margin-bottom: 2rem;
  border-bottom: 2px solid black;
  padding-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: -0.05em;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.form-input {
  width: 100%;
  padding: 0.5rem 1rem;
  border: 1px solid black;
  outline: none;
  transition: background 0.2s;
  font-family: var(--font-sans);
  font-size: 0.875rem;
}

.form-input:focus {
  background: #fafafa;
}

textarea.form-input {
  resize: none;
}

.form-actions {
  display: flex;
  gap: 1rem;
  padding-top: 1rem;
}

.btn-secondary,
.btn-primary {
  flex: 1;
  padding: 0.75rem;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid black;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-sans);
}

.btn-secondary {
  background: white;
  color: black;
}

.btn-secondary:hover {
  background: #f4f4f5;
}

.btn-primary {
  background: black;
  color: white;
}

.btn-primary:hover {
  background: #27272a;
}

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