﻿* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

nav {
  position: fixed;
  top: 0;
  width: 100%;
  height: 60px;
  background-color: #ffffff;
  display: flex;
  justify-content: center;
  padding: 0 15px;
  z-index: 11000;
}

nav .row {
  width: 100%;
  height: 100%;
  align-items: center;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.nav-left img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #fa7e1e, #d62976, #962fbf, #4f5bd5);
  padding: 4px;
  transition: transform 0.35s ease;
}

.nav-left span {
  font-size: 22px;
  font-weight: bold;
  color: #833ab4;
  background: linear-gradient(135deg, #833ab4, #c13584, #e1306c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: "Georgia", serif;
  background-size: 200% 100%;
  background-clip: text;
  animation: logo-gradient 6s linear infinite;
}

.post-button {
  align-items: right;
  background: linear-gradient(135deg, #a658db, #f467b7);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 15px;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}
.hidden {
  display: none !important;
}
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: #999;
  font-size: 18px;
}

.empty-state p {
  margin-top: 10px;
}
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.modal {
  position: relative;
  background: white;
  padding: 30px;
  border-radius: 12px;
  width: 500px;
  max-width: 90%;
  transform: none !important;
  opacity: 1 !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.modal h2 {
  color: #c13584;
  margin-bottom: 20px;
}

.modal label {
  display: block;
  color: #c13584;
  font-weight: bold;
  margin-bottom: 5px;
}

.modal input {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 2px solid #f5c6d0;
  border-radius: 8px;
  font-size: 14px;
}

.modal form button {
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f16dce, #c13584);
  cursor: pointer;
  color: white;
  display: block;
  margin: 0 auto;
}

.comment-form button img {
  width: 20px;
  height: 20px;
}

.close-modal-btn,
.close-comments-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 24px;
  color: #d4627b;
  cursor: pointer;
}
.close-modal-btn {
  width: auto;
  padding: 0;
}

.feed {
  margin-top: 80px;
  padding: 80px 15px 40px;
}

.image-count {
  text-align: center;
  color: #999;
  margin-bottom: 20px;
}

.image-card {
  background: white;
  border-radius: 12px;
  margin-bottom: 25px;
  overflow: hidden;
  width: 100%;
  position: relative;
  z-index: 0;
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.45s ease,
    transform 0.45s ease;
}

.image-card.show {
  opacity: 1;
  transform: none;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
}

.card-author {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: bold;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a658db, #f467b7);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
}
.delete-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #999;
}

.card-image {
  width: 100%;
  display: block;
  aspect-ratio: 16/9;
  object-fit: cover;
  transform: scale(0.98);
  opacity: 0;
  transition:
    transform 0.45s cubic-bezier(0.22, 0.9, 0.32, 1),
    opacity 0.45s cubic-bezier(0.22, 0.9, 0.32, 1),
    box-shadow 0.35s ease;
}

/* when card becomes visible, animate image in */
.image-card.show .card-image {
  transform: scale(1);
  opacity: 1;
}

/* hover enhancement (desktop only) */
.image-card:hover .card-image {
  transform: scale(1.04);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.card-title {
  font-size: 25px;
  padding: 12px 15px;
  color: #333;
}

.card-comments {
  padding: 0 15px 15px;
  border-top: 1px solid #f2f2f2;
}

.delete-btn img {
  width: 20px;
  height: 20px;
}

.comment-list {
  font-size: 16px;
  list-style: none;
  margin-bottom: 8px;
}

.comment-list li {
  margin-bottom: 8px;
}

.comment-main {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 20px;
  color: #333;
}

.comment-main .comment-text {
  font-size: 18px;
  flex: 1;
}

.comment-main .comment-date {
  margin-left: auto;
  font-size: 13px;
  color: #999;
}

.comment-list li strong {
  font-size: 18px;
}

.comment-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #999;
  font-size: 14px;
  display: flex;
  align-items: center;
}

.comment-delete-btn img {
  width: 16px;
  height: 16px;
  display: block;
}

.comment-form {
  display: flex;
  gap: 8px;
}

.comment-form input {
  flex: 1;
  border: none;
  border-radius: 8px;
  outline: none;
  font-size: 15px;
  padding: 8px;
}

.comment-form button {
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  background: none;
  color: white;
  cursor: pointer;
}

.comment-icon-btn {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  padding: 8px 15px;
}

.comments-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.current-page-num {
  border: none;
  font-size: 15px;
}

.prev-page-btn {
  border: none;
}

.next-page-btn {
  border: none;
}

.comments-pagecontroller {
  display: flex;
  justify-content: space-between;
  padding-top: 10px;
  border: none;
}

.comments {
  position: relative;
  background: white;
  border-radius: 12px;
  width: 900px;
  height: 500px;
  display: flex;
  overflow: hidden;
}

.comments-left {
  width: 50%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.comments-left img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comments-right {
  width: 50%;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.comments-right h2 {
  margin-bottom: 10px;
  background: linear-gradient(135deg, #d62976, #962fbf, #4f5bd5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.full-comments-list {
  flex: 1;
  overflow-y: auto;
}

.full-comment-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #f2f2f2;
}

.full-comment-item .comment-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a658db, #f467b7);
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  font-weight: bold;
  flex-shrink: 0;
}

.comment-body {
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
}

.comment-row1 {
  position: relative;
  font-size: 18px;
  padding-right: 25px;
  overflow-wrap: break-word;
  word-break: break-word;
}

.comment-row1 .comment-author {
  flex-shrink: 0;
  margin-right: 4px;
}

.comment-row1 .comment-text {
  overflow-wrap: break-word;
  word-break: break-word;
}

.comment-row1 .comment-delete-btn {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 12px;
  color: #000;
}

.comment-row2 {
  display: flex;
  align-items: center;
  margin-top: 4px;
}

.comment-row2 .comment-date {
  font-size: 12px;
  color: #999;
}

@keyframes logo-gradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.nav-left img:hover {
  transform: rotate(-6deg) scale(1.02);
}

.post-button:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .nav-left span {
    animation: none !important;
    background-attachment: initial;
  }
  .image-card,
  .card-image,
  .nav-left img,
  .post-button {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}

@media (max-width: 600px) {
  nav .col-3 {
    display: none;
  }
  .nav-container {
    flex-basis: 100%;
    padding: 0 15px;
  }

  .post-button {
    padding: 6px 12px;
    font-size: 12px;
    min-height: auto;
    min-width: auto;
  }

  .feed-container {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .modal {
    width: 100%;
    height: auto;
    border-radius: 8px;
    padding: 16px;
  }

  .nav-left img {
    width: 30px;
    height: 30px;
  }
  .nav-left span {
    font-size: 16px;
  }
  .comment-form input {
    font-size: 14px;
    padding: 8px;
  }
}

.feed-container {
  display: flex;
  flex-direction: column;
}

@media (max-width: 900px) {
  .nav-container {
    gap: 12px;
  }
  .nav-left span {
    font-size: 18px;
  }
  .post-button,
  .comment-icon-btn {
    min-height: 44px;
    min-width: 44px;
  }

  .comments {
    width: 90vw;
  }
}

#loading-indicator {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: linear-gradient(135deg, #ec4899, #a855f7);
  color: white;
  padding: 10px 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.45);
  animation: slideUp 0.25s ease-out;
}

#loading-indicator.hidden {
  display: none;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

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

body {
  padding-top: 80px;
}

.galleries-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 10px 0 40px;
}
@media (max-width: 900px) {
  .galleries-container {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .galleries-container {
    grid-template-columns: 1fr;
  }
}

.gallery-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}
.gallery-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.gallery-card .avatar {
  width: 64px;
  height: 64px;
  font-size: 26px;
}
.gallery-name {
  font-weight: bold;
  color: #333;
  font-size: 18px;
  word-break: break-word;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-right button {
  border: none;
  cursor: pointer;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 14px;
}
#signin-btn,
#signout-btn,
#signup-btn {
  background: linear-gradient(135deg, #a658db, #f467b7);
  color: white;
}
#greeting {
  font-weight: bold;
  background: linear-gradient(135deg, #a658db, #f467b7);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

#gallery-view h2 {
  text-align: center;
  color: #c13584;
  margin-bottom: 8px;
}
#back-btn {
  background: none;
  border: 2px solid #a658db;
  border-radius: 50%;
  color: #a658db;
  font-size: 18px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

#realtime-banner {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9000;
  background: linear-gradient(135deg, #ec4899, #a855f7);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.45);
  animation: slideUp 0.25s ease-out;
}

.auth-error {
  color: #e0245e;
  font-size: 14px;
  min-height: 18px;
  margin-bottom: 8px;
}
.comment-hint {
  color: #999;
  font-size: 14px;
  font-style: italic;
  list-style: none;
}
