/* Individual Post Page Styles */

.post-article {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.post-container {
  background: rgba(255, 255, 255, 0.95);
  border: 3px solid #333;
  padding: 3rem;
  margin-bottom: 3rem;
  transition: all 0.6s ease;
}

.post-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 2px solid #eee;
}

.post-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.post-category {
  background: #4169E1;
  color: white;
  padding: 0.3rem 0.8rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  border: 2px solid #333;
}

.post-date {
  color: #666;
  font-size: 1rem;
}

.post-read-time {
  color: #666;
  font-size: 1rem;
}

.post-title {
  font-size: 2.5rem;
  color: #333;
  margin-bottom: 1.5rem;
  line-height: 1.3;
  letter-spacing: 1px;
}

.post-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.post-tag {
  background: #f0f0f0;
  color: #666;
  padding: 0.3rem 0.8rem;
  font-size: 0.9rem;
  border: 1px solid #ccc;
  transition: all 0.3s ease;
}

.post-tag:hover {
  background: #e0e0e0;
  border-color: #999;
}

.post-stats {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #666;
  font-size: 1rem;
}

/* Post Content */
.post-content {
  font-size: 1.2rem;
  line-height: 1.8;
  color: #333;
  margin-bottom: 3rem;
}

.post-content h2 {
  font-size: 1.8rem;
  margin: 2rem 0 1rem;
  color: #333;
}

.post-content h3 {
  font-size: 1.5rem;
  margin: 1.5rem 0 1rem;
  color: #333;
}

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

.post-content ul,
.post-content ol {
  margin: 1rem 0 1.5rem 2rem;
}

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

.post-content code {
  background: #f4f4f4;
  padding: 0.2rem 0.5rem;
  border: 1px solid #ddd;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
}

.post-content pre {
  background: #f4f4f4;
  padding: 1rem;
  border: 2px solid #333;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
}

.post-content blockquote {
  border-left: 4px solid #4169E1;
  padding-left: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: #555;
}

/* Loading Placeholder */
.loading-placeholder {
  animation: pulse 1.5s ease-in-out infinite;
}

.loading-line {
  height: 1rem;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  margin-bottom: 1rem;
  border-radius: 4px;
}

