*,
*::before,
*::after {
  box-sizing: border-box;
  font-weight: 700; /* Make all text bold */
}

/* Base styles */
a {
  color: inherit;
  text-decoration: none;
}

p, h1, h2, h3, h4, h5, h6 {
  margin: 0;
}

body {
  margin: 0;
  font-family: 'Avenir Next', 'Nunito', -apple-system, BlinkMacSystemFont, "avenir next", avenir,
    "segoe ui", "helvetica neue", helvetica, Cantarell, Ubuntu, roboto,
    noto, arial, sans-serif;
  color: #1c1e21;
  background-color: #fff;
  opacity: 0;
  transition: background-color 0.3s, color 0.3s, opacity 0.1s;
}

body::-webkit-scrollbar {
  display: none;
}

/* Dark mode */
/* .dark body {
  color: #f3f4f6;
  background: #171717;
} */

/* Layout */
.container {
  max-width: 935px;
  margin: 0 auto;
  padding: 30px 20px;
  width: 100%;
  position: relative;
}

.customize-banner {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 6px 12px;
  color: #6D28D9; /* Changed from #2563eb */
  font-weight: 700; /* Keep bold */
  text-decoration: none;
  transform: rotate(5deg);
  transition: transform 0.2s;
  cursor: pointer;
  opacity: 0.8;
  background: transparent;
}

.customize-banner:hover {
  transform: rotate(5deg) scale(1.05);
  opacity: 1;
  text-decoration: underline;
}

/* .dark .customize-banner {
  color: #3b82f6;
  background: transparent;
} */

.profile-header {
  display: flex;
}

.profile-picture {
  width: 66px;
  height: 66px;
  border-radius: 50%;
}

.profile-info {
  margin-left: 1em;
  text-align: left;
}

.profile-username {
  font-size: 28px;
  font-weight: 700; /* Keep bold */
  line-height: 32px;
  margin-bottom: 12px;
}

.tip-button {
  margin-left: 8px;
  padding: 4px 10px;
  background: #6D28D9; /* Changed from #007bff */
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

.tip-button:hover {
  background: #5B21B6; /* Changed from #0056b3 */
}

.tip-button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.tip-modal p {
    font-weight: normal;
}

.profile-meta {
  color: #8e8e8e;
  font-size: 14px;
}

.profile-stats {
  display: flex;
  flex-direction: row;
  gap: 16px;
  margin-top: 8px;
  color: #6b7280;
  font-size: 14px;
}

.profile-stat-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.profile-stat-text {
  cursor: default;
}

.profile-stat-text[data-clickable="true"] {
  cursor: pointer;
}

.profile-stat-text[data-clickable="true"]:hover {
  text-decoration: underline; 
}

.profile-stat-text:hover {
  text-decoration: none;
}

.avatar-stack {
  display: flex;
  align-items: center;
  margin-left: auto;
  cursor: pointer;
  transition: opacity 0.2s;
}

.avatar-stack:hover {
  opacity: 0.8;
}

.avatar-stack img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #fff;
  margin-left: -12px;
  pointer-events: none;
}

.dark .avatar-stack img {
  border-color: #171717;
}

.content {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1rem;
  max-width: 935px;
  width: 100%;
  margin: 0 auto;
}

.content.guestbook {
  display: block;
}

