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

body {
    font-family: 'Libre Franklin', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background: #fafafa;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
}

/* Header */
header {
    background: white;
    border-bottom: 1px solid #e5e5e5;
    padding: 48px 40px 40px;
    text-align: center;
}

header h1 {
    font-size: 2.25rem;
    margin-bottom: 8px;
    color: #1a1a1a;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1rem;
    color: #666;
    margin-bottom: 32px;
    font-weight: 400;
}

/* Search Box */
#searchbox {
    max-width: 640px;
    margin: 0 auto;
}

.ais-SearchBox {
    margin-bottom: 0;
}

.ais-SearchBox-form {
    position: relative;
    display: flex;
}

.ais-SearchBox-input {
    flex: 1;
    padding: 14px 18px;
    padding-left: 45px;
    font-size: 15px;
    border: 1px solid #d4d4d4;
    border-radius: 6px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
    width: 100%;
}

.ais-SearchBox-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.ais-SearchBox-submit {
    display: none !important;
}

.ais-SearchBox-submitIcon {
    display: none !important;
}

.ais-SearchBox-reset {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #737373;
    padding: 4px;
    cursor: pointer;
    transition: color 0.2s;
    display: none;
    z-index: 1;
}

.ais-SearchBox-reset[hidden] {
    display: none;
}

.ais-SearchBox-form:not(.ais-SearchBox--noReset) .ais-SearchBox-reset {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ais-SearchBox-reset:hover {
    color: #dc2626;
}

.ais-SearchBox-resetIcon {
    width: 16px;
    height: 16px;
}

.ais-SearchBox-loadingIndicator {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
}

/* Main Layout */
main {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 40px;
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
        padding: 24px;
    }
}

/* Filters Sidebar */
.filters {
    background: white;
    padding: 0;
    height: fit-content;
    position: sticky;
    top: 24px;
}

.filters h3 {
    margin-bottom: 24px;
    color: #1a1a1a;
    font-size: 1.125rem;
    font-weight: 600;
}

.filter-section {
    margin-bottom: 32px;
}

.filter-section h4 {
    margin-bottom: 12px;
    font-size: 0.813rem;
    text-transform: uppercase;
    color: #737373;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.ais-RefinementList-list {
    list-style: none;
}

.ais-RefinementList-item {
    margin-bottom: 8px;
}

.ais-RefinementList-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 6px 0;
    transition: color 0.2s;
}

.ais-RefinementList-label:hover {
    color: #3b82f6;
}

.ais-RefinementList-checkbox {
    margin-right: 10px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.ais-RefinementList-labelText {
    flex: 1;
    font-size: 0.938rem;
    color: #404040;
}

.ais-RefinementList-count {
    background: #f5f5f5;
    color: #737373;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.813rem;
    font-weight: 500;
}

.ais-RefinementList-searchBox {
    margin-bottom: 12px;
}

.ais-RefinementList-searchBox input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d4d4d4;
    border-radius: 6px;
    font-size: 0.875rem;
}

.ais-RefinementList-searchBox input:focus {
    outline: none;
    border-color: #3b82f6;
}

.ais-RefinementList-showMore {
    background: none;
    border: none;
    color: #3b82f6;
    cursor: pointer;
    font-size: 0.875rem;
    margin-top: 8px;
    padding: 4px 0;
    font-weight: 500;
}

.ais-RefinementList-showMore:hover {
    text-decoration: underline;
}

.ais-ClearRefinements {
    margin-top: 24px;
}

.ais-ClearRefinements-button {
    width: 100%;
    padding: 10px 16px;
    background: white;
    color: #737373;
    border: 1px solid #d4d4d4;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.ais-ClearRefinements-button:hover {
    background: #f5f5f5;
    border-color: #a3a3a3;
}

.ais-ClearRefinements-button--disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ais-ClearRefinements-button--disabled:hover {
    background: white;
    border-color: #d4d4d4;
}

/* Results */
.results {
    min-height: 400px;
}

#stats {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e5e5;
}

.ais-Stats {
    color: #737373;
    font-size: 0.938rem;
}

/* Hits */
.ais-Hits-list {
    list-style: none;
    display: grid;
    gap: 16px;
}

.hit {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 24px;
    transition: all 0.2s;
}

.hit:hover {
    border-color: #d4d4d4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.hit-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 16px;
}

.hit-name {
    font-size: 1.25rem;
    color: #1a1a1a;
    font-weight: 600;
    flex: 1;
    line-height: 1.4;
}

.hit-date {
    background: #f5f5f5;
    color: #404040;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    font-weight: 500;
}

.hit-location {
    color: #737373;
    margin-bottom: 12px;
    font-size: 0.938rem;
}

.hit-topics {
    margin-bottom: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.topic-badge {
    background: #f0f9ff;
    color: #0369a1;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.813rem;
    font-weight: 500;
    border: 1px solid #e0f2fe;
}

.hit-description {
    color: #525252;
    line-height: 1.6;
    margin-bottom: 14px;
    font-size: 0.938rem;
}

.hit-link {
    display: inline-flex;
    align-items: center;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.938rem;
    transition: color 0.2s;
}

.hit-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Highlighting */
.ais-Highlight-highlighted {
    background: #fef3c7;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 3px;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 80px 20px;
    color: #737373;
}

.no-results p {
    font-size: 1.125rem;
    margin-bottom: 8px;
}

/* Pagination */
#pagination {
    margin-top: 48px;
    display: flex;
    justify-content: center;
}

.ais-Pagination-list {
    display: flex;
    gap: 6px;
    list-style: none;
}

.ais-Pagination-link {
    display: block;
    padding: 8px 14px;
    background: white;
    border: 1px solid #d4d4d4;
    border-radius: 6px;
    color: #404040;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.938rem;
}

.ais-Pagination-link:hover {
    background: #f5f5f5;
    border-color: #a3a3a3;
}

.ais-Pagination-item--selected .ais-Pagination-link {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.ais-Pagination-item--disabled .ais-Pagination-link {
    opacity: 0.4;
    cursor: not-allowed;
}

.ais-Pagination-item--disabled .ais-Pagination-link:hover {
    background: white;
    border-color: #d4d4d4;
}
