* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --background: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --success: #10b981;
    --error: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* Filters Section */
.filters-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.filters-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group.full-width {
    grid-column: 1 / -1;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.icon {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

/* Input Styles */
input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: all 0.2s;
    background: var(--surface);
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Multi-Select Dropdown */
.multi-select {
    position: relative;
}

.select-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    background: var(--surface);
    transition: all 0.2s;
}

.select-header:hover {
    border-color: var(--primary-color);
}

.select-header.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.select-header .placeholder {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.select-header .placeholder.has-selection {
    color: var(--text-primary);
    font-weight: 500;
}

.chevron {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.select-header.active .chevron {
    transform: rotate(180deg);
}

.select-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    display: none;
    max-height: 400px;
    overflow: hidden;
}

.select-dropdown.show {
    display: block;
}

.search-box {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.dropdown-search {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.875rem;
}

.select-all {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    background: var(--background);
}

.select-all label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    margin: 0;
}

.options-list {
    max-height: 250px;
    overflow-y: auto;
}

.options-list label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: background 0.15s;
    margin: 0;
    font-weight: normal;
}

.options-list label:hover {
    background: var(--background);
}

.options-list input[type="checkbox"] {
    cursor: pointer;
}

/* Toggle Group */
.toggle-group {
    display: flex;
    gap: 0.5rem;
    background: var(--background);
    padding: 0.25rem;
    border-radius: var(--radius);
}

.toggle-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.toggle-option input[type="radio"] {
    display: none;
}

.toggle-option span {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    text-align: center;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.toggle-option input[type="radio"]:checked + span {
    background: var(--surface);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* Clear Button */
.clear-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 1.75rem;
}

.clear-btn:hover {
    border-color: var(--error);
    color: var(--error);
    background: #fef2f2;
}

/* The New Header */
.filter-header {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #666;
  margin-bottom: 10px;
}

/* The Refactored Button */
.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #4285f4; /* Google Blue */
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.2s;
}

.action-btn:hover {
  background-color: #357ae8;
}

.icon {
  width: 18px;
  height: 18px;
}

/* Selected Filters */
.selected-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.filter-tag button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.filter-tag button:hover {
    opacity: 1;
}

.filter-tag .icon {
    width: 16px;
    height: 16px;
}

/* Results Section */
.results-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.results-header h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.results-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 4rem 2rem;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    color: var(--text-secondary);
}

/* Error State */
.error-message {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--error);
}

.error-message svg {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    stroke-width: 2;
}

/* Provider Cards */
.providers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.provider-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: all 0.2s;
    background: var(--surface);
}

.provider-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.provider-header {
    margin-bottom: 1rem;
}

.provider-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.provider-website {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
}

.provider-website:hover {
    color: var(--primary-hover);
}

.provider-info {
    margin-bottom: 1rem;
}

.info-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.info-item .icon {
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.info-item strong {
    color: var(--text-primary);
    min-width: 60px;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge.yes {
    background: #d1fae5;
    color: #065f46;
}

.badge.no {
    background: #fee2e2;
    color: #991b1b;
}

.conditions-list {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.conditions-list h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.condition-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.condition-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    color: var(--text-secondary);
    stroke-width: 1.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .filters-section,
    .results-section {
        padding: 1.5rem;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .providers-grid {
        grid-template-columns: 1fr;
    }

    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}