/* CSS Reset and Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #dae0e6;
  --color-white: #ffffff;
  --color-text: #1c1c1c;
  --color-text-secondary: #787c7e;
  --color-text-muted: #878a8c;
  --color-border: #ccc;
  --color-border-light: #edeff1;
  --color-primary: #0079d3;
  --color-primary-hover: #006cbd;
  --color-hover: #f6f7f8;
  --color-category: #898989;
  --color-modal-bg: rgba(0, 0, 0, 0.5);
  --nav-height: 48px;
  --sidebar-width: 270px;
  --right-sidebar-width: 312px;
  --border-radius: 4px;
  --box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --color-card: var(--color-white);
--color-card-bg: var(--color-white);
}

/* Dark Theme */
[data-theme="dark"] {
  --color-bg: #030303;
  --color-white: #1a1a1b;
  --color-text: #d7dadc;
  --color-text-secondary: #b0b3b8;
  --color-text-muted: #8a8d91;
  --color-border: #343536;
  --color-border-light: #343536;
  --color-hover: #272729;
  --color-category: #6b6c6d;
  --color-modal-bg: rgba(0, 0, 0, 0.7);
}

html {
  font-size: 14px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100vh;
}

/* Top Navigation Bar */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background-color: var(--color-white);
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--color-text);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
}

.logo:hover {
  color: var(--color-primary-hover);
}

.logo-img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.nav-center {
  flex: 1;
  max-width: 600px;
  margin: 0 24px;
}

.search-container {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
}

.search-bar {
  width: 100%;
  height: 36px;
  padding: 8px 12px 8px 40px;
  border: 1px solid var(--color-border-light);
  border-radius: 20px;
  background-color: var(--color-hover);
  font-size: 0.875rem;
  color: var(--color-text);
  transition: border-color 0.2s, background-color 0.2s;
}

.search-bar:focus {
  outline: none;
  border-color: var(--color-primary);
  background-color: var(--color-white);
}

.search-bar::placeholder {
  color: var(--color-text-muted);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Theme Toggle */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--border-radius);
  background-color: var(--color-white);
  cursor: pointer;
  color: var(--color-text);
  transition: background-color 0.2s;
}

.theme-toggle-btn:hover {
  background-color: var(--color-hover);
}

.theme-icon {
  display: none;
}

[data-theme="light"] .sun-icon {
  display: block;
}

[data-theme="dark"] .moon-icon {
  display: block;
}

/* Auth Buttons */
.auth-buttons {
  display: flex;
  gap: 8px;
}

.auth-btn {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.login-btn {
  background-color: transparent;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
}

.login-btn:hover {
  background-color: rgba(0, 121, 211, 0.1);
}

/* User Menu */
.user-menu {
  position: relative;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--border-radius);
  background-color: var(--color-white);
  cursor: pointer;
  color: var(--color-text);
  font-size: 0.875rem;
}

.user-menu-btn:hover {
  background-color: var(--color-hover);
}

.username {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background-color: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  display: none;
  min-width: 150px;
  z-index: 200;
}

.user-dropdown.active {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  color: var(--color-text);
  font-size: 0.875rem;
  cursor: pointer;
  text-align: left;
}

.dropdown-item:hover {
  background-color: var(--color-hover);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-modal-bg);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  position: relative;
  background-color: var(--color-white);
  border-radius: 8px;
  padding: 32px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 4px;
}

.modal-close:hover {
  color: var(--color-text);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--color-text);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.form-group input {
  padding: 10px 12px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  background-color: var(--color-white);
  color: var(--color-text);
}

.form-group input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.form-group select {
  padding: 10px 12px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  background-color: var(--color-white);
  color: var(--color-text);
  cursor: pointer;
}

.form-group select:focus {
  outline: none;
  border-color: var(--color-primary);
}

.form-submit {
  padding: 12px 20px;
  min-width: 100px;
  background-color: var(--color-primary);
  border: none;
  border-radius: 20px;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  margin-top: 8px;
}

