html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f8f9fa;
}

/* Skip link for accessibility */
.visually-hidden-focusable:focus {
    position: absolute !important;
    top: 10px;
    left: 10px;
    z-index: 9999;
    padding: 8px 12px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
}

/* Header improvements */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.navbar-brand .fas {
    color: #007bff;
}

/* Card enhancements */
.tool-card .card {
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}

.tool-card .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

.tool-card .card:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.card-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
}

.card-title {
    color: #2c3e50;
    font-weight: 600;
}

.card-text {
    color: #6c757d;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Badge styling */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.35em 0.65em;
}

.badge.bg-success {
    background-color: #28a745 !important;
}

.badge.bg-info {
    background-color: #17a2b8 !important;
}

.badge.bg-warning {
    background-color: #ffc107 !important;
    color: #212529 !important;
}

.badge.bg-light {
    background-color: #f8f9fa !important;
    color: #6c757d !important;
    border: 1px solid #dee2e6;
}

/* Button improvements */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.4);
}

.btn-outline-secondary {
    border: 1.5px solid #6c757d;
    color: #6c757d;
}

.btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    transform: translateY(-1px);
}

/* Search and filter section */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.form-control, .form-select {
    border-radius: 8px;
    border: 1.5px solid #dee2e6;
    padding: 0.6rem 0.75rem;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
}

.input-group-text {
    background-color: #f8f9fa;
    border: 1.5px solid #dee2e6;
    border-right: none;
    color: #6c757d;
}

/* Custom multiselect styling */
.custom-multiselect .dropdown-menu {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-top: 2px;
}

.custom-multiselect .dropdown-item {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #f8f9fa;
}

.custom-multiselect .dropdown-item:last-child {
    border-bottom: none;
}

.custom-multiselect .dropdown-item:hover {
    background-color: #f8f9fa;
}

.custom-multiselect .form-check-input {
    margin-top: 0.2rem;
}

/* Page header styling */
.bg-primary.bg-gradient {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) !important;
}

.display-6 {
    font-weight: 700;
}

.lead {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Results summary */
.badge.fs-6 {
    font-size: 1rem !important;
    padding: 0.5rem 0.75rem;
}

/* View toggle buttons */
.btn-group .btn-outline-primary {
    border: 1.5px solid #007bff;
    color: #007bff;
}

.btn-group .btn-outline-primary:hover,
.btn-group .btn-outline-primary.active {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

/* Footer improvements - ¼W±jÅv­« */
.footer {
    background-color: #343a40 !important;
    color: #ffffff !important;
    margin-top: 3rem;
}

.footer p {
    color: #ffffff !important;
}

.footer .container {
    color: #ffffff !important;
}

.footer .row {
    color: #ffffff !important;
}

.footer .col-md-6 {
    color: #ffffff !important;
}

.footer a {
    color: #adb5bd !important;
    text-decoration: none;
}

.footer a:hover {
    color: #ffffff !important;
    text-decoration: underline;
}

/* Empty state styling */
.text-center .fa-3x {
    opacity: 0.5;
}

/* Loading animation */
.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Home page specific styles */
.text-purple {
    color: #6f42c1 !important;
}

.min-vh-75 {
    min-height: 75vh;
}

.hero-content {
    padding: 2rem 0;
}

.feature-card {
    padding: 2rem 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: scale(1.05);
}

.stat-number {
    font-size: 2.5rem;
    line-height: 1;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .tool-card .card {
        margin-bottom: 1rem;
    }
    
    .display-6 {
        font-size: 2rem;
    }
    
    .lead {
        font-size: 1rem;
    }
    
    .btn-group {
        width: 100%;
    }
    
    .btn-group .btn {
        flex: 1;
    }
    
    .hero-content {
        padding: 1rem 0;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .feature-card {
        padding: 1.5rem 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-sm {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }
    
    .btn-primary {
        background: #000;
        border-color: #000;
    }
    
    .badge {
        border: 1px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .tool-card .card {
        transition: none;
    }
    
    .tool-card .card:hover {
        transform: none;
    }
    
    .btn {
        transition: none;
    }
    
    .fa-spinner {
        animation: none;
    }
    
    .feature-card {
        transition: none;
    }
    
    .feature-card:hover {
        transform: none;
    }
    
    .stat-card {
        transition: none;
    }
    
    .stat-card:hover {
        transform: none;
    }
}

/* Print styles */
@media print {
    .navbar, .footer, .btn, .form-control, .form-select {
        display: none;
    }
    
    .tool-card {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
    
    .card {
        border: 1px solid #000;
        box-shadow: none;
    }
}