/* Guestbook-specific styles */

/* Mobile-only guestbook button in header */
.btn-guestbook {
	background: #333;
	color: #ddd;
	border: 1px solid #555;
	padding: 4px 8px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	display: none; /* Hidden by default, shown only on mobile */
}
.btn-guestbook:hover {
	background: #3a3a3a;
}

/* Floating guestbook side panel (desktop) */
.guestbook-side-panel {
	position: fixed;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(40, 40, 40, 0.92);
	color: #ddd;
	border: 1px solid rgba(85, 85, 85, 0.8);
	border-right: none;
	border-radius: 8px 0 0 8px;
	padding: 12px 10px;
	cursor: pointer;
	font-size: 13px;
	writing-mode: vertical-rl;
	text-orientation: mixed;
	box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.3);
	transition: all 0.2s ease;
	z-index: 900;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	backdrop-filter: blur(4px);
}
.guestbook-side-panel:hover {
	background: rgba(50, 50, 50, 0.95);
	right: 2px;
	box-shadow: -3px 3px 12px rgba(0, 0, 0, 0.4);
}
.guestbook-panel-icon {
	font-size: 18px;
	writing-mode: horizontal-tb;
	display: none; /* Icon only for mobile */
}
.guestbook-panel-text {
	font-weight: 500;
	letter-spacing: 0.5px;
}

.guestbook-header-actions {
	display: flex;
	gap: 6px;
}

.guestbook-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  /* Keep header/footer fixed; scroll only inside main */
  overflow: hidden;
}

.guestbook-body header {
  flex-shrink: 0;
}

.guestbook-body footer {
  flex-shrink: 0;
  margin-top: auto;
}

.home-link {
  color: #7ec8e3;
  text-decoration: none;
  font-size: 14px;
  margin-right: 16px;
}

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

.gb-back-list {
  color: #7ec8e3;
  text-decoration: none;
  font-size: 14px;
  margin-right: 16px;
}

.gb-back-list:hover {
  text-decoration: underline;
}

.guestbook-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 16px 24px;
  max-width: none;
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  min-height: 0;
  overflow: auto;
}

/* Markdown rendering */
.gb-md {
  white-space: normal;
}

.gb-md p {
  margin: 0 0 0.6em;
}

.gb-md p:last-child {
  margin-bottom: 0;
}

.gb-md pre {
  overflow: auto;
  margin: 0.6em 0;
}

/* New thread form section */
.gb-new-thread {
  background: #252526;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 16px 20px;
}

.gb-new-thread h2 {
  margin: 0 0 16px;
  font-size: 16px;
  color: #e6e6e6;
}

