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

/* Main Container */
.community-main {
  padding: 1rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* Ranking (Top 100) */
.community-ranking-section {
  margin-top: 1rem;
}

.ranking-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ranking-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-neutral-900);
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ranking-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 1px solid var(--color-neutral-200);
  border-radius: 0.75rem;
}

.ranking-item + .ranking-item {
  border-top: 1px solid var(--color-neutral-100);
}

.ranking-rank {
  min-width: 44px;
  text-align: center;
  font-weight: 700;
  color: var(--color-primary-600);
}

.ranking-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.ranking-avatar {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  object-fit: cover;
  border: 2px solid var(--color-primary-100);
  background: #fff;
}

.ranking-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ranking-username {
  font-weight: 600;
  color: var(--color-neutral-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-meta {
  font-size: 0.8125rem;
  color: var(--color-neutral-500);
}

.ranking-stats {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ranking-stat {
  font-size: 0.8125rem;
  color: var(--color-neutral-700);
  background: var(--color-neutral-50);
  border: 1px solid var(--color-neutral-200);
  border-radius: 9999px;
  padding: 0.25rem 0.5rem;
  white-space: nowrap;
}

.ranking-item.skeleton {
  background: var(--color-neutral-50);
}

.ranking-item.skeleton .ranking-avatar {
  background: var(--color-neutral-200);
  border-color: var(--color-neutral-200);
}

.ranking-item.skeleton .ranking-username,
.ranking-item.skeleton .ranking-meta,
.ranking-item.skeleton .ranking-rank,
.ranking-item.skeleton .ranking-stat {
  color: transparent;
  background: linear-gradient(90deg, rgba(0,0,0,0.06), rgba(0,0,0,0.12), rgba(0,0,0,0.06));
  background-size: 200% 100%;
  animation: ranking-shimmer 1.2s linear infinite;
  border-radius: 0.25rem;
}

@keyframes ranking-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (max-width: 768px) {
  .ranking-avatar { width: 32px; height: 32px; }
  .ranking-rank { min-width: 36px; }
  .ranking-item { padding: 0.625rem 0.75rem; }
}

.community-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Hero Section */
.community-hero {
  padding: 2rem;
  text-align: center;
  background: linear-gradient(135deg, var(--color-primary-50) 0%, var(--color-primary-100) 100%);
}

.community-hero h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--color-primary-700);
}

.community-hero p {
  font-size: 1.125rem;
  color: var(--color-neutral-600);
  margin-bottom: 1.5rem;
}

/* Community Stats */
.community-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary-600);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--color-neutral-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* View Toggle */
.view-toggle-bar {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--color-neutral-50);
  border-radius: 0.5rem;
  width: fit-content;
  margin: 0 auto;
}

.view-toggle-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  background: transparent;
  border-radius: 0.375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--color-neutral-600);
}

.view-toggle-btn:hover {
  background: var(--color-neutral-100);
}

.view-toggle-btn.active {
  background: var(--color-primary-600);
  color: white;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* Map Section */
.community-map-section {
  margin-top: 1rem;
}

.map-container {
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.community-map {
  height: 500px;
  width: 100%;
}

.map-hint {
  text-align: center;
  color: var(--color-neutral-600);
  margin-top: 1rem;
  font-style: italic;
}

/* POI Filter Bar */
.poi-filter-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.poi-search-input {
  flex: 1;
  min-width: 250px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-neutral-300);
  border-radius: 0.5rem;
  font-size: 1rem;
}

.poi-search-input:focus {
  outline: none;
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.poi-sort-select {
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-neutral-300);
  border-radius: 0.5rem;
  font-size: 1rem;
  background: white;
  cursor: pointer;
}

/* POI List */
.pois-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.poi-card {
  background: white;
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s;
  cursor: pointer;
  border: 2px solid transparent;
  overflow: hidden;
  word-wrap: break-word;
  max-width: 100%;
}

.poi-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: var(--color-primary-500);
  transform: translateY(-2px);
}

