/* Inherits variables and basic styles from index.css */

.guestbook-container {
  position: relative;
  width: 100%;
  min-height: 100vh;
  padding: 4rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-color-primary);
  font-family: "LatoRegular", sans-serif;
}

.guestbook-header {
  text-align: center;
  margin-bottom: 3rem;
  animation: fadeIn 1s ease-out;
}

.guestbook-header h1 {
  font-family: "LatoBoldItalic", sans-serif;
  font-size: var(--h1-size);
  margin-bottom: 0.5rem;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.guestbook-title {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.title-icon {
  width: 1.35em;
  height: 1.35em;
  max-width: 1.35em;
  max-height: 1.35em;
  display: inline-block;
  opacity: 0.9;
  flex-shrink: 0;
}

.guestbook-header p {
  font-family: "LatoLightItalic", sans-serif;
  font-size: var(--h3-size);
  color: var(--text-color-secondary);
  margin-bottom: 1.5rem;
}

.back-btn-container {
  width: 100%;
  max-width: 800px;
  margin-bottom: 2rem;
  display: flex;
  justify-content: flex-start;
  animation: fadeIn 1s ease-out;
}

.back-btn {
  color: white;
  text-decoration: none;
  font-family: "LatoRegular", sans-serif;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  transition: all 0.3s ease;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--line-color);
  box-shadow: 0 0 10px rgba(182, 216, 255, 0.15);
  transform: translateX(-2px);
}

.back-btn:hover .button-icon {
  transform: translateX(-3px);
}


.guestbook-content {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

/* Form Styles */
.comment-form-container {
  background: rgba(255, 255, 255, 0.05);
  padding: 2rem;
  border-radius: 15px;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: fadeIn 1s ease-out;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-family: "LatoBoldItalic", sans-serif;
  color: var(--text-color-secondary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.8rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: white;
  font-family: "LatoRegular", sans-serif;
  font-size: 1rem;
  transition:
    border-color 0.3s ease,
    background 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--line-color);
  background: rgba(0, 0, 0, 0.5);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.submit-btn {
  background: transparent;
  color: white;
  border: 1px solid var(--line-color);
  padding: 0.8rem 2rem;
  font-size: 1rem;
  font-family: "LatoBoldItalic", sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 50px;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.button-icon {
  width: 1rem;
  height: 1rem;
  max-width: 1rem;
  max-height: 1rem;
  flex-shrink: 0;
  display: inline-block;
  transition: transform 0.3s ease;
}

.submit-btn:hover {
  background: var(--line-color);
  color: var(--bg-color);
  box-shadow: 0 0 15px rgba(182, 216, 255, 0.4);
}

/* Comments List Styles */
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.comment-card {
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem 1.2rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  animation: fadeIn 0.5s ease-out;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  color: var(--text-color-secondary);
}

.comment-author {
  font-family: "LatoBoldItalic", sans-serif;
  color: white;
}

.comment-date {
  font-family: "LatoLight", sans-serif;
  opacity: 0.7;
}

.comment-body {
  font-family: "LatoRegular", sans-serif;
  line-height: 1.6;
  word-wrap: break-word;
}

.loading-comments {
  text-align: center;
  color: var(--text-color-secondary);
  font-style: italic;
}



/* Tag Styles */
.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(182, 216, 255, 0.3);
  color: var(--text-color-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-family: "LatoRegular", sans-serif;
  transition: all 0.3s ease;
  cursor: default;
  white-space: nowrap;
}

.tag:hover {
  background: rgba(182, 216, 255, 0.2);
  border-color: var(--line-color);
  color: white;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Markdown Content Styles */
.markdown-content {
  line-height: 1.8;
  font-family: "LatoRegular", sans-serif;
  color: var(--text-color-primary);
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4 {
  font-family: "LatoBoldItalic", sans-serif;
  color: white;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.markdown-content h1 {
  font-size: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.5rem;
}

.markdown-content h2 {
  font-size: 1.5rem;
}

.markdown-content p {
  margin-bottom: 1.5rem;
}

.markdown-content ul,
.markdown-content ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

.markdown-content li {
  margin-bottom: 0.5rem;
}

.markdown-content blockquote {
  border-left: 3px solid var(--line-color);
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  margin: 1.5rem 0;
  font-style: italic;
  border-radius: 0 10px 10px 0;
}

.markdown-content code {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9em;
  color: #ff9e9e;
}

.markdown-content pre {
  background: rgba(0, 0, 0, 0.3);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.markdown-content pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: 0.9rem;
}

.markdown-content a {
  color: var(--line-color);
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: opacity 0.3s;
}

.markdown-content a:hover {
  opacity: 0.8;
}

.markdown-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.markdown-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

.markdown-content th,
.markdown-content td {
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.75rem;
  text-align: left;
}

.markdown-content th {
  background: rgba(255, 255, 255, 0.1);
  font-family: "LatoBoldItalic", sans-serif;
}

.markdown-content hr {
  border: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  margin: 2rem 0;
}

/* Status Messages */
.guestbook-status {
  padding: 0.8rem 1rem;
  margin-top: 1rem;
  border-radius: 6px;
  font-family: "LatoRegular", sans-serif;
  animation: fadeIn 0.3s ease-out;
  display: none;
  border: 1px solid transparent;
}

.guestbook-status.error {
  display: block;
  background: rgba(220, 53, 69, 0.15);
  color: #ff6b6b;
  border-color: rgba(220, 53, 69, 0.3);
}

.guestbook-status.success {
  display: block;
  background: rgba(40, 167, 69, 0.15);
  color: #51cf66;
  border-color: rgba(40, 167, 69, 0.3);
}

/* Comment Footer & Delete Button */
.comment-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.comment-delete-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.55;
  transition: opacity 0.2s ease, transform 0.2s ease;
  line-height: 1;
}

.comment-delete-btn:hover {
  opacity: 1;
  transform: scale(1.1);
  background: transparent;
}

.comment-delete-icon {
  width: 0.95rem;
  height: 0.95rem;
  max-width: 0.95rem;
  max-height: 0.95rem;
  display: inline-block;
  vertical-align: middle;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 600px) {
  .guestbook-container {
    padding: 2rem 1rem;
  }

  .comment-form-container {
    padding: 1.5rem;
  }
}

/* Load More / Pull Up Indicator */
.load-more-indicator {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 0;
  margin-top: 1rem;
  width: 100%;
  animation: fadeIn 0.5s ease-out;
}

.load-more-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-color-secondary);
  font-family: "LatoRegular", sans-serif;
  font-size: 0.95rem;
  opacity: 0.7;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.load-more-indicator:hover .load-more-content {
  opacity: 1;
}

.load-more-icon {
  font-size: 1.2rem;
  animation: bounceUp 1.5s infinite;
  display: inline-block;
}

.load-more-indicator.loading .load-more-content {
  opacity: 1;
}

.load-more-spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--line-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes bounceUp {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

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

/* Star landmark and textarea wrapper styles */
.comment-content {
  flex: 1;
  min-width: 0;
}

.comment-star-wrapper {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
}

.comment-star {
  width: 1.6rem;
  height: 1.6rem;
  opacity: 0.75;
  animation: floatStar 4s ease-in-out infinite;
  user-select: none;
  pointer-events: none;
}

@keyframes floatStar {
  0%, 100% {
    transform: scale(1);
    opacity: 0.75;
  }
  50% {
    transform: scale(1.15);
    opacity: 1;
    filter: drop-shadow(0 0 5px rgba(250, 243, 148, 0.6));
  }
}

.textarea-wrapper {
  position: relative;
  width: 100%;
}

.char-counter {
  position: absolute;
  bottom: 0.8rem;
  right: 0.8rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.35);
  font-family: "LatoRegular", sans-serif;
  pointer-events: none;
  transition: color 0.3s ease;
}

.char-counter.near-limit {
  color: #ff9e9e;
  text-shadow: 0 0 5px rgba(255, 107, 107, 0.4);
}

