/* Blog Post Container */
.blog-post-container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0;
}

/* Blog Header */
.blog-header {
  margin-bottom: 30px;
}

.related-posts .post-title {
  font-size: 1.5rem;
}

.post-title {
  font-size: 2.5rem;
  line-height: 1.3;
  margin: 15px 0;
  color: var(--secondary-color);
}

/* Author info in header */
.author-info {
  display: flex;
  align-items: center;
  margin-right: 20px;
}

.author-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 10px;
}

.author-name {
  font-weight: 600;
}

/* Post sharing */
/* Enhanced Share Buttons */
.post-share {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.post-share span {
  margin-right: 12px;
  font-size: 0.9rem;
  color: #777;
  font-weight: 500;
  position: relative;
  padding-right: 5px;
}

.post-share span:after {
  content: '';
  position: absolute;
  right: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background-color: var(--accent-color);
  transition: width 0.3s ease;
}

.post-share:hover span:after {
  width: 100%;
  left: 0;
  right: auto;
}

.share-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-left: 10px;
  border-radius: 50%;
  color: white;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.share-icon:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 1;
}

.share-icon:hover:before {
  transform: translateY(0);
}

.share-icon i {
  position: relative;
  z-index: 2;
  font-size: 1rem;
}

.share-icon:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.share-icon.twitter {
  background-color: #1DA1F2;
}

.share-icon.facebook {
  background-color: #4267B2;
}

.share-icon.linkedin {
  background-color: #0077B5;
}

/* Tooltip styles */
.share-icon:after {
  content: attr(aria-label);
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background-color: #333;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 10;
}

.share-icon:before {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent #333 transparent;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 10;
}

.share-icon:hover:after,
.share-icon:hover:before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Featured Image */
.featured-image {
  margin-bottom: 30px;
  border-radius: 10px;
  overflow: hidden;
}

.featured-image img {
  width: 100%;
  display: block;
}

.image-caption {
  font-size: 0.9rem;
  color: #666;
  text-align: center;
  padding: 10px;
  background-color: var(--light-gray);
}

/* Table of Contents */
.table-of-contents {
  background-color: var(--light-gray);
  padding: 25px;
  border-radius: 8px;
  margin-bottom: 30px;
  border-left: 3px solid var(--accent-color);
}

.table-of-contents h3 {
  margin-bottom: 15px;
  color: var(--secondary-color);
}

.table-of-contents ul {
  list-style-type: none;
}

.table-of-contents li {
  margin-bottom: 10px;
}

.table-of-contents a {
  color: var(--accent-color);
  text-decoration: none;
  transition: all 0.3s;
  display: inline-block;
}

.table-of-contents a:hover {
  color: var(--hover-color);
  transform: translateX(5px);
}

/* Blog Content */
.blog-content {
  margin-bottom: 50px;
}

.blog-content section {
  margin-bottom: 40px;
}

.blog-content h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: var(--secondary-color);
  position: relative;
  padding-bottom: 10px;
}

.blog-content h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50px;
  height: 3px;
  background-color: var(--accent-color);
}

.blog-content h3 {
  font-size: 1.4rem;
  margin: 25px 0 15px;
  color: var(--secondary-color);
}

.blog-content p {
  margin-bottom: 20px;
  line-height: 1.8;
  font-size: 1.05rem;
  color: #444;
}

.blog-content ul,
.blog-content ol {
  margin: 0 0 20px 20px;
  line-height: 1.8;
}

.blog-content li {
  margin-bottom: 10px;
}

.blog-content blockquote {
  margin: 30px 0;
  padding: 20px 30px;
  background-color: var(--light-gray);
  border-left: 5px solid var(--accent-color);
  font-style: italic;
  color: #555;
}

.blog-content blockquote cite {
  display: block;
  margin-top: 10px;
  font-style: normal;
  font-weight: 600;
  color: #666;
  text-align: right;
}