/* Active card highlight when synced with panel/map */
.poi-card.active {
  border-color: var(--color-primary-600);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.18);
  transform: translateY(-2px);
}

/* Smooth scrolling */
html { scroll-behavior: smooth; }

.poi-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.poi-card-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

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

.poi-card-save {
  margin-left: auto;
  flex-shrink: 0;
  border-color: rgba(15, 23, 42, 0.16);
  background: #f8fafc;
  color: #0f172a;
}

#modalPoiSaveBtn {
  border-color: rgba(15, 23, 42, 0.16);
  background: #f8fafc;
  color: #0f172a;
}

.poi-card-media {
  width: 100%;
  height: 146px;
  border-radius: 0.65rem;
  overflow: hidden;
  margin-bottom: 0.95rem;
  border: 1px solid var(--color-neutral-200);
  background: var(--color-neutral-100);
}

.poi-card-media[hidden] {
  display: none !important;
}

.poi-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 768px) {
  .poi-card-media {
    height: 128px;
  }
}

.poi-card-name {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--color-neutral-900);
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.poi-card-location {
  font-size: 0.875rem;
  color: var(--color-neutral-500);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.poi-card-stats {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--color-neutral-200);
  border-bottom: 1px solid var(--color-neutral-200);
  margin-bottom: 1rem;
}

.poi-stat {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: var(--color-neutral-600);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
  flex-shrink: 1;
}

.poi-stat-icon {
  font-size: 1rem;
}

.poi-card-preview {
  margin-top: 1rem;
}

.poi-preview-photos {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.poi-preview-photo {
  width: 80px;
  height: 80px;
  border-radius: 0.375rem;
  object-fit: cover;
  flex-shrink: 0;
}

.poi-latest-comment {
  font-size: 0.875rem;
  color: var(--color-neutral-700);
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.poi-card-action {
  margin-top: 1rem;
  width: 100%;
  padding: 0.75rem;
  background: var(--color-primary-600);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.poi-card-action:hover {
  background: var(--color-primary-700);
}

/* Comments Modal */
.comments-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
  animation: fadeIn 0.2s ease-out;
  overscroll-behavior: contain;
}

html.scroll-locked,
body.scroll-locked {
  overscroll-behavior: none;
}

/* CRITICAL: Force modal to be hidden when has [hidden] attribute */
.comments-modal[hidden] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

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

.comments-modal-dialog {
  background: white;
  border-radius: 1rem;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.comments-modal-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
  padding: 1.5rem;
  padding-right: 4.6rem;
  border-bottom: 1px solid var(--color-neutral-200);
  gap: 0.45rem;
}

.comments-modal-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  width: fit-content;
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0;
}

.modal-nav-btn {
  background: var(--color-neutral-100);
  border: 1px solid var(--color-neutral-300);
  border-radius: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-neutral-700);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-nav-btn:hover:not(:disabled) {
  background: var(--color-primary-50);
  border-color: var(--color-primary-500);
  color: var(--color-primary-600);
  transform: scale(1.05);
}

.modal-nav-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.modal-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.comments-modal-title-section {
  width: 100%;
  min-width: 0;
}

.comments-modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.08rem;
  color: var(--color-neutral-900);
  line-height: 1.14;
}

.comments-modal-location {
  font-size: 0.875rem;
  color: var(--color-neutral-500);
  display: block;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.comments-modal-location:empty {
  display: none;
}

.icon-button {
  padding: 0.5rem;
  background: transparent;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--color-neutral-600);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
}

.icon-button:hover {
  background: var(--color-neutral-100);
  color: var(--color-neutral-900);
}

.icon-button:active {
  transform: scale(0.95);
}

#closeCommentsModal {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.28);
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
}

#closeCommentsModal:hover {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.14);
  border-color: rgba(220, 38, 38, 0.38);
}

