/* CVE Insight Tool - Custom Styles */

:root {
    --primary-color: #0056b3;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --secondary-color: #6c757d;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #fafbfc;
    line-height: 1.7;
    font-size: 16px;
    color: #1a1a1a;
    font-weight: 400;
    /* Sticky footer setup */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Make main content area expand to fill available space */
main {
    flex: 1;
}

/* Improved Text Readability */
h1, h2, h3, h4, h5, h6 {
    color: #1a1a1a;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1.1rem; }

p {
    margin-bottom: 1rem;
    line-height: 1.8;
    font-size: 16px;
}

.lead {
    font-size: 1.3rem;
    font-weight: 400;
    line-height: 1.8;
}

/* Better text contrast */
.text-muted {
    color: #333333 !important;
    font-weight: 500;
}

.text-secondary {
    color: #2d2d2d !important;
    font-weight: 500;
}

.text-dark-readable {
    color: #1a1a1a !important;
    font-weight: 600 !important;
}

.text-medium-readable {
    color: #2d2d2d !important;
    font-weight: 500 !important;
}

.text-description {
    color: #1a1a1a !important;
    font-weight: 500 !important;
}

/* Fix text readability on light backgrounds */
.bg-light .card-title,
.bg-light h1, .bg-light h2, .bg-light h3, 
.bg-light h4, .bg-light h5, .bg-light h6 {
    color: #1a1a1a !important;
    font-weight: 600 !important;
}

.bg-light .card-body {
    color: #1a1a1a !important;
}

.bg-light pre,
.bg-light code {
    color: #1a1a1a !important;
}

.bg-light p,
.bg-light li,
.bg-light span,
.bg-light label,
.bg-light .card-text {
    color: #1a1a1a !important;
}

/* Override Bootstrap's default muted text on light backgrounds */
.bg-light .text-muted {
    color: #333333 !important;
}

/* Ensure all cards have good text contrast */
.card .card-title {
    color: #1a1a1a !important;
    font-weight: 600 !important;
}

.card .card-text {
    color: #1a1a1a !important;
}

/* Table headers - clear, readable styling */
table.table thead th,
table.table th,
.table thead th,
.table th {
    color: #1a1a1a !important;
    font-weight: 600 !important;
    background-color: #f8f9fa !important;
    border-color: #dee2e6 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 14px;
    padding: 12px;
}

table.table tbody td,
.table tbody td,
.table td {
    color: #1a1a1a !important;
}

/* Override system dark mode for consistent light theme */
body {
    background-color: #ffffff !important;
    color: #1a1a1a !important;
}

h1, h2, h3, h4, h5, h6 {
    color: #1a1a1a !important;
}

.card {
    background-color: #ffffff !important;
    color: #1a1a1a !important;
}

.form-control {
    background-color: #ffffff !important;
    color: #1a1a1a !important;
    border-color: #ced4da !important;
}

.form-control:focus {
    background-color: #ffffff !important;
    color: #1a1a1a !important;
}

/* Small text improvements */
small, .small {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333333;
}

/* Link improvements */
a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

a:hover {
    color: #003d82;
    text-decoration: underline;
}

.container {
    max-width: 1200px;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), #007bff);
    color: white;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.hero-section h1 {
    margin-bottom: 1rem;
}

.hero-section .lead {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Cards */
.card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    color: #1a1a1a;
}

.stat-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border-radius: 10px;
    overflow: hidden;
    background-color: #ffffff;
    color: #1a1a1a;
}

.stat-card .card-title {
    color: #1a1a1a !important;
    font-weight: 600 !important;
}

.stat-card .card-text {
    color: #1a1a1a !important;
    font-weight: 500 !important;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.action-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

.action-card .card-title {
    color: #1a1a1a !important;
    font-weight: 600 !important;
}

.action-card .card-text {
    color: #1a1a1a !important;
    font-weight: 500 !important;
}

.action-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Severity Badges - Improved Readability */
.badge {
    font-size: 13px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
    letter-spacing: 0.3px;
}

.severity-critical {
    background-color: var(--danger-color) !important;
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.severity-high {
    background-color: #fd7e14 !important;
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.severity-medium {
    background-color: #e67e22 !important;
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.severity-low {
    background-color: var(--success-color) !important;
    color: white !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Tables */
.table {
    font-size: 15px;
    line-height: 1.6;
}

.table th {
    font-weight: 600;
    color: #1a1a1a;
    border-bottom: 2px solid #dee2e6;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: #f8f9fa;
}

.table td {
    font-weight: 500;
    color: #1a1a1a;
    padding: 12px;
    vertical-align: middle;
    background-color: #ffffff;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 86, 179, 0.08);
}

.description-cell {
    max-width: 350px;
    word-wrap: break-word;
    white-space: normal;
    font-size: 15px;
    line-height: 1.6;
}

/* CVE Cards */
.cve-card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease-in-out;
    margin-bottom: 1rem;
}

.cve-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cve-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 1px solid #dee2e6;
    padding: 1rem;
    border-radius: 10px 10px 0 0;
}

.cve-id {
    font-family: 'SF Mono', 'Monaco', 'Consolas', 'Courier New', monospace;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 16px;
    letter-spacing: 0.5px;
}

.cvss-score {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-content .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Forms */
.form-control {
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
    border: 2px solid #e2e8f0;
    padding: 10px 12px;
    background-color: #ffffff;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 86, 179, 0.25);
    color: #1a1a1a;
    background-color: #ffffff;
}

.form-label {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 14px;
    margin-bottom: 6px;
}

.btn {
    font-weight: 600;
    font-size: 15px;
    padding: 10px 20px;
    border-radius: 8px;
}

.btn-custom {
    border-radius: 25px;
    padding: 0.5rem 1.5rem;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}

.btn-custom:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Search Results */
.search-results {
    max-height: 70vh;
    overflow-y: auto;
    background-color: #ffffff;
}

.result-item {
    border-bottom: 1px solid #dee2e6;
    padding: 1rem;
    transition: background-color 0.2s ease-in-out;
    background-color: #ffffff;
    color: #1a1a1a;
}

.result-item:hover {
    background-color: #f8f9fa;
}

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

/* Pagination */
.pagination-custom {
    justify-content: center;
    margin-top: 2rem;
}

.page-link {
    color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: 5px;
    margin: 0 2px;
}

.page-link:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Analysis Section */
.analysis-section {
    background-color: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.analysis-section h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: 1.4rem;
}

.analysis-section p {
    color: #1a1a1a;
    font-size: 15px;
    line-height: 1.7;
    font-weight: 500;
}

/* References */
.reference-item {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--primary-color);
    background-color: #f8f9fa;
    border-radius: 0 5px 5px 0;
}

.reference-tags {
    margin-top: 0.25rem;
}

.reference-tags .badge {
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

/* Weaknesses */
.weakness-item {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 5px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.weakness-id {
    font-family: 'SF Mono', 'Monaco', 'Consolas', 'Courier New', monospace;
    font-weight: 700;
    color: #856404;
    font-size: 15px;
    letter-spacing: 0.3px;
}

/* Affected Products */
.product-item {
    background-color: #e7f3ff;
    border: 1px solid #bee5eb;
    border-radius: 5px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    font-family: 'SF Mono', 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
}

/* Bulk Analysis */
.bulk-stats {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.risk-score {
    font-size: 2rem;
    font-weight: bold;
}

.risk-high {
    color: var(--danger-color);
}

.risk-medium {
    color: var(--warning-color);
}

.risk-low {
    color: var(--success-color);
}

/* Export Options */
.export-option {
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease-in-out;
    cursor: pointer;
}

.export-option:hover {
    border-color: var(--primary-color);
    background-color: rgba(0, 86, 179, 0.05);
}

.export-option.selected {
    border-color: var(--primary-color);
    background-color: rgba(0, 86, 179, 0.1);
}

/* History */
.history-item {
    border-left: 4px solid var(--primary-color);
    background-color: white;
    border-radius: 0 10px 10px 0;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease-in-out;
}

.history-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Settings */
.setting-item {
    background-color: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
}

.setting-label {
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    font-size: 16px;
}

.setting-description {
    color: #333333;
    font-size: 14px;
    margin-bottom: 1rem;
    line-height: 1.6;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        font-size: 15px;
    }
    
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.8rem; }
    h3 { font-size: 1.6rem; }
    h4 { font-size: 1.4rem; }
    
    .hero-section {
        padding: 1.5rem;
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: 2.2rem;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .description-cell {
        max-width: 250px;
        font-size: 14px;
    }
    
    .table-responsive {
        font-size: 14px;
    }
    
    .table th {
        font-size: 13px;
    }
    
    .analysis-section {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    body {
        font-size: 14px;
    }
    
    h1 { font-size: 1.9rem; }
    h2 { font-size: 1.6rem; }
    h3 { font-size: 1.4rem; }
    h4 { font-size: 1.2rem; }
    
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .hero-section h1 {
        font-size: 1.9rem;
    }
    
    .hero-section .lead {
        font-size: 1.1rem;
    }
    
    .btn {
        font-size: 14px;
        padding: 8px 16px;
        font-weight: 600;
    }
    
    .table {
        font-size: 13px;
    }
    
    .form-control {
        font-size: 14px;
    }
}

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

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

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

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

/* Utilities */
.text-monospace {
    font-family: 'SF Mono', 'Monaco', 'Consolas', 'Courier New', monospace;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.border-left-primary {
    border-left: 4px solid var(--primary-color);
}

.bg-light-primary {
    background-color: rgba(0, 86, 179, 0.05);
}

.text-break {
    word-break: break-word;
}

/* Additional text utilities for better readability */
.text-readable {
    color: #1a1a1a;
    font-weight: 500;
    line-height: 1.7;
}

.text-emphasis {
    color: #000000;
    font-weight: 600;
}

.text-large {
    font-size: 17px;
    line-height: 1.8;
}

/* Dark mode DISABLED - causing table header visibility issues */
/* @media (prefers-color-scheme: dark) { ... } */ 

/* High Contrast Text Improvements - Added for better readability */
.navbar-dark .navbar-nav .nav-link {
    color: #ffffff !important;
    font-weight: 500;
}

.navbar-dark .navbar-brand {
    color: #ffffff !important;
    font-weight: 600;
}

/* Ensure all Bootstrap text elements use high contrast */
.btn {
    color: #1a1a1a;
    font-weight: 600;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff !important;
}

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #ffffff !important;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: #ffffff !important;
}

/* List groups and other elements */
.list-group-item {
    color: #1a1a1a;
    background-color: #ffffff;
    border-color: #e5e7eb;
}

.list-group-item:hover {
    background-color: #f8f9fa;
}

/* Alert components */
.alert {
    color: #1a1a1a;
}

.alert-info {
    background-color: #e7f3ff;
    border-color: #bee5eb;
    color: #1a1a1a;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #1a1a1a;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #1a1a1a;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #1a1a1a;
}

/* Modal and dropdown improvements */
.modal-content {
    background-color: #ffffff;
    color: #1a1a1a;
}

.modal-header {
    border-bottom-color: #e5e7eb;
}

.modal-footer {
    border-top-color: #e5e7eb;
}

.dropdown-menu {
    background-color: #ffffff;
    border-color: #e5e7eb;
}

.dropdown-item {
    color: #1a1a1a;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #1a1a1a;
}

/* Breadcrumb and pagination */
.breadcrumb {
    background-color: #f8f9fa;
}

.breadcrumb-item {
    color: #1a1a1a;
}

.breadcrumb-item.active {
    color: #333333;
}

/* Fix for Recent CVEs dynamic content - HIGH CONTRAST */
.table-dark th {
    background-color: #2c3e50 !important;
    color: #ffffff !important;
    font-weight: 600;
    border-color: #495057;
}

.table-dark {
    background-color: #2c3e50 !important;
    color: #ffffff !important;
}

/* Override Bootstrap table-dark for better readability */
.table-hover tbody tr:hover td {
    background-color: #f8f9fa !important;
    color: #1a1a1a !important;
}

/* Ensure all table content is high contrast */
.table tbody tr td {
    background-color: #ffffff !important;
    color: #1a1a1a !important;
    font-weight: 500;
    border-color: #dee2e6;
}

.table tbody tr {
    background-color: #ffffff !important;
}

/* Recent CVE specific styling */
.recent-summary {
    background-color: #ffffff !important;
    padding: 15px !important;
    border-radius: 8px !important;
    border: 1px solid #e5e7eb !important;
    margin-bottom: 1rem !important;
}

.recent-summary h4 {
    color: #1a1a1a !important;
    font-weight: 600 !important;
    margin: 0 !important;
}

/* Badge improvements for dynamic content */
.badge.bg-secondary {
    background-color: #495057 !important;
    color: #ffffff !important;
    font-weight: 600;
}

.badge.bg-primary {
    background-color: var(--primary-color) !important;
    color: #ffffff !important;
    font-weight: 600;
}

/* Ensure description cells are readable */
.description-cell {
    color: #1a1a1a !important;
    background-color: #ffffff !important;
    font-weight: 500;
    line-height: 1.6;
}

/* FINAL OVERRIDE: Force all table elements to be readable - highest specificity */
body .table thead th,
body .table th,
body table.table thead th, 
body table.table th {
    color: #1a1a1a !important;
    background-color: #f8f9fa !important;
    font-weight: 600 !important;
    border-color: #dee2e6 !important;
}

body .table tbody td,
body .table td,
body table.table tbody td,
body table.table td {
    color: #1a1a1a !important;
    background-color: #ffffff !important;
}

/* Override any dark mode rules completely */
@media (prefers-color-scheme: dark) {
    body .table th,
    body .table thead th {
        color: #1a1a1a !important;
        background-color: #f8f9fa !important;
    }
    
    body .table td,
    body .table tbody td {
        color: #1a1a1a !important;
        background-color: #ffffff !important;
    }
}

/* Page navigation text */
.text-muted.small {
    color: #333333 !important;
    font-weight: 500;
}

/* Full width layout for specific pages */
body main.container-fluid {
    max-width: none !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Fix dropdown positioning for full-width layout */
.navbar-nav .dropdown-menu {
    transform: translateX(-50%) !important;
    left: 50% !important;
}

/* Specifically fix cache dropdown that's positioned at far right */
.navbar-nav.ms-auto .dropdown-menu {
    transform: translateX(-80%) !important;
    left: 80% !important;
    min-width: 200px !important;
}

/* Navigation spacing improvements for full-width layout */
.navbar-nav .nav-item {
    margin: 0 8px;
}

.navbar-nav .nav-link {
    padding: 8px 16px !important;
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
    font-weight: 500;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.navbar-brand {
    margin-right: 2rem !important;
    font-weight: 600;
    font-size: 1.3rem;
}

/* Better spacing for right-side nav items */
.navbar-nav:not(.me-auto) {
    margin-left: 1rem;
}

.navbar-nav:not(.me-auto) .nav-item {
    margin: 0 4px;
}

/* Responsive navigation improvements */
@media (max-width: 991.98px) {
    .navbar-nav .nav-item {
        margin: 4px 0;
    }
    
    .navbar-nav .nav-link {
        padding: 12px 16px !important;
    }
    
    .navbar-nav:not(.me-auto) {
        margin-left: 0;
        margin-top: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 1rem;
    }
}

/* Clean table header styling - now that inline styles are removed */ 