/* =============================================================================
   Blog Color and Visibility Fixes
   Addressing contrast issues and dropdown problems
   ============================================================================= */

/* Fix Hero Section Text Contrast */
#blog-hero, #news-hero {
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.9) 0%, rgba(99, 102, 241, 0.9) 100%),
              linear-gradient(135deg, #1e3a8a 0%, #6366f1 100%);
}

#news-hero {
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.9) 0%, rgba(52, 211, 153, 0.9) 100%),
              linear-gradient(135deg, #059669 0%, #34d399 100%);
}

/* Improve text readability in hero sections */
.blog-hero-content h1,
.news-hero-content h1 {
  color: #ffffff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  font-weight: 800;
}

.blog-hero-content .lead,
.news-hero-content .lead {
  color: #ffffff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  opacity: 1;
}

/* Fix Statistics Cards Contrast */
.stat-item {
  background: rgba(255, 255, 255, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(20px);
  color: #ffffff;
}

.stat-number {
  color: #ffffff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  font-weight: 900;
}

.stat-label {
  color: #ffffff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  opacity: 1;
  font-weight: 600;
}

/* Fix Author Actions Button Contrast - ONLY for blog content, NOT navbar */
.blog-hero .btn-outline-light,
.news-hero .btn-outline-light,
.author-actions .btn-outline-light {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: #ffffff;
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.blog-hero .btn-outline-light:hover,
.news-hero .btn-outline-light:hover,
.author-actions .btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.7);
  color: #ffffff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-success {
  background: #22c55e;
  border-color: #22c55e;
  color: #ffffff;
  font-weight: 600;
  text-shadow: none;
}

.btn-success:hover {
  background: #16a34a;
  border-color: #16a34a;
  color: #ffffff;
}

/* Fix Dropdown Menu Issues - ONLY for blog content, NOT navbar */
.blog-content .form-control,
.blog-content .form-select,
.blog-content select.form-control {
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  background-color: #ffffff;
  color: #1f2937;
  min-height: 48px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  width: 100%;
  box-sizing: border-box;
}

/* Fix dropdown option display - ONLY for blog content, NOT navbar */
.blog-content select.form-control option,
.blog-filter-form select.form-control option {
  padding: 8px 12px;
  color: #1f2937;
  background-color: #ffffff;
  font-weight: normal;
  white-space: normal;
  word-wrap: break-word;
}

.blog-content select.form-control option:hover,
.blog-filter-form select.form-control option:hover {
  background-color: #f3f4f6;
}

/* Ensure dropdown has proper width */
.blog-filter-form select,
.news-filter-form select {
  width: 100%;
  max-width: none;
  min-width: 200px;
}

/* Fix focus states - ONLY for blog content, NOT navbar */
.blog-content .form-control:focus,
.blog-content .form-select:focus,
.blog-content select.form-control:focus,
.blog-filter-form .form-control:focus,
.blog-filter-form .form-select:focus,
.blog-filter-form select.form-control:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  outline: none;
}

/* Fix card text contrast */
.card-body {
  color: #1f2937;
}

.card-title a {
  color: #111827;
  font-weight: 700;
}

.card-title a:hover {
  color: #1d4ed8;
  text-decoration: none;
}

.card-text {
  color: #4b5563;
  line-height: 1.6;
}

/* Fix meta information visibility */
.post-meta small,
.news-meta small {
  color: #6b7280;
  font-weight: 500;
}

/* Fix badge contrast */
.badge {
  font-weight: 600;
  padding: 6px 12px;
}

.badge-success {
  background-color: #10b981;
  color: #ffffff;
}

.badge-secondary,
.badge-outline-secondary {
  background-color: #6b7280;
  color: #ffffff;
  border: 1px solid #6b7280;
}

.badge-outline-info {
  background-color: #0ea5e9;
  color: #ffffff;
  border: 1px solid #0ea5e9;
}

/* Fix breadcrumb visibility */
.breadcrumb-item a {
  color: #1d4ed8;
  text-decoration: none;
}

.breadcrumb-item a:hover {
  color: #1e40af;
  text-decoration: underline;
}

.breadcrumb-item.active {
  color: #4b5563;
}

/* Fix search input - ONLY for blog content, NOT navbar */
.blog-content input[type="search"],
.blog-content input[type="text"],
.blog-filter-form input[type="search"],
.blog-filter-form input[type="text"] {
  color: #1f2937;
  background-color: #ffffff;
  border: 2px solid #e2e8f0;
}

.blog-content input[type="search"]:focus,
.blog-content input[type="text"]:focus,
.blog-filter-form input[type="search"]:focus,
.blog-filter-form input[type="text"]:focus {
  border-color: #3b82f6;
  color: #1f2937;
}

/* Fix button text visibility */
.btn-primary {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
  font-weight: 600;
}

.btn-primary:hover {
  background-color: #1e40af;
  border-color: #1e40af;
  color: #ffffff;
}

/* Fix sidebar text */
.card-header {
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  color: #1f2937;
  font-weight: 700;
}

.list-group-item {
  color: #374151;
  border-color: #e5e7eb;
}

.list-group-item:hover {
  background-color: #f3f4f6;
  color: #1f2937;
}

/* Fix pagination */
.page-link {
  color: #374151;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
}

.page-link:hover {
  color: #1f2937;
  background-color: #f9fafb;
  border-color: #d1d5db;
}

.page-item.active .page-link {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
}

/* Responsive fixes for mobile */
@media (max-width: 768px) {
  .stat-item {
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.4);
    margin-bottom: 16px;
  }
  
  .blog-filter-form select,
  .news-filter-form select {
    min-width: auto;
    font-size: 14px;
  }
  
  .blog-content .form-control,
  .blog-content .form-select,
  .blog-filter-form .form-control,
  .blog-filter-form .form-select {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* High contrast mode improvements */
@media (prefers-contrast: high) {
  .stat-item {
    background: rgba(255, 255, 255, 0.95);
    color: #000000;
    border: 3px solid #000000;
  }
  
  .stat-number,
  .stat-label {
    color: #000000;
    text-shadow: none;
  }
  
  .blog-hero-content h1,
  .news-hero-content h1,
  .blog-hero-content .lead,
  .news-hero-content .lead {
    text-shadow: 2px 2px 0px #000000;
  }
}

/* Print styles override */
@media print {
  .stat-item {
    background: #ffffff;
    color: #000000;
    border: 2px solid #000000;
  }
  
  .card {
    border: 1px solid #000000;
  }
  
  .btn {
    border: 2px solid #000000;
    color: #000000;
    background: #ffffff;
  }
}