/* Code Block */
.code-block {
  position: relative;
  margin: 30px 0;
  border-radius: 8px;
  overflow: hidden;
}

.code-block pre {
  background-color: #2c3e50;
  color: #ecf0f1;
  padding: 20px;
  overflow-x: auto;
  font-family: Consolas, Monaco, 'Andale Mono', monospace;
  line-height: 1.5;
  font-size: 0.95rem;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: none;
  border-radius: 4px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
}

.copy-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Tip Box */
.tip-box {
  background-color: rgba(52, 152, 219, 0.1);
  border-left: 4px solid var(--accent-color);
  padding: 20px;
  margin: 30px 0;
  border-radius: 0 8px 8px 0;
}

.tip-box h4 {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  color: var(--accent-color);
}

.tip-box h4 i {
  margin-right: 10px;
}

.tip-box p {
  margin-bottom: 0;
}

/* Image with Caption */
.image-with-caption {
  margin: 30px 0;
}

.image-with-caption img {
  width: 100%;
  border-radius: 8px 8px 0 0;
  display: block;
}

/* Author Bio */
.author-bio {
  display: flex;
  background-color: var(--light-gray);
  padding: 25px;
  border-radius: 10px;
  margin-bottom: 40px;
}

.author-img-large {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 25px;
}

.author-details h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #777;
  margin-bottom: 5px;
}

.author-details h4 {
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: var(--secondary-color);
}

.author-details p {
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 15px;
}

.author-social {
  display: flex;
  gap: 12px;
}

.author-social a {
  color: var(--secondary-color);
  font-size: 1.2rem;
  transition: all 0.3s;
}

.author-social a:hover {
  color: var(--accent-color);
  transform: translateY(-3px);
}

/* Comments Section - UPDATED */
/* Main Comments Section container */
.comments-section {
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid #e9ecef;
}

/* Comments Section Main Title */
.comments-section>h2 {
  font-size: 1.8rem;
  margin-bottom: 30px;
  color: var(--secondary-color);
  display: flex;
  align-items: center;
}

/* Comment Count Badge */
#comment-count {
  display: inline-block;
  background-color: #0d6efd;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 50px;
  font-size: 0.9rem;
  margin-left: 0.5rem;
}

/* Comments Container */
.comments-container {
  margin-bottom: 40px;
}

/* Section titles within comments area */
.section-title {
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: var(--secondary-color);
  position: relative;
  padding-bottom: 10px;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 3px;
  background-color: var(--accent-color);
}

/* Enhanced Comment Form Styling - Fixed */
.comment-form {
  background-color: #f8fbff;
  padding: 1.8rem;
  border-radius: 12px;
  margin-bottom: 2.5rem;
  border: 1px solid #e0e8f5;
  box-shadow: 0 6px 15px rgba(13, 110, 253, 0.08);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.comment-form:hover {
  box-shadow: 0 8px 20px rgba(13, 110, 253, 0.12);
  transform: translateY(-2px);
}

.comment-form::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #0d6efd, #5a9cff);
}

.form-group {
  margin-bottom: 1.2rem;
  position: relative;
}

.comment-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #495057;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 2px solid #e0e8f5;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  background-color: #ffffff;
  color: #495057;
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
}

.comment-form input:hover,
.comment-form textarea:hover {
  border-color: #5a9cff;
}

.comment-form textarea {
  min-height: 120px;
  resize: vertical;
}

.comment-form .input-icon {
  position: absolute;
  top: 38px;
  right: 15px;
  color: #6c757d;
  transition: all 0.3s ease;
}

.comment-form input:focus+.input-icon,
.comment-form textarea:focus+.input-icon {
  color: #0d6efd;
}

