/**
 * Blog Styles for BookMyMedicare
 * Modern, responsive blog design with SEO optimization
 */

/* Blog Section Styles */
.blog-section {
  background: #f8f9fa;
  min-height: 60vh;
}

.section-header {
  margin-bottom: 3rem;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--theme-primary);
  margin-bottom: 0.5rem;
}

.section-subtitle {
  font-size: 1.1rem;
  color: #6c757d;
  margin-bottom: 0;
}

/* Blog Cards */
.blog-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border: none;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.blog-image {
  position: relative;
  overflow: hidden;
  height: 200px;
  flex-shrink: 0;
}

.featured-blog .blog-image {
  height: 250px;
}

.blog-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.blog-card:hover .blog-image img {
  transform: scale(1.05);
}

.blog-category {
  position: absolute;
  top: 15px;
  left: 15px;
  background: var(--theme-primary);
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 2;
}

.blog-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: #6c757d;
  flex-wrap: wrap;
}

.blog-meta span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.blog-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  line-height: 1.4;
  flex-shrink: 0;
}

.blog-title a {
  color: var(--theme-primary);
  text-decoration: none;
}

.blog-title a:hover {
  color: var(--theme-secondry);
}

.blog-excerpt {
  color: #6c757d;
  line-height: 1.6;
  margin-bottom: 1rem;
  flex: 1;
}

.blog-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid #eee;
  margin-top: auto;
}

.blog-author {
  font-size: 0.85rem;
  color: #6c757d;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.read-more {
  color: var(--theme-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s ease;
}

.read-more:hover {
  color: var(--theme-secondry);
  transform: translateX(3px);
}

/* Blog Filters */
.blog-filters {
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
}

.search-form .input-group {
  max-width: 300px;
}

.results-count {
  font-size: 0.9rem;
}

/* Pagination */
.pagination .page-link {
  color: var(--theme-primary);
  border: 1px solid #dee2e6;
  padding: 0.5rem 0.75rem;
  transition: all 0.2s ease;
}

.pagination .page-item.active .page-link {
  background-color: var(--theme-primary);
  border-color: var(--theme-primary);
}

.pagination .page-link:hover {
  color: var(--theme-secondry);
  background-color: #f8f9fa;
  transform: translateY(-1px);
}

/* No Results */
.no-results {
  background: white;
  border-radius: 15px;
  margin: 2rem 0;
  padding: 3rem 2rem;
}

/* Blog Sidebar */
.blog-sidebar {
  position: sticky;
  top: 2rem;
}

.sidebar-widget {
  background: white;
  border-radius: 15px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.sidebar-widget:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.widget-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--theme-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #f8f9fa;
}

/* Category List */
.category-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: #495057;
  transition: all 0.2s ease;
}

.category-item:hover,
.category-item.active {
  background: rgba(9, 51, 91, 0.1);
  color: var(--theme-primary);
  transform: translateX(3px);
}

.category-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.category-name {
  flex: 1;
  font-weight: 500;
}

.category-count {
  background: #f8f9fa;
  color: #6c757d;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.category-item.active .category-count {
  background: var(--theme-primary);
  color: white;
}

/* Recent Posts */
.recent-posts {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.recent-post {
  display: flex;
  gap: 0.75rem;
  transition: all 0.2s ease;
  padding: 0.5rem;
  border-radius: 8px;
}

.recent-post:hover {
  background: #f8f9fa;
}

.recent-post-image {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
}

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

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

.recent-post-content {
  flex: 1;
}

.recent-post-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.25rem;
}

.recent-post-title a {
  color: var(--theme-primary);
  text-decoration: none;
}

.recent-post-title a:hover {
  color: var(--theme-secondry);
}

.recent-post-meta {
  font-size: 0.8rem;
  color: #6c757d;
}

/* CTA Widget */
.cta-widget {
  background: linear-gradient(
    135deg,
    var(--theme-primary),
    var(--theme-secondry)
  );
  color: white;
  position: relative;
  overflow: hidden;
}

.cta-widget::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  transform: rotate(45deg);
}

