/* =============================================================================
   Blog Page Layout Fixes
   Addressing spacing, button visibility, dropdown overlap, and newsletter issues
   ============================================================================= */

/* Fix Stats Box Spacing */
.blog-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  margin-top: 48px;
  padding: 0 16px;
}

.stat-item {
  flex: 1;
  min-width: 140px;
  max-width: 200px;
  text-align: center;
  color: white;
  padding: 24px 16px;
  border-radius: 12px;
  backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  margin: 8px;
}

.stat-item:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Fix Author Action Buttons */
.author-actions {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.author-actions .btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
  justify-content: center;
}

/* Fix Write Post Button - Make it highly visible */
.author-actions .btn-success {
  background-color: #059669;
  border-color: #059669;
  color: #ffffff;
  text-shadow: none;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.author-actions .btn-success:hover {
  background-color: #047857;
  border-color: #047857;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.4);
}

/* Fix Outline Buttons */
.author-actions .btn-outline-light {
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: #ffffff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
}

.author-actions .btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.7);
  color: #ffffff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  transform: translateY(-2px);
}

/* Fix Dropdown Menu Overlap Issues */
.blog-filters {
  background: linear-gradient(to bottom, #ffffff, #f8fafc);
  border-bottom: 1px solid #e2e8f0;
  padding: 32px 0;
  margin-bottom: 32px;
}

.blog-filters .card {
  border: none;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  background: #ffffff;
  overflow: visible;
}

.blog-filters .card-body {
  padding: 32px;
}

.blog-filter-form .row {
  align-items: end;
}

.blog-filter-form .col-md-3,
.blog-filter-form .col-md-4 {
  margin-bottom: 16px;
}

/* Improve Form Select Spacing and Visibility */
.form-select,
.form-control {
  padding: 14px 16px;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  background-color: #ffffff;
  color: #374151;
  min-height: 52px;
  line-height: 1.4;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  margin-bottom: 8px;
}

.form-select:focus,
.form-control:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  outline: none;
  z-index: 10;
}

/* Fix Search Button */
.blog-filter-form .btn-primary {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
  font-weight: 600;
  padding: 14px 24px;
  border-radius: 8px;
  min-height: 52px;
  font-size: 15px;
}

.blog-filter-form .btn-primary:hover {
  background-color: #1e40af;
  border-color: #1e40af;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.3);
}

/* Fix Newsletter/Stay Updated Box */
.newsletter-signup,
.stay-updated-box,
.newsletter-form {
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  margin-bottom: 24px;
}

.newsletter-signup h5,
.stay-updated-box h5 {
  color: #1f2937;
  font-weight: 700;
  margin-bottom: 16px;
  font-size: 18px;
}

.newsletter-signup p,
.stay-updated-box p {
  color: #4b5563;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 20px;
}

.newsletter-form .input-group {
  background: #ffffff;
  border: 2px solid #d1d5db;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
}

.newsletter-form .form-control {
  border: none;
  background: transparent;
  color: #374151;
  font-size: 15px;
  padding: 12px 16px;
  margin-bottom: 0;
  flex: 1;
  height: 46px;
  min-height: 46px;
}

.newsletter-form .form-control:focus {
  box-shadow: none;
  border-color: transparent;
}

.newsletter-form .btn {
  border: none;
  background-color: #059669;
  color: #ffffff;
  font-weight: 600;
  padding: 12px 20px;
  font-size: 15px;
  transition: all 0.3s ease;
  height: 46px;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.newsletter-form .btn:hover {
  background-color: #047857;
  color: #ffffff;
  transform: translateX(-2px);
}

/* Fix Sidebar Card Spacing */
.blog-sidebar .card {
  border: none;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  background: #ffffff;
  margin-bottom: 32px;
  overflow: hidden;
}

.blog-sidebar .card-header {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border-bottom: 2px solid #e2e8f0;
  color: #1f2937;
  font-weight: 700;
  padding: 20px 24px;
  font-size: 16px;
}

.blog-sidebar .card-body {
  padding: 24px;
}

/* Fix Featured Post Card */
.featured-post-card {
  margin-bottom: 24px;
}

.featured-post-card .card {
  border: none;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  background: #ffffff;
  overflow: hidden;
  transition: all 0.4s ease;
}

.featured-post-card .card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

/* Responsive Layout Fixes */
@media (max-width: 768px) {
  .blog-stats {
    flex-direction: column;
    gap: 16px;
    margin-top: 32px;
  }
  
  .stat-item {
    max-width: none;
    margin: 0 auto 16px auto;
    width: 100%;
    max-width: 280px;
  }
  
  .author-actions {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  
  .author-actions .btn {
    width: 100%;
    max-width: 280px;
  }
  
  .blog-filters .card-body {
    padding: 24px 16px;
  }
  
  .blog-filter-form .col-md-3,
  .blog-filter-form .col-md-4 {
    margin-bottom: 20px;
  }
  
  .blog-filter-form .row {
    margin-bottom: 0;
  }
  
  .newsletter-signup,
  .stay-updated-box {
    padding: 24px 16px;
    margin-bottom: 20px;
  }
  
  .blog-sidebar .card {
    margin-bottom: 24px;
  }
}

@media (max-width: 576px) {
  .blog-stats {
    padding: 0 8px;
  }
  
  .stat-item {
    padding: 20px 12px;
    font-size: 14px;
  }
  
  .stat-number {
    font-size: 28px;
  }
  
  .form-select,
  .form-control {
    font-size: 16px; /* Prevents zoom on iOS */
    min-height: 48px;
  }
  
  .blog-filters .card-body {
    padding: 20px 12px;
  }
}

/* Fix Container Spacing */
.container {
  padding-left: 20px;
  padding-right: 20px;
}

@media (min-width: 1200px) {
  .container {
    max-width: 1140px;
    padding-left: 15px;
    padding-right: 15px;
  }
}

/* Additional Visual Improvements */
.blog-content {
  padding: 48px 0;
}

.blog-filters + .blog-content {
  padding-top: 0;
}

/* Fix any remaining overlap issues */
.row > * {
  position: relative;
  z-index: 1;
}

.dropdown-menu,
.form-select[multiple],
.form-select[size] {
  z-index: 1050;
}