/* ===========================================
   TOPIC DETAIL PAGE STYLES
   =========================================== */

.topic-detail-page {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px 32px;
  box-sizing: border-box;
}

.topic-detail-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  margin-top: 16px;
}

.topic-main-content {
  min-width: 0;
  width: 100%;
}

/* Topic Header Banner */
.topic-header-banner {
  background-color: #1a1a2e;
  background-size: cover;
  background-position: center;
  border-radius: 23px 23px 0 0;
  overflow: hidden;
}

.topic-header-overlay {
  background: linear-gradient(180deg, rgba(26, 26, 46, 0.6) 0%, rgba(26, 26, 46, 0.9) 100%);
  padding: 24px 32px 0;
  display: flex;
  flex-direction: column;
}

.topic-header-content {
  color: #ffffff;
}

.topic-category-badge {
  display: inline-block;
  background: rgba(0, 184, 122, 0.2);
  color: #00B87A;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 12px;
  border: 1px solid rgba(0, 184, 122, 0.3);
}

.topic-title {
  font-family: inherit;
  font-size: 28px;
  font-weight: 600;
  margin: 0 0 8px 0;
  line-height: 1.2;
}

.topic-description {
  font-family: inherit;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.8);
  margin: 0 0 16px 0;
  line-height: 1.5;
  max-width: 600px;
}

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

.topic-creator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topic-creator-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  overflow: hidden;
}

.topic-creator-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.topic-creator-name {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}

.topic-stats {
  display: flex;
  gap: 16px;
}

.topic-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
}

.topic-stat svg {
  opacity: 0.8;
}

.topic-participants {
  display: flex;
  align-items: center;
  margin-top: 16px;
  gap: -8px;
}

.participant-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 2px solid #1a1a2e;
  margin-left: -8px;
  overflow: hidden;
}

.participant-avatar:first-child {
  margin-left: 0;
}

.participant-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.more-participants {
  margin-left: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

/* Add Story Button */
.topic-add-story-overlay {
  display: flex;
  justify-content: flex-end;
  padding: 0 32px 20px 0;
}

.add-story-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: linear-gradient(135deg, #00A778, #008F65);
  color: #fff;
  border: none;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 167, 120, 0.3);
}

.add-story-btn:hover {
  background: linear-gradient(135deg, #008F65, #007A56);
  box-shadow: 0 4px 12px rgba(0, 167, 120, 0.4);
  transform: translateY(-1px);
}

.add-story-btn:active {
  transform: translateY(0);
}

.add-story-btn svg {
  flex-shrink: 0;
}

/* Story Modal */
.story-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.story-modal {
  background: #F5F5F7;
  border-radius: 20px;
  width: 520px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  padding: 12px 20px 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.25s ease;
}

.story-modal-guidelines {
  padding: 0;
  width: 480px;
  overflow: hidden;
}

.story-modal-guidelines .cpm-guidelines-sheet {
  padding: 16px 20px 20px;
}

.story-drag-handle {
  width: 36px;
  height: 4px;
  background: #CCC;
  border-radius: 2px;
  margin: 0 auto 12px;
}

.story-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.story-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #EDEDEF;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}

.story-close-btn:hover {
  background: #DDDDE0;
}

.story-feeling-wrapper {
  position: relative;
}

.story-feeling-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #fff;
  border: 1.5px solid #E0E0E4;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  transition: border-color 0.15s;
}

.story-feeling-pill:hover {
  border-color: #CCC;
}

.story-feeling-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.story-feeling-text {
  font-size: 14px;
  color: #333;
}

.story-feeling-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  border: 1px solid #E8E8EC;
  width: 380px;
  z-index: 100;
  overflow: hidden;
}

.story-feeling-dropdown-scroll {
  max-height: 340px;
  overflow-y: auto;
  padding: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.story-feeling-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  border-radius: 8px;
  transition: background 0.12s;
}

.story-feeling-option:hover {
  background: #F0F0F4;
}

.story-feeling-active {
  background: #EDE9FE;
}

