/**
 * Custom styles for Trust Credible Application
 * Extends Bootstrap with minimal custom styling
 */

/* Global Styles */
body {
    background-color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    color: #333333;
}

/* Navigation */
.navbar {
    background-color: #ffffff !important;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
    color: #333333 !important;
}

.navbar-light .navbar-nav .nav-link {
    color: #333333 !important;
}

.navbar-light .navbar-nav .nav-link:hover {
    color: #0d6efd !important;
}

/* Cards */
.card {
    border: 1px solid #e9ecef;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background-color: #ffffff;
}

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

.card-body {
    padding: 1.25rem;
}

.card-title {
    color: #333333;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* Business Cards Specific */
.card .text-muted a {
    color: #0d6efd !important;
    text-decoration: none;
}

.card .text-muted a:hover {
    text-decoration: underline;
}

/* Badges */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
}

/* Modal */
.modal-content {
    border: 1px solid #e9ecef;
    background-color: #ffffff;
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
}

/* Form Elements */
.form-control:focus,
.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Dropdown Menu */
.dropdown-menu {
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background-color: #ffffff;
}

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

/* Pagination */
.pagination .page-link {
    border-color: #e9ecef;
    color: #333333;
}

.pagination .page-link:hover {
    background-color: #f8f9fa;
    border-color: #e9ecef;
}

.pagination .page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* Alerts */
.alert {
    border-radius: 0.5rem;
    border: none;
    margin-bottom: 1rem;
}

/* Empty State */
.text-center .fa-3x {
    color: var(--bs-secondary);
    margin-bottom: 1rem;
}

/* Footer */
footer {
    border-top: 1px solid #e9ecef;
    margin-top: auto;
    background-color: #f8f9fa;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-group-sm > .btn,
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .table-responsive {
        border-radius: 0.5rem;
    }
}

/* Loading States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Focus States for Accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: none;
}

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

::-webkit-scrollbar-track {
    background: var(--bs-dark);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--bs-light);
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .modal,
    .dropdown,
    footer {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000 !important;
        break-inside: avoid;
        margin-bottom: 1rem;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .card {
        border-width: 2px;
    }
    
    .btn {
        border-width: 2px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .card,
    .btn {
        transition: none;
    }
}

/* Home Page Styles */
.hero-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 70vh;
}

.min-vh-75 {
    min-height: 75vh;
}

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

.search-container .input-group-text {
    background: #ffffff;
    border-color: #ced4da;
}

.hero-illustration svg {
    max-width: 100%;
    height: auto;
}

/* Category Cards */
.category-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #0d6efd;
}

.category-icon {
    transition: transform 0.3s ease;
}

.category-card:hover .category-icon {
    transform: scale(1.1);
}

/* Features Section */
.feature-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--bs-primary-rgb), 0.1);
    border-radius: 50%;
    flex-shrink: 0;
}

.features-illustration svg {
    max-width: 100%;
    height: auto;
}

/* Stats Section Animation */
.display-6 {
    font-weight: 700;
    font-size: 3rem;
}

/* CTA Section */
.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.125rem;
}

/* Popular categories hover effect */
.category-card h5 {
    transition: color 0.3s ease;
}

.category-card:hover h5 {
    color: #0d6efd !important;
}

/* Search bar focus states */
.search-container .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Hero section responsive */
@media (max-width: 768px) {
    .hero-section {
        min-height: 60vh;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .search-container .input-group-lg .form-control {
        font-size: 1rem;
        padding: 0.5rem 0.75rem;
    }
    
    .btn-lg {
        padding: 0.5rem 1.5rem;
        font-size: 1rem;
    }
    
    .display-6 {
        font-size: 2rem;
    }
}

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

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

/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
}

/* Fix for search match summary boxes - ensure they stay visible */
.alert-info {
    position: static !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: auto !important;
}

.search-match-summary {
    position: static !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Prevent auto-dismiss of search match summaries */
.alert-permanent {
    position: static !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Upload area styles */
.upload-area {
    transition: all 0.3s ease;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-area:hover {
    border-color: #198754 !important;
    background-color: #f8f9fa !important;
}

.upload-area.dragover {
    border-color: #0d6efd !important;
    background-color: #e7f3ff !important;
}

.upload-label {
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-icon {
    transition: transform 0.2s ease;
}

.upload-area:hover .upload-icon {
    transform: scale(1.1);
}
