/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --bg: #f0f2f5;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #666666;
  --border: #e0e0e0;
  --primary: #ff6b8a;
  --primary-hover: #ff5277;
  --accent: #ffb6c1;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --header-bg: #333333;
  --header-text: #ffffff;
  --header-height: 64px;
  --max-width: 1400px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Noto Sans SC', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  color: var(--header-text);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.25rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.logo-icon {
  font-size: 1.5rem;
}

.search-form {
  flex: 1;
  max-width: 480px;
  display: flex;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 10px 40px 10px 40px;
  border: none;
  border-radius: 999px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 0.95rem;
  outline: none;
  transition: background 0.2s;
}

.search-input::placeholder {
  color: rgba(255,255,255,0.6);
}

.search-input:focus {
  background: rgba(255,255,255,0.25);
}

.search-icon-left {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-left: auto;
}

.close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: #fff;
  transition: background 0.2s;
}

.close-btn:hover {
  background: rgba(255,255,255,0.2);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 14px rgba(255,107,138,0.35);
}

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

.btn-ghost:hover {
  background: var(--bg);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

/* Language Switcher */
.lang-switcher {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: rgba(255,255,255,0.8);
}

.lang-btn:hover {
  background: var(--bg);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 280px;
  padding: 16px;
  display: none;
  flex-direction: column;
  gap: 12px;
  z-index: 150;
}

.lang-dropdown.active {
  display: flex;
}

.lang-section {
  display: flex;
  flex-direction: column;
}

.lang-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.lang-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.lang-select-btn {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  text-align: center;
  background: transparent;
  color: var(--text);
  transition: all 0.2s ease;
  font-weight: 500;
}

.lang-select-btn:hover {
  background: var(--bg);
  border-color: var(--primary);
}

.lang-select-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

.lang-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.content-lang-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.content-lang-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  padding: 4px 0;
  transition: opacity 0.2s;
  user-select: none;
}

.content-lang-checkbox-label input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

.content-lang-checkbox-label input[type="checkbox"]:disabled + span,
.content-lang-checkbox-label input[type="checkbox"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.content-lang-checkbox-label.content-lang-specific input[type="checkbox"]:disabled {
  opacity: 0.4;
}

.lang-dropdown-footer {
  margin-top: 4px;
}

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

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  color: #ffffff;
  transition: background 0.2s;
}
.user-menu-btn:hover {
  background: rgba(255,255,255,0.2);
}

.user-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 500;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  display: none;
  overflow: hidden;
}

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

.user-dropdown a,
.user-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  font-size: 0.9rem;
  color: var(--text);
  background: none;
}

.user-dropdown a:hover,
.user-dropdown button:hover {
  background: var(--bg);
}

.logout-form {
  margin: 0;
}

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 24px;
}

/* Home Layout */
.home-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.sidebar {
  width: 150px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--header-height) + 24px);
}

.main-content {
  flex: 1;
  min-width: 0;
}

/* Hero Bar */
.hero-bar {
  margin-bottom: 24px;
}

.tag-layered {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 48px;
  cursor: pointer;
}

.tag-layered-base {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  right: 20px;
  background: #fdf2f8; /* weak pink */
  border-radius: 999px;
  z-index: 1;
  padding-left: 12px;
  display: flex;
  align-items: center;
}

.tag-layered-hole {
  width: 12px;
  height: 12px;
  background: #f472b6; /* deep pink */
  border-radius: 50%;
}

.tag-layered-top {
  position: relative;
  margin-left: 36px;
  background: #ff6b8a; /* deep pink */
  border: 3px solid #fce7f3;
  border-radius: 999px;
  padding: 0 24px;
  min-width: 120px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  overflow: hidden;
}

.tag-layered-top::after {
  content: attr(data-bg-text);
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3.2rem;
  font-weight: 900;
  font-style: italic;
  color: rgba(255, 255, 255, 0.4);
  z-index: 1;
  pointer-events: none;
}