.story-feeling-option-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.story-info-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.story-info-btn:hover {
  background: #EDEDEF;
}

.story-guidelines-popup {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid #E8E8EC;
}

.story-guidelines-popup p {
  margin: 0 0 8px;
  font-size: 14px;
  color: #333;
}

.story-guidelines-popup ul {
  margin: 0 0 12px;
  padding-left: 20px;
}

.story-guidelines-popup li {
  font-size: 13px;
  color: #666;
  margin-bottom: 4px;
}

.story-guidelines-close {
  background: #7C5CFC;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.story-error {
  background: #FFF0F0;
  color: #D32F2F;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 10px;
}

.story-topic-label {
  font-size: 14px;
  color: #333;
  margin-bottom: 12px;
  padding: 0 2px;
  direction: auto;
}

.story-topic-prefix {
  color: #00A778;
  font-weight: 600;
}

.story-textarea-wrapper {
  background: #fff;
  border: 1.5px solid #E0E0E4;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 6px;
  position: relative;
}

.story-textarea {
  width: 100%;
  min-height: 200px;
  border: none;
  outline: none;
  resize: none;
  font-size: 15px;
  line-height: 1.55;
  color: #333;
  background: transparent;
  font-family: inherit;
}

.story-textarea::placeholder {
  color: #B0B4BC;
}

.story-char-count {
  text-align: right;
  font-size: 13px;
  color: #B0B4BC;
  margin-top: 8px;
}

.story-char-count .story-char-met {
  color: #333;
  font-weight: 500;
}

.story-divider {
  height: 1px;
  background: #E0E0E4;
  margin: 14px 0;
}

.story-adult-section {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}

.story-adult-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.story-adult-label {
  font-size: 15px;
  font-weight: 600;
  color: #333;
}

.story-toggle {
  width: 46px;
  height: 26px;
  border-radius: 13px;
  background: #DDDDE0;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
}

.story-toggle-on {
  background: #7C5CFC;
}

.story-toggle-knob {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.story-toggle-on .story-toggle-knob {
  transform: translateX(20px);
}

.story-adult-desc {
  font-size: 13px;
  color: #888;
  margin: 6px 0 0;
  line-height: 1.4;
}

.story-share-btn {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: none;
  background: #EDEDEF;
  color: #B0B4BC;
  font-size: 16px;
  font-weight: 600;
  cursor: not-allowed;
  transition: all 0.2s;
}

.story-share-active {
  background: #00B87A;
  color: #fff;
  cursor: pointer;
}

.story-share-active:hover {
  background: #00A06A;
}

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

/* Topic Posts Section */
.topic-posts-section {
  margin-top: 24px;
}

.topic-posts-container {
  background: var(--bg-white);
  border-radius: 16px;
  padding: 0 20px;
  margin-top: 24px;
}

.topic-posts-container .post-card {
  border-bottom: 1px solid var(--border-light);
  padding: 16px 0;
}

.topic-posts-container .post-card:last-child {
  border-bottom: none;
}

.topic-posts-section .section-title {
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-black);
  margin: 0 0 20px 0;
}

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

.topic-post-card {
  background: var(--bg-main);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.topic-post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.topic-post-link {
  display: block;
  padding: 16px;
  text-decoration: none;
  color: inherit;
}

.topic-post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.topic-post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  overflow: hidden;
}

.topic-post-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.topic-post-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topic-post-author {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-black);
  display: flex;
  align-items: center;
  gap: 6px;
}

.topic-post-author .author-flag {
  font-size: 12px;
}

.topic-post-date {
  font-size: 12px;
  color: var(--text-gray);
}

.topic-post-content {
  margin-bottom: 12px;
}

.topic-post-content p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-black);
  margin: 0;
}

.topic-post-footer {
  display: flex;
  gap: 16px;
}

.topic-post-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-gray);
}

.topic-post-stat svg {
  opacity: 0.7;
}

.no-posts-message {
  padding: 32px 20px;
  text-align: center;
}

