/* ============================================================
   Community & Gallery Section Styles
   ============================================================ */

/* ========== Showcases Section (Two Column) ========== */
.showcases-section {
  padding: 80px 0;
  background: linear-gradient(180deg, #f7efe5 0%, #fdf8f3 50%, #faf4ed 100%);
  position: relative;
  overflow: hidden;
}

.showcases-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(218, 165, 32, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(139, 69, 19, 0.06) 0%, transparent 40%);
  pointer-events: none;
}

.showcases-container {
  position: relative;
  z-index: 1;
}

.showcases-header {
  text-align: center;
  margin-bottom: 48px;
}

.showcases-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(139, 69, 19, 0.1), rgba(218, 165, 32, 0.15));
  color: var(--color-primary);
  padding: 8px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 20px;
  border: 1px solid rgba(139, 69, 19, 0.15);
}

.showcases-title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--color-text);
  margin: 0 0 16px;
  line-height: 1.2;
  background: linear-gradient(135deg, #4a2c1a 0%, #8b4513 50%, #b8860b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.showcases-subtitle {
  color: var(--color-text-secondary);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

.showcases-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

/* ========== Infinite Gallery Carousel ========== */
.gallery-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 
    0 10px 40px rgba(139, 69, 19, 0.08),
    0 2px 10px rgba(139, 69, 19, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  height: 100%;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.gallery-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.gallery-card-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--color-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.gallery-card-title .icon {
  font-size: 1.5rem;
}

.gallery-card-count {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  background: rgba(139, 69, 19, 0.08);
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 500;
}

/* ========== Main Carousel ========== */
.gallery-carousel {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto 20px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  aspect-ratio: 3 / 4;
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-slide.active {
  opacity: 1;
  z-index: 1;
}

.carousel-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.carousel-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 24px 24px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  color: white;
  z-index: 2;
}

.carousel-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 4px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.carousel-author {
  font-size: 0.85rem;
  margin: 0;
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: white;
  font-size: 1.5rem;
  font-weight: 300;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

.carousel-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
  left: 12px;
}

.carousel-next {
  right: 12px;
}

.carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.carousel-dot:hover {
  background: rgba(255, 255, 255, 0.7);
}

.carousel-dot.active {
  background: white;
  width: 24px;
  border-radius: 999px;
}

/* Marquee / Infinite Scroll Container */
.gallery-marquee-wrapper {
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
  border-radius: 16px;
  flex: 1;
  min-width: 0;
  width: 100%;
}

.gallery-marquee {
  display: flex;
  gap: 16px;
  animation: marquee-scroll 30s linear infinite;
  width: max-content;
}

.gallery-marquee:hover {
  animation-play-state: paused;
}

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.gallery-marquee-item {
  flex-shrink: 0;
  width: 180px;
  border-radius: 12px;
  overflow: hidden;
  background: white;
  box-shadow: 0 4px 12px rgba(139, 69, 19, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.gallery-marquee-item:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 28px rgba(139, 69, 19, 0.18);
}

.gallery-marquee-item img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}

.gallery-marquee-info {
  padding: 10px 12px;
  background: white;
}

.gallery-marquee-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-marquee-author {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.gallery-marquee-author .avatar {
  font-size: 0.75rem;
}

/* Second row - reverse direction */
.gallery-marquee-wrapper.reverse .gallery-marquee {
  animation-direction: reverse;
}

.gallery-marquee-rows {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ========== Community Forum ========== */
.community-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 
    0 10px 40px rgba(139, 69, 19, 0.08),
    0 2px 10px rgba(139, 69, 19, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.community-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.community-card-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--color-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.community-card-title .icon {
  font-size: 1.5rem;
}

/* Upload Button */
.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--color-primary), #a0522d);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(139, 69, 19, 0.25);
}

.upload-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(139, 69, 19, 0.35);
}

/* Community Posts List */
.community-posts {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 8px;
  margin-right: -8px;
}

.community-posts::-webkit-scrollbar {
  width: 6px;
}

.community-posts::-webkit-scrollbar-track {
  background: rgba(139, 69, 19, 0.05);
  border-radius: 999px;
}

.community-posts::-webkit-scrollbar-thumb {
  background: rgba(139, 69, 19, 0.2);
  border-radius: 999px;
}

.community-posts::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 69, 19, 0.3);
}