.content.small {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 640px) {
  .content {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .content.small {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .content {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .content.small {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .content {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .content.small {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
}

.feed-item {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: #f3f4f6;
  border-radius: 0.375rem;
  overflow: hidden;
  width: 100%;
  border: 1px solid #d1d5db;
  transition: background-color 0.2s, border-color 0.2s;
}

.feed-item:hover {
  background-color: #e5e7eb;
  border-color: #6b7280;
}

.feed-image {
  width: 100%;
}

.feed-image img {
  display: block;
  width: 100%;
  height: auto;
}

.feed-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0.5rem;
}

.feed-title {
  font-size: 1.125rem;
  font-weight: 700; /* Keep bold */
  color: #1f2937;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  margin-bottom: 0.25rem;
}

.feed-description {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 0;
}

/* .dark .feed-description {
  color: #9ca3af;
} */

.feed-stats {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: auto;
}

.feed-stat {
  display: flex;
  align-items: center;
}

.stat-icon {
  width: 12px;
  height: 12px;
}

/* .dark .feed-item {
  background-color: #1e1e1e;
  border-color: #333333;
}

.dark .feed-title {
  color: #f3f4f6;
}

.dark .feed-avatar {
  color: #f3f4f6;
} */

.feed-avatar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.feed-avatar img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

/* .dark .feed-avatar-name {
  color: #9ca3af;
} */

.comment-section {
  margin: 20px auto;
  display: none;
}

.comments {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.comment {
  display: flex;
  align-items: flex-start;
  padding: 12px;
  gap: 8px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  transition: background-color 0.2s;
}

/* .dark .comment {
  background: #1e1e1e;
  border-color: #333;
} */

.comment:hover {
  background: #e5e7eb;
}

/* .dark .comment:hover {
  background: #262626;
} */

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

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

.username {
  font-weight: 700; /* Keep bold */
  margin-bottom: 2px;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

.username:hover {
  text-decoration: underline;
}

.message {
  color: inherit;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.new-comment {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  margin-bottom: 8px;
}

/* .dark .new-comment {
  background: #1e1e1e;
  border-color: #333;
} */

.comment-input-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

.comment-input-wrapper {
  position: relative;
  flex: 1;
}

.comment-input {
  width: 100%;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  resize: none;
  height: 80px;
  background: white;
  color: #1f2937;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color 0.2s, background-color 0.2s;
}

/* .dark .comment-input {
  background: #262626;
  border-color: #404040;
  color: #f3f4f6;
} */

.comment-input:focus {
  outline: none;
  border-color: #6D28D9; /* Changed from #2563eb */
  box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.1); /* Updated RGBA shadow */
}

/* .dark .comment-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
} */

.character-count {
  position: absolute;
  bottom: -20px;
  right: 0;
  font-size: 12px;
  color: #6b7280;
}

.character-count.warning {
  color: #ef4444;
}

/* .dark .character-count {
  color: #9ca3af;
}

.dark .character-count.warning {
  color: #f87171;
} */

.button-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.submit-btn {
  padding: 8px 16px;
  background: #6D28D9; /* Changed from #2563eb */
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700; /* Keep bold */
  cursor: pointer;
  transition: background-color 0.2s;
}

.submit-btn:hover {
  background: #5B21B6; /* Changed from #1d4ed8 */
}

.submit-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

/* .dark .submit-btn:disabled {
  background: #4b5563;
} */

.reminder-text {
  color: #6b7280;
  font-size: 12px;
  margin-top: 8px;
  margin-right: 12px;
  text-align: right;
}

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

.comment-metadata {
  display: flex;
  align-items: center;
  gap: 6px;
}

.timestamp {
  color: #6b7280;
  font-size: 12px;
}

.heart-button {
  padding: 2px 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
}

.heart-button svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: transparent;
}

.heart-button.liked {
  color: #ef4444; /* Red */
  border-color: #ef4444;
}

.heart-button.liked svg {
  fill: #ef4444;
}

.heart-button:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

/* .dark .heart-button {
  border-color: #404040;
}

.dark .heart-button:hover {
  background: #262626;
  border-color: #6b7280;
}

.dark .timestamp {
  color: #9ca3af;
} */

.comment-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.delete-button {
  padding: 2px 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #ef4444;
  border-radius: 4px;
  background: transparent;
  color: #ef4444;
  cursor: pointer;
  transition: all 0.2s;
}

.delete-button:hover {
  background: #fee2e2;
  border-color: #dc2626;
}

/* .dark .delete-button:hover {
  background: rgba(239, 68, 68, 0.1);
} */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
}

/* .dark .modal {
  background: #1e1e1e;
  border: 1px solid #333;
} */

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

.modal-title {
  font-size: 18px;
  font-weight: 700; /* Keep bold */
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: inherit;
  padding: 4px;
}

.modal-content {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.customize-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.customize-option {
  padding: 16px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

/* .dark .customize-option {
  background: #262626;
  border-color: #404040;
} */

.customize-option:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
  transform: translateX(4px);
}

/* .dark .customize-option:hover {
  background: #1e1e1e;
  border-color: #6b7280;
} */

.customize-modal {
  width: 90%;
  max-width: 600px;
}

/* .dark .customize-modal {
  background: #1e1e1e !important;
  border: 1px solid #404040 !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3) !important;
}

.dark .modal-title {
  color: #f3f4f6;
}

.dark .modal-close {
  color: #f3f4f6;
}

.dark .customize-modal a {
  color: #3b82f6;
}

.dark .customize-modal .customize-options > div {
  color: #f3f4f6;
} */

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
}

.page-button {
  padding: 4px 10px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
}

.page-button:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.page-button.active {
  background: #6D28D9; /* Changed from #2563eb */
  color: white;
  border-color: #6D28D9; /* Changed from #2563eb */
}

/* .dark .page-button {
  border-color: #404040;
  color: #9ca3af;
}

.dark .page-button:hover {
  background: #262626;
  border-color: #6b7280;
}

.dark .page-button.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: white;
} */

.tab-container {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #d1d5db;
}

.tab {
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  color: #6b7280;
  font-weight: 700; /* Keep bold */
}

.tab.active {
  color: #6D28D9; /* Changed from #2563eb */
  border-bottom-color: #6D28D9; /* Changed from #2563eb */
}

/* .dark .tab-container {
  border-bottom-color: #404040;
}

.dark .tab {
  color: #9ca3af;
}

.dark .tab.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
} */

@media (max-width: 640px) {
  .customize-banner {
    padding: 4px 8px;
    font-size: 14px;
    top: 10px;
    right: 10px;
    transform: rotate(3deg);
  }

  .customize-banner:hover {
    transform: rotate(3deg) scale(1.05);
  }
}

.username {
  font-weight: 700; /* Keep bold */
  margin-bottom: 2px;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

.username:hover {
  text-decoration: underline;
}

.comment > a {
  display: block;
  text-decoration: none;
}

.comment > a:hover {
  opacity: 0.8;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
}

.discord-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #5865F2;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background-color 0.2s;
  font-size: 14px;
}

.discord-link:hover {
  background-color: rgba(88, 101, 242, 0.1);
}

/* .dark .discord-link {
  color: #7289DA;
}

.dark .discord-link:hover {
  background-color: rgba(114, 137, 218, 0.1);
} */

.discord-logo {
  width: 16px;
  height: 16px;
}

/* Badges styles */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* Adjusted for bigger icons */
  gap: 16px;
  padding: 16px;
  background-color: #f3f4f6;
  border-radius: 0.375rem;
  border: 1px solid #d1d5db;
  /* Ensure badges grid spans all columns if inside .content */
  grid-column: 1 / -1; 
}

.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  border-radius: 8px;
  background-color: #fff;
  border: 1px solid #d1d5db;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.badge-item:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.badge-icon {
  width: 240px; /* Make image just a bit bigger (from 200px to 240px) */
  height: 240px;
  border-radius: 0; /* Changed from 50% to 0 for square image */
  object-fit: cover;
  flex-shrink: 0;
  border: none; /* Removed border (was 3px solid #2563eb) */
  padding: 0; /* Removed padding (was 2px) */
}

.badge-info {
  flex-grow: 0;
  width: 100%;
  min-height: 40px; /* Ensure title has minimum space */
}

.badge-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0;
  color: #1f2937;
}

.badge-description {
  font-size: 0.875rem;
  color: #fff; /* Initially white/hidden */
  background-color: rgba(0, 0, 0, 0.85); /* Dark overlay */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none; /* Allows click-through if needed, but we don't need it */
  z-index: 10;
  font-weight: 700;
  line-height: 1.4;
}

.badge-item:hover .badge-description {
  opacity: 1;
  pointer-events: auto;
}

.badge-item.badge-locked {
  opacity: 0.5;
  filter: grayscale(100%);
  cursor: default;
}

.badge-item.badge-locked:hover {
  box-shadow: none;
}

.badge-item.badge-locked .badge-description {
  opacity: 0;
  pointer-events: none;
}

@media (min-width: 640px) {
  .badges-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .badges-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)); /* Keep 3 for better spacing with large icon */
  }
}