.comments-modal-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.modal-poi-description-section {
  border: 1px solid var(--color-neutral-200);
  border-radius: 0.75rem;
  background: linear-gradient(180deg, #f9fbff 0%, #ffffff 100%);
  padding: 0.9rem 1rem;
}

.modal-poi-description {
  margin: 0;
  font-size: 1.01rem;
  line-height: 1.54;
  color: var(--color-neutral-700);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Add Comment Section */
.add-comment-section {
  background: var(--color-neutral-50);
  border-radius: 0.75rem;
  padding: 1.5rem;
}

.auth-required-message {
  text-align: center;
  padding: 2rem;
}

.auth-required-message p {
  margin-bottom: 1rem;
  color: var(--color-neutral-600);
}

.add-comment-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.user-avatar-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-primary-200);
}

.form-hint {
  font-size: 0.875rem;
  color: var(--color-neutral-500);
  margin: 0;
}

.comment-textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--color-neutral-300);
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  min-height: 80px;
}

.comment-textarea:focus {
  outline: none;
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.comment-photos-preview {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.photo-preview-item {
  position: relative;
  width: 100px;
  height: 100px;
}

.photo-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.5rem;
}

.photo-preview-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-danger-600);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.add-comment-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.photo-upload-label {
  cursor: pointer;
  margin: 0;
}

/* Comments List */
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.comment-item {
  background: white;
  border: 1px solid var(--color-neutral-200);
  border-radius: 0.75rem;
  padding: 1.25rem;
  transition: all 0.2s;
}

.comment-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.comment-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.comment-author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-primary-200);
}

.comment-author-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.comment-author-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.comment-author-name {
  font-weight: 600;
  color: var(--color-neutral-900);
}

.comment-author-level {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.125rem 0.5rem;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-600));
  color: white;
  white-space: nowrap;
}

.comment-timestamp {
  font-size: 0.875rem;
  color: var(--color-neutral-500);
}

.comment-edited {
  font-size: 0.75rem;
  color: var(--color-neutral-400);
  font-style: italic;
  margin-left: 0.25rem;
}

.comment-actions-menu {
  position: relative;
}

.comment-menu-btn {
  padding: 0.25rem 0.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--color-neutral-500);
  border-radius: 0.25rem;
}

.comment-menu-btn:hover {
  background: var(--color-neutral-100);
}

.comment-menu-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  background: white;
  border: 1px solid var(--color-neutral-200);
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  min-width: 150px;
  margin-top: 0.25rem;
}

.comment-menu-item {
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--color-neutral-700);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.comment-menu-item:hover {
  background: var(--color-neutral-50);
}

.comment-menu-item.danger {
  color: var(--color-danger-600);
}

.comment-menu-item.danger:hover {
  background: var(--color-danger-50);
}

.comment-content {
  margin-bottom: 1rem;
  line-height: 1.6;
  color: var(--color-neutral-800);
  word-wrap: break-word;
}

.comment-photos {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.comment-photo {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: transform 0.2s;
}

.comment-photo:hover {
  transform: scale(1.05);
}

.comment-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-neutral-100);
}

.comment-like-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: 1px solid var(--color-neutral-300);
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--color-neutral-700);
  transition: all 0.2s;
}

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

.comment-like-btn.liked {
  background: var(--color-danger-50);
  border-color: var(--color-danger-300);
  color: var(--color-danger-700);
}

.comment-reply-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: 1px solid var(--color-neutral-300);
  border-radius: 0.375rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--color-neutral-700);
  transition: all 0.2s;
}

.comment-reply-btn:hover {
  background: var(--color-neutral-50);
}

/* Replies Section */
.comment-replies {
  margin-top: 1rem;
  padding-left: 3rem;
  border-left: 2px solid var(--color-neutral-200);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.reply-item {
  background: var(--color-neutral-50);
  border-radius: 0.5rem;
  padding: 1rem;
}

/* Edit Comment Form */
.edit-comment-form {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.edit-comment-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--color-neutral-300);
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 0.875rem;
  resize: vertical;
}

.edit-comment-actions {
  display: flex;
  gap: 0.5rem;
}

