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

/* Force all text to black */
body, body * {
  color: #000 !important;
}

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

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "avenir next", avenir,
    "segoe ui", "helvetica neue", helvetica, Cantarell, Ubuntu, roboto,
    noto, arial, sans-serif;
  color: #1c1e21;
  opacity: 0;
  transition: background-color 0.3s, color 0.3s, opacity 0.1s;
  background-image: url('IMG_0332.jpeg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  min-height: 100vh;
}

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

/* Dark mode */
.dark body {
  color: #f3f4f6;
  background-image: url('IMG_0332.jpeg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

/* Layout */
.container {
  width: 95vw;
  /* use full viewport height minus padding so children can flex to fill without leaving a gap */
  height: calc(100vh - 40px);
  padding: 20px;
  /* center the panel in the viewport */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 6px 20px rgba(16,24,40,0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dark .container {
  background: rgba(18, 18, 18, 0.35);
  backdrop-filter: blur(10px) saturate(90%);
  -webkit-backdrop-filter: blur(10px) saturate(90%);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}

.customize-banner {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 6px 12px;
  color: #2563eb;
  font-weight: 500;
  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;
  flex-shrink: 0;
}

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

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

.profile-username {
  font-size: 28px;
  font-weight: 300;
  line-height: 32px;
  margin-bottom: 12px;
}

.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: make it a true flex column that can shrink so children (embed) can fill */
.content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 1rem;
  /* allow content to use the full width of the panel so embeds can stretch vertically without layout constraints */
  max-width: 100%;
  width: 100%;
  margin: 0;
  overflow: hidden;
  min-height: 0; /* allow children to shrink properly */
}

.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: 500;
  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%;
}

.feed-avatar-name {
  font-size: 14px;
  color: #6b7280;
}

.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: 600;
  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: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.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: #2563eb;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.submit-btn:hover {
  background: #1d4ed8;
}

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

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

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

.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:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

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

.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: 70%;
  max-width: none;
  height: 90%;
  max-height: 90%;
  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: 600;
}

.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: 70%;
  max-width: none;
  height: 90%;
  max-height: 90%;
}

.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: #2563eb;
  color: white;
  border-color: #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;
  flex-shrink: 0;
}

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

.tab.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

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

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

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

/* full-width embed wrapper so iframes take the entire available area of the content */
.embed-full {
  grid-column: 1 / -1;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
  /* make the embed a flexible child so it fills remaining space */
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  align-items: stretch; /* ensure children stretch vertically */
}

/* Force iframe inside embed-full to fill its wrapper */
.embed-full iframe {
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  display: block;
  border-radius: 8px;
  flex: 1 1 auto; /* allow iframe to grow/shrink inside flex container */
  min-height: 0; /* prevent flex overflow causing gaps */
}

/* small-screen adjustments */
@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: 600;
  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;
}