.form-submit:hover {
  background-color: var(--color-primary-hover);
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.auth-switch button {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.auth-switch button:hover {
  text-decoration: underline;
}

/* Forgot Password Styles */
.forgot-password-link {
  text-align: center;
  margin-top: 12px;
}

.forgot-password-link button {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 0.875rem;
  cursor: pointer;
}

.forgot-password-link button:hover {
  text-decoration: underline;
}

.forgot-password-desc {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.reset-success {
  text-align: center;
  color: #22c55e;
  font-size: 0.875rem;
  margin-top: 16px;
  padding: 12px;
  background-color: rgba(34, 197, 94, 0.1);
  border-radius: var(--border-radius);
}

.back-to-login {
  text-align: center;
  margin-top: 16px;
}

.back-to-login button {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 0.875rem;
  cursor: pointer;
}

.back-to-login button:hover {
  text-decoration: underline;
}

/* Main Container */
.main-container {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr var(--right-sidebar-width);
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
  padding: calc(var(--nav-height) + 20px) 24px 20px;
  min-height: 100vh;
}

/* Left Sidebar */
.left-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 20px);
  height: fit-content;
  max-height: calc(100vh - var(--nav-height) - 40px);
  overflow-y: auto;
  background-color: var(--color-white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border-light);
}

.sidebar-header h3 {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
}

.close-sidebar-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
  padding: 4px;
}

.sidebar-nav {
  padding: 8px 0;
}

.category-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--color-border-light);
}

.category-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-category);
  padding: 8px 16px 4px;
}

.nav-item {
  padding: 10px 16px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.nav-item:hover {
  background-color: var(--color-hover);
}

.nav-item.active {
  background-color: var(--color-border-light);
  border-left: 3px solid var(--color-primary);
}

.nav-item-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item-title {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-text);
}

.nav-item-desc {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

/* Center Feed */
.center-feed {
  min-width: 0;
}

.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--color-white);
  padding: 12px 16px;
  border-radius: var(--border-radius);
  margin-bottom: 16px;
  box-shadow: var(--box-shadow);
}

.feed-header h2 {
  font-size: 1rem;
  font-weight: 600;
}

.feed-tabs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  }

.feed-sort {
  display: flex;
  gap: 4px;
}

