/* Discussion Page Styles */

.discussion-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.discussion-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid var(--border-color);
}

.discussion-header h1 {
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.discussion-header p {
  color: var(--text-light);
  font-size: 1.1rem;
}

.discussion-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.discussion-filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.discussion-filters select,
.discussion-filters input {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.95rem;
  background: var(--white);
  color: var(--text-dark);
}

.discussion-filters input::placeholder {
  color: var(--text-light);
}

/* New Discussion Form */
.new-discussion-form {
  background: var(--light-bg);
  padding: 2rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
}

.new-discussion-form h3 {
  margin-bottom: 1.5rem;
  color: var(--text-dark);
}

.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
  font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--white);
  color: var(--text-dark);
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(91, 95, 255, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

/* Discussion Thread */
.discussion-thread {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
}

.discussion-thread:hover {
  box-shadow: var(--shadow-md);
}

.thread-header {
  padding: 1.5rem;
  background: var(--light-bg);
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
}

.thread-author-info {
  display: flex;
  gap: 1rem;
  align-items: start;
  flex: 1;
}

.thread-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-blue), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.thread-meta {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.thread-author-name {
  font-weight: 700;
  color: var(--text-dark);
}

.thread-category {
  display: inline-block;
  background: var(--primary-blue);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-top: 0.25rem;
  width: fit-content;
}

.thread-timestamp {
  font-size: 0.85rem;
  color: var(--text-light);
}

.thread-stats {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  padding: 0.5rem 1rem;
  background: var(--light-bg-2);
  border-radius: 4px;
}

.thread-stats div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.thread-stats-number {
  font-weight: 700;
  color: var(--primary-blue);
  font-size: 1.1rem;
}

.thread-stats-label {
  font-size: 0.75rem;
  color: var(--text-light);
  text-transform: uppercase;
}

.thread-body {
  padding: 1.5rem;
}

.thread-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-dark);
  line-height: 1.4;
}

.thread-content {
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.thread-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.thread-tag {
  background: var(--light-bg);
  color: var(--primary-blue);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  border: 1px solid var(--primary-blue);
  cursor: pointer;
  transition: all 0.3s ease;
}

.thread-tag:hover {
  background: var(--primary-blue);
  color: white;
}

.thread-footer {
  padding: 1rem 1.5rem;
  background: var(--light-bg-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.thread-actions {
  display: flex;
  gap: 1rem;
}

.thread-action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
}

.thread-action-btn:hover {
  color: var(--primary-blue);
  background: rgba(91, 95, 255, 0.1);
}

.thread-action-btn.active {
  color: var(--primary-blue);
  font-weight: 600;
}

.thread-reply-btn {
  background: var(--primary-blue);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.thread-reply-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* Comments Section */
.comments-section {
  background: var(--light-bg-2);
  padding: 1.5rem;
  margin-top: 1rem;
  border-radius: 6px;
}

.comments-section h4 {
  margin-bottom: 1rem;
  color: var(--text-dark);
}

.comment {
  background: var(--white);
  padding: 1.25rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  border-left: 3px solid var(--primary-blue);
}

.comment.reply {
  margin-left: 2rem;
  border-left-color: var(--accent-purple);
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-blue), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.comment-info {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex: 1;
}

.comment-author {
  font-weight: 600;
  color: var(--text-dark);
}

.comment-timestamp {
  color: var(--text-light);
  font-size: 0.85rem;
}

.comment-content {
  color: var(--text-dark);
  line-height: 1.6;
  margin-bottom: 0.75rem;
  word-wrap: break-word;
}

.comment-mentions {
  background: rgba(91, 95, 255, 0.1);
  color: var(--primary-blue);
  padding: 0 0.3rem;
  border-radius: 2px;
  font-weight: 600;
}

.comment-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.comment-action {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s ease;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
}

.comment-action:hover {
  color: var(--primary-blue);
  background: rgba(91, 95, 255, 0.1);
}

.comment-action.liked {
  color: var(--danger);
}

.comment-action.liked svg {
  fill: var(--danger);
}

/* Comment Form */
.comment-form {
  background: var(--white);
  padding: 1.25rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
}

.comment-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
  margin-bottom: 0.75rem;
  transition: all 0.3s ease;
}

.comment-form textarea:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(91, 95, 255, 0.1);
}

.comment-form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.comment-form-actions button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.comment-form-submit {
  background: var(--primary-blue);
  color: white;
}

.comment-form-submit:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.comment-form-cancel {
  background: var(--light-bg);
  color: var(--text-dark);
  border: 1px solid var(--border-color);
}

.comment-form-cancel:hover {
  background: var(--border-color);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--light-bg);
  border-radius: 8px;
  color: var(--text-light);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .discussion-container {
    padding: 1rem;
  }

  .discussion-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .discussion-filters {
    flex-direction: column;
  }

  .discussion-filters input,
  .discussion-filters select {
    width: 100%;
  }

  .thread-header {
    flex-direction: column;
  }

  .thread-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .comment.reply {
    margin-left: 1rem;
  }

  .new-discussion-form {
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 480px) {
  .discussion-header h1 {
    font-size: 1.75rem;
  }

  .thread-stats {
    flex-direction: row;
    width: 100%;
  }

  .thread-title {
    font-size: 1.1rem;
  }

  .comment-form-actions {
    flex-direction: column-reverse;
  }

  .comment-form-actions button {
    width: 100%;
  }
}