/* Loading Spinner */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  gap: 1rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--color-neutral-200);
  border-top-color: var(--color-primary-600);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Button Loading State */
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

button:disabled:hover {
  transform: none;
}

/* Smooth transitions */
.poi-card,
.comment-item,
.notification-item {
  transition: all 0.2s ease-out;
}

/* Focus states for accessibility */
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-neutral-700);
}

.empty-state-description {
  color: var(--color-neutral-500);
  margin-bottom: 1.5rem;
}

/* Profile Button with Avatar */
.btn-profile {
  display: inline-flex !important;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem !important;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-profile:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.header-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-primary-500);
  background: white;
}

.btn-profile span {
  font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
  .comments-modal {
    align-items: flex-start;
    justify-content: center;
    padding-top: calc(env(safe-area-inset-top, 0px) + 4px);
    padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
  }

  .community-hero h1 {
    font-size: 1.5rem;
  }
  
  .community-stats {
    gap: 1rem;
  }
  
  .stat-value {
    font-size: 1.5rem;
  }
  
  .pois-list {
    grid-template-columns: 1fr;
  }
  
  .comments-modal-dialog {
    max-height: calc(100svh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 8px);
    margin: 0;
    border-radius: 1rem 1rem 0 0;
  }

  .comments-modal-header {
    padding: 0.78rem 0.9rem 0.72rem;
    padding-right: 4rem;
    gap: 0.35rem;
  }

  .comments-modal-topbar {
    gap: 0.28rem;
  }

  .modal-header-actions {
    gap: 0.28rem;
  }

  .comments-modal-title {
    font-size: 1.25rem;
    line-height: 1.18;
    margin-bottom: 0.15rem;
  }

  .comments-modal-location {
    font-size: 0.95rem;
    line-height: 1.52;
  }
  
  .comment-replies {
    padding-left: 1.5rem;
  }
  
  .poi-filter-bar {
    flex-direction: column;
  }
  
  .poi-search-input {
    min-width: 100%;
  }
  
  /* Ensure rating section is visible on mobile */
  .modal-rating-section {
    display: block !important;
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .modal-rating-section h3 {
    font-size: 1rem;
  }
  
  /* Larger touch targets for mobile */
  .modal-nav-btn {
    width: 3rem;
    height: 3rem;
    font-size: 1.75rem;
    border-width: 2px;
  }
  
  .icon-button {
    min-width: 44px;
    min-height: 44px;
    padding: 0.75rem;
  }

  #closeCommentsModal {
    top: 0.5rem;
    right: 0.56rem;
  }
  
  /* Better button spacing on mobile */
  .comment-footer {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  
  .comment-footer button {
    min-height: 44px;
    padding: 0.5rem 1rem;
  }
  
  /* Larger tap area for photo upload */
  .photo-preview-container {
    min-height: 44px;
  }
  
  /* Comment level badge on mobile */
  .comment-author-level {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
  }
  
  .comment-author-name-row {
    gap: 0.35rem;
  }
  
  /* POI cards more touch-friendly */
  .poi-card {
    padding: 1.25rem;
  }
  
  .poi-card-actions {
    gap: 0.75rem;
  }
  
  .poi-card-actions button {
    min-height: 44px;
    padding: 0.625rem 1.25rem;
  }
}

@media (max-width: 480px) {
  .community-main {
    padding: 0.5rem;
  }
  
  .community-hero {
    padding: 1.5rem 1rem;
  }
  
  .comments-modal-content {
    padding: 1rem;
  }

  .modal-poi-description-section {
    padding: 0.75rem 0.85rem;
  }

  .modal-poi-description {
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .comments-modal-title {
    font-size: 1.35rem;
  }
  
  .add-comment-section {
    padding: 1rem;
  }
  
  /* Modal swipe hint */
  .comments-modal-dialog::before {
    content: '';
    position: absolute;
    top: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
    z-index: 1;
  }
  
  /* POI Cards - force single column and prevent overflow */
  .pois-list {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .poi-card {
    padding: 1rem;
    max-width: 100%;
    min-width: 0;
  }
  
  .poi-card-name {
    font-size: 1.125rem;
  }
  
  .poi-card-stats {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .poi-stat {
    font-size: 0.8125rem;
    flex: 1 1 45%;
    min-width: 0;
  }
}

@media (max-width: 380px) {
  .comments-modal {
    padding: 0.35rem;
  }

  .comments-modal-dialog {
    max-height: 96svh;
    border-radius: 0.85rem 0.85rem 0 0;
  }

  .comments-modal-header {
    padding: 0.62rem 0.62rem 0.58rem;
    padding-right: 3.4rem;
    gap: 0.24rem;
  }

  .comments-modal-topbar {
    gap: 0.2rem;
  }

  .modal-header-actions {
    gap: 0.2rem;
  }

  .modal-nav-btn {
    width: 2.35rem;
    height: 2.35rem;
    font-size: 1.35rem;
    border-width: 1px;
  }

  .icon-button {
    min-width: 2.35rem;
    min-height: 2.35rem;
    padding: 0.35rem;
    font-size: 1.2rem;
  }

  #closeCommentsModal {
    top: 0.36rem;
    right: 0.4rem;
  }

  .ce-save-star.ce-save-star-sm {
    width: 2.35rem;
    height: 2.35rem;
    min-width: 2.35rem;
    min-height: 2.35rem;
    font-size: 1.1rem;
  }

  .comments-modal-title {
    font-size: 1.08rem;
    line-height: 1.15;
    margin-bottom: 0.08rem;
  }

  .comments-modal-location {
    font-size: 0.86rem;
    line-height: 1.4;
  }

  .comments-modal-content {
    padding: 0.75rem;
    gap: 1rem;
  }
}

/* ===================================
   RATING SYSTEM STYLES
   =================================== */

/* Star Rating Container */
.star-rating {
  display: inline-flex;
  gap: 0.125rem;
  font-size: 1.25rem;
  line-height: 1;
}

.star-rating.interactive {
  cursor: pointer;
  user-select: none;
}

/* Individual Stars */
.star {
  display: inline-block;
  transition: all 0.2s ease;
}

.star-full {
  color: #fbbf24; /* Amber 400 */
}

.star-half {
  color: #fbbf24;
  opacity: 0.6;
}

.star-empty {
  color: #d1d5db; /* Gray 300 */
}

.star-rating.interactive .star {
  cursor: pointer;
}

.star-rating.interactive .star:hover {
  transform: scale(1.2);
  filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.6));
}

/* Rating Summary */
.rating-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.rating-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-neutral-900);
}