.sort-btn {
  padding: 6px 12px;
  border: none;
  background: none;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.sort-btn:hover {
  background-color: var(--color-hover);
}

.sort-btn.active {
  background-color: var(--color-border-light);
  color: var(--color-text);
}

/* Language Tabs */
.feed-language-tabs {
  display: flex;
  gap: 4px;
}

.lang-tab {
  padding: 6px 12px;
  border: none;
  background: none;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.lang-tab:hover {
  background-color: var(--color-hover);
}

.lang-tab.active {
  background-color: var(--color-border-light);
  color: var(--color-text);
}

/* Activity Tabs */
.feed-activity-tabs {
  display: flex;
  gap: 4px;
}

.activity-tab {
  padding: 6px 12px;
  border: none;
  background: none;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.activity-tab:hover {
  background-color: var(--color-hover);
}

.activity-tab.active {
  background-color: var(--color-border-light);
  color: var(--color-text);
}

.posts-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Post Card */
.post-card {
  display: flex;
  background-color: var(--color-white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  border: 1px solid var(--color-border-light);
  transition: border-color 0.15s;
  overflow: hidden;
}

.post-card:hover {
  border-color: var(--color-border);
  cursor: pointer;
}

.post-card:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.post-content {
  flex: 1;
  padding: 12px;
  min-width: 0;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.post-category {
  background-color: var(--color-border-light);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.post-author {
  color: var(--color-text);
  font-weight: 500;
}

.post-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 10px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

/* ... 상세보기 버튼 */
.post-readmore {
  display: none;           /* ✅ 기본은 숨김 (JS가 보여줌) */

  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;

  font-weight: 400;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.post-readmore:hover {
  text-decoration: underline;    /* 호버만 살짝 */
}

.post-image-container {
  margin: 12px 0;
}

.post-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  object-fit: cover;
}

.post-preview {
  position: relative;       /* ✅ 추가 */
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  white-space: pre-line;
}

/* ✅ more를 ellipsis 대신 보이게 만드는 세트 */
.post-preview.has-more .post-preview-content.is-clamped {
  padding-right: 3.5em; /* more 자리 확보 */
}

/* ✅ ellipsis 영역을 배경으로 덮어서 점(...)을 숨김 */
.post-preview.has-more::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 4.2em;     /* more + 여백 */
  height: 1.6em;    /* 한 줄 높이 */
  background: var(--color-white); /* 카드 배경 */
}

/* ✅ more를 오른쪽 아래에 “덮어서” 올리기 */
.post-preview.has-more .post-readmore {
  display: inline;
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 2;
}

.post-preview-content.is-clamped {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 8;
  overflow: hidden;
}

/* preview 내부 기본 margin 제거 → more 위치 정상화 */
.post-preview-content h1,
.post-preview-content h2,
.post-preview-content h3,
.post-preview-content h4,
.post-preview-content h5,
.post-preview-content h6,
.post-preview-content p {
  margin: 0;
}

.post-preview-content ul,
.post-preview-content ol {
  margin: 0;
  padding-left: 1.2em;
}

.post-preview-content li {
  margin: 0;
}


.post-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: none;
  background: none;
  border-radius: 2px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background-color 0.15s;
}

.action-btn:hover {
  background-color: var(--color-hover);
}

.action-btn svg {
  width: 16px;
  height: 16px;
}

/* Like Button */
.like-btn {
  transition: color 0.15s;
}

.like-btn.liked {
  color: #e74c3c;
}

.like-btn:hover {
  color: #e74c3c;
}

.like-count {
  margin-left: 2px;
}

/* Save Button */
.save-btn {
  transition: color 0.15s;
}

.save-btn.saved {
  color: #f59e0b;
}

.save-btn:hover {
  color: #f59e0b;
}

/* View Count */
.view-count-display {
  cursor: default;
  color: var(--color-text-muted);
}

.view-count-display:hover {
  background-color: transparent;
}

.right-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 20px);

  /* ✅ 핵심 */
  max-height: calc(100vh - var(--nav-height) - 40px);
  overflow-y: auto;

  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-box {
  background-color: var(--color-white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
}

.sidebar-box-title {
  font-size: 0.875rem;
  font-weight: 600;
  padding: 12px 16px;
  background-color: var(--color-primary);
  color: #fff;
}

.sidebar-box-content {
  padding: 16px;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.community-stats {
  display: flex;
  gap: 24px;
  padding: 0 16px 16px;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.rules-list {
  padding: 16px;
  padding-left: 32px;
  margin: 0;
}

.rules-list li {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
  line-height: 1.5;
}

.rules-list li:last-child {
  margin-bottom: 0;
}

/* Contact Us Box */
.instagram-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
}

.instagram-link:hover {
  text-decoration: underline;
}

.instagram-icon {
  flex-shrink: 0;
}

/* Mobile Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 150;
}

.sidebar-overlay.active {
  display: block;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  background-color: var(--color-white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

.empty-state h3 {
  font-size: 1.125rem;
  color: var(--color-text);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Responsive Design */
@media (max-width: 1200px) {
  .main-container {
    grid-template-columns: var(--sidebar-width) 1fr;
  }

  .right-sidebar {
    display: none;
  }
}

@media (max-width: 900px) {
  .main-container {
    grid-template-columns: 1fr;
    padding: calc(var(--nav-height) + 16px) 16px 16px;
  }

  .mobile-menu-btn {
    display: block;
  }

  .left-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    z-index: 200;
    transition: left 0.3s ease;
  }

  .left-sidebar.active {
    left: 0;
  }

  .close-sidebar-btn {
    display: block;
  }

  .nav-center {
    margin: 0 12px;
  }

  .feed-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (max-width: 700px) {
  .auth-buttons {
    display: none;
  }

  .auth-buttons.mobile-visible {
    display: flex;
  }
}

@media (max-width: 600px) {
  .top-nav {
    padding: 0 12px;
  }

  .logo {
    font-size: 1.25rem;
  }

  .nav-center {
    margin: 0 8px;
  }

  .search-bar {
    height: 32px;
    font-size: 0.8125rem;
  }

  .post-title {
    font-size: 1rem;
  }

  .post-actions {
    gap: 8px;
  }
}

/* Scrollbar Styling */
.left-sidebar::-webkit-scrollbar {
  width: 8px;
}

.left-sidebar::-webkit-scrollbar-track {
  background: var(--color-hover);
}

.left-sidebar::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

.left-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* Inline Post Detail View */
.post-detail-inline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background-color: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: var(--border-radius);
  color: var(--color-text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s;
  width: fit-content;
}

.back-btn:hover {
  background-color: var(--color-hover);
}

.post-detail-card {
  background-color: var(--color-white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
}

.post-detail-header {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--color-border-light);
}

.post-detail-main {
  flex: 1;
}

.post-detail-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.post-detail-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 16px;
  line-height: 1.4;
}

.post-detail-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 16px;
}

.post-detail-body {
  font-size: 0.875rem;                 /* 피드 미리보기와 동일 */
  color: var(--color-text-secondary);  /* 피드 미리보기와 동일 */
  line-height: 1.5;                    /* 피드 미리보기와 동일 */
  white-space: pre-line;               /* 피드 미리보기와 동일 */
}

.post-detail-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border-light);
}

/* Comments Section */
.comments-section {
  padding: 16px;
  border-top: 1px solid var(--color-border-light);
}

.comments-header {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 16px;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.comment-input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  background-color: var(--color-white);
  color: var(--color-text);
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

.comment-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.comment-submit {
  align-self: flex-end;
  padding: 8px 16px;
  background-color: var(--color-primary);
  border: none;
  border-radius: 20px;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.comment-submit:hover {
  background-color: var(--color-primary-hover);
}

.comment-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.comment-item {
  padding: 12px;
  background-color: var(--color-hover);
  border-radius: var(--border-radius);
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.comment-author {
  font-weight: 600;
  color: var(--color-text);
}

.comment-text {
  font-size: 0.875rem;
  color: var(--color-text);
  line-height: 1.5;
}

.no-comments {
  text-align: center;
  padding: 24px;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* My Page Button */
/* Profile Button (circular) */
.profile-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background-color: var(--color-hover);
  border: 1px solid var(--color-border-light);
  border-radius: 50%;
  color: var(--color-text);
  font-size: 1.125rem;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
  overflow: hidden;
}

.profile-btn:hover {
  background-color: var(--color-border-light);
  border-color: var(--color-text-muted);
}

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.follow-toggle-btn {
  padding: 8px 14px;
  border-radius: 9999px;
  border: none;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.follow-toggle-btn.is-following {
  background: transparent;
  border: 1px solid var(--color-border-light);
  color: var(--color-text);
}

/* Notification Button */
.notification-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background-color: transparent;
  border: 1px solid var(--color-border-light);
  border-radius: 50%;
  color: var(--color-text);
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.notification-btn:hover {
  background-color: var(--color-hover);
  border-color: var(--color-text-muted);
}

/* My Page View */
.my-page-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.my-page-card {
  background-color: var(--color-white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 24px;
}

.my-page-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 20px;
  text-align: center;
}

.my-page-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border-light);
}

.my-page-stats .stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.my-page-stats .stat-number {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
}

.my-page-stats .stat-label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.my-page-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 400px;
  margin: 0 auto;
}

.my-page-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.my-page-form label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.my-page-form input {
  padding: 10px 12px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--border-radius);
  font-size: 0.9375rem;
  background-color: var(--color-white);
  color: var(--color-text);
}

.my-page-form input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.my-page-form .form-submit {
  margin-top: 8px;
  padding: 12px;
  background-color: var(--color-primary);
  border: none;
  border-radius: 20px;
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

.my-page-form .form-submit:hover {
  background-color: var(--color-primary-hover);
}

/* Profile Page Header */
.profile-header-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border-light);
  border-radius: 12px;
  margin-bottom: 16px;
}