.tag-layered-text {
  position: relative;
  z-index: 2;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-shadow: 
    -1px -1px 0 #333,
     1px -1px 0 #333,
    -1px  1px 0 #333,
     1px  1px 0 #333;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

/* ===== Masonry Grid ===== */
.masonry-grid {
  column-count: 5;
  column-gap: 16px;
}

.post-card {
  break-inside: avoid;
  margin-bottom: 16px;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.post-card-link {
  display: block;
}

.post-image-wrap {
  overflow: hidden;
  max-height: 320px;
  background-color: var(--border);
}

.post-image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s;
}

.post-card:hover .post-image {
  transform: scale(1.03);
}

.post-content {
  padding: 0 16px 16px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  word-break: break-word;
}

.post-card-title {
  margin: 12px 0 8px 0;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text);
  word-break: break-word;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.post-tag {
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.post-content p {
  margin: 0;
}

.post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 16px;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.post-author:hover {
  color: var(--text);
}

.post-author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.post-author-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.like-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: color 0.2s;
}

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

.like-btn.liked {
  color: var(--primary);
}

.like-btn svg {
  transition: transform 0.2s;
}

.like-btn:active svg {
  transform: scale(1.3);
}

/* ===== Post Detail ===== */
.post-detail {
  max-width: 720px;
  margin: 0 auto;
}

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

.post-detail-image img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  background: #000;
}

.post-detail-body {
  padding: 24px;
}

.post-detail-text {
  font-size: 1.05rem;
  line-height: 1.7;
  margin: 0 0 16px;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-detail-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.post-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

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

/* ===== Profile ===== */
.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
  padding: 24px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.profile-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--surface);
  box-shadow: var(--shadow);
}

.profile-name {
  margin: 0 0 4px;
  font-size: 1.5rem;
}

.profile-username {
  margin: 0 0 8px;
  color: var(--text-secondary);
}

.profile-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ===== Auth Pages ===== */
.auth-page {
  max-width: 420px;
  margin: 40px auto;
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

.auth-title {
  text-align: center;
  margin: 0 0 24px;
  font-size: 1.5rem;
}

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

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

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

.form-group input,
.form-group textarea {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: var(--bg);
  outline: none;
  transition: box-shadow 0.2s, border-color 0.2s;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,107,138,0.15);
}

.form-group input[type="file"] {
  padding: 8px;
}

.image-preview {
  margin-top: 8px;
}

.image-preview img {
  max-height: 200px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.upload-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 0.3s;
}

.progress-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.alert-error {
  background: #ffe5e5;
  color: #c00;
}

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

.auth-switch a {
  color: var(--primary);
  font-weight: 500;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

/* ===== FAB ===== */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(255,107,138,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 90;
}

.fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(255,107,138,0.5);
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 20px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.sort-widget {
  margin-top: 24px;
  padding: 16px 12px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sort-title {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.sort-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sort-option-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: all 0.2s ease;
  font-weight: 500;
}

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

.sort-option-btn.active {
  background: rgba(255, 107, 138, 0.1);
  color: var(--primary);
  font-weight: 600;
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
  .masonry-grid {
    column-count: 4;
  }
}

@media (max-width: 992px) {
  .masonry-grid {
    column-count: 3;
  }
}

@media (max-width: 768px) {
  .header-inner {
    gap: 10px;
    padding: 0 14px;
  }

  .logo-text {
    display: none;
  }

  .user-name {
    display: none;
  }

  .masonry-grid {
    column-count: 2;
    column-gap: 12px;
  }

  .post-card {
    margin-bottom: 12px;
    border-radius: var(--radius-sm);
  }

  .main-content {
    padding: 14px;
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
    padding: 20px;
  }

  .auth-page {
    margin: 20px auto;
    padding: 0 14px;
  }

  .auth-card {
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .masonry-grid {
    column-count: 2;
    column-gap: 8px;
  }

  .post-content {
    padding: 10px 12px 4px;
    font-size: 0.85rem;
  }

  .post-footer {
    padding: 8px 12px 10px;
  }

  .post-author-name {
    max-width: 80px;
  }
}

/* ===== Premium Post Lightbox Modal (after_click_a_post.PNG) ===== */
.post-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
  animation: modalFadeIn 0.3s ease;
}

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

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-close-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.modal-close-btn:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: scale(1.05);
}

.modal-container {
  display: flex;
  width: 1080px;
  max-width: 95%;
  max-height: 85vh;
  gap: 32px;
  align-items: stretch;
  animation: modalSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
  from {
    transform: translateY(30px) scale(0.98);
  }
  to {
    transform: translateY(0) scale(1);
  }
}

.modal-media-section {
  flex: 1.3;
  max-height: 80vh;
  overflow-y: auto;
  display: block;
}

/* Custom Scrollbar for tall media scrolling */
.modal-media-section::-webkit-scrollbar {
  width: 8px;
}
.modal-media-section::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 24px;
}
.modal-media-section::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
}
.modal-media-section::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