.comment-form button {
  background: linear-gradient(90deg, #0d6efd, #3a8bfe);
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 8px rgba(13, 110, 253, 0.2);
}

.comment-form button:hover {
  background: linear-gradient(90deg, #0b5ed7, #2474e9);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(13, 110, 253, 0.25);
}

.comment-form button:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(13, 110, 253, 0.2);
}

.comment-form button i {
  margin-right: 8px;
  font-size: 1.1rem;
}

.required-field::after {
  content: '*';
  color: #dc3545;
  margin-left: 4px;
}

.form-text {
  font-size: 0.85rem;
  color: #6c757d;
  margin-top: 0.5rem;
}

/* Form message container */
.form-message {
  padding: 0.8rem;
  margin: 1rem 0;
  border-radius: 4px;
  font-weight: 500;
  display: flex;
  align-items: center;
  opacity: 0;
  animation: fadeIn 0.5s forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.form-message i {
  margin-right: 0.5rem;
  font-size: 1.2rem;
}

.form-message.success {
  background-color: #d1e7dd;
  border: 1px solid #badbcc;
  color: #0f5132;
}

.form-message.error {
  background-color: #f8d7da;
  border: 1px solid #f5c2c7;
  color: #842029;
}

/* Comments List Container */
.comments-list {
  margin-top: 30px;
}

/* Individual Comment Styling */
.comment {
  margin-bottom: 2rem;
  padding: 1.5rem;
  border-radius: 8px;
  background-color: #f8f9fa;
  border-left: 4px solid #0d6efd;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease-in-out;
  display: flex;
}

.comment:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Comment Avatar */
.comment-avatar {
  margin-right: 20px;
}

.comment-avatar img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

/* Comment Content */
.comment-body {
  flex: 1;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e9ecef;
}

.comment-author {
  font-weight: 700;
  color: #212529;
  font-size: 1.1rem;
}

.author-badge {
  background-color: var(--accent-color);
  color: white;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 8px;
  vertical-align: middle;
}

.comment-date {
  font-size: 0.9rem;
  color: #6c757d;
}

.comment-content {
  line-height: 1.6;
  color: #495057;
}

.comment-meta {
  margin-bottom: 10px;
}

.comment-actions button {
  background: none;
  border: none;
  color: var(--accent-color);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
}

.comment-actions button:hover {
  color: var(--hover-color);
  text-decoration: underline;
}

/* Reply comments styles */
.comment.reply {
  margin-left: 50px;
  background-color: rgba(245, 245, 245, 0.5);
  padding: 20px;
  border-radius: 8px;
  border-bottom: none;
}

/* Status Messages */
.no-comments {
  text-align: center;
  padding: 2rem 1.5rem;
  background-color: #f8f9fa;
  border-radius: 8px;
  margin: 1.5rem 0;
  color: #6c757d;
  border: 1px dashed #ced4da;
}

.loading-comments {
  text-align: center;
  padding: 1.5rem;
  color: #6c757d;
  font-style: italic;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .post-title {
    font-size: 1.5rem;
  }

  .author-bio {
    flex-direction: column;
    text-align: center;
  }

  .author-img-large {
    margin: 0 auto 20px;
  }

  .author-social {
    justify-content: center;
  }

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

  .comment-date {
    margin-top: 0.3rem;
  }

  .comment-form {
    padding: 1.5rem;
  }

  .comment.reply {
    margin-left: 25px;
  }
}

@media (max-width: 576px) {
  .blog-post-container {
    margin: 20px auto;
  }

  .post-meta {
    flex-wrap: wrap;
  }

  .post-share {
    margin-left: 0;
    margin-top: 15px;
    width: 100%;
    justify-content: flex-start;
  }

  .share-icon {
    margin-left: 0;
    margin-right: 12px;
  }

  .comment-avatar img {
    width: 40px;
    height: 40px;
  }

  .comment.reply {
    margin-left: 15px;
  }

  .comment-form {
    padding: 1.2rem;
  }

  .comment-form button {
    width: 100%;
  }
}

.delete-comment-btn {
  background: none;
  border: none;
  color: #ff4757;
  cursor: pointer;
  padding: 5px;
  margin-left: 10px;
}

.delete-comment-btn:hover {
  color: #ff0000;
}

.admin-login-btn {
  background: #f1f1f1;
  border: 1px solid #ddd;
  padding: 5px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.9em;
  margin-bottom: 20px;
}

/* Copy Link Button */
.share-icon.copy-link {
  background-color: #4CAF50;
}

/* Text-to-Speech Button */
.share-icon.text-to-speech {
  background-color: #9C27B0;
}

/* Active state for the TTS button when playing */
.share-icon.text-to-speech.active {
  background-color: #7B1FA2;
}

/* Feedback animation for copy action */
@keyframes copyFeedback {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

.share-icon.copied {
  animation: copyFeedback 0.5s ease;
}

/* Screen reader only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Tooltip for copy and TTS actions */
.share-icon.copy-link:after {
  content: "Copy link";
}

.share-icon.text-to-speech:after {
  content: "Read aloud";
}

.share-icon.text-to-speech.active:after {
  content: "Stop reading";
}

/* Media queries for responsive behavior */
@media (max-width: 576px) {

  .share-icon.copy-link,
  .share-icon.text-to-speech {
    margin-right: 12px;
    margin-left: 0;
  }
}

/* Comment Counter Styles */
.comment-count {
  display: inline-block;
  font-weight: normal;
  color: #666;
}

h2 .comment-count,
h3 .comment-count {
  font-size: 0.8em;
}

/* Badge style for comment count */
.comment-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 12px;
  background-color: #f0f0f0;
  color: #333;
  font-size: 0.85em;
  font-weight: 600;
  margin-left: 8px;
}

/* Animation for count changes */
@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

.comment-count-updated {
  animation: pulse 0.5s ease-in-out;
}

/* Also See / Related Posts Section */
.also-see-section {
  margin: 60px 0 40px;
  padding-top: 30px;
  border-top: 1px solid #e9ecef;
}

.also-see-section h2 {
  font-size: 1.8rem;
  margin-bottom: 30px;
  color: var(--secondary-color);
  position: relative;
  padding-bottom: 10px;
}

.also-see-section h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50px;
  height: 3px;
  background-color: var(--accent-color);
}

.related-posts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
}