.profile-avatar-wrapper {
  flex-shrink: 0;
  position: relative;
}

.profile-avatar-large {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--color-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid var(--color-border-light);
}

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

.profile-avatar-large svg {
  color: var(--color-text-muted);
}

/* Clickable Avatar for Upload */
.profile-avatar-clickable {
  cursor: pointer;
  position: relative;
}

.profile-avatar-clickable:hover {
  opacity: 0.9;
}

.avatar-edit-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  border-bottom-left-radius: 50%;
  border-bottom-right-radius: 50%;
}

.avatar-edit-overlay svg {
  color: white;
}

.profile-avatar-clickable:hover .avatar-edit-overlay {
  opacity: 1;
  }

/* Camera overlay for avatar on My Profile */
.avatar-camera-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s ease;
  cursor: pointer;
}

.avatar-camera-overlay svg {
  color: white;
}

.profile-avatar-clickable:hover .avatar-camera-overlay {
  opacity: 1;
}

/* Avatar action item danger style */
.avatar-action-danger {
  color: #dc3545;
}

.avatar-action-danger:hover {
  background-color: rgba(220, 53, 69, 0.1);
}

.profile-info {
  flex: 1;
  min-width: 0;
}

.profile-display-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
}

.profile-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  }
  
  .profile-header-actions .theme-toggle-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  color: var(--color-text);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
  }
  
  .profile-header-actions .theme-toggle-btn:hover {
  background-color: var(--color-hover);
  border-color: var(--color-border);
  }

