/**
 * Text visibility fixes for portfolio
 * This file ensures proper contrast between text and backgrounds
 */

/* Global text color adjustments */
:root {
  --text-light: #F9FAFB;
  --text-dark: #1F2937;
  --text-muted-light: #D1D5DB;
  --text-muted-dark: #6B7280;
}

/* Section specific fixes */
/* Light sections */
#services, #work, #about, #blog {
  color: var(--text-dark);
}

#services h2, #services h5, #services h6,
#work h2, #work h5, #work h6, 
#about h2, #about h4,
#blog h2, #blog h5, #blog h6 {
  color: var(--text-dark) !important;
}

/* Dark sections */
#home, #reviews, #contact {
  color: var(--text-light);
}

#home h1, #home h2, #home h6,
#reviews h2, #reviews h5, #reviews h6,
#contact h2, #contact h5, #contact h6 {
  color: var(--text-light) !important;
}

/* Light containers on any background */
.bg-white, .bg-light, .bg-gray-50, .bg-gray-100 {
  color: var(--text-dark);
}

.bg-white h5, .bg-white p, 
.bg-light h5, .bg-light p, 
.bg-gray-50 h5, .bg-gray-50 p,
.bg-gray-100 h5, .bg-gray-100 p {
  color: var(--text-dark) !important;
}

/* Dark containers on any background */
.bg-dark, .bg-dark-light, 
.from-dark, .from-dark-light {
  color: var(--text-light);
}

.bg-dark h5, .bg-dark p, 
.bg-dark-light h5, .bg-dark-light p,
.from-dark h5, .from-dark p,
.from-dark-light h5, .from-dark-light p {
  color: var(--text-light) !important;
}

/* Fix headings on light backgrounds */
.bg-white h1, .bg-white h2, .bg-white h3, .bg-white h4, .bg-white h5, .bg-white h6,
.bg-light h1, .bg-light h2, .bg-light h3, .bg-light h4, .bg-light h5, .bg-light h6,
.bg-gray-50 h1, .bg-gray-50 h2, .bg-gray-50 h3, .bg-gray-50 h4, .bg-gray-50 h5, .bg-gray-50 h6,
.bg-gray-100 h1, .bg-gray-100 h2, .bg-gray-100 h3, .bg-gray-100 h4, .bg-gray-100 h5, .bg-gray-100 h6 {
  color: var(--text-dark) !important;
}

/* Fix headings on dark backgrounds */
.bg-dark h1, .bg-dark h2, .bg-dark h3, .bg-dark h4, .bg-dark h5, .bg-dark h6,
.bg-dark-light h1, .bg-dark-light h2, .bg-dark-light h3, .bg-dark-light h4, .bg-dark-light h5, .bg-dark-light h6,
.bg-gradient-to-r.from-dark h1, .bg-gradient-to-r.from-dark h2, .bg-gradient-to-r.from-dark h3, 
.bg-gradient-to-r.from-dark h4, .bg-gradient-to-r.from-dark h5, .bg-gradient-to-r.from-dark h6,
.bg-gradient-to-br.from-dark h1, .bg-gradient-to-br.from-dark h2, .bg-gradient-to-br.from-dark h3,
.bg-gradient-to-br.from-dark h4, .bg-gradient-to-br.from-dark h5, .bg-gradient-to-br.from-dark h6 {
  color: var(--text-light) !important;
}

/* Fix paragraph text on light backgrounds */
.bg-white p, .bg-light p, .bg-gray-50 p, .bg-gray-100 p {
  color: var(--text-dark) !important;
}

/* Fix paragraph text on dark backgrounds */
.bg-dark p, .bg-dark-light p, 
.bg-gradient-to-r.from-dark p, .bg-gradient-to-br.from-dark p {
  color: var(--text-light) !important;
  opacity: 0.9;
}

/* Service cards text fixes */
.bg-white .text-gray-600 {
  color: #4B5563 !important;
}

/* Blog section visibility fixes */
#blog .text-gray-800 {
  color: #1F2937 !important;
}

#blog .text-gray-600 {
  color: #4B5563 !important;
}

#blog h5 {
  color: #1F2937 !important;
}

/* Testimonials */
#reviews p {
  color: #E0E7FF !important;
}

#reviews .text-indigo-200,
#reviews .text-indigo-300 {
  color: #C7D2FE !important;
}

/* Enhance contrast of muted text on dark backgrounds */
.bg-dark .text-white/80, 
.bg-dark-light .text-white/80,
.bg-gradient-to-r.from-dark .text-white/80 {
  color: rgba(255, 255, 255, 0.9) !important;
}

.bg-dark .text-white/70, 
.bg-dark-light .text-white/70,
.bg-gradient-to-r.from-dark .text-white/70 {
  color: rgba(255, 255, 255, 0.8) !important;
}

/* Enhance all accent colors for better visibility */
.text-primary-light {
  color: #93C5FD !important;
}

.text-primary {
  color: #3B82F6 !important;
}

/* Fix visibility of headings within containers */
.section-title h2 {
  color: var(--text-dark) !important;
}

.bg-dark .section-title h2,
.bg-dark-light .section-title h2,
.bg-gradient-to-r.from-dark .section-title h2,
.bg-gradient-to-br.from-dark .section-title h2,
.bg-gradient-to-br.from-indigo-900 .section-title h2,
.bg-gradient-to-br.from-indigo-600 .section-title h2 {
  color: var(--text-light) !important;
}

/* Fix emphasis texts and subtitles */
.text-indigo-600 {
  color: #4F46E5 !important;
}

.bg-dark .text-indigo-600,
.bg-dark-light .text-indigo-600 {
  color: #818CF8 !important;
}

/* Fix for skill bars text */
.skill-name h6, .skill-name span {
  color: var(--text-dark) !important;
}

/* Fix counter section */
.counter-number, .counter-title {
  color: var(--text-dark) !important;
}

/* Forms in dark sections */
.bg-dark input, 
.bg-dark textarea,
.bg-dark-light input, 
.bg-dark-light textarea,
.from-dark input, 
.from-dark textarea {
  color: white !important;
}

/* Gradient card text */
.bg-gradient-to-r.from-primary p,
.bg-gradient-to-r.from-primary h3,
.bg-gradient-to-r.from-secondary p,
.bg-gradient-to-r.from-secondary h3 {
  color: white !important;
}

/* Social media icons in all contexts */
.social-icon i, 
.fab, .fas, .far, .fa {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Specific fixes for sections with gradient backgrounds */
.bg-gradient-to-br.from-indigo-900 h2,
.bg-gradient-to-br.from-indigo-900 h3,
.bg-gradient-to-br.from-indigo-900 h6,
.bg-gradient-to-br.from-indigo-600 h2,
.bg-gradient-to-br.from-indigo-600 h3,
.bg-gradient-to-br.from-indigo-600 h6 {
  color: white !important;
}

/* Fix for "Let's Work Together" and other contact headings */
#contact h2, #contact h3, #contact h5, #contact h6, 
#contact .font-semibold, #contact .text-indigo-300 {
  color: white !important;
}

/* Fix for "Recent Projects" heading */
#work h2, #work h6, #work .text-indigo-300 {
  color: white !important;
}
