/*
 * Medicare Provider Search - Main Styles - Kern Family Health Care Branded
 * Version: 1.1.0
 * Purpose: Complete styling for two-tab provider/facility search interface
 * Compatibility: Modern browsers, standalone deployment, WCAG 2.1 AA compliant
 */

/* Google Fonts - Open Sans for Kern Family Health Care branding */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800&display=swap');

/* ==========================================================================
   CSS Reset & Base Styles
   ========================================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Remove default button styles */
button {
    border: none;
    background: none;
    font: inherit;
    cursor: pointer;
}

/* Remove default input styles */
input, select, textarea {
    font: inherit;
    border: none;
    background: none;
}

/* ==========================================================================
   App Container & Layout
   ========================================================================== */

.medicare-provider-search {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    min-height: 100vh;
}

/* Iframe-specific adjustments */
@media screen and (max-width: 768px) {
    .medicare-provider-search {
        padding: 15px;
    }
}

/* ==========================================================================
   Header Styles
   ========================================================================== */

.search-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.search-title {
    font-size: 2rem;
    font-weight: 700;
    color: #4f2683;
    margin-bottom: 8px;
}

.search-subtitle {
    font-size: 1.1rem;
    color: #666;
    font-weight: 400;
}

@media screen and (max-width: 768px) {
    .search-title {
        font-size: 1.5rem;
    }
    
    .search-subtitle {
        font-size: 1rem;
    }
}

/* ==========================================================================
   Tab Navigation
   ========================================================================== */

.tab-navigation {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 3px solid #e0e0e0;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    background-color: transparent;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.tab-button:hover {
    background-color: #e9ecef;
    color: #333;
}

.tab-button:focus {
    outline: 2px solid #4f2683;
    outline-offset: -2px;
    z-index: 1;
}

.tab-button.active {
    color: #4f2683;
    background-color: #fff;
    border-bottom-color: #4f2683;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: #4f2683;
}

@media screen and (max-width: 768px) {
    .tab-button {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
}

/* ==========================================================================
   Search Panels
   ========================================================================== */

.search-panel {
    background-color: #fff;
    border-radius: 0 0 8px 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-panel:not(.active) {
    display: none;
}

/* ==========================================================================
   Form Styles
   ========================================================================== */

.search-form {
    display: grid;
    gap: 30px;
}

.search-section {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #4f2683;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #4f2683;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

/* Removed blue vertical line decoration for cleaner appearance */

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

/* Form Rows for side-by-side layout */
.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-row .form-group:last-child {
    margin-bottom: 0;
}

/* Responsive form rows */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 20px;
    }
    
    .form-row .form-group {
        margin-bottom: 20px;
    }
    
    .form-row .form-group:last-child {
        margin-bottom: 0;
    }
}

/* Form Labels */
.form-label {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

/* Form Help Text */
.form-help-text {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-top: 4px;
    margin-bottom: 0;
    font-style: italic;
}

/* Form Inputs */
.form-input, .form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #d0d7de;
    border-radius: 6px;
    font-size: 1rem;
    background-color: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: #4f2683;
    box-shadow: 0 0 0 3px rgba(31, 71, 136, 0.1);
}

.form-input::placeholder {
    color: #999;
    font-style: italic;
}

/* Form Help Text */
.form-help {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-top: 4px;
    font-style: italic;
}

/* Checkbox Groups */
.checkbox-group {
    border: none;
    padding: 0;
}

.checkbox-group legend {
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    cursor: pointer;
    font-weight: normal;
    position: relative;
}

/* Hide default checkbox */
.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 0;
    height: 0;
}

/* Custom checkbox */
.checkbox-label::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 12px;
    border: 2px solid #d0d7de;
    border-radius: 4px;
    background-color: #fff;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

/* When checkbox is checked, update the custom checkbox */
.checkbox-label input[type="checkbox"]:checked + .checkbox-text::before,
.checkbox-label:has(input[type="checkbox"]:checked)::before {
    background-color: #4f2683;
    border-color: #4f2683;
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='m13.854 3.646-6 6-2.5-2.5a.5.5 0 0 0-.708.708l2.854 2.854a.5.5 0 0 0 .708 0l6.354-6.354a.5.5 0 1 0-.708-.708z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px 14px;
}