.logout-btn-header {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  color: var(--color-text);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
  }
  
  .logout-btn-header:hover {
  background-color: var(--color-hover);
  border-color: var(--color-border);
  }

/* Chat button for other user profiles - blue pill with white text */
.logout-btn-header.chat-btn {
  background-color: var(--color-primary);
  border: none;
  border-radius: 9999px;
  color: #fff;
  padding: 10px 24px;
  font-size: 0.875rem;
  font-weight: 600;
}

.logout-btn-header.chat-btn:hover {
  background-color: var(--color-primary-hover);
}

/* Profile Tabs */
.profile-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--color-border-light);
  padding-bottom: 12px;
}

.profile-tab {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--color-border-light);
  border-radius: 20px;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.profile-tab:hover {
  background: var(--color-hover);
  color: var(--color-text);
}

.profile-tab.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

/* Profile Tab Content */
.profile-tab-content {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border-light);
  border-radius: 12px;
  padding: 20px;
}

.empty-tab-message {
  text-align: center;
  color: var(--color-text-muted);
  padding: 40px 20px;
  font-size: 0.9rem;
}

/* Saved Posts List */
.saved-posts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.saved-post-item {
  padding: 12px 16px;
  background: var(--color-hover);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.saved-post-item:hover {
  background: var(--color-border-light);
}

.saved-post-title {
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 4px;
}

.saved-post-meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* My Comments List */
.my-comments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.my-comment-item {
  padding: 12px 16px;
  background: var(--color-hover);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.my-comment-item:hover {
  background: var(--color-border-light);
}

.my-comments-list .comment-text {
  color: var(--color-text);
  margin-bottom: 4px;
  line-height: 1.4;
}

.my-comments-list .comment-meta {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* Form Field Helper */
.field-helper {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.field-error {
  display: block;
  font-size: 0.75rem;
  color: #ef4444;
  margin-top: 4px;
}

.required {
  color: #ef4444;
}

/* Feed Title Row */
.feed-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Create Post Button */
.create-post-btn {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.1s;
}

.create-post-btn:hover {
  background: var(--color-primary-hover, #0056b3);
  transform: translateY(-1px);
}

.create-post-btn svg {
  flex-shrink: 0;
}

/* Topic Tabs */
.feed-topic-tabs {
  display: none;
  gap: 8px;
  flex-wrap: wrap;
}

.topic-tab {
  padding: 6px 14px;
  border: 1px solid var(--color-border-light);
  border-radius: 16px;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.topic-tab:hover {
  background: var(--color-hover);
  color: var(--color-text);
}

.topic-tab.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

/* Create Post Modal */
.create-post-modal {
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

.create-post-modal .form-group {
  margin-bottom: 16px;
}

.create-post-modal textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  background: var(--color-card-bg);
  color: var(--color-text);
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  min-height: 150px;
}

.create-post-modal textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.create-post-modal select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  background: var(--color-card-bg);
  color: var(--color-text);
  font-size: 0.95rem;
  cursor: pointer;
}

.create-post-modal select:focus {
  outline: none;
  border-color: var(--color-primary);
  }

/* Create Post Modal Button Sizing - make Cancel and Create buttons identical */
.create-post-modal .form-actions .form-cancel,
.create-post-modal .form-actions .form-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  height: 44px;
  padding: 0 20px;
  margin-top: 0;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: 20px;
  box-sizing: border-box;
}

.create-post-modal .form-actions .form-cancel {
  border-color: var(--color-border-light);
}
  
  /* Image Upload Area */
.image-upload-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.image-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--color-hover);
  border: 1px dashed var(--color-border-light);
  border-radius: 8px;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s;
  width: fit-content;
}

.image-upload-btn:hover {
  background: var(--color-border-light);
  color: var(--color-text);
}

.image-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.image-preview-item {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
}

.image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Form Actions */
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.form-cancel {
  padding: 12px 20px;
  min-width: 100px;
  background: transparent;
  border: 1px solid var(--color-border-light);
  border-radius: 20px;
  color: var(--color-text);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.15s;
  }

.form-cancel:hover {
  background: var(--color-hover);
}

/* Chat Button in Header */
.chat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background-color: transparent;
  border: 1px solid var(--color-border-light);
  border-radius: 50%;
  color: var(--color-text);
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
  }
  
  .chat-btn:hover {
  background-color: var(--color-hover);
  border-color: var(--color-text-muted);
  }

/* Profile Stats Inline */
.profile-stats-inline {
  display: flex;
  gap: 16px;
  margin-top: 4px;
}

.profile-stat-item {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.profile-stat-item strong {
  color: var(--color-text);
  font-weight: 600;
}

/* Posts Sort Row */
.posts-sort-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.posts-sort-btn {
  padding: 6px 14px;
  border: 1px solid var(--color-border-light);
  border-radius: 16px;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.posts-sort-btn:hover {
  background: var(--color-hover);
  color: var(--color-text);
}

.posts-sort-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
  }

/* Comments Sort Row - matches Posts sort styling */
.comments-sort-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.comments-sort-btn {
  padding: 6px 14px;
  border: 1px solid var(--color-border-light);
  border-radius: 16px;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.comments-sort-btn:hover {
  background: var(--color-hover);
  color: var(--color-text);
}

.comments-sort-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

/* Comment item footer with meta and like button */
.comment-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

/* Comment Like Button - matches post like styling */
.comment-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
}

.comment-like-btn:hover {
  background: var(--color-hover);
  color: var(--color-text);
}

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

.comment-like-btn svg {
  flex-shrink: 0;
}

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

/* Comment actions row in post detail */
.comment-actions {
  display: flex;
  align-items: center;
  margin-top: 8px;
}
  
  /* My Posts List */
.my-posts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.my-post-item {
  padding: 12px 16px;
  background: var(--color-hover);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.my-post-item:hover {
  background: var(--color-border-light);
}

.my-post-title {
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 6px;
}

.my-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.my-post-meta span:not(:last-child)::after {
  content: "•";
  margin-left: 8px;
}

/* Clickable Author */
.clickable-author {
  cursor: pointer;
  font-weight: 500;
  color: var(--color-text);
  transition: color 0.15s;
}

.clickable-author:hover {
  color: var(--color-primary);
  text-decoration: underline;
  }

/* Author with Avatar */
.author-with-avatar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.author-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.author-avatar-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.6rem;
  font-weight: 600;
}
  
  /* Chat Button in Profile Header */
.chat-btn-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--color-primary);
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s;
}