.rating-count {
  font-size: 0.875rem;
  color: var(--color-neutral-600);
}

.rating-text {
  font-size: 0.875rem;
  color: var(--color-neutral-500);
  font-style: italic;
}

/* Rating in POI Cards */
.poi-card-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-neutral-200);
}

.poi-card-rating .star-rating {
  font-size: 1rem;
}

.poi-card-rating .rating-value {
  font-size: 1rem;
}

.poi-card-rating .rating-count {
  font-size: 0.75rem;
}

/* Rating Section in Modal */
.modal-rating-section {
  padding: 1.5rem;
  background: var(--color-neutral-50);
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
}

.modal-rating-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--color-neutral-900);
}

.rating-interactive-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
}

.rating-interactive-container .star-rating {
  font-size: 2rem;
}

.rating-prompt {
  font-size: 0.875rem;
  color: var(--color-neutral-600);
  margin-top: 0.5rem;
}

.rating-prompt.rated {
  color: var(--color-primary-600);
  font-weight: 500;
}

/* Rating Breakdown */
.rating-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.rating-bar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.rating-bar-label {
  font-size: 0.875rem;
  color: var(--color-neutral-700);
  min-width: 2.5rem;
}

.rating-bar {
  flex: 1;
  height: 0.5rem;
  background: var(--color-neutral-200);
  border-radius: 0.25rem;
  overflow: hidden;
}

