*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  background-color: #ffffff;
  color: #333333;
  padding: 10px;
  overflow-x: hidden;
}

[data-theme="dark"] body {
  background-color: #121212;
  color: #f5f5f5;
}

.gallery-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding-bottom: 5px;
}

.gallery-logo {
  display: block;
  height: 40px;
  width: auto;
  object-fit: contain;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #333333;
  font-weight: 600;
  font-size: 0.9rem;
  transition: opacity 0.2s ease;
}

[data-theme="dark"] .user-profile-badge {
  color: #f5f5f5;
}

.user-profile-badge:hover {
  opacity: 0.8;
}

.user-avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #eaeaea;
}

[data-theme="dark"] .user-avatar {
  border: 1px solid #252525;
}

.user-name {
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  width: 100%;
}

.gallery-item {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: #eaeaea;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

[data-theme="dark"] .gallery-item {
  background-color: #252525;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.gallery-item:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

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

.lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 20px;
}

.lightbox-content {
  max-width: 90%;
  max-height: 75%;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-info {
  color: #ffffff;
  margin-top: 15px;
  text-align: center;
  max-width: 600px;
  font-size: 0.95rem;
}

.lightbox-meta {
  margin-top: 8px;
  display: flex;
  gap: 15px;
  justify-content: center;
  font-size: 0.85rem;
  opacity: 0.8;
}

.lightbox-meta a {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 600;
}

.lightbox-meta a:hover {
  text-decoration: underline;
}

.close-btn {
  position: absolute;
  top: 20px;
  right: 25px;
  color: #ffffff;
  font-size: 40px;
  font-weight: bold;
  background: none;
  border: none;
  cursor: pointer;
}

.footer-nav {
  margin-top: 25px;
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 10px 0;
  border-top: 1px solid #eaeaea;
}

[data-theme="dark"] .footer-nav {
  border-top: 1px solid #252525;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #666666;
  text-decoration: none;
  font-size: 0.85rem;
}

[data-theme="dark"] .footer-link {
  color: #aaaaaa;
}

.footer-link:hover {
  text-decoration: underline;
}

.footer-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.lightbox-icon svg {
  width: 14px;
  height: 14px;
}

@media (prefers-color-scheme: dark) {
  [data-theme="auto"] body {
    background-color: #121212;
    color: #f5f5f5;
  }

  [data-theme="auto"] .user-profile-badge {
    color: #f5f5f5;
  }

  [data-theme="auto"] .user-avatar {
    border: 1px solid #252525;
  }

  [data-theme="auto"] .gallery-item {
    background-color: #252525;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  }

  [data-theme="auto"] .footer-nav {
    border-top: 1px solid #252525;
  }

  [data-theme="auto"] .footer-link {
    color: #aaaaaa;
  }
}

.heart {
  color: #ff4d6d;
  animation: heartbeat 1.3s ease-in-out infinite;
  transform-origin: center;
}

@keyframes heartbeat {
  0%,
  30%,
  100% {
    transform: scale(1);
  }

  6% {
    transform: scale(1.15);
  }
  12% {
    transform: scale(0.98);
  }

  18% {
    transform: scale(1.1);
  }
  24% {
    transform: scale(1);
  }
}