.modal-image-wrapper {
  width: 100%;
  display: block;
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.modal-image-wrapper img {
  width: 100%;
  height: auto;
  display: block;
}

.modal-post-description {
  margin: 4px 0 18px;
  font-size: 1rem;
  color: var(--text);
  line-height: 1.55;
  word-break: break-word;
}

.modal-post-time {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: -10px;
  margin-bottom: 18px;
  font-weight: 500;
}

.modal-sidebar {
  width: 380px;
  flex-shrink: 0;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
  border: 1px solid var(--border);
}

.modal-author-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.modal-author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.modal-author-info {
  display: flex;
  flex-direction: column;
}

.modal-author-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.modal-author-username {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.modal-stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding: 0 4px;
}

.modal-stat-views {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.modal-sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 18px 0;
}

/* ===== Unified Scroll Container for Sidebar ===== */
.modal-sidebar-scroll-container {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 16px;
}

/* Custom Scrollbar for Unified Sidebar */
.modal-sidebar-scroll-container::-webkit-scrollbar {
  width: 6px;
}
.modal-sidebar-scroll-container::-webkit-scrollbar-track {
  background: transparent;
}
.modal-sidebar-scroll-container::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.modal-sidebar-scroll-container::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* ===== Modal Comments Section ===== */
.modal-comments-section {
  display: flex;
  flex-direction: column;
}

.modal-comments-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.modal-comments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 8px;
}

.modal-comment-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid transparent;
  transition: border-color 0.2s;
}

.modal-comment-item:hover {
  border-color: var(--border);
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.comment-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.comment-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 2px;
}

.comment-author-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}

.comment-author-username {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.comment-date {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-left: auto;
}

.comment-text {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.4;
  margin: 0;
  word-break: break-word;
}

.modal-add-comment-section {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: auto;
}

.modal-add-comment-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.comment-input-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.comment-input-wrapper {
  flex: 1;
  display: flex;
  gap: 6px;
}

.comment-input-wrapper input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 0.85rem;
  outline: none;
  transition: all 0.2s;
}

.comment-input-wrapper input:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(255, 107, 138, 0.15);
}

.comment-submit-btn {
  padding: 8px 12px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s;
}

.comment-submit-btn:hover {
  background: var(--primary-hover);
  box-shadow: 0 2px 8px rgba(255, 107, 138, 0.25);
}

.comment-login-prompt {
  text-align: center;
}

.no-other-posts, .loading-spinner {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 30px 0;
}

/* Responsive Modal styling */
@media (max-width: 992px) {
  .modal-container {
    flex-direction: column;
    max-height: 90vh;
    gap: 16px;
    width: 500px;
  }
  .post-modal {
    padding: 20px;
  }
  .modal-media-section {
    flex: none;
    max-height: 40vh;
  }
  .modal-image-wrapper {
    max-height: 40vh;
  }
  .modal-image-wrapper img {
    max-height: 40vh;
  }
  .modal-post-description {
    font-size: 0.95rem;
    max-height: 80px;
  }
  .modal-sidebar {
    width: 100%;
    max-height: 45vh;
    padding: 18px;
  }
  .modal-close-btn {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 576px) {
  .modal-container {
    width: 100%;
  }
}