.gb-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gb-form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gb-form-row label {
  font-size: 12px;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gb-form-row input,
.gb-form-row textarea {
  background: #1e1e1e;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 8px 10px;
  color: #e6e6e6;
  font-size: 14px;
  font-family: inherit;
}

.gb-form-row input:focus,
.gb-form-row textarea:focus {
  outline: none;
  border-color: #0e639c;
}

.gb-form-row textarea {
  resize: vertical;
  min-height: 80px;
}

.gb-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.gb-btn-submit {
  background: #0e639c;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.gb-btn-submit:hover {
  background: #1177bb;
}

.gb-btn-submit:disabled {
  background: #555;
  cursor: not-allowed;
}

.gb-note {
  font-size: 12px;
  color: #888;
  font-style: italic;
}

.gb-md-link {
  color: inherit;
}

.gb-md-link:hover {
  text-decoration: underline;
}

.gb-btn-preview {
  background: #333;
  color: #ddd;
  border: 1px solid #555;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

.gb-btn-preview:hover {
  background: #3a3a3a;
}

.gb-preview {
  margin-top: 8px;
  border: 1px solid #333;
  background: #1e1e1e;
  border-radius: 6px;
  padding: 10px 12px;
  color: #ccc;
}

/* Threads section */
.gb-threads {
  flex: 1;
}

.gb-threads h2 {
  margin: 0 0 16px;
  font-size: 16px;
  color: #e6e6e6;
}

.gb-threads-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gb-loading {
  text-align: center;
  color: #888;
  padding: 24px;
}

.gb-empty {
  text-align: center;
  color: #666;
  padding: 24px;
  font-style: italic;
}

/* Thread card */
.gb-thread-card {
  background: #252526;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 14px 18px;
  cursor: default;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.gb-thread-card:hover {
  border-color: #555;
  background: #2a2a2a;
}

.gb-thread-card.gb-highlight {
  border-color: #0e639c;
}

.gb-thread-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.gb-thread-topic {
  font-size: 15px;
  font-weight: 600;
  color: #e6e6e6;
  margin: 0;
  flex: 1;
}

.gb-thread-meta {
  font-size: 11px;
  color: #888;
  white-space: nowrap;
}

.gb-thread-author {
  color: #7ec8e3;
  font-weight: 500;
}

.gb-thread-preview {
  font-size: 13px;
  color: #ccc;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.gb-thread-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 11px;
  color: #666;
}

/* Thread actions */
.gb-thread-actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.gb-inline-success {
  color: #7cfc90;
  font-size: 12px;
}

/* Inline reply form */
.gb-inline-reply {
  margin-top: 10px;
  border: 1px solid #333;
  background: #1e1e1e;
  border-radius: 6px;
  padding: 10px 12px;
}

.gb-inline-reply .gb-form-row {
  margin-bottom: 8px;
}

.gb-inline-reply .gb-form-row:last-child {
  margin-bottom: 0;
}

.gb-inline-reply-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.gb-btn-cancel {
  background: #333;
  color: #ddd;
  border: 1px solid #555;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

.gb-btn-cancel:hover {
  background: #3a3a3a;
}

.gb-thread-replies {
  color: #888;
}

/* Messages/replies */
.gb-messages {
  margin-top: 20px;
  border-top: 1px solid #333;
  padding-top: 16px;
}

.gb-messages-title {
  font-size: 13px;
  color: #888;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gb-message {
  background: #252526;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.gb-message-meta {
  font-size: 11px;
  color: #888;
  margin-bottom: 6px;
}

.gb-message-author {
  color: #7ec8e3;
  font-weight: 500;
}

.gb-anchor-link {
  color: #7ec8e3;
  text-decoration: none;
  margin-left: 6px;
  font-weight: 600;
}

.gb-anchor-link:hover {
  text-decoration: underline;
}

.gb-msg-highlight {
  outline: 1px solid #0e639c;
  outline-offset: 2px;
}

.gb-message-body {
  font-size: 13px;
  color: #ccc;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.gb-message-actions {
  margin-top: 8px;
}

.gb-btn-reply {
  background: none;
  border: none;
  color: #7ec8e3;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}

.gb-btn-reply:hover {
  text-decoration: underline;
}

/* Nested replies */
.gb-message-replies {
  margin-left: 20px;
  margin-top: 10px;
  border-left: 2px solid #333;
  padding-left: 12px;
}

/* Toast notification */
.gb-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: #2e7d32;
  color: white;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 4000;
  pointer-events: none;
}

.gb-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.gb-toast.error {
  background: #c62828;
}

/* Admin messages */
.gb-admin-badge {
  display: inline-block;
  background: linear-gradient(135deg, #f0a000 0%, #d49000 100%);
  color: #1e1e1e;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  margin-right: 6px;
  letter-spacing: 0.03em;
}

.gb-message-admin,
.gb-thread-card.gb-message-admin {
  border-color: #f0a000;
  background: linear-gradient(135deg, #2a2520 0%, #252526 100%);
}

.gb-message-admin .gb-message-author,
.gb-thread-card.gb-message-admin .gb-thread-author {
  color: #f0a000;
  font-weight: 600;
}

/* =====================================================
   Drawer-specific overrides (for embedded guestbook)
   ===================================================== */

/* Section titles in drawer */
.guestbook-content .gbd-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #888;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.guestbook-content .gbd-new-thread-section {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #3a3a3a;
}

.guestbook-content .gbd-threads-section {
  flex: 1;
}

/* Thread cards in drawer */
.guestbook-content .gb-thread-card {
  background: #252526;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
}

.guestbook-content .gb-thread-card .gb-thread-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  border: none;
  padding: 0;
}

.guestbook-content .gb-thread-topic {
  font-size: 15px;
  font-weight: 600;
  color: #e0e0e0;
  margin: 0;
}

.guestbook-content .gb-thread-preview {
  font-size: 13px;
  color: #aaa;
  margin-bottom: 8px;
  line-height: 1.4;
}

.guestbook-content .gb-thread-footer {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #888;
  margin-bottom: 8px;
}

.guestbook-content .gb-thread-author {
  color: #0078d4;
}

/* Admin thread styling in drawer */
.guestbook-content .gb-thread-card.gb-message-admin {
  border-color: #f0a000;
  background: linear-gradient(135deg, #2a2520 0%, #252526 100%);
}

.guestbook-content .gb-thread-card.gb-message-admin .gb-thread-author {
  color: #f0a000;
  font-weight: 600;
}

.guestbook-content .gb-thread-actions {
  margin-bottom: 8px;
}

/* Messages title in drawer */
.guestbook-content .gb-messages-title {
  font-size: 13px;
  font-weight: 600;
  color: #888;
  margin-bottom: 10px;
}

/* Inline reply in drawer */
.guestbook-content .gb-inline-reply {
  background: #1e1e1e;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  padding: 12px;
  margin-top: 10px;
}

.guestbook-content .gb-inline-reply-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.guestbook-content .gb-btn-cancel {
  background: #333;
  color: #ddd;
  border: 1px solid #555;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}

.guestbook-content .gb-btn-cancel:hover {
  background: #444;
}

.guestbook-content .gb-inline-success {
  background: #2d4a2d;
  color: #8bc34a;
  padding: 10px;
  border-radius: 6px;
  text-align: center;
  margin-top: 10px;
}

/* Loading/error states in drawer */
.guestbook-content .gb-loading,
.guestbook-content .gb-error {
  text-align: center;
  padding: 30px;
  color: #888;
}

.guestbook-content .gb-error {
  color: #ff6b6b;
}

.guestbook-content .gb-empty {
  text-align: center;
  padding: 30px;
  color: #888;
}

/* Form inputs in drawer */
.guestbook-content input[type="text"],
.guestbook-content textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  background: #1e1e1e;
  border: 1px solid #3a3a3a;
  border-radius: 4px;
  color: #e0e0e0;
  font-size: 14px;
}

.guestbook-content textarea {
  min-height: 60px;
  resize: vertical;
  font-family: inherit;
}

/* Time tooltips */
.gb-time {
  cursor: help;
}

/* Responsive */
@media (max-width: 600px) {
  .guestbook-main {
    padding: 12px 16px;
  }

  .gb-thread-header {
    flex-direction: column;
    align-items: stretch;
  }

  /* Show mobile button, hide side panel */
  .btn-guestbook {
    display: inline-block;
  }
  .guestbook-side-panel {
    display: none;
  }

  /* Show icon in mobile button */
  .btn-guestbook .guestbook-panel-icon {
    display: inline;
  }
}
