/* URGENT FIX: Override Bootstrap's text-light and bg-dark classes for footer visibility */

/* Target the exact footer structure - override Bootstrap utility classes */
.container-fluid.bg-dark.text-light.footer h4.text-light,
.bg-dark.text-light.footer h4.text-light,
.footer.bg-dark h4.text-light {
    color: #007bff !important;
}

/* Light mode - Force blue color for all footer headings */
[data-theme="light"] .container-fluid.bg-dark.text-light.footer h4.text-light,
[data-theme="light"] .bg-dark.text-light.footer h4.text-light,
[data-theme="light"] .footer.bg-dark h4.text-light,
[data-theme="light"] .footer h4 {
    color: #007bff !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Dark mode - Keep white color for footer headings */
[data-theme="dark"] .container-fluid.bg-dark.text-light.footer h4.text-light,
[data-theme="dark"] .bg-dark.text-light.footer h4.text-light,
[data-theme="dark"] .footer.bg-dark h4.text-light,
[data-theme="dark"] .footer h4 {
    color: #ffffff !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Force override Bootstrap text utilities */
.footer h4.text-light {
    color: #007bff !important;
}

[data-theme="dark"] .footer h4.text-light {
    color: #ffffff !important;
}

/* Ultra-specific override for footer content */
.container-fluid.bg-dark.footer p,
.container-fluid.bg-dark.footer a,
.bg-dark.footer p,
.bg-dark.footer a {
    color: #007bff !important;
}

[data-theme="light"] .container-fluid.bg-dark.footer p,
[data-theme="light"] .container-fluid.bg-dark.footer a,
[data-theme="light"] .bg-dark.footer p,
[data-theme="light"] .bg-dark.footer a {
    color: #007bff !important;
}

[data-theme="dark"] .container-fluid.bg-dark.footer p,
[data-theme="dark"] .container-fluid.bg-dark.footer a,
[data-theme="dark"] .bg-dark.footer p,
[data-theme="dark"] .bg-dark.footer a {
    color: #cbd5e1 !important;
}

/* Emergency override - target by element type */
.footer * {
    color: inherit !important;
}

[data-theme="light"] .footer h1,
[data-theme="light"] .footer h2,
[data-theme="light"] .footer h3,
[data-theme="light"] .footer h4,
[data-theme="light"] .footer h5,
[data-theme="light"] .footer h6 {
    color: #007bff !important;
}

[data-theme="dark"] .footer h1,
[data-theme="dark"] .footer h2,
[data-theme="dark"] .footer h3,
[data-theme="dark"] .footer h4,
[data-theme="dark"] .footer h5,
[data-theme="dark"] .footer h6 {
    color: #ffffff !important;
}

/* Override inline styles for theme responsiveness */
[data-theme="light"] .footer h4[style*="color"] {
    color: #007bff !important;
}

[data-theme="dark"] .footer h4[style*="color"] {
    color: #ffffff !important;
}

/* Backup selector for footer headings */
.footer h4 {
    font-weight: 700 !important;
    font-size: 1.3rem !important;
    margin-bottom: 1.5rem !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    display: inline-block;
}

.footer .btn-link {
    color: var(--text-secondary, #64748b) !important;
    font-weight: 600 !important;
    font-size: 1.05rem !important;
    text-decoration: none !important;
    padding: 10px 0 !important;
    display: block !important;
    text-align: left !important;
    border: none !important;
    background: none !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    text-transform: capitalize;
    border-left: 3px solid transparent;
    padding-left: 15px !important;
}

/* Light mode specific colors for footer links */
[data-theme="light"] .footer .btn-link {
    color: #007bff !important;
}

/* Dark mode specific colors for footer links */
[data-theme="dark"] .footer .btn-link {
    color: #e8e8e8 !important;
}

.footer .btn-link:hover {
    color: var(--primary, #007bff) !important;
    font-weight: 700 !important;
    transform: translateX(8px) !important;
    text-shadow: 0 0 8px rgba(0,123,255,0.6) !important;
    border-left-color: #007bff !important;
    background: rgba(0,123,255,0.1) !important;
    border-radius: 0 5px 5px 0;
}

/* Light mode hover for footer links */
[data-theme="light"] .footer .btn-link:hover {
    color: #0056b3 !important;
    text-shadow: none !important;
}

/* Dark mode hover for footer links */
[data-theme="dark"] .footer .btn-link:hover {
    color: #ffffff !important;
    text-shadow: 0 0 8px rgba(255,255,255,0.6) !important;
}

/* Footer Content Text Styling */
.footer p,
.footer a {
    color: var(--text-secondary, #64748b) !important;
}

/* Light mode footer content */
[data-theme="light"] .footer p,
[data-theme="light"] .footer a {
    color: #007bff !important;
}

/* Dark mode footer content */
[data-theme="dark"] .footer p,
[data-theme="dark"] .footer a {
    color: #cbd5e1 !important;
}

/* Override inline styles for footer links */
.footer a[style*="color"] {
    color: var(--text-secondary, #64748b) !important;
}

[data-theme="light"] .footer a[style*="color"] {
    color: #007bff !important;
}

[data-theme="dark"] .footer a[style*="color"] {
    color: #cbd5e1 !important;
}

/* Footer Icons Styling */
.footer i {
    color: var(--text-secondary, #64748b) !important;
}

[data-theme="light"] .footer i {
    color: #007bff !important;
}

[data-theme="dark"] .footer i {
    color: #cbd5e1 !important;
}

/* Comprehensive Footer Text Visibility Fix */
/* Target all footer sections specifically */
.container-fluid.footer .col-lg-3 p,
.container-fluid.footer .col-lg-3 a,
.footer .col-lg-3 p,
.footer .col-lg-3 a,
.bg-dark.footer p,
.bg-dark.footer a {
    color: var(--text-secondary, #64748b) !important;
}

/* Light mode - make all footer text blue for visibility */
[data-theme="light"] .container-fluid.footer .col-lg-3 p,
[data-theme="light"] .container-fluid.footer .col-lg-3 a,
[data-theme="light"] .footer .col-lg-3 p,
[data-theme="light"] .footer .col-lg-3 a,
[data-theme="light"] .bg-dark.footer p,
[data-theme="light"] .bg-dark.footer a {
    color: #007bff !important;
}

/* Dark mode - keep white/light colors for footer text */
[data-theme="dark"] .container-fluid.footer .col-lg-3 p,
[data-theme="dark"] .container-fluid.footer .col-lg-3 a,
[data-theme="dark"] .footer .col-lg-3 p,
[data-theme="dark"] .footer .col-lg-3 a,
[data-theme="dark"] .bg-dark.footer p,
[data-theme="dark"] .bg-dark.footer a {
    color: #cbd5e1 !important;
}

/* Force override any Bootstrap or inline styles */
.footer * {
    color: inherit !important;
}

/* Ensure high contrast for accessibility */
[data-theme="light"] .footer {
    --text-contrast: #0056b3 !important;
}

[data-theme="dark"] .footer {
    --text-contrast: #ffffff !important;
}

.footer .btn-link:before {
    content: "●" !important;
    color: #007bff !important;
    font-size: 1rem !important;
    margin-right: 10px !important;
    opacity: 0.7 !important;
    transition: all 0.3s ease !important;
    font-weight: bold !important;
}

.footer .btn-link:hover:before {
    opacity: 1 !important;
    color: var(--primary, #007bff) !important;
    transform: scale(1.2);
}

/* Light mode hover for footer link bullets */
[data-theme="light"] .footer .btn-link:hover:before {
    color: #0056b3 !important;
}

/* Dark mode hover for footer link bullets */
[data-theme="dark"] .footer .btn-link:hover:before {
    color: #ffffff !important;
}

/* Enhanced Footer Link Styling */
.footer .btn-link:focus {
    outline: 2px solid #007bff !important;
    outline-offset: 2px !important;
    color: var(--primary, #007bff) !important;
    background: rgba(0,123,255,0.2) !important;
}

/* Light mode focus for footer links */
[data-theme="light"] .footer .btn-link:focus {
    color: #0056b3 !important;
}

/* Dark mode focus for footer links */
[data-theme="dark"] .footer .btn-link:focus {
    color: #ffffff !important;
}

/* Make Quick Links section more prominent */
.footer .col-lg-2 {
    background: rgba(0,0,0,0.3);
    border-radius: 15px;
    padding: 25px 20px;
    margin: 10px 5px;
    border: 1px solid rgba(0,123,255,0.3);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.footer .col-lg-2:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0,123,255,0.1) 0%, rgba(0,123,255,0.05) 100%);
    z-index: -1;
}

/* Blogs Section Enhancement - Theme Responsive */
/* Target the specific blogs section */
.container-fluid .box-with-humber h2,
.feature .box-with-humber h2,
.box-with-humber h2.display-5 {
    color: var(--text-primary, #1e293b) !important;
    font-weight: 700 !important;
    font-size: 1.3rem !important;
    margin-bottom: 1.5rem !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    border-bottom: 2px solid #007bff !important;
    padding-bottom: 10px !important;
    display: inline-block !important;
}

/* Light mode specific colors for blogs headings */
[data-theme="light"] .container-fluid .box-with-humber h2,
[data-theme="light"] .feature .box-with-humber h2,
[data-theme="light"] .box-with-humber h2.display-5 {
    color: #007bff !important;
}

/* Dark mode specific colors for blogs headings */
[data-theme="dark"] .container-fluid .box-with-humber h2,
[data-theme="dark"] .feature .box-with-humber h2,
[data-theme="dark"] .box-with-humber h2.display-5 {
    color: #ffffff !important;
}

.container-fluid .box-with-humber .btn-link,
.feature .box-with-humber .btn-link,
.box-with-humber a.btn-link {
    color: var(--text-secondary, #64748b) !important;
    font-weight: 600 !important;
    font-size: 1.05rem !important;
    text-decoration: none !important;
    padding: 10px 0 !important;
    display: block !important;
    text-align: left !important;
    border: none !important;
    background: none !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    text-transform: capitalize !important;
    border-left: 3px solid transparent !important;
    padding-left: 15px !important;
}

/* Light mode specific colors for blogs links */
[data-theme="light"] .container-fluid .box-with-humber .btn-link,
[data-theme="light"] .feature .box-with-humber .btn-link,
[data-theme="light"] .box-with-humber a.btn-link {
    color: #007bff !important;
}

/* Dark mode specific colors for blogs links */
[data-theme="dark"] .container-fluid .box-with-humber .btn-link,
[data-theme="dark"] .feature .box-with-humber .btn-link,
[data-theme="dark"] .box-with-humber a.btn-link {
    color: #e8e8e8 !important;
}

.container-fluid .box-with-humber .btn-link:hover,
.feature .box-with-humber .btn-link:hover,
.box-with-humber a.btn-link:hover {
    color: var(--primary, #007bff) !important;
    font-weight: 700 !important;
    transform: translateX(8px) !important;
    border-left-color: #007bff !important;
    background: rgba(0,123,255,0.1) !important;
    border-radius: 0 5px 5px 0 !important;
}

/* Light mode hover for blogs links */
[data-theme="light"] .container-fluid .box-with-humber .btn-link:hover,
[data-theme="light"] .feature .box-with-humber .btn-link:hover,
[data-theme="light"] .box-with-humber a.btn-link:hover {
    color: #0056b3 !important;
    text-shadow: none !important;
}

/* Dark mode hover for blogs links */
[data-theme="dark"] .container-fluid .box-with-humber .btn-link:hover,
[data-theme="dark"] .feature .box-with-humber .btn-link:hover,
[data-theme="dark"] .box-with-humber a.btn-link:hover {
    color: #ffffff !important;
    text-shadow: 0 0 8px rgba(255,255,255,0.6) !important;
}

.container-fluid .box-with-humber .btn-link:before,
.feature .box-with-humber .btn-link:before,
.box-with-humber a.btn-link:before {
    content: "●" !important;
    color: #007bff !important;
    font-size: 1rem !important;
    margin-right: 10px !important;
    opacity: 0.7 !important;
    transition: all 0.3s ease !important;
    font-weight: bold !important;
}

.container-fluid .box-with-humber .btn-link:hover:before,
.feature .box-with-humber .btn-link:hover:before,
.box-with-humber a.btn-link:hover:before {
    opacity: 1 !important;
    color: #ffffff !important;
    transform: scale(1.2) !important;
}

/* Enhanced Blogs Link Styling */
.container-fluid .box-with-humber .btn-link:focus,
.feature .box-with-humber .btn-link:focus,
.box-with-humber a.btn-link:focus {
    outline: 2px solid #007bff !important;
    outline-offset: 2px !important;
    color: var(--primary, #007bff) !important;
    background: rgba(0,123,255,0.2) !important;
}

/* Light mode focus for blogs links */
[data-theme="light"] .container-fluid .box-with-humber .btn-link:focus,
[data-theme="light"] .feature .box-with-humber .btn-link:focus,
[data-theme="light"] .box-with-humber a.btn-link:focus {
    color: #0056b3 !important;
}

/* Dark mode focus for blogs links */
[data-theme="dark"] .container-fluid .box-with-humber .btn-link:focus,
[data-theme="dark"] .feature .box-with-humber .btn-link:focus,
[data-theme="dark"] .box-with-humber a.btn-link:focus {
    color: #ffffff !important;
}

/* Make Both Blogs and News sections prominent - Theme Responsive */
.container-fluid .box-with-humber,
.feature .box-with-humber,
.p-3.box-with-humber {
    border-radius: 15px !important;
    padding: 25px 20px !important;
    margin: 10px 5px !important;
    border: 1px solid rgba(0,123,255,0.3) !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Light mode background for blogs/news boxes */
[data-theme="light"] .container-fluid .box-with-humber,
[data-theme="light"] .feature .box-with-humber,
[data-theme="light"] .p-3.box-with-humber {
    background: rgba(255,255,255,0.95) !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important;
}

/* Dark mode background for blogs/news boxes */
[data-theme="dark"] .container-fluid .box-with-humber,
[data-theme="dark"] .feature .box-with-humber,
[data-theme="dark"] .p-3.box-with-humber {
    background: rgba(0,0,0,0.85) !important;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3) !important;
}

/* News section title styling - white like Blogs */
.container-fluid .box-with-humber h2,
.feature .box-with-humber h2,
.p-3.box-with-humber h2 {
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 1.3rem !important;
    margin-bottom: 1.5rem !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    border-bottom: 2px solid #007bff !important;
    padding-bottom: 10px !important;
    display: inline-block !important;
}

/* Remove white background from Twitter embed */
.twitter-timeline,
.twitter-timeline iframe,
.twitter-feed iframe {
    background: transparent !important;
    border: none !important;
}

/* Make Twitter embed blend with dark theme */
.twitter-feed {
    background: transparent !important;
    border-radius: 10px !important;
    overflow: hidden !important;
}

.container-fluid .box-with-humber:before,
.feature .box-with-humber:before,
.p-3.box-with-humber:before {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(135deg, rgba(0,123,255,0.1) 0%, rgba(0,123,255,0.05) 100%) !important;
    z-index: -1 !important;
}

/* Text Justification for Entire Website */
/* Global Text Justification */
body,
p,
.text-justify,
.content p,
.description,
.team-item p,
.footer p,
.about-text,
.research-description,
.project-description {
    text-align: justify !important;
    text-justify: inter-word !important;
    -webkit-hyphens: auto;
    -moz-hyphens: auto;
    hyphens: auto;
    word-spacing: 0.1em;
    line-height: 1.6;
}

/* Specific sections that need justification */
#director-section .content p,
.phd-section .team-item p,
#researchers-section .team-item p,
#undergrad-section .team-item p,
#alumni-section .team-item p,
#collaborators-section .team-item p {
    text-align: justify !important;
    text-justify: inter-word !important;
}

/* Footer About section text justification */
.footer .col-lg-4 p {
    text-align: justify !important;
    text-justify: inter-word !important;
    line-height: 1.7 !important;
}

/* Cards and team items text justification */
.card-body p,
.team-member-description,
.publication-abstract,
.project-summary,
.blog-content p {
    text-align: justify !important;
    text-justify: inter-word !important;
}

/* Responsive adjustments for justified text */
@media (max-width: 768px) {
    body p,
    .content p {
        text-align: left !important;
        word-spacing: normal;
    }
    
    .footer .col-lg-2 {
        margin: 5px 0;
        border-left: 3px solid #007bff;
    }
    
    .footer .btn-link {
        font-size: 0.95rem !important;
        padding: 6px 0 !important;
    }
}

/* Small screen adjustments */
@media (max-width: 576px) {
    .footer .col-lg-2 h4 {
        font-size: 1.1rem !important;
        margin-bottom: 1rem !important;
    }
    
    .footer .btn-link {
        font-size: 0.9rem !important;
    }
}

/* Ensure proper text rendering */
* {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Special handling for headings - keep them centered/left as appropriate */
h1, h2, h3, h4, h5, h6,
.heading,
.title,
.section-title {
    text-align: inherit !important;
}

/* Navigation and UI elements should not be justified */
.navbar,
.nav,
.breadcrumb,
.btn,
.badge,
.alert,
.modal-title,
button {
    text-align: inherit !important;
}

/* Form elements */
input, textarea, select, label {
    text-align: inherit !important;
}

/* ===== PUBLICATION CARDS UNIFORM HEIGHT ===== */
/* Make all publication cards the same height */
.service-item {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}

.service-item .p-4 {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    min-height: 300px !important;
}

.service-item h4 {
    min-height: 60px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    margin-bottom: 15px !important;
}

.service-item p {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    text-align: center !important;
    margin-bottom: 20px !important;
    line-height: 1.6 !important;
}

.service-item .fw-medium {
    margin-top: auto !important;
    align-self: center !important;
}

/* Ensure uniform spacing in publication section */
.service-item .col-md-6,
.service-item .col-lg-4 {
    margin-bottom: 30px !important;
}

/* Force equal height for the entire row */
.row.g-4 {
    display: flex !important;
    flex-wrap: wrap !important;
}

.row.g-4 > [class*="col-"] {
    display: flex !important;
}
