/* ======= Blog Page Styles ======= */

/* Blog Header Section */
.blog-header {
  position: relative;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 50%, #f7fee7 100%);
  border-radius: 0 0 32px 32px;
  overflow: hidden;
}

/* Blog Filters Section */
.blog-filters {
  border-bottom: 1px solid rgba(34, 197, 94, 0.1);
}

/* Search Container */
.search-container {
  position: relative;
}

.blog-search {
  padding: 12px 50px 12px 20px;
  border: 2px solid rgba(34, 197, 94, 0.1);
  border-radius: 25px;
  background: white;
  font-size: 0.95rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.08);
}

.blog-search:focus {
  outline: none;
  border-color: #22c55e;
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.15);
  transform: translateY(-1px);
}

.search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: #22c55e;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.3s ease;
  cursor: pointer;
}

.search-btn:hover {
  background: #16a34a;
  transform: translateY(-50%) scale(1.05);
}

/* Category Filter */
.category-select {
  border: 2px solid rgba(34, 197, 94, 0.1);
  border-radius: 16px;
  padding: 12px 16px;
  background: white;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.08);
}

.category-select:focus {
  outline: none;
  border-color: #22c55e;
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.15);
}

/* Blog Posts Container */
.blog-posts-container {
  min-height: 600px;
}

/* Blog Post Cards */
.blog-post {
  margin-bottom: 2rem;
}

.blog-post-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(34, 197, 94, 0.05);
}

.blog-post-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(34, 197, 94, 0.15);
}

.blog-post-image {
  position: relative;
  height: 250px;
  overflow: hidden;
}

.blog-post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.blog-post-card:hover .blog-post-image img {
  transform: scale(1.05);
}

.blog-post-category {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(34, 197, 94, 0.9);
  color: white;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.blog-post-content {
  padding: 30px;
}

.blog-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: #6b7280;
}

.blog-post-meta i {
  margin-right: 4px;
  color: #22c55e;
}

.blog-post-title {
  margin-bottom: 16px;
}

.blog-post-title a {
  color: #1f2937;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.3;
  transition: color 0.3s ease;
}

.blog-post-title a:hover {
  color: #22c55e;
}

