/* Custom CSS for Embedded Insurance Directory */

:root {
    --primary-color: #0066cc;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --white-color: #ffffff;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
}

/* Base Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    line-height: 1.6;
    color: var(--gray-800);
}

/* Force consistent font family across all elements EXCEPT Font Awesome icons */
*:not([class*="fa-"]):not(.fas):not(.far):not(.fab):not(.fal):not(.fad), 
*::before:not([class*="fa-"]):not(.fas):not(.far):not(.fab):not(.fal):not(.fad), 
*::after:not([class*="fa-"]):not(.fas):not(.far):not(.fab):not(.fal):not(.fad) {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    font-weight: 600 !important;
}

p, span:not([class*="fa-"]):not(.fas):not(.far):not(.fab):not(.fal):not(.fad), 
div:not([class*="fa-"]):not(.fas):not(.far):not(.fab):not(.fal):not(.fad), 
a:not([class*="fa-"]):not(.fas):not(.far):not(.fab):not(.fal):not(.fad), 
button, input, textarea, select, label, small, strong, em, 
b:not([class*="fa-"]):not(.fas):not(.far):not(.fab):not(.fal):not(.fad) {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

/* Specifically exclude i tags with Font Awesome classes from font override */
i:not([class*="fa-"]):not(.fas):not(.far):not(.fab):not(.fal):not(.fad) {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

.card, .card-body, .card-header, .card-footer, .card-title, .card-text {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

/* Font Awesome Icon Fix - HIGH PRIORITY */
i.fas, i.far, i.fab, i.fal, i.fad,
.fas, .far, .fab, .fal, .fad {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 5 Free", "Font Awesome 5 Pro" !important;
    font-weight: 900 !important;
    display: inline-block !important;
    font-style: normal !important;
}

i.far, .far {
    font-weight: 400 !important;
}

i[class*="fa-"], [class*="fa-"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 5 Free", "Font Awesome 5 Pro" !important;
    font-style: normal !important;
}

/* Ensure icons display properly with maximum specificity */
i.fas::before, i.far::before, i.fab::before, i.fal::before, i.fad::before,
.fas::before, .far::before, .fab::before, .fal::before, .fad::before {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 5 Free", "Font Awesome 5 Pro" !important;
}

.breadcrumb, .breadcrumb-item, .badge, .btn, .form-control, .form-label {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

/* Override Bootstrap font settings */
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

/* Bootstrap component overrides */
.navbar, .navbar-brand, .nav-link, .dropdown-item {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

/* Ensure text contrast and readability */
.text-muted {
    color: #6c757d !important;
    opacity: 1 !important;
}

/* Company card specific font fixes */
.company-card * {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

/* Force Arial as fallback if Segoe UI fails */
@supports not (font-family: 'Segoe UI') {
    *, *::before, *::after {
        font-family: Arial, Helvetica, sans-serif !important;
    }
}

/* Navigation */
.navbar-brand {
    font-size: 1.5rem;
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link {
    color: var(--gray-700) !important;
    font-weight: 500;
    padding: 0.75rem 1rem !important;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #004499 100%);
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.hero-section h1 {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Feature Icons */
.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out, transform 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* Company Logos */
.company-logo {
    border-radius: 0.375rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
    background-color: #ffffff;
    padding: 0.5rem;
}

.company-logo:hover {
    transform: scale(1.05);
}

.company-card {
    height: 100%;
}

.company-card .card-header {
    border-bottom: 2px solid var(--primary-color);
    background: linear-gradient(45deg, var(--primary-color), #0052a3);
    color: white;
}

.company-card .card-header h5 {
    color: white;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #0052a3;
    border-color: #0052a3;
    transform: translateY(-1px);
}

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

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

/* Forms */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

/* Badges */
.badge {
    font-weight: 500;
}

.bg-primary-subtle {
    background-color: rgba(0, 102, 204, 0.1) !important;
}

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

/* Footer */
footer {
    background-color: var(--gray-900) !important;
}

/* Breadcrumb */
.breadcrumb {
    background-color: transparent;
    padding: 0;
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: #0052a3;
    text-decoration: underline;
}

/* Search Results */
.search-highlight {
    background-color: #fff3cd;
    padding: 0.1rem 0.2rem;
    border-radius: 0.25rem;
}

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

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        min-height: 50vh;
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 3rem 0;
    }
    
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .lead {
        font-size: 1rem;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Print Styles */
@media print {
    .navbar,
    footer,
    .btn,
    .card-header {
        display: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid var(--gray-300) !important;
    }
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--gray-800);
    }
    
    .btn-primary {
        border: 2px solid var(--primary-color);
    }
}

/* Enhanced Text Visibility */
.text-muted {
    color: #6c757d !important;
}

.card .text-muted {
    color: #6c757d !important;
}

/* Ensure all cards have proper contrast */
.card {
    background-color: #ffffff;
    color: #212529;
}

.card-body {
    color: #212529;
}

.card-header {
    color: #212529;
}

/* Override any dark theme text issues */
.card .text-muted.small {
    color: #6c757d !important;
    opacity: 0.8;
}

/* CRITICAL Font Awesome Override - MUST BE LAST */
/* This ensures Font Awesome icons display correctly */
i[class^="fa-"], i[class*=" fa-"], 
i.fas, i.far, i.fab, i.fal, i.fad {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro" !important;
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    line-height: 1 !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Specific weights for different Font Awesome styles */
i.fas { font-weight: 900 !important; }
i.far { font-weight: 400 !important; }
i.fab { font-weight: 400 !important; }
i.fal { font-weight: 300 !important; }
i.fad { font-weight: 900 !important; }

/* Trending Insights Section */
.trending-insight-card {
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.125);
}

.trending-insight-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    border-color: var(--primary-color);
}

.trending-insight-card .card-img-top {
    transition: all 0.3s ease;
}

.trending-insight-card:hover .card-img-top {
    transform: scale(1.02);
}

.trending-insight-card .card-title {
    color: var(--gray-900);
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.trending-insight-card .card-text {
    font-size: 0.9rem;
    line-height: 1.5;
    flex-grow: 1;
}

.trending-insight-card .btn-outline-primary {
    transition: all 0.3s ease;
    font-weight: 500;
}

.trending-insight-card .btn-outline-primary:hover {
    transform: translateY(-1px);
}

/* Responsive adjustments for trending insights */
@media (max-width: 768px) {
    .trending-insight-card .card-title {
        font-size: 1rem;
    }
    
    .trending-insight-card .card-text {
        font-size: 0.85rem;
    }
}

/* Badge styling for trending insights */
.trending-insight-card .badge {
    font-size: 0.75rem;
    padding: 0.35em 0.6em;
}

/* Fallback image styling for trending insights */
.trending-insight-card .card-img-top.bg-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #004c99 100%) !important;
}
