/* =============================================================================
   Guestbook Plugin – Stylesheet
   Compatible with MooSocial's Bootstrap-based theme
   ============================================================================= */

/* ── Wrapper ─────────────────────────────────────────────────────────────── */
.guestbook-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
  font-family: inherit;
}

.guestbook-header h2 {
  margin-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 8px;
}

/* ── Write-entry form ────────────────────────────────────────────────────── */
.guestbook-form-box {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 24px;
}

.guestbook-form-box h3 {
  margin-bottom: 10px;
}

.guestbook-textarea {
  width: 100%;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 8px 10px;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.15s;
}

.guestbook-textarea:focus {
  outline: none;
  border-color: #80bdff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.guestbook-form-footer {
  margin-top: 10px;
  text-align: left;
}

.guestbook-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.guestbook-col {
  flex: 1 1 200px;
}

.guestbook-input {
  width: 100%;
  border: 1px solid #ced4da;
  border-radius: 4px;
  padding: 7px 10px;
  font-family: inherit;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.guestbook-input:focus {
  outline: none;
  border-color: #80bdff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.guestbook-logged-as {
  color: #555;
  margin-bottom: 8px;
}

.guestbook-captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.guestbook-captcha-label {
  color: #444;
  margin: 0;
  white-space: nowrap;
}

.guestbook-captcha-question {
  font-weight: 700;
  color: #0056b3;
  letter-spacing: 0.05em;
}

.guestbook-captcha-input {
  width: 70px !important;
  text-align: center;
  font-weight: 600;
}

.guestbook-moderation-note {
  color: #888;
  display: block;
  margin-bottom: 8px;
}

/* ── Entry list ──────────────────────────────────────────────────────────── */
.guestbook-entries {
  list-style: none;
  margin: 0;
  padding: 0;
}

.guestbook-entry {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid #eeeeee;
}

.guestbook-entry:last-child {
  border-bottom: none;
}

/* ── Author column ───────────────────────────────────────────────────────── */
.guestbook-entry-author {
  flex: 0 0 80px;
  text-align: center;
  font-weight: 600;
  word-break: break-word;
}

.guestbook-avatar {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 6px;
  border: 2px solid #dee2e6;
}

/* ── Entry text ──────────────────────────────────────────────────────────── */
.guestbook-entry-body {
  flex: 1 1 200px;
}

.guestbook-entry-text {
  margin: 0 0 8px;
  line-height: 1.55;
  color: #333;
}

/* ── Owner reply ─────────────────────────────────────────────────────────── */
.guestbook-reply {
  background: #f0f4ff;
  border-left: 3px solid #4a7cf7;
  border-radius: 0 4px 4px 0;
  padding: 8px 12px;
  margin-top: 10px;
  color: #333;
}

.guestbook-reply strong {
  display: block;
  margin-bottom: 4px;
  color: #4a7cf7;
}

.guestbook-reply-form {
  margin-top: 12px;
}

/* ── Meta bar ────────────────────────────────────────────────────────────── */
.guestbook-entry-meta {
  flex: 0 0 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #888;
}

.guestbook-date {
  flex: 1;
}

.guestbook-delete {
  color: #dc3545;
  text-decoration: none;
}

.guestbook-delete:hover {
  text-decoration: underline;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.guestbook-empty {
  text-align: center;
  color: #aaa;
  padding: 32px 0;
  font-style: italic;
}

/* ── Pagination ──────────────────────────────────────────────────────────── */
.guestbook-pagination {
  margin-top: 20px;
  margin-bottom: 20px;
  text-align: left;
}

.guestbook-pagination span {
  display: inline-block;
  padding: 4px 10px;
  margin: 0 2px;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  color: #007bff;
  text-decoration: none;
}

.guestbook-pagination .current {
  background: #007bff;
  border-color: #007bff;
  color: #fff;
}

/* ── Admin table ─────────────────────────────────────────────────────────── */
.guestbook-admin-wrap {
  padding: 16px;
}

.guestbook-admin-table td {
  vertical-align: middle;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 540px) {
  .guestbook-entry-author {
    flex: 0 0 56px;
  }
  .guestbook-avatar {
    width: 44px;
    height: 44px;
  }
}