.rating-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  transition: width 0.3s ease;
}

.rating-bar-count {
  font-size: 0.875rem;
  color: var(--color-neutral-600);
  min-width: 2rem;
  text-align: right;
}

.rating-breakdown-empty {
  font-size: 0.875rem;
  color: var(--color-neutral-500);
  font-style: italic;
  text-align: center;
  padding: 1rem;
}

/* Remove Rating Button */
.remove-rating-btn {
  font-size: 0.75rem;
  color: var(--color-neutral-500);
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 0.25rem 0.5rem;
  margin-top: 0.5rem;
}

.remove-rating-btn:hover {
  color: var(--color-red-600);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .rating-interactive-container .star-rating {
    font-size: 2rem;
  }
  
  /* Larger touch targets for stars */
  .rating-interactive-container .star-rating .star {
    padding: 0.5rem;
    margin: 0 0.125rem;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: rgba(37, 99, 235, 0.2);
  }
  
  .modal-rating-section {
    display: block !important;
    padding: 1rem;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .poi-card-rating {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  /* Ensure rating display and breakdown are visible */
  #ratingDisplay,
  #ratingBreakdown {
    display: block !important;
    visibility: visible !important;
  }
  
  /* Better spacing for rating breakdown on mobile */
  .rating-breakdown-row {
    padding: 0.75rem 0;
  }
  
  .rating-breakdown-bar {
    min-height: 8px;
  }
}

/* ===================================
   PHOTO LIGHTBOX
   =================================== */

.photo-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 20000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1rem 5.5rem;
  overscroll-behavior: contain;
}

.photo-lightbox[hidden] {
  display: none;
}

.lightbox-content {
  max-width: min(96vw, 1100px);
  max-height: calc(100vh - 8.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.lightbox-image {
  max-width: 100%;
  max-height: calc(100vh - 12rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.lightbox-panorama {
  position: relative;
  width: min(96vw, 1100px);
  height: min(70vh, 760px);
  border-radius: 0.5rem;
  overflow: hidden;
  background: #0f172a;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.lightbox-panorama[hidden] {
  display: none !important;
}

.lightbox-panorama .ce-panorama-stage {
  width: 100%;
  height: 100%;
}

.lightbox-panorama-hint {
  position: absolute;
  left: 50%;
  bottom: 0.85rem;
  transform: translate(-50%, 12px);
  z-index: 4;
  max-width: min(92%, 540px);
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.84);
  color: #f8fafc;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.01em;
  text-align: center;
  padding: 0.5rem 0.9rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.38);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
}

.lightbox-panorama-hint.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.lightbox-caption {
  color: white;
  font-size: 1rem;
  text-align: center;
  padding: 0.5rem 1rem;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 0.5rem;
}

.lightbox-controls {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.5rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  z-index: 20002;
}

.lightbox-close,
.lightbox-nav {
  position: static;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 2.8rem;
  height: 2.8rem;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--color-neutral-900);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20003;
}

.lightbox-close {
  font-size: 1.45rem;
}

.lightbox-close:hover,
.lightbox-nav:hover:not(:disabled) {
  background: #ffffff;
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.28);
}

.lightbox-close:active,
.lightbox-nav:active:not(:disabled) {
  transform: scale(0.95);
}

.lightbox-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.comment-photo {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.comment-photo:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Mobile lightbox adjustments */
@media (max-width: 768px) {
  .photo-lightbox {
    padding: 0.8rem 0.65rem 5.8rem;
  }
  
  .lightbox-image {
    max-height: calc(100vh - 12rem);
  }
  
  .lightbox-close,
  .lightbox-nav {
    width: 3.15rem;
    height: 3.15rem;
    font-size: 1.65rem;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
  }

  .lightbox-controls {
    gap: 0.55rem;
    padding: 0.4rem 0.45rem;
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
  }
  
  /* Swipe indicator hint */
  .lightbox-content::after {
    content: 'Przesuń palcem aby nawigować';
    position: absolute;
    bottom: 5.3rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.5);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    pointer-events: none;
    animation: fadeOut 3s forwards;
  }
  
  @keyframes fadeOut {
    0%, 70% { opacity: 1; }
    100% { opacity: 0; }
  }
}