.no-posts-message p {
  font-size: 15px;
  color: var(--text-gray);
  margin: 0;
}

/* Topic Sidebar */
.topic-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.topic-sidebar .sidebar-section {
  background: var(--bg-white);
  border-radius: 16px;
  padding: 20px;
}

.topic-sidebar .sidebar-title {
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-black);
  margin: 0 0 12px 0;
}

.topic-sidebar .sidebar-description {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-gray);
  margin: 0 0 16px 0;
}

.topic-sidebar .sidebar-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}

.topic-sidebar .stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  padding: 12px;
  background: var(--bg-main);
  border-radius: 8px;
}

.topic-sidebar .stat-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-black);
}

.topic-sidebar .stat-label {
  font-size: 12px;
  color: var(--text-gray);
  margin-top: 2px;
}

.topic-sidebar .sidebar-created {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

.topic-sidebar .guidelines-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.topic-sidebar .guidelines-list li {
  font-size: 13px;
  color: var(--text-gray);
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.topic-sidebar .guidelines-list li:before {
  content: "•";
  color: var(--topic-badge-border);
}

.topic-sidebar .guidelines-list li:last-child {
  border-bottom: none;
}

/* Related Topics Section */
.related-topics-section {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: 24px;
  padding: 15px 0 0 0;
  overflow: hidden;
}

.related-topics-header {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 15px 10px 15px;
}

.related-topics-header .sidebar-title {
  font-family: inherit;
  font-size: 16px;
  font-weight: 510;
  color: #0F1B31;
  letter-spacing: -0.32px;
  line-height: 1.3;
  margin: 0;
}

.related-topics-header .fire-icon {
  font-size: 20px;
}

.related-topics-list {
  display: flex;
  flex-direction: column;
}

.related-topic-card {
  padding: 16px 15px;
  border-top: 1px solid #DBE0E8;
}

.related-topic-author {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.related-topic-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.related-topic-avatar img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.related-topic-avatar .fruit-icon {
  width: 20px;
  height: 20px;
}

.related-topic-username {
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  color: #0F1B31;
  line-height: 1.5;
}

.related-topic-title {
  display: block;
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  color: #0F1B31;
  line-height: 18px;
  text-decoration: none;
  margin-bottom: 8px;
}

.related-topic-title:hover {
  color: var(--accent-purple);
}

.related-topic-description {
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  color: #4b5563;
  line-height: 1.6;
  margin: 0 0 8px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-topic-stats {
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  color: #7C8696;
  line-height: 1.6;
  margin: 0;
}

.related-topic-stats .stat-dot {
  margin: 0 8px;
}

/* Web Footer */
.web-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0;
  margin-top: 32px;
  position: relative;
  width: 318px;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0;
  width: 318px;
}

.footer-links-text {
  width: 318px;
  font-family: inherit;
  font-style: normal;
  font-weight: 400;
  font-size: 12px;
  line-height: 24px;
  color: #000000;
  opacity: 0.5;
  margin: 0;
}

.language-button {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0;
  gap: 4px;
  width: 72px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-style: normal;
  font-weight: 400;
  font-size: 12px;
  line-height: 24px;
  color: #000000;
  opacity: 0.5;
}

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

.footer-copyright {
  width: 318px;
  font-family: inherit;
  font-style: normal;
  font-weight: 400;
  font-size: 12px;
  line-height: 16px;
  color: #000000;
  opacity: 0.5;
  margin: 16px 0 0 0;
}

.language-button .chevron-icon {
  transform: rotate(90deg);
  opacity: 0.5;
}

.footer-language-links {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.footer-copyright {
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  color: rgba(0, 0, 0, 0.5);
  line-height: 16px;
  margin: 0;
}

/* Responsive Topic Detail */
@media (max-width: 900px) {
  .topic-detail-layout {
    grid-template-columns: 1fr;
  }
  
  .topic-sidebar {
    display: none;
  }
  
  .topic-header-overlay {
    padding: 20px;
  }
  
  .topic-title {
    font-size: 22px;
  }
  
  .topic-meta-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