.cta-widget .widget-title {
  color: white;
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

.cta-content {
  position: relative;
  z-index: 2;
}

.cta-content h4 {
  color: white;
  margin-bottom: 0.75rem;
}

.cta-content p {
  margin-bottom: 1rem;
  opacity: 0.9;
}

.cta-content .btn {
  background: white;
  color: var(--theme-primary);
  border: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.cta-content .btn:hover {
  background: #f8f9fa;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Single Blog Post Styles */
.blog-post-header {
  max-width: 800px;
  margin: 0 auto;
}

.blog-category-badge {
  display: inline-block;
  background: var(--theme-primary);
  color: white;
  padding: 8px 16px;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.blog-post-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.blog-post-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.blog-post-section {
  background: #f8f9fa;
}

.blog-featured-image {
  text-align: center;
  margin-bottom: 2rem;
}

.blog-featured-image img {
  max-height: 400px;
  width: 100%;
  object-fit: cover;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border-radius: 15px;
}

.blog-excerpt {
  background: white;
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  border-left: 4px solid var(--theme-primary);
  margin-bottom: 2rem;
}

.blog-excerpt .lead {
  font-size: 1.2rem;
  color: #495057;
  margin-bottom: 0;
  line-height: 1.6;
}

.blog-content {
  background: white;
  padding: 3rem;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  font-size: 1.1rem;
  line-height: 1.8;
  color: #495057;
}

.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4,
.blog-content h5,
.blog-content h6 {
  color: var(--theme-primary);
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.blog-content h2 {
  font-size: 1.8rem;
  border-bottom: 2px solid #f8f9fa;
  padding-bottom: 0.5rem;
}

.blog-content h3 {
  font-size: 1.5rem;
}

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

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

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

.blog-content blockquote {
  background: #f8f9fa;
  border-left: 4px solid var(--theme-primary);
  padding: 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  border-radius: 0 8px 8px 0;
}

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

.blog-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.blog-content th,
.blog-content td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.blog-content th {
  background: var(--theme-primary);
  color: white;
  font-weight: 600;
}

/* Blog Tags */
.blog-tags {
  background: white;
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  margin-top: 2rem;
}

.tags-title {
  color: var(--theme-primary);
  font-weight: 600;
  margin-bottom: 1rem;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-item {
  background: #f8f9fa;
  color: #495057;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid #dee2e6;
  transition: all 0.2s ease;
}

.tag-item:hover {
  background: var(--theme-primary);
  color: white;
  transform: translateY(-1px);
}

/* Social Share */
.blog-share {
  background: white;
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  margin-top: 2rem;
}

.share-title {
  color: var(--theme-primary);
  font-weight: 600;
  margin-bottom: 1rem;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.share-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.share-btn.facebook {
  background: #1877f2;
  color: white;
}

.share-btn.twitter {
  background: #1da1f2;
  color: white;
}

.share-btn.linkedin {
  background: #0077b5;
  color: white;
}

.share-btn.whatsapp {
  background: #25d366;
  color: white;
}

.share-btn.copy-link {
  background: #6c757d;
  color: white;
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  color: white;
  text-decoration: none;
}

/* Author Bio */
.author-bio {
  background: white;
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  margin-top: 2rem;
}

.author-card {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.author-avatar {
  flex-shrink: 0;
}

.author-avatar img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--theme-primary);
}

.author-name {
  color: var(--theme-primary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.author-description {
  color: #6c757d;
  margin-bottom: 0;
  line-height: 1.6;
}

/* Table of Contents */
.toc-widget {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border: 1px solid #dee2e6;
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toc-item {
  display: block;
  color: #495057;
  text-decoration: none;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f8f9fa;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.toc-item:hover,
.toc-item.active {
  color: var(--theme-primary);
  text-decoration: none;
  transform: translateX(5px);
}

.toc-item.toc-h3 {
  padding-left: 1rem;
  font-size: 0.85rem;
}

.toc-item.toc-h4 {
  padding-left: 2rem;
  font-size: 0.8rem;
}

/* Related Posts */
.related-posts {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.related-post {
  display: flex;
  gap: 0.75rem;
  transition: all 0.2s ease;
  padding: 0.5rem;
  border-radius: 8px;
}

.related-post:hover {
  background: #f8f9fa;
}

.related-post-image {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
}

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

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

.related-post-content {
  flex: 1;
}

.related-post-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.related-post-title a {
  color: var(--theme-primary);
  text-decoration: none;
}

.related-post-title a:hover {
  color: var(--theme-secondry);
}

.related-post-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: #6c757d;
}

/* Responsive Design */
@media (max-width: 768px) {
  .section-title {
    font-size: 2rem;
  }

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

  .blog-post-meta {
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
  }

  .blog-filters {
    padding: 1rem;
  }

  .blog-filters .row > div {
    margin-bottom: 1rem;
  }

  .blog-filters .col-md-6:last-child {
    margin-bottom: 0;
  }

  .search-form .input-group {
    max-width: 100%;
  }

  .blog-sidebar {
    position: static;
    margin-top: 3rem;
  }

  .blog-meta {
    flex-direction: column;
    gap: 0.5rem;
  }

  .blog-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .blog-content {
    padding: 2rem 1.5rem;
  }

  .blog-excerpt {
    padding: 1.5rem;
  }

  .blog-tags,
  .blog-share,
  .author-bio {
    padding: 1.5rem;
  }

  .share-buttons {
    justify-content: center;
  }

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

  .related-post {
    flex-direction: column;
  }

  .related-post-image {
    width: 100%;
    height: 150px;
  }
}

@media (max-width: 576px) {
  .blog-card {
    margin-bottom: 1.5rem;
  }

  .blog-content {
    padding: 1.5rem 1rem;
  }

  .blog-excerpt {
    padding: 1rem;
  }

  .sidebar-widget {
    padding: 1rem;
  }

  .share-buttons {
    flex-direction: column;
  }

  .share-btn {
    justify-content: center;
  }
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in-left {
  animation: slideInLeft 0.6s ease-in-out;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Loading States */
.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

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

/* Print Styles */
@media print {
  .blog-sidebar,
  .blog-share,
  .breadcrumb,
  .navbar,
  .footer {
    display: none !important;
  }

  .blog-content {
    box-shadow: none;
    padding: 0;
  }

  .blog-post-title {
    color: #000 !important;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .blog-card {
    border: 2px solid #000;
  }

  .blog-category {
    border: 1px solid #000;
  }

  .sidebar-widget {
    border: 1px solid #000;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .blog-card,
  .share-btn,
  .category-item,
  .recent-post,
  .related-post {
    transition: none;
  }

  .blog-card:hover {
    transform: none;
  }

  .fade-in,
  .slide-in-left {
    animation: none;
  }
}