.related-post {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.related-post:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.related-post-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.related-post-image {
  height: auto;
  overflow: hidden;
}

.related-post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.related-post:hover .related-post-image img {
  transform: scale(1.05);
}

.related-post-content {
  padding: 15px;
  background-color: white;
}

.related-post .post-category {
  display: inline-block;
  font-size: 0.8rem;
  color: white;
  background-color: var(--accent-color);
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.related-post .post-title {
  font-size: 1.1rem;
  margin: 8px 0;
  line-height: 1.4;
  color: var(--secondary-color);
  transition: color 0.3s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-post:hover .post-title {
  color: var(--accent-color);
}

.related-post .post-meta {
  display: flex;
  font-size: 0.8rem;
  color: #777;
}

.related-post .post-date {
  margin-right: 15px;
}

.related-post .post-meta i {
  margin-right: 5px;
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .related-posts {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .related-posts {
    grid-template-columns: 1fr;
  }

  .related-post-image {
    height: auto;
  }
}

/* Default Styles */
.image-caption,
.blog-content .image-caption {
  display: block;
  font-size: 16px;
  color: #888;
  text-align: center;
  padding: 8px;
  font-style: italic;
  max-width: 100%;
  word-wrap: break-word;
}

/* Tablet: max-width 768px */
@media (max-width: 768px) {

  .image-caption,
  .blog-content .image-caption {
    font-size: 14px;
    padding: 6px;
  }
}

/* Mobile: max-width 480px */
@media (max-width: 480px) {

  .image-caption,
  .blog-content .image-caption {
    font-size: 12px;
    padding: 4px;
  }
}