/* Topic Show Page */

/* Topic Header Wrapper */
.topic-header-wrapper {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  align-items: stretch;
}

/* Topic Header Card */
.topic-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  flex: 1;
  overflow: visible;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  position: relative;
}

/* Topic Header Top */
.topic-header-top {
  background: var(--muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}


.topic-meta-bottom {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-secondary);
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 16px;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  background: var(--muted);
}

.topic-date-meta {
  font-size: 11px;
  color: var(--text-secondary);
}

.topic-meta-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.topic-meta-bottom span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.topic-meta-bottom i {
  font-size: 11px;
}

/* Topic buttons are now in buttons.css */

.topic-like-count {
  font-weight: 600;
}


.topic-title {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  padding: 16px;
  line-height: 1.4;
}

.topic-description {
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.5;
  margin: 0;
  padding: 0 16px 16px 16px;
  word-wrap: break-word;
}

.topic-description p {
  margin-bottom: 4px;
  color: #e3e3e3;
  margin-top: 0;
}

.topic-description p:first-child {
  margin-top: 0;
}

/* İlk element (resim veya yazı) üstten başlasın */
.topic-description > *:first-child {
  margin-top: 0 !important;
}

.topic-description p:last-child {
  margin-bottom: 0;
}

.topic-description .mention {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.topic-description .mention:hover {
  text-decoration: underline;
}

.topic-description .hashtag {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.topic-description .hashtag:hover {
  text-decoration: underline;
}

.topic-description li {
  color: #e3e3e3;
}

.topic-categories-mobile {
  display: none; /* Desktop'ta gizle, sadece mobil görünümde göster */
}

.topic-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 16px;
  background: var(--muted);
  border-top: 1px solid var(--border);
}

.topic-tag {
  display: inline-block;
  padding: 3px 8px;
  background: var(--bg-card);
  color: var(--primary);
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.2s;
}

.topic-tag:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Author Sidebar - Desktop */
.topic-author-sidebar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

.topic-author-info {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.topic-author-avatar {
  width: 75px;
  height: 75px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.topic-author-avatar:hover {
  opacity: 0.8;
}

.topic-author-avatar img,
.topic-author-avatar picture,
.topic-author-avatar picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.topic-author-avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 30px;
  font-weight: 600;
}

.topic-author-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  flex: 1;
  min-width: 0;
}

.topic-author-username {
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: opacity 0.2s;
}

.topic-author-username:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.topic-author-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  width: 100%;
  justify-content: space-between;
}

.topic-author-rank {
  order: 1;
  margin-top: 0;
  font-size: 11px;
  padding: 4px 9px;
  flex-shrink: 0;
}

.topic-categories-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
  order: 2;
  flex-shrink: 0;
}

/* Posts Section */

.topic-no-posts {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
}

.topic-posts-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 10px;
}

/* Comment Card - Same design as topic card */
.comment-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.comment-author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.comment-author-avatar:hover {
  opacity: 0.8;
}

.comment-author-avatar img,
.comment-author-avatar picture,
.comment-author-avatar picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.comment-author-avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
}

.comment-author-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.comment-author-name-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.comment-author-username {
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: opacity 0.2s;
  line-height: 1.2;
}

.comment-author-username:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.comment-author-rank {
  font-size: 10px;
  padding: 3px 8px;
}

.comment-date-meta {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.2;
}

.comment-content {
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  padding: 12px 16px 16px 16px;
  word-wrap: break-word;
}

.comment-content p {
  margin-bottom: 6px;
  margin-top: 0;
}

.comment-content p:last-child {
  margin-bottom: 0;
}

.comment-content p:first-child {
  margin-top: 0;
}

/* İlk element (resim veya yazı) üstten başlasın */
.comment-content > *:first-child {
  margin-top: 0 !important;
}


.comment-text {
  color: var(--text-primary);
}

.comment-text blockquote {
  margin: 0 0 0 0;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--primary);
  border-radius: 6px;
  color: var(--text-primary);
  line-height: 1.6;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.comment-text blockquote[contenteditable="false"],
.comment-text blockquote.quote-readonly {
  cursor: default !important;
  user-select: none !important;
  opacity: 0.95;
  pointer-events: none !important;
}

.comment-text blockquote[contenteditable="false"] *,
.comment-text blockquote.quote-readonly * {
  pointer-events: none !important;
  user-select: none !important;
}

.comment-text blockquote strong {
  font-weight: 600;
  color: var(--primary);
  display: inline;
  margin-right: 4px;
}

.comment-text blockquote p {
  margin: 0;
  padding: 0;
}

.comment-text blockquote p:first-child {
  margin-top: 0;
}