.chat-btn-header:hover {
  background: var(--color-primary-hover, #0056b3);
}

/* Avatar Crop Modal */
.avatar-crop-modal {
  width: 100%;
  max-width: 400px;
  padding: 24px;
}

.crop-instructions {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin-bottom: 20px;
}

.crop-container {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.crop-area {
  position: relative;
  width: 250px;
  height: 250px;
  overflow: hidden;
  background: var(--color-hover);
  border-radius: 8px;
  cursor: grab;
}

.crop-area:active {
  cursor: grabbing;
}

.crop-image-wrapper {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  }
  
  .crop-image-wrapper img {
  display: block;
  user-select: none;
  pointer-events: none;
  max-width: none;
  max-height: none;
  }

.crop-circle-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 250px;
  height: 250px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  border: 2px solid white;
  }

.zoom-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
  color: var(--color-text-muted);
}

.zoom-slider {
  width: 150px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--color-border-light);
  border-radius: 2px;
  outline: none;
}

.zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  border: none;
}

.zoom-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  border: none;
}

/* Ensure profile images fill their containers */
.profile-btn img,
.profile-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Avatar Action Menu */
.avatar-action-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-white);
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 140px;
  z-index: 100;
  overflow: hidden;
  }

.avatar-action-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--color-text);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.15s;
  text-align: left;
}

