/* ADP - Appliance Diagnostic Platform Styles */
/* ExcelFormulaTool-inspired minimalist design */

:root {
    --primary-color: #0D6EFD;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-bg: #f8f9fa;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    
    /* Light mode variables */
    --bg-color: #f3f3f3;
    --body-bg: #f3f3f3;
    --text-color: #212529;
    --card-bg: #ffffff;
    --navbar-bg: #ffffff;
    --input-bg: #ffffff;
    --input-border: #d1d1d1;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --modal-bg: #ffffff;
    --modal-header-bg: #f8f9fa;
    --border-color: #dee2e6;
}

/* Force light theme when explicitly detected */
html.force-light-theme {
    --bg-color: #f3f3f3 !important;
    --body-bg: #f3f3f3 !important;
    --text-color: #56595C !important;
    --card-bg: #ffffff !important;
    --navbar-bg: #ffffff !important;
    --input-bg: #ffffff !important;
    --input-border: #d1d1d1 !important;
    --shadow-color: rgba(0, 0, 0, 0.1) !important;
    --modal-bg: #ffffff !important;
    --modal-header-bg: #f8f9fa !important;
    --light-bg: #f8f9fa !important;
    --border-color: #dee2e6 !important;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
    --primary-color: #0D6EFD !important;
}

/* Force dark theme when explicitly detected */
html.force-dark-theme,
@media screen and (prefers-color-scheme: dark) {
    :root {
        --bg-color: #181a1b;
        --body-bg: #181a1b;
        --text-color: #F0EFED;
        --card-bg: #1e2021;
        --navbar-bg: #1e2021;
        --input-bg: #2d3134;
        --input-border: #3e4446;
        --shadow-color: rgba(0, 0, 0, 0.5);
        --modal-bg: #1e2021;
        --modal-header-bg: #2d3134;
        --light-bg: #1e2021;
        --border-color: #3e4446;
        --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
        --primary-color: #0D6EFD;
    }
}

/* Global Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--body-bg);
    color: var(--text-color);
    line-height: 1.6;
    transition: var(--transition);
}

/* Part Number Affiliate Links */
.part-number-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px dotted var(--primary-color);
    transition: all 0.2s ease;
}

.part-number-link:hover {
    color: #0056b3;
    text-decoration: none;
    border-bottom: 1px solid #0056b3;
    background-color: rgba(13, 110, 253, 0.1);
    padding: 1px 2px;
    border-radius: 2px;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-color);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    opacity: 1;
}

.back-to-top.show {
    opacity: 0.9;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:focus {
    outline: 3px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}



/* Ensure proper container centering */
.container {
    max-width: 1140px;
    margin: 0 auto;
    padding-left: 15px;
    padding-right: 15px;
}

/* Center all content sections */
.row.justify-content-center {
    margin-left: 0;
    margin-right: 0;
}

.col-lg-8 {
    margin: 0 auto;
    float: none;
}

/* Header Styles */
.navbar {
    background-color: var(--navbar-bg) !important;
    border-bottom: 1px solid var(--border-color);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color) !important;
}

.navbar-text {
    color: var(--text-color) !important;
}

.display-4 {
    font-weight: 700;
    color: var(--primary-color);
}

/* Card Styles */
.card {
    border-radius: var(--border-radius);
    transition: var(--transition);
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
}

.card-header {
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
    font-weight: 600;
    background-color: var(--modal-header-bg);
    border-bottom-color: var(--border-color);
    color: var(--text-color);
}

/* Form Styles */
.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 1px solid var(--input-border);
    background-color: var(--input-bg);
    color: var(--text-color);
    transition: var(--transition);
    font-size: 1rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
    background-color: var(--input-bg);
    color: var(--text-color);
}

.form-control-lg {
    font-size: 1.1rem;
    padding: 0.75rem 1rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* Button Styles */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    border: none;
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.btn-outline-primary {
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.example-btn {
    text-align: left;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
}

.example-btn:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Loading Animation */
.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3em;
}

/* Results Section Styles */
#resultsSection .card-header {
    padding: 1rem 1.25rem;
}