/* Post Card */
.post-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(139, 69, 19, 0.06);
  transition: all 0.3s ease;
  border: 1px solid rgba(139, 69, 19, 0.06);
}

.post-card:hover {
  box-shadow: 0 8px 24px rgba(139, 69, 19, 0.12);
  transform: translateY(-2px);
}

.post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 10px;
}

.post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-accent-light), #f5e6d3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.post-meta {
  flex: 1;
  min-width: 0;
}

.post-author {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.post-time {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin: 0;
}

.post-image {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  background: #faf6f1;
}

.post-content {
  padding: 12px 16px;
}

.post-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 6px;
  line-height: 1.4;
}

.post-description {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px 12px;
  border-top: 1px solid rgba(139, 69, 19, 0.06);
}

.post-action {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.post-action:hover {
  background: rgba(139, 69, 19, 0.06);
  color: var(--color-primary);
}

.post-action.liked {
  color: #e74c3c;
}

.post-action .icon {
  font-size: 1rem;
}

.post-action .count {
  font-weight: 500;
}

/* Comments Section */
.post-comments {
  padding: 0 16px 12px;
  border-top: 1px solid rgba(139, 69, 19, 0.06);
  display: none;
}

.post-comments.show {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

.comment-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(139, 69, 19, 0.04);
}

.comment-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.comment-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f5e6d3, #e8d5b8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

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

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

.comment-author {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
}

.comment-time {
  font-size: 0.65rem;
  color: var(--color-text-muted);
  margin: 0;
}

.comment-text {
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* Comment Input */
.comment-input-row {
  display: flex;
  gap: 8px;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px solid rgba(139, 69, 19, 0.06);
}

.comment-input {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.8rem;
  border: 1px solid rgba(139, 69, 19, 0.15);
  border-radius: 999px;
  background: #faf6f1;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.comment-input:focus {
  border-color: var(--color-primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

.comment-submit {
  padding: 8px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  background: var(--color-primary);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.comment-submit:hover {
  background: #a0522d;
}

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

/* Upload Modal */
.upload-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.upload-modal-overlay.show {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.upload-modal {
  background: white;
  border-radius: 24px;
  padding: 32px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.upload-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.upload-modal-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--color-text);
  margin: 0;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(139, 69, 19, 0.08);
  color: var(--color-text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(139, 69, 19, 0.15);
  color: var(--color-text);
}

.upload-form-group {
  margin-bottom: 16px;
}

.upload-form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}

.upload-form-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 0.9rem;
  border: 2px solid rgba(139, 69, 19, 0.1);
  border-radius: 12px;
  background: #faf6f1;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
  box-sizing: border-box;
}

.upload-form-input:focus {
  border-color: var(--color-primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

.upload-form-textarea {
  resize: vertical;
  min-height: 80px;
}

.upload-image-drop {
  border: 2px dashed rgba(139, 69, 19, 0.2);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  background: #faf6f1;
  cursor: pointer;
  transition: all 0.3s ease;
}

.upload-image-drop:hover,
.upload-image-drop.dragover {
  border-color: var(--color-primary);
  background: rgba(139, 69, 19, 0.05);
}

.upload-image-drop .drop-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.upload-image-drop .drop-text {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin: 0 0 4px;
  font-weight: 500;
}

.upload-image-drop .drop-hint {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin: 0;
}

.upload-preview-img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 12px;
  object-fit: contain;
  margin: 0 auto;
  display: block;
}

.upload-submit-btn {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--color-primary), #a0522d);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 8px;
  box-shadow: 0 4px 12px rgba(139, 69, 19, 0.25);
}

.upload-submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(139, 69, 19, 0.35);
}

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

/* Responsive */
@media (max-width: 968px) {
  .showcases-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .gallery-carousel {
    aspect-ratio: 2 / 3;
    max-width: 280px;
  }

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

  .carousel-btn {
    width: 36px;
    height: 36px;
    font-size: 1.3rem;
  }

  .gallery-marquee-item {
    width: 150px;
  }

  .gallery-marquee-item img {
    height: 200px;
  }
}

@media (max-width: 640px) {
  .showcases-section {
    padding: 48px 0;
  }

  .gallery-card,
  .community-card {
    padding: 20px;
  }

  .community-posts {
    max-height: 400px;
  }

  .upload-modal {
    padding: 24px 20px;
  }

  .gallery-marquee-item {
    width: 130px;
  }

  .gallery-marquee-item img {
    height: 170px;
  }
}