/* Hover state */
.checkbox-label:hover::before {
    border-color: #4f2683;
    background-color: #f8f9fa;
}

/* Focus state for accessibility */
.checkbox-label input[type="checkbox"]:focus + .checkbox-text::before,
.checkbox-label:has(input[type="checkbox"]:focus)::before {
    outline: 2px solid #4f2683;
    outline-offset: 2px;
}

.checkbox-text {
    color: #333;
    font-size: 0.95rem;
}

.checkbox-label:hover .checkbox-text {
    color: #4f2683;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 15px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
    justify-content: flex-start;
}

@media screen and (max-width: 768px) {
    .form-actions {
        flex-direction: column;
    }
}

/* ==========================================================================
   Button Styles
   ========================================================================== */

.btn {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    border: 2px solid transparent;
}

.btn:focus {
    outline: 2px solid #4f2683;
    outline-offset: 2px;
}

.btn-primary {
    background-color: #4f2683;
    color: #fff !important;
    border-color: #4f2683;
}

.btn-primary:hover {
    background-color: #163a70;
    color: #fff !important;
    border-color: #163a70;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(31, 71, 136, 0.2);
}

.btn-primary:active {
    background-color: #163a70;
    color: #fff !important;
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(31, 71, 136, 0.2);
}

.btn-secondary {
    background-color: #fff;
    color: #666;
    border-color: #d0d7de;
}

.btn-secondary:hover {
    background-color: #f8f9fa;
    color: #333;
    border-color: #999;
}

@media screen and (max-width: 768px) {
    .btn {
        width: 100%;
        min-width: unset;
    }
}

/* ==========================================================================
   Search Results
   ========================================================================== */

