/* NUDGEWIRE ARTICLE CONTRAST FIX - COMPREHENSIVE SOLUTION */

/* ================================================
   ARTICLE CARD STRUCTURE FIX
   ================================================ */

/* Article Card Base */
.article-card {
    background-color: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px !important;
    padding: 1.5rem !important;
    transition: all 0.3s ease !important;
}

.dark .article-card {
    background-color: #1a1a1a !important;
    border: 1px solid #333333 !important;
}

.dark .article-card:hover {
    background-color: #242424 !important;
    border-color: #00d4ff !important;
}

/* Article Category Badge */
.article-category {
    display: inline-block !important;
    padding: 0.25rem 0.75rem !important;
    background-color: #f3f4f6 !important;
    color: #374151 !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    border-radius: 9999px !important;
    margin-bottom: 0.75rem !important;
}

.dark .article-category {
    background-color: #374151 !important;
    color: #e5e7eb !important;
}

/* Article Title */
.article-title {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    color: #111827 !important;
    line-height: 1.4 !important;
    margin-bottom: 0.75rem !important;
    transition: all 0.3s ease !important;
}

.dark .article-title {
    color: #00ff88 !important;
    text-shadow: 
        0 0 10px rgba(0, 255, 136, 0.5),
        0 0 20px rgba(0, 255, 136, 0.3),
        0 0 30px rgba(0, 255, 136, 0.2) !important;
}

.dark .article-title:hover {
    color: #00ffaa !important;
    text-shadow: 
        0 0 15px rgba(0, 255, 136, 0.7),
        0 0 30px rgba(0, 255, 136, 0.5),
        0 0 45px rgba(0, 255, 136, 0.3) !important;
}

/* Article Summary */
.article-summary {
    font-size: 0.95rem !important;
    color: #4b5563 !important;
    line-height: 1.6 !important;
    margin-bottom: 1rem !important;
}

.dark .article-summary {
    color: #d1d5db !important;
}

/* Article Meta Container */
.article-meta {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    font-size: 0.875rem !important;
    color: #6b7280 !important;
}

.dark .article-meta {
    color: #9ca3af !important;
}

/* Article Date */
.article-date {
    display: flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
    color: #6b7280 !important;
}

.dark .article-date {
    color: #9ca3af !important;
}

/* Read Time */
.read-time {
    display: flex !important;
    align-items: center !important;
    gap: 0.25rem !important;
    color: #6b7280 !important;
}

.dark .read-time {
    color: #9ca3af !important;
}

/* Article Grid Container */
.article-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)) !important;
    gap: 2rem !important;
    padding: 2rem !important;
}

/* ================================================
   TEXT COLOR OVERRIDES
   ================================================ */

/* Force all text in articles to have proper contrast */
.article-card * {
    color: inherit !important;
}

.article-card h1,
.article-card h2,
.article-card h3,
.article-card h4,
.article-card h5,
.article-card h6 {
    color: #111827 !important;
}

.dark .article-card h1,
.dark .article-card h2,
.dark .article-card h4,
.dark .article-card h5,
.dark .article-card h6 {
    color: #ffffff !important;
}

/* Special treatment for h3 which are article titles */
.dark .article-card h3 {
    color: #00ff88 !important;
    text-shadow: 
        0 0 10px rgba(0, 255, 136, 0.5),
        0 0 20px rgba(0, 255, 136, 0.3),
        0 0 30px rgba(0, 255, 136, 0.2) !important;
}

.dark .article-card:hover h3 {
    color: #00ffaa !important;
    text-shadow: 
        0 0 15px rgba(0, 255, 136, 0.7),
        0 0 30px rgba(0, 255, 136, 0.5),
        0 0 45px rgba(0, 255, 136, 0.3) !important;
}

.article-card p,
.article-card span:not(.text-2xl):not(.arrow-icon),
.article-card div:not(.article-category) {
    color: #4b5563 !important;
}

.dark .article-card p,
.dark .article-card span:not(.text-2xl):not(.arrow-icon),
.dark .article-card div:not(.article-category) {
    color: #d1d5db !important;
}

/* ================================================
   HERO SECTION FIX
   ================================================ */

.hero-section {
    background-color: #f9fafb !important;
    color: #111827 !important;
}

.dark .hero-section {
    background-color: #0a0a0a !important;
    color: #e5e7eb !important;
}

.hero-section h1,
.hero-section h2,
.hero-section h3 {
    color: #111827 !important;
}

.dark .hero-section h1,
.dark .hero-section h2,
.dark .hero-section h3 {
    color: #ffffff !important;
}

.hero-section p {
    color: #4b5563 !important;
}

.dark .hero-section p {
    color: #d1d5db !important;
}

/* ================================================
   NAVIGATION MENU FIX
   ================================================ */

#nav-menu {
    background-color: #ffffff !important;
}