.comment-text blockquote p:last-child {
  margin-bottom: 0;
}

/* Blockquote'ten sonraki ilk elemente bir satır boşluk ekle */
.comment-text blockquote + * {
  margin-top: 1.6em !important;
}

/* Blockquote'ten sonraki son elementin alt margin'ini kaldır */
.comment-text blockquote ~ *:last-child {
  margin-bottom: 0 !important;
}

.comment-text .mention {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.comment-text .mention:hover {
  text-decoration: underline;
}

.comment-text .hashtag {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.comment-text .hashtag:hover {
  text-decoration: underline;
}

.comment-meta-bottom {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-secondary);
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 16px;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  background: var(--muted);
}

.comment-meta-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.comment-meta-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

/* Comment action links are now in buttons.css */

.comment-like-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.comment-like-btn:not(.liked) {
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.comment-like-btn:not(.liked):hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  color: #ffffff;
}

.comment-like-btn.liked {
  background: #e74c3c;
  border-color: #e74c3c;
  color: white;
}

.comment-like-btn.liked:hover {
  background: #c0392b;
  border-color: #c0392b;
}

.comment-like-btn i {
  font-size: 12px;
}

.comment-like-count {
  font-weight: 600;
}

/* Comment delete button is now in buttons.css */

/* Pagination */
.topic-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 12px;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.pagination-btn {
  padding: 6px 12px;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
}

.pagination-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.pagination-info {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 0 8px;
}

/* Reply Form */
.topic-reply-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow: hidden;
  margin-top: 10px;
  backdrop-filter: blur(20px) saturate(110%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.topic-reply-header {
  background: var(--muted);
  margin: -16px -16px 16px -16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.topic-reply-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}


.topic-login-prompt {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 10px;
}

/* Kilitlenen konu - Siyah beyaz */
.topic-locked {
  filter: grayscale(100%);
  -webkit-filter: grayscale(100%);
}

.topic-locked img {
  filter: grayscale(100%);
  -webkit-filter: grayscale(100%);
}

.topic-login-prompt a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.topic-login-prompt a:hover {
  text-decoration: underline;
}

.topic-reply-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  transition: all 0.2s;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}

.topic-reply-form textarea {
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  margin-top: 0;
}

.topic-reply-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--bg-card);
}

.topic-reply-form .form-actions {
  margin-top: 12px;
}


/* Responsive - Mobile */
@media (max-width: 768px) {
  .topic-header-wrapper {
    flex-direction: column;
    gap: 0;
  }
  
  .topic-header-card {
    margin-bottom: 0;
    overflow: hidden;
    position: relative;
  }
  
  .topic-author-sidebar {
    width: 100%;
    padding: 0;
  }
  
  .topic-author-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    width: 100%;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
  }
  
  .topic-author-badges {
    gap: 6px;
  }
  
  .topic-author-rank {
    font-size: 10px;
    padding: 3px 8px;
  }
  
  .topic-author-badges {
    flex-wrap: nowrap;
    justify-content: flex-start;
  }
  
  .topic-categories-badges {
    display: none; /* Mobil görünümde header'daki kategori badge'lerini gizle */
  }
  
  .topic-categories-mobile {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 16px;
    background: var(--muted);
    border-top: 1px solid var(--border);
  }
  
  .topic-category-badge-mobile {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: var(--bg-card);
    color: var(--primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s;
  }
  
  .topic-category-badge-mobile:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
  }
  
  .topic-category-badge-mobile .icon-svg {
    width: 12px;
    height: 12px;
    object-fit: contain;
    display: block;
    filter: brightness(0) invert(1);
  }
  
  .topic-author-rank {
    order: 1;
  }
  
  .topic-author-avatar {
    width: 65px;
    height: 65px;
    flex-shrink: 0;
  }
  
  .topic-author-avatar-placeholder {
    font-size: 26px;
  }
  
  .topic-author-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    flex: 1;
    min-width: 0;
    overflow: hidden;
  }
  
  .topic-author-username {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  
  .topic-author-rank {
    margin-top: 0;
    font-size: 11px;
    padding: 4px 9px;
  }
  
  .topic-title {
    font-size: 18px;
  }
  
  .topic-header-top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  
  .topic-meta {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
  }
  
  .comment-author-avatar {
    width: 32px;
    height: 32px;
  }
  
  .comment-author-avatar-placeholder {
    font-size: 14px;
  }
  
  .comment-author-username {
    font-size: 13px;
  }
  
  .comment-author-rank {
    font-size: 10px;
    padding: 3px 8px;
  }
  
  .comment-date-meta {
    font-size: 11px;
  }
  
  .comment-content {
    padding: 12px 12px 12px 12px;
  }
}
