/* Global Theme Fixes for Light/Dark Mode Consistency */

/* Override Tailwind color classes with theme-aware colors */
/* Text Colors */
html.light-theme .text-white,
html.light-theme .text-gray-200,
html.light-theme .text-gray-300 {
    color: #1f2937 !important; /* dark gray for light theme */
}

html.light-theme .text-gray-400,
html.light-theme .text-gray-500 {
    color: #6b7280 !important; /* medium gray for light theme */
}

html.light-theme .text-gray-600 {
    color: #4b5563 !important; /* darker gray for light theme */
}

/* Background Colors */
html.light-theme .bg-gray-800,
html.light-theme .bg-gray-700 {
    background-color: #f3f4f6 !important; /* light gray for light theme */
}

html.light-theme .bg-gray-800\/80 {
    background-color: rgba(243, 244, 246, 0.8) !important;
}

html.light-theme .bg-gray-800\/90 {
    background-color: rgba(243, 244, 246, 0.9) !important;
}

html.light-theme .bg-gray-700\/50 {
    background-color: rgba(229, 231, 235, 0.5) !important;
}

/* Hover States */
html.light-theme .hover\:bg-gray-700:hover {
    background-color: #e5e7eb !important;
}

html.light-theme .hover\:bg-gray-700\/50:hover {
    background-color: rgba(229, 231, 235, 0.5) !important;
}

/* Border Colors */
html.light-theme .border-gray-700 {
    border-color: #d1d5db !important;
}

html.light-theme .border-gray-700\/50 {
    border-color: rgba(209, 213, 219, 0.5) !important;
}

/* Glass Effect for Light Theme */
html.light-theme .glass-effect {
    background-color: rgba(255, 255, 255, 0.85) !important;
    border-color: rgba(209, 213, 219, 0.8) !important;
}

/* Notification Dropdown Specific */
html.light-theme #notification-dropdown {
    background-color: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(209, 213, 219, 0.8) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
}

/* Text Gradient for Light Theme */
html.light-theme .text-gradient {
    background-image: linear-gradient(to right, #2563eb, #3b82f6) !important;
}

/* Links and Accents */
html.light-theme a {
    color: inherit;
}

html.light-theme a:hover {
    color: #2563eb;
}

/* Form Elements */
html.light-theme input,
html.light-theme textarea,
html.light-theme select {
    background-color: #ffffff;
    border-color: #d1d5db;
    color: #1f2937;
}

html.light-theme input::placeholder,
html.light-theme textarea::placeholder {
    color: #9ca3af;
}

/* Buttons */
html.light-theme button {
    color: inherit;
}

/* Card Headers */
html.light-theme .card-header-block {
    background-color: #f9fafb;
}

/* Code Blocks */
html.light-theme pre,
html.light-theme code {
    background-color: #f3f4f6;
    color: #1f2937;
}

/* Scrollbar for Light Theme */
html.light-theme ::-webkit-scrollbar {
    background-color: #f3f4f6;
}

html.light-theme ::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
}

html.light-theme ::-webkit-scrollbar-thumb:hover {
    background-color: #9ca3af;
}

/* Ensure all text is readable in light theme */
html.light-theme * {
    color: inherit;
}

/* Fix specific elements that might have inline colors */
html.light-theme [style*="color: white"],
html.light-theme [style*="color: #fff"],
html.light-theme [style*="color: #ffffff"] {
    color: #1f2937 !important;
}

/* Navigation specific fixes */
html.light-theme .nav-link {
    color: #4b5563;
}

html.light-theme .nav-link:hover,
html.light-theme .nav-link.active {
    color: #2563eb;
}

/* Mobile menu fixes */
html.light-theme #mobile-menu {
    background-color: rgba(255, 255, 255, 0.95) !important;
}

html.light-theme #mobile-menu a {
    color: #4b5563 !important;
}

html.light-theme #mobile-menu a:hover {
    color: #2563eb !important;
    background-color: #f3f4f6 !important;
}

/* Dropdown menus */
html.light-theme #lang-dropdown,
html.light-theme #blog-nav-dropdown {
    background-color: rgba(255, 255, 255, 0.95) !important;
    border-color: #d1d5db !important;
}

html.light-theme #lang-dropdown a,
html.light-theme #blog-nav-dropdown a {
    color: #4b5563 !important;
}

html.light-theme #lang-dropdown a:hover,
html.light-theme #blog-nav-dropdown a:hover {
    background-color: #f3f4f6 !important;
    color: #2563eb !important;
}

/* Footer specific */
html.light-theme footer {
    background-color: #f9fafb !important;
    color: #6b7280 !important;
}

html.light-theme footer p {
    color: #6b7280 !important;
}

/* Make sure icons inherit the correct color */
html.light-theme i.fas,
html.light-theme i.far,
html.light-theme i.fab {
    color: inherit;
}

/* Specific icon color fixes */
html.light-theme .text-red-400 {
    color: #ef4444 !important;
}

html.light-theme .text-green-400 {
    color: #10b981 !important;
}

html.light-theme .text-blue-400 {
    color: #3b82f6 !important;
}

/* Ensure readability of all elements */
html.light-theme {
    color-scheme: light;
}