.avatar-action-item:hover {
  background: var(--color-hover);
}

.avatar-action-item svg {
  flex-shrink: 0;
}

.avatar-action-remove {
  color: #dc3545;
}

.avatar-action-remove:hover {
  background: rgba(220, 53, 69, 0.1);
}

/* Kebab Menu (3-dot menu) */
.kebab-menu-container {
  position: relative;
}

.kebab-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.kebab-menu-btn:hover {
  background: var(--color-hover);
  color: var(--color-text);
}

.kebab-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--color-card);
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 120px;
  z-index: 200;
  overflow: hidden;
  display: none;
}

.kebab-menu.active {
  display: block;
}

.kebab-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  color: var(--color-text);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color 0.15s;
  text-align: left;
}

.kebab-menu-item:hover {
  background: var(--color-hover);
}

.kebab-menu-item svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.kebab-menu-item.danger {
  color: #dc3545;
}

.kebab-menu-item.danger:hover {
  background: rgba(220, 53, 69, 0.1);
}

/* Post card kebab menu positioning */
.post-content {
  position: relative;
}

.post-card .kebab-menu-container {
  position: absolute;
  top: 0;
  right: 0;
}

/* Post detail kebab menu positioning */
.post-detail-main {
  position: relative;
}

.post-detail-main > .kebab-menu-container {
  position: absolute;
  top: 0;
  right: 0;
}

/* Comment kebab menu positioning */
.comment-item {
  position: relative;
}

.comment-item .kebab-menu-container {
  position: absolute;
  top: 8px;
  right: 8px;
}

/* Report Modal */
.report-modal {
  max-width: 400px;
}

.report-desc {
  color: var(--color-text-muted);
  font-size: 0.875rem;
  margin-bottom: 16px;
}

/* Confirm Modal */
.confirm-modal {
  max-width: 380px;
  text-align: center;
  padding: 24px;
}

.confirm-modal .modal-title {
  margin-bottom: 12px;
}

.confirm-desc {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.confirm-modal .form-actions {
  justify-content: center;
}

/* Ensure Cancel and Delete buttons are exactly the same size */
.confirm-modal .form-cancel,
.confirm-modal .form-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  height: 44px;
  padding: 0 20px;
  margin-top: 0;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: 20px;
  box-sizing: border-box;
}