#resultsSection .card-body {
    padding: 1.5rem 1.25rem;
}

/* Diagnosis Items */
.diagnosis-item {
    background-color: var(--light-bg);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    border-left: 4px solid var(--primary-color);
    transition: var(--transition);
    color: var(--text-color);
}

.diagnosis-item:hover {
    background-color: var(--light-bg);
    opacity: 0.9;
    transform: translateX(5px);
    box-shadow: var(--box-shadow);
}

.diagnosis-item.clickable-diagnosis:hover {
    background-color: #e3f2fd;
    border-left-color: #0056b3;
    cursor: pointer;
}

.diagnosis-item strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Diagnosis Detail Modal */
.diagnosis-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.diagnosis-detail-overlay.show {
    opacity: 1;
}

.diagnosis-detail-modal {
    background: white;
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.diagnosis-detail-overlay.show .diagnosis-detail-modal {
    transform: scale(1);
}

.diagnosis-detail-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--primary-color);
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.diagnosis-detail-header h5 {
    margin: 0;
    color: white;
}

.diagnosis-detail-header .btn-close {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: auto;
    opacity: 0.9;
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.diagnosis-detail-header .btn-close:before {
    content: "×";
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    position: absolute;
    top: 44%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.diagnosis-detail-header .btn-close:hover {
    opacity: 1;
    background: rgba(220, 53, 69, 0.8);
    border-color: rgba(220, 53, 69, 1);
    transform: scale(1.05);
}

.diagnosis-detail-body {
    padding: 1.5rem;
}

.diagnosis-detail-body h6 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.diagnosis-detail-body ul {
    margin-bottom: 1.5rem;
}

.diagnosis-detail-body li {
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

/* DIY Fix Steps */
.diy-step {
    background-color: #f8fff8;
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--success-color);
    transition: var(--transition);
    font-size: 1.05rem !important;
}

/* Ensure DIY step content matches font size */
.diy-step * {
    font-size: 1.05rem !important;
}

.diy-step:hover {
    background-color: #e8f5e8;
    transform: translateX(3px);
}

.diy-step .step-number {
    background-color: var(--success-color);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 0.5rem;
}

/* Professional Advice */
.pro-advice {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    border-left: 4px solid var(--warning-color);
    font-size: 1.05rem;
}

.cost-estimate {
    background-color: #fff;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-top: 0.75rem;
    border: 1px solid #e9ecef;
    font-weight: 600;
    color: var(--primary-color);
}

/* Alert Styles */
.alert {
    border-radius: var(--border-radius);
    border: none;
    font-weight: 500;
    font-size: 1.05rem !important;
}

.alert * {
    font-size: 1.05rem !important;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid var(--warning-color);
    font-size: 1.05rem !important;
}

.alert-warning i {
    font-size: 1.05rem !important;
}

.alert-warning *,
.alert-warning,
.alert-warning small,
.diy-step.alert-warning,
.diy-step.alert-warning *,
.diy-step.alert-warning small {
    font-size: 1.05rem !important;
    line-height: 1.6 !important;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--danger-color);
    font-size: 1.05rem;
}

/* Footer Styles */
footer {
    border-top: 1px solid #e9ecef;
    margin-top: 4rem;
}

/* Additional centering for main content */
main {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.container {
    width: 100%;
    max-width: 1140px;
}

/* Text centering */
.text-center h1,
.text-center h2,
.text-center p {
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2.5rem;
    }
    
    .btn-lg {
        padding: 0.625rem 1.5rem;
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Ensure mobile centering */
    .col-lg-8 {
        width: 100%;
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Focus and Accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Parts Navigation Styles */
.parts-hint-header {
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.4);
    text-underline-offset: 2px;
}

.parts-hint-header:hover {
    opacity: 1 !important;
    transform: translateY(-1px);
    text-decoration-color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

#parts-navigation-hint {
    transition: all 0.3s ease;
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

#parts-navigation-hint .btn-outline-info {
    border-color: #0dcaf0;
    color: #0dcaf0;
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
}

#parts-navigation-hint .btn-outline-info:hover {
    background-color: #0dcaf0;
    color: white;
}

/* Mobile Sticky Parts Hint */
.mobile-parts-sticky {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 12px 16px;
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
    z-index: 1050;
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    max-width: 200px;
}

.mobile-parts-sticky.show {
    opacity: 1;
    transform: translateY(0);
}

.mobile-parts-sticky .btn-light {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border: none;
    background-color: rgba(255, 255, 255, 0.9);
    color: #28a745;
}

.mobile-parts-sticky .btn-light:hover {
    background-color: white;
    color: #20c997;
}

/* Enhanced Parts Section Badge */
.card-header .badge {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Print Styles */
@media print {
    .navbar,
    footer,
    #diagnosisForm,
    .example-btn,
    #exportPdfBtn,
    .parts-hint-header,
    #parts-navigation-hint,
    .mobile-parts-sticky {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
    }
}

/* Enhanced Diagnosis Detail Modal Styles */
.diagnosis-detail-header.enhanced {
    padding: 24px;
    border-bottom: 2px solid #e9ecef;
    background-color: var(--primary-color);
    color: white;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.header-content h5 {
    margin: 0;
    color: white;
    font-weight: 700;
    font-size: 1.3rem;
}

.diagnosis-badge {
    display: flex;
    gap: 8px;
}

.likelihood-badge {
    background: linear-gradient(45deg, #4caf50, #66bb6a);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

.btn-close.enhanced {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.9;
    margin-left: 16px;
    flex-shrink: 0;
}

.btn-close.enhanced:before {
    content: "×";
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.btn-close.enhanced:hover {
    background: rgba(220, 53, 69, 0.8);
    border-color: rgba(220, 53, 69, 1);
    transform: scale(1.05);
    opacity: 1;
}

.diagnosis-detail-body.enhanced {
    padding: 28px;
    background: #fafafa;
}

.diagnosis-title-section {
    margin-bottom: 24px;
    padding: 16px;
    background: white;
    border-radius: 12px;
    border-left: 4px solid #1976d2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.diagnosis-name {
    margin: 0 0 8px 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #1976d2;
}

.technical-indicator {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
}

.diagnostic-sections {
    display: grid;
    gap: 20px;
    margin-bottom: 24px;
}

.diagnostic-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.diagnostic-section.primary {
    border-left: 4px solid #17a2b8;
}

.diagnostic-section.secondary {
    border-left: 4px solid #ffc107;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.section-header h6 {
    margin: 0;
    font-weight: 600;
    color: var(--text-color);
}

/* Ensure proper contrast for Bootstrap card headers */
.bg-success h5,
.bg-success .h5 {
    color: white !important;
}

.bg-warning h5, 
.bg-warning .h5 {
    color: #212529 !important;
}

.bg-primary h5,
.bg-primary .h5 {
    color: white !important;
}

/* Theme-specific overrides for card headers */
html.force-light-theme .bg-success h5,
html.force-light-theme .bg-success .h5 {
    color: white !important;
}

html.force-light-theme .bg-primary h5,
html.force-light-theme .bg-primary .h5 {
    color: white !important;
}

html.force-dark-theme .bg-success h5,
html.force-dark-theme .bg-success .h5 {
    color: white !important;
}

html.force-dark-theme .bg-primary h5,
html.force-dark-theme .bg-primary .h5 {
    color: white !important;
}

.enhanced-list {
    list-style: none;
    padding: 0 !important;
    margin: 0 !important;
}

.enhanced-list .diagnostic-item {
    padding: 2px 0 !important;
    margin: 0 !important;
}

.diagnostic-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 2px 0 !important;
    margin: 0 !important;
    border-bottom: 1px solid #f1f3f4;
}

.diagnostic-item:last-child {
    border-bottom: none;
}

.diagnostic-item i {
    margin-top: 2px;
}

.protocol-list {
    list-style: none;
    padding: 0 !important;
    margin: 0 !important;
}

.protocol-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 4px 0 !important;
    border-bottom: 1px solid #f1f3f4;
}

.protocol-step:last-child {
    border-bottom: none;
}

.step-marker {
    background: #ffc107;
    color: #212529;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.step-content {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex: 1;
}

.expert-analysis {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #c8e6c9;
}

.analysis-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.analysis-header h6 {
    margin: 0;
    color: #2e7d32;
    font-weight: 600;
}

.analysis-content {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.insight-icon {
    background: #4caf50;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.analysis-content p {
    margin: 0;
    line-height: 1.6;
    color: #2e7d32;
}

.safety-notice {
    background: linear-gradient(135deg, #ffebee 0%, #fce4ec 100%);
    border: 1px solid #f8bbd9;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.safety-notice i {
    font-size: 1.2rem;
    margin-top: 2px;
}

.safety-content {
    color: #c62828;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Expandable Diagnosis Styles */
.diagnosis-container {
    width: 100%;
}

.diagnosis-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.diagnosis-content-wrapper {
    flex: 1;
    line-height: 1.4;
}

.diagnosis-preview,
.diagnosis-full {
    display: inline;
}

.see-more-btn {
    font-size: 0.85rem;
    color: var(--primary-color) !important;
    text-decoration: none !important;
    border: none !important;
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: auto !important;
    line-height: 1.2;
    white-space: nowrap;
    font-weight: 500;
}

.see-more-btn:hover {
    color: #0056b3 !important;
    text-decoration: underline !important;
}

/* Ensure visibility in both light and dark modes */
html.force-light-theme .see-more-btn {
    color: #0D6EFD !important;
}

html.force-dark-theme .see-more-btn {
    color: #4dabf7 !important;
}

.see-more-btn:focus {
    outline: 1px solid #007bff;
    outline-offset: 2px;
}

.diagnosis-full {
    margin-top: 8px;
    line-height: 1.4;
}



.diagnosis-item.clickable-diagnosis {
    transition: all 0.2s ease;
    border-radius: 8px;
    padding: 12px;
}

.diagnosis-item.clickable-diagnosis:hover {
    background-color: var(--light-bg);
    transform: translateY(-1px);
    box-shadow: var(--box-shadow);
}

/* Dark Mode Enhancements */
/* Placeholder and selection styles for dark mode */
.form-control::placeholder {
    color: var(--text-color);
    opacity: 0.6;
}

.form-control::-webkit-input-placeholder {
    color: var(--text-color);
    opacity: 0.6;
}

.form-control::-moz-placeholder {
    color: var(--text-color);
    opacity: 0.6;
}

/* Force light theme overrides */
html.force-light-theme .bg-light,
html.force-light-theme .bg-white {
    background-color: #ffffff !important;
    color: #56595C !important;
}

html.force-light-theme .navbar-light {
    background-color: #ffffff !important;
}

html.force-light-theme .text-muted,
html.force-light-theme .text-secondary,
html.force-light-theme .form-text,
html.force-light-theme .small,
html.force-light-theme .lead.text-muted,
html.force-light-theme p.text-muted,
html.force-light-theme h2.text-muted,
html.force-light-theme .card .text-muted,
html.force-light-theme .navbar .text-muted {
    color: #6c757d !important;
}

html.force-light-theme h1,
html.force-light-theme h2,
html.force-light-theme h3,
html.force-light-theme h4,
html.force-light-theme h5,
html.force-light-theme h6,
html.force-light-theme .display-4 {
    color: #0D6EFD !important;
}

html.force-light-theme .card {
    background-color: #ffffff !important;
    border-color: #dee2e6 !important;
}

html.force-light-theme footer.bg-light {
    background-color: #f8f9fa !important;
}

html.force-light-theme footer p[style*="background-color: #fff3cd"] {
    background-color: #fff3cd !important;
    color: #856404 !important;
}

/* Light mode icon and link colors - Maximum specificity */
/* Navbar brand and primary icons should be blue */
html.force-light-theme .navbar-brand,
html.force-light-theme .navbar-brand i.fas,
html.force-light-theme .navbar-brand i.far,
html.force-light-theme .navbar-brand i.fab {
    color: #0D6EFD !important;
}

/* General icons and nav links use dark gray */
html.force-light-theme .navbar-nav .nav-link i.fas,
html.force-light-theme .navbar-nav .nav-link i.far,
html.force-light-theme .navbar-nav .nav-link i.fab,
html.force-light-theme .navbar-nav .nav-link,
html.force-light-theme i,
html.force-light-theme .fa,
html.force-light-theme .fas,
html.force-light-theme .far,
html.force-light-theme .fab {
    color: #56595C !important;
}

html.force-light-theme .navbar-brand:hover,
html.force-light-theme .navbar-nav .nav-link:hover,
html.force-light-theme .navbar-brand:hover i,
html.force-light-theme .navbar-nav .nav-link:hover i {
    color: #4fa8da !important;
}

html.force-light-theme .btn-primary i,
html.force-light-theme .btn-outline-primary i,
html.force-light-theme .btn i {
    color: inherit !important;
}

/* Ensure icons in primary buttons are white */
html.force-light-theme .btn-primary i,
html.force-light-theme .btn-primary .fas,
html.force-light-theme .btn-primary .far,
html.force-light-theme .btn-primary .fab {
    color: white !important;
}

html.force-light-theme .card i,
html.force-light-theme .diagnosis-item i,
html.force-light-theme footer i,
html.force-light-theme .text-primary i {
    color: #56595C !important;
}

/* Ensure icons in card headers with color backgrounds remain white */
html.force-light-theme .card-header.bg-primary i,
html.force-light-theme .card-header.bg-success i {
    color: white !important;
}

html.force-light-theme .diagnosis-item strong i,
html.force-light-theme .text-primary,
html.force-light-theme .text-primary i {
    color: #0D6EFD !important;
}

/* Override any Font Awesome defaults in light mode */
html.force-light-theme .navbar-brand .fa-screwdriver-wrench {
    color: #0D6EFD !important;
}

html.force-light-theme .fa-shield-alt,
html.force-light-theme [class*="fa-"] {
    color: #56595C !important;
}

/* Bootstrap component overrides for dark mode - Dark Reader style */
html.force-dark-theme,
@media screen and (prefers-color-scheme: dark) {
    /* Complete dark theme like Dark Reader */
    .bg-light, .bg-white {
        background-color: var(--card-bg) !important;
        color: var(--text-color) !important;
    }
    
    .navbar-light {
        background-color: var(--navbar-bg) !important;
    }
    
    /* Override all muted/secondary text to use bright color */
    .text-muted,
    .text-secondary,
    .form-text,
    .small,
    .lead.text-muted,
    p.text-muted,
    h2.text-muted,
    .card .text-muted,
    .navbar .text-muted {
        color: var(--text-color) !important;
    }
    
    /* Override text-muted for form labels to use bright text */
    .form-label.text-muted,
    label.text-muted,
    .card .form-label.text-muted,
    .card label.text-muted {
        color: var(--text-color) !important;
    }
    
    /* All text should be light colored */
    body, html, h1, h2, h3, h4, h5, h6, p, div, span, label, .form-label {
        color: var(--text-color) !important;
    }
    
    /* Cards completely dark */
    .card {
        background-color: var(--card-bg) !important;
        border-color: var(--border-color) !important;
    }
    
    .card * {
        color: var(--text-color) !important;
    }
    
    .card .text-muted {
        color: var(--text-color) !important;
    }
    
    /* Navigation completely dark */
    .navbar {
        background-color: var(--navbar-bg) !important;
        border-color: var(--border-color) !important;
    }
    
    .navbar-brand {
        color: var(--primary-color) !important;
    }
    
    .navbar-brand i {
        color: var(--primary-color) !important;
    }
    
    .navbar-text {
        color: var(--text-color) !important;
    }
    
    /* Ensure all blue elements use consistent color */
    .text-primary, h1.text-primary {
        color: var(--primary-color) !important;
    }
    
    .btn-primary {
        background-color: #3d8bb8 !important;
        border-color: #3d8bb8 !important;
        color: #ffffff !important;
    }
    
    .btn-primary:hover, .btn-primary:focus, .btn-primary:active {
        background-color: var(--primary-color) !important;
        border-color: var(--primary-color) !important;
        color: #ffffff !important;
    }
    
    .border {
        border-color: var(--border-color) !important;
    }
    
    .alert-info {
        background-color: #1f4e5f;
        border-color: #17a2b8;
        color: #ffffff;
    }
    
    .alert-warning {
        background-color: #332701 !important;
        color: #F0EFED !important;
        border-left-color: #ffc107 !important;
    }
    
    .alert-danger {
        background-color: #2c0b0e !important;
        color: #F0EFED !important;
        border-left-color: #dc3545 !important;
    }
    
    /* Example buttons dark */
    .example-btn {
        background-color: var(--input-bg) !important;
        color: var(--text-color) !important;
        border-color: var(--border-color) !important;
    }
    
    .example-btn:hover {
        background-color: var(--primary-color) !important;
        color: white !important;
        border-color: var(--primary-color) !important;
    }
    
    /* Footer warning banner dark mode override */
    footer p[style*="background-color: #fff3cd"] {
        background-color: var(--input-bg) !important;
        color: var(--text-color) !important;
        border-left-color: var(--primary-color) !important;
    }
    
    /* Footer styling */
    footer.bg-light {
        background-color: var(--card-bg) !important;
    }
    
    footer .text-muted {
        color: var(--text-color) !important;
    }
    
    .modal-content {
        background-color: var(--modal-bg);
        color: var(--text-color);
    }
    
    .modal-header {
        background-color: var(--modal-header-bg);
        border-bottom-color: var(--border-color);
    }
    
    .btn-close {
        filter: invert(1);
    }
    
    .pro-advice {
        background: linear-gradient(135deg, #664d03 0%, #795d0a 100%);
        color: #ffecb5;
    }
    
    .cost-estimate {
        background-color: var(--input-bg);
        border-color: var(--border-color);
        color: var(--text-color);
    }
    
    .diagnosis-detail-header.enhanced {
        background: linear-gradient(135deg, var(--card-bg) 0%, var(--light-bg) 50%, var(--card-bg) 100%);
    }
    
    .diagnosis-detail-body.enhanced {
        background: var(--body-bg);
    }
    
    .diagnostic-section {
        background: var(--card-bg);
        border-color: var(--border-color);
        color: var(--text-color);
    }
    
    .diagnosis-title-section {
        background: var(--card-bg);
        color: var(--text-color);
    }
    
    .expert-analysis {
        background: linear-gradient(135deg, #1f4e3d 0%, #2d5a4a 100%);
        border-color: #4caf50;
        color: #c8e6c9;
    }
    
    .analysis-header h6 {
        color: #c8e6c9;
    }
    
    .analysis-content p {
        color: #c8e6c9;
    }
    
    .safety-notice {
        background: linear-gradient(135deg, #4d1f26 0%, #5d2533 100%);
        border-color: #f8bbd9;
        color: #f1aeb5;
    }
    
    .safety-content {
        color: #f1aeb5;
    }
    
    footer {
        border-top-color: var(--border-color);
    }
}

/* Part number affiliate links styling */
.part-number-link {
    color: #0066cc;
    text-decoration: underline;
    font-weight: 600;
    padding: 2px 4px;
    background-color: rgba(0, 102, 204, 0.1);
    border-radius: 3px;
    transition: all 0.2s ease;
}

.part-number-link:hover {
    color: #004499;
    background-color: rgba(0, 102, 204, 0.2);
    text-decoration: none;
}