.blog-post-excerpt {
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.blog-post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.blog-read-more {
  background: transparent;
  border: 2px solid #22c55e;
  color: #22c55e;
  padding: 8px 20px;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.blog-read-more:hover {
  background: #22c55e;
  color: white;
  transform: translateX(4px);
}

.blog-post-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.blog-tag {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Loading State */
.loading-state .spinner-border {
  width: 3rem;
  height: 3rem;
}

/* No Results State */
.no-results-icon {
  font-size: 4rem;
  color: #d1d5db;
  margin-bottom: 1rem;
}

/* Pagination */
.blog-pagination {
  margin-top: 3rem;
}

.pagination .page-link {
  border: 2px solid rgba(34, 197, 94, 0.1);
  color: #22c55e;
  padding: 12px 16px;
  margin: 0 4px;
  border-radius: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.pagination .page-link:hover {
  background: #22c55e;
  border-color: #22c55e;
  color: white;
  transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
  background: #22c55e;
  border-color: #22c55e;
  color: white;
}

.pagination .page-item.disabled .page-link {
  color: #d1d5db;
  border-color: rgba(209, 213, 219, 0.3);
}

/* Sidebar Styles */
.blog-sidebar {
  position: sticky;
  top: 100px;
}

.sidebar-widget {
  background: white;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.05);
}

.widget-title {
  color: #1f2937;
  font-weight: 700;
  margin-bottom: 20px;
  font-size: 1.1rem;
  position: relative;
  padding-bottom: 12px;
}

.widget-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: #22c55e;
  border-radius: 2px;
}

/* Recent Posts Widget */
.recent-post {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(34, 197, 94, 0.1);
}

.recent-post:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.recent-post-image {
  flex-shrink: 0;
  width: 70px;
  height: 70px;
  border-radius: 8px;
  overflow: hidden;
}

.recent-post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recent-post-content h6 {
  margin-bottom: 8px;
  line-height: 1.3;
}

.recent-post-content h6 a {
  color: #1f2937;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.3s ease;
}

.recent-post-content h6 a:hover {
  color: #22c55e;
}

.recent-post-date {
  font-size: 0.8rem;
  color: #6b7280;
}

/* Categories List */
.categories-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: 10px;
  text-decoration: none;
  color: #6b7280;
  transition: all 0.3s ease;
  border: 1px solid rgba(34, 197, 94, 0.1);
}

.category-link:hover {
  background: rgba(34, 197, 94, 0.05);
  color: #22c55e;
  transform: translateX(4px);
}

.category-count {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Tags Cloud */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-link {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  padding: 6px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.tag-link:hover {
  background: #22c55e;
  color: white;
  transform: translateY(-2px);
}

/* Newsletter Widget */
.newsletter-widget {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 2px solid rgba(34, 197, 94, 0.1);
}

.widget-description {
  color: #6b7280;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.newsletter-form .input-group {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.1);
}

.newsletter-form .form-control {
  border: none;
  padding: 12px 16px;
  font-size: 0.9rem;
}

.newsletter-form .btn {
  border: none;
  background: #22c55e;
  color: white;
  padding: 12px 16px;
  transition: background 0.3s ease;
}

.newsletter-form .btn:hover {
  background: #16a34a;
}

/* CTA Widget */
.cta-widget {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
}

.cta-widget .widget-title {
  color: white;
}

.cta-widget .widget-title::after {
  background: rgba(255, 255, 255, 0.3);
}

.cta-widget p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 20px;
}

.cta-widget .btn {
  background: white;
  color: #22c55e;
  border: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

.cta-widget .btn:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 991.98px) {
  .blog-sidebar {
    position: static;
    margin-top: 3rem;
  }
  
  .blog-post-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .blog-post-meta {
    gap: 12px;
    flex-direction: column;
  }
  
  .blog-filters .row {
    flex-direction: column;
  }
  
  .blog-filters .col-lg-6 {
    margin-bottom: 1rem;
  }
  
  .category-filter {
    text-align: left !important;
  }
}

@media (max-width: 767.98px) {
  .blog-header {
    padding: 3rem 0 !important;
  }
  
  .blog-header h1 {
    font-size: 2.5rem !important;
  }
  
  .blog-post-content {
    padding: 20px;
  }
  
  .blog-post-image {
    height: 200px;
  }
  
  .blog-post-title a {
    font-size: 1.2rem;
  }
  
  .sidebar-widget {
    padding: 20px;
  }
  
  .blog-post-meta {
    font-size: 0.8rem;
  }
  
  .recent-post {
    flex-direction: column;
    text-align: center;
  }
  
  .recent-post-image {
    width: 100%;
    height: 120px;
    margin-bottom: 8px;
  }
}

@media (max-width: 575.98px) {
  .blog-header h1 {
    font-size: 2rem !important;
  }
  
  .blog-header p {
    font-size: 1rem !important;
  }
  
  .blog-post-image {
    height: 180px;
  }
  
  .blog-post-content {
    padding: 16px;
  }
  
  .blog-post-title a {
    font-size: 1.1rem;
  }
  
  .sidebar-widget {
    padding: 16px;
  }
  
  .search-container {
    margin-bottom: 1rem;
  }
}

/* Animation Classes */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

/* Custom Scrollbar for Sidebar */
.blog-sidebar::-webkit-scrollbar {
  width: 6px;
}

.blog-sidebar::-webkit-scrollbar-track {
  background: rgba(34, 197, 94, 0.05);
  border-radius: 3px;
}

.blog-sidebar::-webkit-scrollbar-thumb {
  background: rgba(34, 197, 94, 0.3);
  border-radius: 3px;
}

.blog-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(34, 197, 94, 0.5);
}

/* Loading Animation */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading-state {
  animation: pulse 2s infinite;
}

/* Hover Effects */
.blog-post-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.05) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  border-radius: 20px;
}

.blog-post-card:hover::before {
  opacity: 1;
}

/* Focus States for Accessibility */
.blog-search:focus,
.category-select:focus,
.newsletter-form .form-control:focus {
  outline: 2px solid #22c55e;
  outline-offset: 2px;
}

.blog-read-more:focus,
.category-link:focus,
.tag-link:focus {
  outline: 2px solid #22c55e;
  outline-offset: 2px;
}

/* Print Styles */
@media print {
  .blog-sidebar,
  .blog-filters,
  .blog-pagination {
    display: none !important;
  }
  
  .blog-post-card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    break-inside: avoid;
  }
}