.loading-line.short {
  width: 60%;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Post Actions */
.post-actions {
  display: flex;
  gap: 1rem;
  padding-top: 2rem;
  border-top: 2px solid #eee;
  justify-content: center;
  flex-wrap: wrap;
}

.action-btn {
  background: transparent;
  border: 2px solid #333;
  padding: 0.8rem 1.5rem;
  font-family: 'VT323', monospace;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.action-btn:hover {
  background: #333;
  color: white;
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0px rgba(0, 0, 0, 0.2);
}

.action-btn.liked {
  background: #ff006e;
  color: white;
  border-color: #ff006e;
}

.action-btn.bookmarked {
  background: #06ffa5;
  color: #333;
  border-color: #06ffa5;
}

/* ============================================
   COMMENTS SECTION
   ============================================ */

.comments-section {
  max-width: 800px;
  margin: 3rem auto;
  padding: 0 2rem;
  display: flex;
  flex-direction: column;
}

#comments-list {
  order: 1;
  margin-bottom: 2rem;
}

.comments-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.comments-header h2 {
  font-size: 1.8rem;
  color: #333;
}

.comments-header p {
  color: #666;
  font-size: 1rem;
}

/* Comment Form */
.comment-form-container {
  order: 2;
  background: var(--bg-secondary, #f9f9f9);
  border: 2px solid var(--border-color, #ddd);
  border-radius: 8px;
  padding: 2rem;
  margin-top: 2rem;
  transition: all 0.6s ease;
}

.comment-form-container h3 {
  margin-bottom: 1rem;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.comment-form-container form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 0.4rem;
  font-family: 'VT323', monospace;
  font-size: 1rem;
  color: var(--text-primary, #333);
}

.form-group input,
.form-group textarea {
  padding: 0.8rem;
  border: 2px solid var(--border-color, #333);
  font-family: 'VT323', monospace;
  font-size: 1rem;
  transition: all 0.3s ease;
  resize: vertical;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #333);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #4169E1;
  box-shadow: 0 0 0 2px rgba(65, 105, 225, 0.2);
}

.form-group small {
  color: var(--text-secondary, #666);
  font-size: 0.85rem;
  margin-top: 0.3rem;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.submit-comment {
  background: #4169E1;
  color: white;
  border: 3px solid #333;
  padding: 1rem 2rem;
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.submit-comment:hover {
  background: #333;
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0px #4169E1;
}

.submit-comment:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.moderation-notice {
  color: var(--text-secondary, #666);
  font-size: 0.85rem;
  font-style: italic;
}

/* ============================================
   COMMENT ITEMS
   ============================================ */

.comment {
  padding: 1.5rem;
  border: 2px solid var(--border-color, #ddd);
  background: var(--bg-primary, white);
  transition: all 0.3s ease;
  position: relative;
  margin-bottom: 1rem;
}

.comment:hover {
  border-color: #999;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.comment-author {
  font-weight: bold;
  color: var(--text-primary, #333);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.comment-date {
  color: var(--text-secondary, #666);
  font-size: 0.9rem;
}

.comment-content p {
  color: var(--text-secondary, #555);
  line-height: 1.6;
  margin: 0;
}

.comment-text {
  color: var(--text-secondary, #555);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.admin-badge {
  background: #06ffa5;
  color: #333;
  padding: 0.2rem 0.6rem;
  border-radius: 8px;
  font-size: 0.7rem;
  font-family: 'VT323', monospace;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.comment-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.reply-btn,
.like-btn {
  background: none;
  border: 1px solid var(--border-color, #ddd);
  color: var(--text-secondary, #666);
  cursor: pointer;
  font-family: 'VT323', monospace;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
}

.reply-btn:hover {
  background: #4169E1;
  color: white;
  border-color: #4169E1;
}

.like-btn:hover {
  background: #ff006e;
  color: white;
  border-color: #ff006e;
}

.like-btn.liked {
  background: #ff006e;
  color: white;
  border-color: #ff006e;
}

.like-count {
  font-weight: bold;
}

/* ============================================
   THREADED REPLIES
   ============================================ */

.comment-replies {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color, #e0e0e0);
}

.comment-reply {
  margin-left: 2rem;
  padding: 1rem 1rem 1rem 1.5rem;
  border-left: 4px solid #4169E1;
  background: var(--bg-secondary, #f9f9f9);
  border-bottom: 1px solid var(--border-color, #e0e0e0);
  margin-bottom: 0.5rem;
}

.comment-reply[data-depth="2"] {
  margin-left: 1.5rem;
  border-left-color: #8338ec;
}

.comment-reply[data-depth="3"] {
  margin-left: 1rem;
  border-left-color: #06ffa5;
}

.comment-reply.admin-reply {
  border-left: 4px solid #06ffa5;
  background: rgba(6, 255, 165, 0.05);
}

/* Reply Form */
.reply-form {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-secondary, #f5f5f5);
  border: 1px solid var(--border-color, #ddd);
  border-radius: 8px;
  border-left: 4px solid #4169E1;
}

.reply-form.hidden {
  display: none;
}

.reply-form h4 {
  margin: 0 0 1rem 0;
  color: var(--text-primary, #333);
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
}

.reply-form .form-group {
  margin-bottom: 0.75rem;
}

.reply-form input,
.reply-form textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 4px;
  font-family: 'VT323', monospace;
  font-size: 1rem;
  resize: vertical;
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #333);
  box-sizing: border-box;
}

.reply-form input:focus,
.reply-form textarea:focus {
  outline: none;
  border-color: #4169E1;
  box-shadow: 0 0 0 2px rgba(65, 105, 225, 0.2);
}

.reply-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.submit-reply,
.cancel-reply {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 4px;
  font-family: 'VT323', monospace;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.submit-reply {
  background: #4169E1;
  color: white;
}

.submit-reply:hover {
  background: #3355c0;
  transform: translateY(-1px);
}

.submit-reply:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cancel-reply {
  background: #999;
  color: white;
}

.cancel-reply:hover {
  background: #777;
  transform: translateY(-1px);
}

/* No Comments */
.no-comments {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary, #666);
  font-style: italic;
}

.no-comments p {
  font-size: 1.1rem;
  margin: 0;
}

/* ============================================
   RELATED POSTS
   ============================================ */

.related-card-title {
  font-size: 1.2rem;
  color: #333;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.related-card-excerpt {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.5;
}

.related-card-meta {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #999;
}

/* ============================================
   MODAL REPLY FORM (blog listing page)
   ============================================ */

.modal-reply-form {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  border-left: 4px solid var(--accent-primary);
  transition: all 0.8s ease;
}

.modal-reply-form-content h4 {
  margin: 0 0 1rem 0;
  color: var(--text-primary);
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  transition: all 0.8s ease;
}

.modal-form-group {
  margin-bottom: 1rem;
}

.modal-form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-family: 'VT323', monospace;
  font-size: 1rem;
  color: var(--text-primary);
  transition: all 0.8s ease;
}

.modal-form-group input,
.modal-form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: 'VT323', monospace;
  font-size: 1rem;
  resize: vertical;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: all 0.8s ease;
}

.modal-form-group input::placeholder,
.modal-form-group textarea::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

.modal-form-group input:focus,
.modal-form-group textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.2);
}

.modal-reply-actions {
  display: flex;
  gap: 0.75rem;
}

.modal-submit-reply,
.modal-cancel-reply {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-family: 'VT323', monospace;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-submit-reply {
  background: var(--accent-primary);
  color: var(--bg-primary);
}

.modal-submit-reply:hover {
  background: var(--accent-secondary);
  transform: translateY(-2px);
}

.modal-submit-reply:disabled {
  background: var(--border-color);
  cursor: not-allowed;
  opacity: 0.5;
}

.modal-cancel-reply {
  background: var(--text-secondary);
  color: var(--bg-primary);
}

.modal-cancel-reply:hover {
  background: var(--border-strong);
  transform: translateY(-2px);
}

/* ============================================
   THEME SUPPORT
   ============================================ */

/* Night Mode */
body.night-mode .post-container {
  background: rgba(42, 42, 42, 0.95);
  border-color: #fff;
}

body.night-mode .post-title,
body.night-mode .comments-header h2 {
  color: white;
}

body.night-mode .post-content {
  color: #ccc;
}

body.night-mode .comment-form-container {
  background: rgba(42, 42, 42, 0.9);
  border-color: #fff;
}

body.night-mode .comment {
  background: #333;
  border-color: #555;
}

body.night-mode .comment-reply {
  background: #2a2a2a;
}

body.night-mode .form-group input,
body.night-mode .form-group textarea {
  background: #1a1a1a;
  color: white;
  border-color: #555;
}

body.night-mode .reply-form {
  background: #2a2a2a;
  border-color: #555;
}

body.night-mode .related-posts {
  background: #1a1a1a;
}

body.night-mode .related-card {
  background: #2a2a2a;
  border-color: #555;
}

body.night-mode .related-card-title {
  color: white;
}

/* Cyberpunk Mode */
body.cyberpunk-mode .post-container {
  background: rgba(10, 10, 35, 0.95);
  border-color: #00ffff;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

body.cyberpunk-mode .post-title,
body.cyberpunk-mode .comments-header h2 {
  color: #ff00ff;
  text-shadow: 0 0 10px #ff00ff;
}

body.cyberpunk-mode .comments-section {
  background: #0a0a0a;
  border-top-color: #ff00ff;
}

body.cyberpunk-mode .comment-form-container {
  background: rgba(26, 0, 51, 0.9);
  border-color: #00ffff;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

body.cyberpunk-mode .comment {
  background: #16213e;
  border-color: #ff00ff;
}

body.cyberpunk-mode .comment-reply {
  background: #1a1a3e;
  border-left-color: #00ffff;
}

/* Blueprint Mode */
body.blueprint-mode .comment-form-container {
  background: rgba(30, 58, 138, 0.9);
  border-color: #ffffff;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

/* Monochrome Mode */
body.monochrome-mode {
  background: #f5f5dc;
}

body.monochrome-mode .post-container {
  background: rgba(245, 245, 220, 0.95);
  border-color: #8b4513;
}

body.monochrome-mode .post-title,
body.monochrome-mode .comments-header h2 {
  color: #654321;
}

body.monochrome-mode .comment-form-container {
  background: rgba(245, 245, 220, 0.9);
  border-color: #8b4513;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
  .post-article,
  .comments-section {
    padding: 0 1rem;
  }

  .post-container {
    padding: 2rem 1.5rem;
  }

  .post-title {
    font-size: 2rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .post-actions {
    flex-direction: column;
    align-items: center;
  }

  .comment-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .comment-reply {
    margin-left: 1rem;
  }

  .comment-replies {
    margin-left: 0;
    padding-left: 0;
  }

  .comments-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .reply-actions {
    flex-direction: column;
  }

  .submit-reply,
  .cancel-reply {
    width: 100%;
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .submit-comment {
    width: 100%;
    justify-content: center;
  }
}