.confirm-modal .form-cancel {
  border-color: var(--color-border-light);
}

.form-submit-danger {
  background: #dc3545;
}

.form-submit-danger:hover {
  background: #c82333;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--color-card);
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 0.9rem;
  animation: slideIn 0.3s ease;
}

.toast.success {
  border-left: 4px solid #28a745;
}

.toast.error {
  border-left: 4px solid #dc3545;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Edit comment inline */
.comment-edit-form {
  margin-top: 8px;
}

.comment-edit-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-border-light);
  border-radius: 6px;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 0.9rem;
  resize: vertical;
  min-height: 60px;
}

.comment-edit-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.comment-edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  justify-content: flex-end;
}

.comment-edit-actions button {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
}

.comment-edit-cancel {
  background: transparent;
  border: 1px solid var(--color-border-light);
  color: var(--color-text-muted);
}

.comment-edit-save {
  background: var(--color-primary);
  border: none;
  color: white;
}

/* Post content editor */
.post-editor {
  min-height: 180px;        /* ⭐ 핵심 */
  padding: 12px;
  border: 2px solid #2563eb; /* 지금 보이는 파란 테두리 유지 */
  border-radius: 6px;
  font-size: 15px;
  line-height: 1.6;
  overflow-y: auto;
}

.post-editor:empty::before {
  content: attr(placeholder);
  color: #9ca3af;
  pointer-events: none;
}

.post-editor:focus {
  outline: none;
  border-color: #1d4ed8;
}

/* Modal 내부가 길어지면 스크롤 생기게 */
.modal {
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.post-full {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  white-space: pre-line;
}
.post-full p { margin: 0; } /* 원하면 간격도 피드처럼 */

/* ✅ Topbar profile avatar ONLY */
.profile-btn {
  overflow: hidden;
  line-height: 0;
}

#profileBtnContent {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-btn #profileBtnContent img {
  width: 100% !important;
  height: 100% !important;
  display: block;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
}

/* Dark mode: normalize ONLY Word-pasted inline colors */
[data-theme="dark"] .post-detail-body [style*="color"],
[data-theme="dark"] .post-detail-body [style*="color"] * ,
[data-theme="dark"] .post-preview [style*="color"],
[data-theme="dark"] .post-preview [style*="color"] * ,
[data-theme="dark"] .post-full [style*="color"],
[data-theme="dark"] .post-full [style*="color"] * {
  color: var(--color-text-secondary) !important;
}

/* Dark mode: normalize Word-pasted inline colors INSIDE editor too */
[data-theme="dark"] .post-editor [style*="color"],
[data-theme="dark"] .post-editor [style*="color"] * {
  color: var(--color-text-secondary) !important;
}

/* ===== Post image sizing (Reddit-like) ===== */
.post-image-wrap {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #0000000a;
}

/* ✅ 기본(상세 포함): 너무 길면 화면 기준으로 제한 */
.post-image-wrap img {
  display: block;
  width: 100%;
  height: auto;

  max-height: 70vh;     /* 상세는 크게 */
  object-fit: contain;
}

/* ✅ 피드(카드)에서는 더 작게 */
.post-card .post-image-wrap img {
  max-height: 45vh;     /* 추천: 35~55vh 사이에서 취향대로 */
}

/* ✅ (선택) 모바일에서는 더 작게 */
@media (max-width: 768px) {
  .post-card .post-image-wrap img {
    max-height: 38vh;
  }
}

/* 클릭 가능하게 */
.post-image-wrap img.clickable {
  cursor: zoom-in;
}

/* ===== Create Post modal image preview size ===== */
#imagePreviews img {
  width: 100%;
  max-height: 200px;   /* 핵심: 모달 길어지는 거 방지 */
  object-fit: contain; /* 이미지 안 잘리게 */
  border-radius: 10px;
  display: block;
  margin-top: 10px;
}