.search-results {
    margin-top: 30px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.results-header {
    background-color: #4f2683;
    color: #fff;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.results-header .results-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
    color: #fff !important;
}

.results-header .results-count {
    font-size: 0.95rem;
    opacity: 0.9;
    margin: 0;
    color: #fff !important;
}

.results-list {
    max-height: 600px;
    overflow-y: auto;
    padding: 0;
}

/* Individual Result Items */
.result-item {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.2s ease;
    position: relative;
}

.result-item:hover {
    background-color: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.result-item:last-child {
    border-bottom: none;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 12px;
}

.result-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #4f2683;
    margin: 0;
    flex: 1;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.result-type {
    font-size: 0.85rem;
    color: #666;
    background-color: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
    white-space: nowrap;
}

.result-distance {
    font-size: 0.85rem;
    color: #0056b3;
    background-color: #e7f3ff;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid #b3d9ff;
}

/* Enhanced Provider Badges */
.provider-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.badge {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-pcp {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.badge-fqhc {
    background-color: #cce7ff;
    color: #004085;
    border: 1px solid #99d3ff;
}

.badge-telehealth {
    background-color: #e7f3ff;
    color: #0056b3;
    border: 1px solid #b3d9ff;
}

.badge-multilocation {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.badge-accepting {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.badge-not-accepting {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Provider Information Grid */
.result-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 15px;
}

.result-info-item {
    display: flex;
    align-items: flex-start;
    font-size: 0.9rem;
    gap: 8px;
}

.result-info-item .icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.result-info-item .label {
    font-weight: 600;
    color: #495057;
    min-width: 70px;
}

.result-info-item .value {
    color: #666;
    flex: 1;
}

/* Provider Group and Hospital Affiliation */
.provider-organization {
    background-color: #f8f9fa;
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    border-left: 3px solid #17a2b8;
}

.organization-name {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.organization-type {
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Accessibility Indicators */
.accessibility-indicators {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
    align-items: center;
}

.accessibility-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.85rem;
    margin-right: 8px;
}

.accessibility-badge {
    background-color: #e9ecef;
    color: #495057;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 500;
    border: 1px solid #ced4da;
}

.accessibility-badge.highlighted {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

/* Practice Hours Display */
.practice-hours {
    font-size: 0.85rem;
    color: #666;
    padding: 6px 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hours-label {
    font-weight: 500;
}

.hours-text {
    color: #333;
}

.hours-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-open {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}

.status-closed {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

/* Enhanced Contact Section */
.result-contact {
    background-color: #f0f4f8;
    padding: 15px;
    border-radius: 8px;
    font-size: 0.9rem;
    position: relative;
}

.contact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.location-indicator {
    font-size: 0.8rem;
    color: #6c757d;
    font-weight: 500;
}

.result-address {
    color: #666;
    margin-bottom: 8px;
    line-height: 1.4;
}

.facility-name {
    font-weight: 600;
    color: #495057;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.result-phone {
    color: #4f2683;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.result-phone:hover {
    text-decoration: underline;
}

/* Responsive Adjustments */
@media screen and (max-width: 768px) {
    .result-info {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .result-meta {
        order: -1;
        width: 100%;
    }
    
    .provider-badges {
        margin-bottom: 8px;
    }
}

@media screen and (max-width: 480px) {
    .result-item {
        padding: 15px;
    }
    
    .result-info-item {
        font-size: 0.85rem;
    }
    
    .result-contact {
        padding: 12px;
    }
}

/* ==========================================================================
   Loading & Error States
   ========================================================================== */

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background-color: rgba(255, 255, 255, 0.95);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #4f2683;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1rem;
    color: #666;
    margin: 0;
}

.error-message {
    background-color: #fff2f0;
    border: 2px solid #ffccc7;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    color: #d4380d;
}

.error-message h3 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.error-message p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media screen and (max-width: 1024px) {
    .medicare-provider-search {
        padding: 15px;
    }
    
    .search-section {
        padding: 15px;
    }
}

@media screen and (max-width: 768px) {
    .search-panel {
        padding: 15px;
    }
    
    .search-section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .section-title {
        font-size: 1.1rem;
    }
    
    .form-input, .form-select {
        padding: 10px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .results-header {
        padding: 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .result-item {
        padding: 15px;
    }
}

@media screen and (max-width: 480px) {
    .medicare-provider-search {
        padding: 10px;
    }
    
    .search-header {
        margin-bottom: 20px;
    }
    
    .tab-navigation {
        margin-bottom: 20px;
    }
    
    .tab-button {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .search-section {
        padding: 12px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
}

/* ==========================================================================
   Accessibility Enhancements
   ========================================================================== */

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-input, .form-select {
        border-width: 3px;
    }
    
    .btn {
        border-width: 3px;
    }
    
    .tab-button.active {
        border-bottom-width: 5px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .loading-spinner {
        animation: none;
        border-top-color: #4f2683;
    }
}

/* Focus indicators for keyboard navigation */
.form-input:focus,
.form-select:focus,
.checkbox-label input:focus,
.btn:focus,
.tab-button:focus {
    outline: 2px solid #4f2683;
    outline-offset: 2px;
}

/* Screen reader only content */
.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;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .medicare-provider-search {
        max-width: none;
        padding: 0;
        box-shadow: none;
    }
    
    .tab-navigation,
    .form-actions,
    .loading,
    .error-message {
        display: none;
    }
    
    .search-panel {
        display: block !important;
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
    
    .search-results {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .result-item {
        page-break-inside: avoid;
        border-bottom: 1px solid #ccc;
    }
}

/* ==========================================================================
   Form Validation & Enhancement Styles
   ========================================================================== */

/* Form validation styles */
.form-group {
    position: relative;
}

.form-group input.invalid,
.form-group select.invalid {
    border-color: #d63384;
    box-shadow: 0 0 0 0.2rem rgba(214, 51, 132, 0.25);
}

.form-group .help-text {
    font-size: 0.875rem;
    color: #666;
    margin-top: 0.25rem;
    display: block;
}

/* NPI input specific styling */
#provider-npi {
    font-family: monospace;
    letter-spacing: 1px;
}

/* Accessibility checkbox group styling */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 5px;
}

.checkbox-group .checkbox-item {
    display: flex;
    align-items: center;
    min-width: 200px;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
}

.checkbox-group label {
    margin: 0;
    font-size: 0.9rem;
    cursor: pointer;
}

/* Responsive checkbox layout */
@media (max-width: 768px) {
    .checkbox-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .checkbox-group .checkbox-item {
        min-width: auto;
        width: 100%;
    }
}

/* ==============================
   Results Controls & Filtering
   ============================== */

.results-controls {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* Sort Controls */
.sort-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
    margin: 0;
}

.control-select {
    padding: 6px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: white;
    color: #495057;
    min-width: 140px;
}

.control-select:focus {
    outline: none;
    border-color: #4f2683;
    box-shadow: 0 0 0 2px rgba(31, 71, 136, 0.2);
}

.control-button {
    padding: 6px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background-color: white;
    color: #495057;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.control-button:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.control-button:focus {
    outline: none;
    border-color: #4f2683;
    box-shadow: 0 0 0 2px rgba(31, 71, 136, 0.2);
}

.control-button.secondary {
    background-color: #6c757d;
    color: white;
    border-color: #6c757d;
}

.control-button.secondary:hover {
    background-color: #545b62;
    border-color: #545b62;
}

/* Filter Controls */
.filter-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-panel {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #dee2e6;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 16px;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.85rem;
    margin: 0;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #495057;
    cursor: pointer;
    position: relative;
}

.filter-checkbox input[type="checkbox"] {
    opacity: 0;
    position: absolute;
    width: 16px;
    height: 16px;
}

.filter-checkbox .checkmark {
    width: 16px;
    height: 16px;
    border: 2px solid #ced4da;
    border-radius: 3px;
    background-color: white;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.filter-checkbox input[type="checkbox"]:checked + .checkmark {
    background-color: #4f2683;
    border-color: #4f2683;
}

.filter-checkbox input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.filter-checkbox:hover .checkmark {
    border-color: #4f2683;
}

.filter-checkbox input[type="checkbox"]:focus + .checkmark {
    box-shadow: 0 0 0 2px rgba(31, 71, 136, 0.2);
}

/* Active Filters */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 24px;
    align-items: flex-start;
}

.filter-tag {
    background-color: #4f2683;
    color: white;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.filter-tag .remove {
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0 2px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.filter-tag .remove:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Results Count with Active Filters */
.results-count {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.results-meta {
    font-size: 0.85rem;
    color: #6c757d;
}

/* Responsive Design for Controls */
@media screen and (max-width: 768px) {
    .controls-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .sort-controls, .filter-controls {
        justify-content: center;
    }
    
    .filter-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .control-select {
        min-width: 120px;
    }
}

@media screen and (max-width: 480px) {
    .results-controls {
        padding: 12px;
    }
    
    .sort-controls {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .control-button {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}

/* ==============================
   Provider Detail Modal
   ============================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.modal-content {
    position: relative;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
}

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #4f2683;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: #e9ecef;
    color: #495057;
}

.modal-close:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(31, 71, 136, 0.2);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Provider Detail Content */
.provider-detail {
    display: grid;
    gap: 24px;
}

.detail-section {
    background-color: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #4f2683;
}

.detail-section h3 {
    margin: 0 0 12px 0;
    font-size: 1.1rem;
    color: #4f2683;
    font-weight: 600;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.detail-value {
    color: #666;
    font-size: 0.95rem;
}

.locations-list {
    display: grid;
    gap: 16px;
}

.location-card {
    background-color: white;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.location-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.location-title {
    font-weight: 600;
    color: #333;
    margin: 0;
}

.location-type {
    background-color: #e9ecef;
    color: #495057;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}



/* Enhanced Result Item with View Details Button */
.result-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-view-details {
    background-color: #4f2683;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.btn-view-details:hover {
    background-color: #153a6b;
    transform: translateY(-1px);
}

.btn-view-details:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(31, 71, 136, 0.2);
}



/* Print Styles */
@media print {
    .modal-overlay,
    .results-controls,
    .search-form,
    .modal-footer,
    .btn,
    button {
        display: none !important;
    }
    
    .modal-content {
        position: static;
        box-shadow: none;
        border: 1px solid #333;
        max-width: none;
        width: 100%;
        max-height: none;
    }
    
    .modal-header {
        background-color: white;
        border-bottom: 2px solid #333;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .detail-section {
        break-inside: avoid;
        margin-bottom: 20px;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* Responsive Design for Modals */
@media screen and (max-width: 768px) {
    .modal {
        padding: 10px;
    }
    
    .modal-content {
        border-radius: 8px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}



/* ===== ENHANCED UX FEATURES ===== */

/* Keyboard Navigation Support */
.result-item.keyboard-focus {
    outline: 3px solid #4f2683;
    outline-offset: 2px;
    background-color: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
}

.skip-link:focus {
    top: 6px !important;
    z-index: 1001;
}



/* Action Buttons Container */
.result-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.result-actions .btn {
    flex: 1;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.result-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Provider Detail Grid for Modal */
.detail-section {
    margin-bottom: 1.5rem;
}

.detail-section h3 {
    color: #4f2683;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.detail-value {
    color: #212529;
    font-size: 0.9rem;
}

.location-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.location-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.location-title {
    color: #4f2683;
    font-size: 1rem;
    margin: 0;
}

.location-type {
    background: #e7f3ff;
    color: #4f2683;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}



/* ==========================================================================
   Kern Family Health Care Site Header & Footer
   ========================================================================== */

/* Site Header */
.kfhc-site-header {
    background: #ffffff;
    border-bottom: 2px solid #4f2683;
    padding: 15px 0;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
    padding: 10px 0;
}

.site-branding {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 15px;
}

.site-logo {
    height: 50px;
    width: auto;
}

.site-title {
    color: #4f2683;
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.language-selector {
    font-size: 14px;
}

.lang-link {
    color: #4f2683;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s;
}

.lang-link:hover {
    color: #43206f;
    text-decoration: underline;
}

/* Adjust search header for standalone layout */
.medicare-provider-search .search-header {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 30px;
    padding: 25px 30px;
}

/* Site Footer */
.kfhc-site-footer {
    background: #4f2683 url('https://member.kernfamilyhealthcare.com/filestore/%7B18a82ce3-352e-428a-9f69-e5da4c428836%7D/branding/images/wave2.png') no-repeat top center;
    background-size: 100% auto;
    border-top: 2px solid #4f2683;
    margin-top: 50px;
    padding: 110px 0 30px;
    font-size: 14px;
    color: white;
    min-height: 140px;
    position: relative;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-info {
    line-height: 1.6;
}

.footer-notice {
    margin-bottom: 15px;
    color: white;
}

.footer-notice:last-child {
    margin-bottom: 0;
}

.footer-notice strong {
    color: white;
    font-weight: 600;
}

.footer-notice a {
    color: white;
    text-decoration: underline;
}

.footer-notice a:hover {
    color: #f0f0f0;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-copyright {
    color: white;
    font-size: 13px;
}

.footer-social {
    display: flex;
}

.social-links {
    display: flex;
    flex-direction: row;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.social-links a {
    display: block;
    color: rgb(242, 242, 242);
    font-size: 22px;
    text-decoration: none;
    margin: 0;
    padding: 0;
    width: 34px;
    height: 34px;
    text-align: center;
    line-height: 22px;
    transition: opacity 0.3s ease;
}

.social-links a:hover {
    opacity: 0.8;
}

.social-icon {
    display: block;
    width: 32px;
    height: 32px;
    background: rgba(242, 242, 242, 0.9);
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

/* Facebook Icon */
.social-icon.facebook::before {
    content: "f";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Georgia', serif;
    font-size: 20px;
    font-weight: bold;
    color: #4267B2;
    background: white;
    border-radius: 3px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Twitter Icon */  
.social-icon.twitter::before {
    content: "🐦";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
}

/* YouTube Icon */
.social-icon.youtube::before {
    content: "▶";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    color: #FF0000;
    background: white;
    border-radius: 2px;
    width: 20px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hover effects */
.social-links a:hover .social-icon {
    opacity: 0.8;
    transform: scale(1.05);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .result-actions {
        flex-direction: column;
    }
    
    .result-actions .btn {
        width: 100%;
    }
    
    .detail-grid {
        grid-template-columns: 1fr;
    }
    
    .location-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    /* Header responsive */
    .header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        min-height: auto;
        padding: 15px 0;
    }
    
    .site-title {
        font-size: 20px;
    }
    
    .header-actions {
        align-self: flex-end;
    }
    
    /* Footer responsive */
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .medicare-provider-search .search-header {
        padding: 20px;
    }
}