/* ===================================
   POI MINI MAP & CHECK-IN SECTION
   =================================== */

.modal-poi-gallery-section {
  padding: 1rem 1.5rem 1rem;
  border-bottom: 1px solid var(--color-neutral-200);
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.modal-poi-gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.modal-poi-gallery-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-neutral-800);
}

.modal-poi-gallery-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-primary-700);
  background: rgba(37, 99, 235, 0.1);
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  white-space: nowrap;
}

.modal-poi-gallery-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(110px, 140px);
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  scroll-snap-type: x proximity;
}

.modal-poi-gallery-item {
  position: relative;
  border: 1px solid var(--color-neutral-200);
  border-radius: 0.5rem;
  padding: 0;
  background: white;
  cursor: pointer;
  overflow: hidden;
  min-height: 78px;
  scroll-snap-align: start;
}

.modal-poi-gallery-item:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}

.modal-poi-gallery-thumb {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 78px;
}

.modal-poi-gallery-item img {
  width: 100%;
  height: 100%;
  min-height: 78px;
  object-fit: cover;
  display: block;
}

.modal-poi-gallery-item.is-panorama .modal-poi-gallery-thumb::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 38%;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.58) 100%);
  pointer-events: none;
}

.modal-poi-gallery-badge {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 2;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(15, 23, 42, 0.86);
  color: #bfdbfe;
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  pointer-events: none;
}

.modal-map-section {
  padding: 0 1.5rem 1rem;
  border-bottom: 1px solid var(--color-neutral-200);
}

.poi-mini-map {
  width: 100%;
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-neutral-100);
  margin-bottom: 1rem;
}

.poi-mini-map .leaflet-container {
  height: 100%;
  width: 100%;
  border-radius: 12px;
}

.poi-location-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.poi-distance-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.distance-icon {
  font-size: 1.25rem;
}

.poi-distance {
  font-size: 0.95rem;
  color: var(--color-neutral-600);
}

@media (max-width: 768px) {
  .modal-poi-gallery-section {
    padding: 0.85rem 1rem 0.9rem;
  }

  .modal-poi-gallery-track {
    grid-auto-columns: minmax(96px, 120px);
  }
}

.poi-distance.near {
  color: #16a34a;
  font-weight: 600;
}

.poi-distance.far {
  color: var(--color-neutral-500);
}

.btn-checkin {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25);
}

.btn-checkin:hover:not(:disabled) {
  background: linear-gradient(135deg, #15803d 0%, #166534 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.35);
}

.btn-checkin:disabled {
  background: var(--color-neutral-300);
  color: var(--color-neutral-500);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-checkin.checked {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.checkin-icon {
  font-size: 1.1rem;
}

.check-in-status {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--color-neutral-600);
  text-align: center;
}

.check-in-status.success {
  color: #16a34a;
  font-weight: 500;
}

.check-in-status.error {
  color: #dc2626;
}

.check-in-status.info {
  color: #2563eb;
}

.user-location-marker-container {
  position: relative;
  width: 28px;
  height: 28px;
}

/* User location marker */
.user-location-marker {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background-color: #ffffff;
  background-image: url('/assets/cyprus_logo-1000x1054.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.35);
}

.user-location-marker::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(37, 99, 235, 0.35);
  pointer-events: none;
}

.user-location-pulse {
  position: absolute;
  width: 28px;
  height: 28px;
  background: rgba(37, 99, 235, 0.2);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
  }
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .modal-map-section {
    padding: 0 1rem 1rem;
  }
  
  .poi-mini-map {
    height: 180px;
  }
  
  .poi-location-info {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  
  .poi-distance-container {
    justify-content: center;
  }
  
  .btn-checkin {
    width: 100%;
    justify-content: center;
  }
}