.dark #nav-menu {
    background-color: #111827 !important;
}

#nav-menu h2 {
    color: #111827 !important;
}

.dark #nav-menu h2 {
    color: #ffffff !important;
}

.category-link span:not(.text-2xl) {
    color: #374151 !important;
}

.dark .category-link span:not(.text-2xl) {
    color: #e5e7eb !important;
}

.category-link:hover {
    background-color: #f3f4f6 !important;
}

.dark .category-link:hover {
    background-color: #1f2937 !important;
}

/* ================================================
   STAT CARDS FIX
   ================================================ */

.stat-card {
    background-color: #ffffff !important;
    border: 1px solid #e5e7eb !important;
}

.dark .stat-card {
    background-color: #1f2937 !important;
    border: 1px solid #374151 !important;
}

.stat-card h3,
.stat-card .text-4xl {
    color: #111827 !important;
}

.dark .stat-card h3,
.dark .stat-card .text-4xl {
    color: #10b981 !important;
}

.stat-card p {
    color: #6b7280 !important;
}

.dark .stat-card p {
    color: #9ca3af !important;
}

/* ================================================
   GRADIENT TEXT EXCEPTIONS
   ================================================ */

/* Keep gradient text special */
.glowing-title,
.gradient-text,
.hero-title {
    background: linear-gradient(45deg, #00ff88, #00d4ff, #00ff88) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* ================================================
   SVG ICON COLORS
   ================================================ */

.article-card svg {
    color: #9ca3af !important;
}

.dark .article-card svg {
    color: #6b7280 !important;
}

/* ================================================
   OVERRIDE INLINE STYLES
   ================================================ */

/* Override any inline dark mode text colors */
.dark [class*="text-gray-900"],
.dark [class*="text-gray-800"],
.dark [class*="text-gray-700"] {
    color: #e5e7eb !important;
}

.dark [class*="text-gray-600"],
.dark [class*="text-gray-500"] {
    color: #9ca3af !important;
}

.dark [class*="text-gray-400"],
.dark [class*="text-gray-300"] {
    color: #d1d5db !important;
}

/* Override backgrounds */
.dark [class*="bg-white"] {
    background-color: #1f2937 !important;
}

.dark [class*="bg-gray-50"],
.dark [class*="bg-gray-100"] {
    background-color: #374151 !important;
}

/* ================================================
   FOOTER DISCLAIMER BOX
   ================================================ */

footer .bg-warning-red\/20 {
    background-color: rgba(239, 68, 68, 0.2) !important;
    border: 1px solid rgba(239, 68, 68, 0.5) !important;
}

footer .bg-warning-red\/20 h3 {
    color: #ef4444 !important;
}

footer .bg-warning-red\/20 p {
    color: #fbbf24 !important;
}

.dark footer .bg-warning-red\/20 {
    background-color: rgba(127, 29, 29, 0.3) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

.dark footer .bg-warning-red\/20 h3 {
    color: #fca5a5 !important;
}

.dark footer .bg-warning-red\/20 p {
    color: #fde68a !important;
}

/* ================================================
   BUTTONS AND INTERACTIVE ELEMENTS
   ================================================ */

button:not(#darkModeToggle):not(#mobileMenuToggle):not(#menu-toggle) {
    background-color: #f3f4f6 !important;
    color: #374151 !important;
}

.dark button:not(#darkModeToggle):not(#mobileMenuToggle):not(#menu-toggle) {
    background-color: #374151 !important;
    color: #e5e7eb !important;
}

button:hover:not(#darkModeToggle):not(#mobileMenuToggle):not(#menu-toggle) {
    background-color: #e5e7eb !important;
}

.dark button:hover:not(#darkModeToggle):not(#mobileMenuToggle):not(#menu-toggle) {
    background-color: #4b5563 !important;
}

/* ================================================
   ENSURE READABILITY EVERYWHERE
   ================================================ */

/* Global fallback for any missed elements */
body:not(.dark) * {
    color-scheme: light;
}

body.dark * {
    color-scheme: dark;
}

/* Ensure minimum contrast ratios */
.dark {
    --min-contrast-ratio: 4.5;
}

/* Force inherit on nested elements */
.dark main * {
    color: inherit;
}

/* Then apply specific overrides */
.dark main h1,
.dark main h2,
.dark main h3,
.dark main h4,
.dark main h5,
.dark main h6 {
    color: #ffffff !important;
}

.dark main p,
.dark main li,
.dark main span:not(.glowing-title):not(.gradient-text) {
    color: #d1d5db !important;
}

/* ================================================
   ANIMATION OVERLAYS
   ================================================ */

/* Ensure overlays don't break contrast */
.absolute.inset-0.bg-gradient-to-t {
    pointer-events: none !important;
    opacity: 0.1 !important;
}

.dark .absolute.inset-0.bg-gradient-to-t {
    opacity: 0.05 !important;
}