@media (min-width: 1024px) {
  .badges-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)); /* Keep 3 columns on large screens to accommodate large icons */
  }
}

/* New site list styles */
.site-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  padding: 16px;
  background-color: #f3f4f6;
  border-radius: 0.375rem;
  border: 1px solid #d1d5db;
  grid-column: 1 / -1; 
}

.site-link-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px;
  background-color: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  cursor: pointer;
  transition: box-shadow 0.2s, background-color 0.2s;
  text-align: left;
}

.site-link-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  background-color: #f9fafb;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #1f2937;
  margin-bottom: 4px;
}

.site-url {
  font-size: 0.875rem;
  color: #6b7280;
  word-break: break-all;
}

/* Site Viewer Modal Styles */
.site-viewer-modal {
  max-width: 100vw;
  width: 100vw;
  max-height: 100vh;
  height: 100vh;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.site-viewer-header {
  /* DELETED */
}

.site-viewer-modal .modal-title {
  /* DELETED */
}

.iframe-container {
  flex-grow: 1;
  position: relative;
  overflow: hidden;
}

.site-iframe {
  width: 100%;
  height: 100%;
  display: block;
}

.open-external-button {
  position: absolute;
  bottom: 15px;
  right: 15px;
  padding: 8px 12px;
  background: #6D28D9; /* Changed from #2563eb */
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  z-index: 10;
}

.open-external-button:hover {
  background: #5B21B6; /* Changed from #1d4ed8 */
}

/* New overlay styles for fullscreen viewer */
.site-close-button {
  position: absolute;
  top: 15px;
  left: 15px;
  background: rgba(0, 0, 0, 0.5); /* Semi-transparent background for visibility */
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  transition: background-color 0.2s;
}

.site-close-button:hover {
  background: rgba(0, 0, 0, 0.7);
}