/* Forum Container */
.forum-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Forum Header */
.forum-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0a0f1f 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.forum-header h1 {
  margin: 0;
  font-size: 2.5rem;
}

/* Forum Statistics */
.forum-stats {
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 15px;
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-card i {
  font-size: 2.5rem;
  color: #667eea;
}

.stat-info h3 {
  margin: 0;
  font-size: 1.8rem;
  color: #333;
}

.stat-info p {
  margin: 0;
  color: #666;
}

/* Categories Section */
.categories-section {
  margin-bottom: 30px;
}

.categories-section h2 {
  margin-bottom: 20px;
  color: #333;
}

.categories-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.category-card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: grid;
  grid-template-columns: 60px 1fr auto 200px;
  gap: 20px;
  align-items: center;
  transition: box-shadow 0.3s ease;
}

.category-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.category-icon {
  font-size: 2.5rem;
  color: #667eea;
  text-align: center;
}

.category-info h3 {
  margin: 0 0 5px 0;
  font-size: 1.3rem;
}

.category-info h3 a {
  color: #333;
  text-decoration: none;
}

.category-info h3 a:hover {
  color: #667eea;
}

.category-description {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
}

.category-stats {
  text-align: center;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #666;
}

.category-last-post {
  border-left: 2px solid #eee;
  padding-left: 15px;
}

.last-post-title {
  margin: 0 0 5px 0;
  font-size: 0.9rem;
}

.last-post-title a {
  color: #333;
  text-decoration: none;
}

.last-post-title a:hover {
  color: #667eea;
}

.last-post-meta {
  margin: 0;
  font-size: 0.85rem;
  color: #666;
}

