/* ===== COMMUNITY PAGE ===== */

body { background: var(--bg); color: var(--text); font-family: var(--font); }

.comm-layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 100px 20px 60px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  align-items: start;
}

@media (max-width: 768px) {
  .comm-layout { grid-template-columns: 1fr; padding-top: 80px; }
  .comm-sidebar { order: -1; }
}

/* ===== CREATE POST CARD ===== */
.comm-create-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}
.cc-top { display: flex; gap: 14px; align-items: flex-start; }
.cc-avatar { width: 44px; height: 44px; flex-shrink: 0; }
.cc-textarea {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--text);
  font-size: 0.95rem;
  resize: none;
  min-height: 80px;
  outline: none;
  transition: border-color 0.2s;
}
.cc-textarea:focus { border-color: var(--gold); }
.cc-photos-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
}
.cc-photo-preview {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg4);
}
.cc-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.cc-photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
}
.cc-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.cc-file-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  color: var(--text2);
  font-size: 0.88rem;
  transition: all 0.2s;
}
.cc-file-btn:hover { border-color: var(--gold); color: var(--gold); }
.cc-post-btn {
  background: var(--gold);
  color: #000;
  font-weight: 700;
  border-radius: 8px;
  padding: 9px 22px;
  font-size: 0.9rem;
  transition: background 0.2s;
}
.cc-post-btn:hover { background: var(--gold-light); }

/* ===== POST CARD ===== */
.post-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  overflow: hidden;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
}
.post-user-info { flex: 1; }
.post-user-name { font-weight: 600; font-size: 0.95rem; }
.post-time { color: var(--text3); font-size: 0.78rem; }
.post-delete-btn {
  background: none;
  border: none;
  color: var(--text3);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}
.post-delete-btn:hover { background: #ff444420; color: #ff6666; }

.post-text {
  padding: 0 20px 14px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
}

.post-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 3px;
}
.post-photos.single { grid-template-columns: 1fr; }
.post-photo {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  cursor: pointer;
  transition: opacity 0.2s;
}
.post-photo:hover { opacity: 0.9; }

.post-actions {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}
.post-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.85rem;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.2s;
}
.post-action-btn:hover { border-color: var(--gold); color: var(--gold); }
.post-action-btn.liked { border-color: #e0245e; color: #e0245e; background: #e0245e15; }

/* ===== COMMENT MODAL ===== */
.cmt-list { max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.cmt-item { display: flex; gap: 10px; align-items: flex-start; }
.cmt-body { background: var(--bg3); border-radius: 12px; padding: 10px 14px; flex: 1; }
.cmt-user { font-weight: 600; font-size: 0.82rem; margin-bottom: 4px; }
.cmt-text { font-size: 0.88rem; color: var(--text); }
.cmt-meta { font-size: 0.75rem; color: var(--text3); margin-top: 4px; }
.cmt-delete-btn { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 0.75rem; padding: 2px 6px; }
.cmt-delete-btn:hover { color: #ff6666; }
.cmt-input-row { display: flex; gap: 10px; align-items: center; }
.cmt-input-avatar { width: 36px; height: 36px; flex-shrink: 0; }
.cmt-input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 16px;
  color: var(--text);
  outline: none;
  font-size: 0.88rem;
}
.cmt-input:focus { border-color: var(--gold); }
.cmt-send-btn {
  background: var(--gold);
  color: #000;
  font-weight: 700;
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.cmt-login-msg { font-size: 0.88rem; color: var(--text2); }
.cmt-login-msg a { color: var(--gold); }

/* ===== SIDEBAR ===== */
.comm-sidebar { display: flex; flex-direction: column; gap: 16px; }
.cs-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.cs-card h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 10px; }
.cs-card p { font-size: 0.85rem; color: var(--text2); line-height: 1.5; }
.top-traveler {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.top-traveler:last-child { border-bottom: none; }
.tt-info { flex: 1; font-size: 0.85rem; }
.tt-name { font-weight: 600; }
.tt-posts { color: var(--text3); font-size: 0.78rem; }

/* ===== EMPTY STATE ===== */
.comm-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text3);
  font-size: 2rem;
}
.comm-empty p { font-size: 1rem; margin-top: 12px; }

/* ===== LIGHTBOX ===== */
.comm-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.comm-lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 8px; }
.comm-lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
}
