/* src/styles/CommunityPage.css */
.forum-container {
  width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
  background: linear-gradient(to bottom, #a8d5e2, #b8e2c8);  min-height: 80vh;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  border-radius: 8px;
}

.forum-header {
  margin-left: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.forum-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #333;
}

.forum-subtitle {
  color: #666;
  font-size: 1rem;
}

.forum-filters {
  margin-bottom: 1.5rem;
}

.forum-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.forum-input {
  flex: 2;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 0.25rem;
  min-width: 200px;
}

.forum-select {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 0.25rem;
  min-width: 150px;
}

.forum-posts {
  display: flex;
  flex-direction: column;
  gap: 2rem; /* Increased gap between posts */
  padding: 1rem 0;
}

.forum-post-card {
  background-color: white;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
  cursor: pointer;
  margin: 0.5rem 0; /* Added extra margin */
  border: 1px solid rgba(182, 121, 121, 0.1);
}

.forum-post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(182, 121, 121, 0.15);
}

.forum-post {
  width: 100%;
}

.forum-post-content {
  flex: 1;
}

.forum-post-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.forum-post-content h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #333;
}

.forum-post-content p {
  color: #555;
  margin-bottom: 0.75rem;
}

.forum-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.forum-tags span {
  background-color: #f0f0f0;
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  color: #555;
}

.forum-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vote-buttons {
  display: flex;
  gap: 0.5rem;
}

.vote-button {
  padding: 5px 10px;
  margin-right: 5px;
  background-color: transparent;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #333;
}

.vote-button.voted-up {
  background-color: #22c55e !important;
  color: white !important;
  border-color: #22c55e !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(34, 197, 94, 0.2);
}

.vote-button.voted-down {
  background-color: #ef4444 !important;
  color: white !important;
  border-color: #ef4444 !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(239, 68, 68, 0.2);
}

.vote-button:hover {
  opacity: 0.8;
}

.vote-button.active {
  background-color: #4CAF50;
  color: white;
  border-color: #4CAF50;
}

.vote-button.remove-vote {
  color: #f44336;
}

.vote-button.remove-vote:hover {
  background-color: #ffebee;
}

.vote-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.post-stats {
  font-size: 0.875rem;
  color: #666;
}

.forum-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.pagination-button {
  padding: 0.5rem 1rem;
  background-color: #b67979;
  color: white;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-button:hover {
  background-color: #a66868;
}

.pagination-button:disabled {
  background-color: #d9d9d9;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 0.875rem;
  color: #666;
}

.forum-empty {
  text-align: center;
  padding: 2rem;
}

.forum-empty h2 {
  font-size: 1.5rem;
  color: #333;
  margin-bottom: 0.5rem;
}

.forum-empty p {
  color: #666;
  margin-bottom: 1rem;
}

.forum-loading {
  text-align: center;
  padding: 2rem;
  font-size: 1rem;
  color: #666;
}

.forum-error {
  margin-bottom: 1.5rem;
  border: 1px solid #f44336;
  border-radius: 0.25rem;
}

.forum-error h2 {
  color: #f44336;
  margin-bottom: 0.5rem;
}

.forum-error p {
  margin-bottom: 1rem;
}

.mt-2 {
  margin-top: 0.5rem;
}


@media (max-width: 768px) {
  .forum-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .forum-filter-row {
    flex-direction: column;
  }
  
  .forum-input, .forum-select {
    flex: 1;
    width: 100%;
  }
}

.forum-create-button {
  padding: 0.75rem 1.5rem;
  background-color: #4CAF50 !important; /* Added !important to check specificity issues */
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
  display: inline-block;
  margin-right: 10px;
}

.forum-create-button:hover {
  background-color: #68d391;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(182, 121, 121, 0.2);
}

.post-author-wrapper {
  color: #666;
}

.author-link {
  cursor: pointer;
  color: #2d7c4b;
  transition: color 0.2s ease;
}

.author-link:hover {
  color: #4e8846;
  text-decoration: underline;
}