/* Posts Sidebar */
.posts-sidebar {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.posts-sidebar h3 {
  margin: 0 0 15px 0;
  font-size: 1.2rem;
  color: #333;
}

.sidebar-posts-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.sidebar-post-item a {
  color: #333;
  text-decoration: none;
  font-weight: 500;
}

.sidebar-post-item a:hover {
  color: #667eea;
}

.post-meta {
  margin-top: 5px;
  font-size: 0.85rem;
  color: #666;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Category Header */
.category-header {
  background: white;
  border-radius: 10px;
  padding: 30px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.category-header h1 {
  margin: 0 0 10px 0;
  color: #333;
}

/* Forum Controls */
.forum-controls {
  background: white;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Posts List */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.post-card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 20px;
  align-items: start;
  transition: box-shadow 0.3s ease;
}

.post-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.post-card.sticky-post {
  border-left: 4px solid #ffc107;
}

.post-avatar img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-placeholder {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #999;
}

.post-content {
  flex: 1;
}

.post-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.post-title-row h3,
.post-title-row h4 {
  margin: 0;
  font-size: 1.2rem;
}

.post-title-row a {
  color: #333;
  text-decoration: none;
}

.post-title-row a:hover {
  color: #667eea;
}

.post-author a {
  color: #667eea;
  text-decoration: none;
}

.post-author a:hover {
  text-decoration: underline;
}

.post-stats {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: center;
}

.post-last-reply {
  grid-column: 2 / 4;
  padding-top: 10px;
  border-top: 1px solid #eee;
}

/* Post Detail */
.post-detail-card {
  background: white;
  border-radius: 10px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 2px solid #eee;
}

.post-header h1 {
  margin: 0;
  font-size: 2rem;
  color: #333;
}

.post-actions {
  display: flex;
  gap: 10px;
}

.post-author-info {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.author-avatar img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-placeholder-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #999;
}

.author-details h4 {
  margin: 0 0 5px 0;
}

.author-details h4 a {
  color: #667eea;
  text-decoration: none;
}

.author-details h4 a:hover {
  text-decoration: underline;
}

.post-content-body {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #333;
  margin-bottom: 20px;
}

.post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.post-stats-detail {
  display: flex;
  gap: 20px;
}

.post-actions-buttons {
  display: flex;
  gap: 10px;
}

/* Replies Section */
.replies-section {
  margin-bottom: 30px;
}

.replies-section h3 {
  margin-bottom: 20px;
  color: #333;
}

.reply-form-container {
  background: white;
  border-radius: 10px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.reply-form-container h4 {
  margin: 0 0 20px 0;
  color: #333;
}

.replies-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.reply-card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  gap: 15px;
}

.reply-avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-placeholder-small {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #999;
}

.reply-content {
  flex: 1;
}

.reply-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.reply-author strong a {
  color: #667eea;
  text-decoration: none;
}

.reply-author strong a:hover {
  text-decoration: underline;
}

.reply-actions {
  display: flex;
  gap: 5px;
}

.reply-to-info {
  margin-bottom: 10px;
  padding: 5px 10px;
  background: #f0f0f0;
  border-radius: 5px;
  font-size: 0.9rem;
}

.reply-body {
  line-height: 1.6;
  color: #333;
}

/* Form Container */
.form-container {
  background: white;
  border-radius: 10px;
  padding: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.form-container h1 {
  margin: 0 0 30px 0;
  color: #333;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.posting-guidelines {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 20px;
}

.posting-guidelines h4 {
  margin: 0 0 15px 0;
  color: #333;
}

.posting-guidelines ul {
  margin: 0;
  padding-left: 20px;
}

.posting-guidelines li {
  margin-bottom: 8px;
  color: #666;
}

/* Search Container */
.search-container {
  background: white;
  border-radius: 10px;
  padding: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.search-form {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 30px;
}

/* User Activity */
.user-activity-header {
  background: white;
  border-radius: 10px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  gap: 30px;
  align-items: center;
}

.user-avatar-large img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-placeholder-xlarge {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: #999;
}

.user-info h1 {
  margin: 0 0 10px 0;
  color: #333;
}

.user-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.activity-tabs {
  background: white;
  border-radius: 10px;
  padding: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.reply-card-simple {
  background: white;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 15px;
}

/* Related Posts */
.related-posts-section {
  background: white;
  border-radius: 10px;
  padding: 20px;
  margin-top: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.related-posts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.related-post-item {
  padding: 10px;
  border-left: 3px solid #667eea;
  background: #f8f9fa;
}

.related-post-item a {
  color: #333;
  text-decoration: none;
  font-weight: 500;
}

.related-post-item a:hover {
  color: #667eea;
}

/* Responsive Design */
@media (max-width: 768px) {
  .category-card {
    grid-template-columns: 1fr;
  }

  .post-card {
    grid-template-columns: 1fr;
  }

  .user-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .post-header {
    flex-direction: column;
  }

  .post-footer {
    flex-direction: column;
    gap: 15px;
  }
}

/* File Upload Styles */
.attachment-image {
  margin: 10px 0;
}

.attachment-image img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.attachment-image-small {
  margin: 8px 0;
}

.attachment-image-small img {
  max-width: 300px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.attachment-files,
.attachment-files-small {
  margin-top: 10px;
}

.attachment-files h6 {
  color: #667eea;
  font-weight: 600;
  margin-bottom: 8px;
}

.attachment-file-item,
.attachment-file-item-small {
  margin: 5px 0;
}

.attachment-file-item a,
.attachment-file-item-small a {
  text-decoration: none;
}

.attachment-file-item a:hover,
.attachment-file-item-small a:hover {
  text-decoration: none;
  opacity: 0.8;
}

.existing-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 8px;
}

.attachment-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: white;
  border-radius: 6px;
  border: 1px solid #dee2e6;
  position: relative;
}

.delete-attachment-btn {
  margin-left: auto;
  padding: 2px 8px;
  font-size: 0.875rem;
}

.delete-attachment-btn:hover {
  background-color: #dc3545;
  border-color: #dc3545;
}

.attachment-thumbnail {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
}

#image-preview,
#file-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.preview-item {
  position: relative;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #dee2e6;
  display: inline-block;
  margin: 5px;
  text-align: center;
}

.preview-item img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  margin-bottom: 5px;
}

.preview-item small {
  display: block;
  word-break: break-all;
  max-width: 100px;
}

.preview-item .remove-preview-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  padding: 2px 6px;
  font-size: 0.75rem;
  line-height: 1;
  border-radius: 3px;
  z-index: 10;
}

.preview-item .remove-preview-btn:hover {
  background-color: #dc3545;
  border-color: #dc3545;
}

/* Post Preview Styles */
.post-preview-container {
  min-height: 300px;
  padding: 20px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
}

.preview-title {
  color: #333;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #667eea;
}

.preview-content {
  color: #555;
  line-height: 1.6;
  margin-bottom: 15px;
}

.preview-images {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.preview-images img {
  max-width: 200px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

#edit-tab-btn.active,
#preview-tab-btn.active {
  background-color: #667eea;
  color: white;
  border-color: #667eea;
}

/* Image Gallery Styles */
.image-gallery {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 15px 0;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

.image-gallery-small {
  max-width: 500px;
}

.gallery-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
}

.gallery-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-slide.active {
  opacity: 1;
  z-index: 1;
}

.gallery-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  padding: 15px 10px;
  cursor: pointer;
  z-index: 10;
  transition: background 0.3s ease;
  font-size: 1.5rem;
}

.gallery-nav:hover {
  background: rgba(0, 0, 0, 0.8);
}

.gallery-prev {
  left: 10px;
  border-radius: 0 4px 4px 0;
}

.gallery-next {
  right: 10px;
  border-radius: 4px 0 0 4px;
}

.gallery-counter {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
  z-index: 10;
}

/* Responsive Gallery */
@media (max-width: 768px) {
  .gallery-nav {
    padding: 10px 8px;
    font-size: 1.2rem;
  }

  .gallery-prev {
    left: 5px;
  }

  .gallery-next {
    right: 5px;
  }

  .gallery-counter {
    font-size: 0.8rem;
    padding: 4px 12px;
  }
}

/* Drag and Drop Styles */
.drag-drop-zone {
  border: 2px dashed #667eea;
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  background: #f8f9fa;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.drag-drop-zone:hover {
  background: #e9ecef;
  border-color: #5568d3;
}

.drag-drop-zone.drag-over {
  background: #e7f1ff;
  border-color: #0066cc;
  border-style: solid;
}

.drag-drop-zone-small {
  padding: 20px;
}

.drag-drop-content {
  pointer-events: none;
}

.drag-drop-icon {
  font-size: 3rem;
  color: #667eea;
  margin-bottom: 10px;
  display: block;
}

.drag-drop-icon-small {
  font-size: 2rem;
  color: #667eea;
  margin-bottom: 5px;
  display: block;
}

.drag-drop-text {
  color: #6c757d;
  font-size: 1rem;
  margin: 0;
}

.drag-drop-text-small {
  color: #6c757d;
  font-size: 0.875rem;
  margin: 0;
}

.drag-drop-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  border: none;
  padding: 0;
}

/* Upload Progress Overlay */
.upload-progress-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-progress-content {
  background: white;
  padding: 40px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.upload-progress-content h5 {
  color: #333;
  margin: 0;
}

.upload-progress-content .progress {
  height: 25px;
  margin: 0 auto;
}

.upload-progress-content .progress-bar {
  font-size: 0.875rem;
  line-height: 25px;
}

#upload-status {
  font-size: 0.875rem;
  margin: 0;
}
