/* Override theme's search input styles */
body[theme="dark"] .search input,
body[theme="dark"] .pagefind-ui__search-input,
body[theme="dark"] .pagefind-ui__search-input:focus,
body[theme="dark"] .pagefind-ui__search-input:hover {
    background-color: #2a2a2a !important;
    color: #ffffff !important;
    border-color: #333333 !important;
    padding: 0.75rem 1rem 0.75rem 3.5rem !important;
    font-size: 1rem !important;
    width: 100% !important;
    margin: 0 auto !important;
    display: block !important;
    box-shadow: none !important;
}

/* Dark mode styles */
body[theme="dark"] .pagefind-ui {
    --pagefind-ui-primary: #ffffff;
    --pagefind-ui-text: #ffffff;
    --pagefind-ui-background: #1a1a1a;
    --pagefind-ui-border: #333333;
}

body[theme="dark"] .pagefind-ui__search-input,
body[theme="dark"] .pagefind-ui__search-input::placeholder {
    background-color: #2a2a2a !important;
    color: #ffffff !important;
    border-color: #3a3a3a !important;
}

body[theme="dark"] .pagefind-ui__results-area,
body[theme="dark"] .pagefind-ui__result,
body[theme="dark"] .pagefind-ui__result-inner,
body[theme="dark"] .pagefind-ui__result-nested {
    background-color: transparent !important;
    color: #a9a9b3 !important;
}

body[theme="dark"] .pagefind-ui__result-link {
    color: #a9a9b3 !important;
}

body[theme="dark"] .pagefind-ui__result-link:hover {
    color: #ffffff !important;
}

body[theme="dark"] .pagefind-ui__result-excerpt {
    color: #a9a9b3 !important;
}

body[theme="dark"] .pagefind-ui__message {
    color: #a9a9b3 !important;
}

body[theme="dark"] .pagefind-ui__button {
    background-color: transparent !important;
    color: #a9a9b3 !important;
    border: 1px solid #3a3a3a !important;
}

body[theme="dark"] .pagefind-ui__button:hover {
    background-color: #3a3a3a !important;
    color: #ffffff !important;
}

body[theme="dark"] .pagefind-ui__search-clear {
    color: #ffffff;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

body[theme="dark"] .pagefind-ui__search-clear:hover {
    background-color: #3a3a3a;
    border-radius: var(--pagefind-ui-border-radius);
}

/* Light mode styles */
body[theme="light"] .pagefind-ui {
    --pagefind-ui-primary: #000000;
    --pagefind-ui-text: #333333;
    --pagefind-ui-background: #ffffff;
    --pagefind-ui-border: #e5e5e5;
}

body[theme="light"] .search input,
body[theme="light"] .pagefind-ui__search-input,
body[theme="light"] .pagefind-ui__search-input:focus,
body[theme="light"] .pagefind-ui__search-input:hover {
    background-color: #ffffff !important;
    color: #333333 !important;
    border-color: #e5e5e5 !important;
    padding: 0.75rem 1rem 0.75rem 1.5rem !important;
    font-size: 1rem !important;
    width: 100% !important;
    margin: 0 auto !important;
    display: block !important;
    box-shadow: none !important;
}

body[theme="light"] .pagefind-ui__search-input,
body[theme="light"] .pagefind-ui__search-input::placeholder {
    background-color: #ffffff !important;
    color: #333333 !important;
    border-color: #e5e7eb !important;
}

body[theme="light"] .pagefind-ui__results-area,
body[theme="light"] .pagefind-ui__result,
body[theme="light"] .pagefind-ui__result-inner,
body[theme="light"] .pagefind-ui__result-nested {
    background-color: transparent !important;
    color: #333333 !important;
}

body[theme="light"] .pagefind-ui__result-link {
    color: #333333 !important;
}

body[theme="light"] .pagefind-ui__result-link:hover {
    color: #4b5563 !important;
}

body[theme="light"] .pagefind-ui__result-excerpt {
    color: #333333 !important;
}

body[theme="light"] .pagefind-ui__message {
    color: #333333 !important;
}

body[theme="light"] .pagefind-ui__button {
    background-color: transparent !important;
    color: #333333 !important;
    border: 1px solid #e5e7eb !important;
}

body[theme="light"] .pagefind-ui__button:hover {
    background-color: #f3f4f6 !important;
}

body[theme="light"] .pagefind-ui__search-clear {
    color: #666666;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

body[theme="light"] .pagefind-ui__search-clear:hover {
    background-color: #f5f5f5;
    border-radius: var(--pagefind-ui-border-radius);
}

/* Pagefind UI Customization */
.pagefind-ui {
    --pagefind-ui-scale: 1;
    --pagefind-ui-primary: #4b5563;
    --pagefind-ui-text: #1f2937;
    --pagefind-ui-background: #ffffff;
    --pagefind-ui-border: #e5e7eb;
    --pagefind-ui-border-width: 1px;
    --pagefind-ui-border-radius: 8px;
    --pagefind-ui-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

/* Dark mode support */
[theme="dark"] .pagefind-ui {
    --pagefind-ui-primary: #9ca3af;
    --pagefind-ui-text: #e5e7eb;
    --pagefind-ui-background: #1f2937;
    --pagefind-ui-border: #374151;
}

/* Search input styling */
.pagefind-ui__search-input {
    padding: 0.75rem 1rem !important;
    border-radius: var(--pagefind-ui-border-radius);
    border: var(--pagefind-ui-border-width) solid var(--pagefind-ui-border);
    background: var(--pagefind-ui-background);
    color: var(--pagefind-ui-text);
    font-size: 1rem;
    width: 100%;
    margin-bottom: 1rem;
}

/* Results styling */
.pagefind-ui__results-area {
    margin-top: 1rem;
}

.pagefind-ui__result {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-radius: var(--pagefind-ui-border-radius);
    background: var(--pagefind-ui-background);
    border: none;
}

.pagefind-ui__result-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.pagefind-ui__result-link {
    color: var(--pagefind-ui-primary);
    text-decoration: none;
}

.pagefind-ui__result-link:hover {
    text-decoration: underline;
}

.pagefind-ui__result-excerpt {
    color: var(--pagefind-ui-text);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

/* Highlight styling */
.pagefind-ui__result-excerpt mark {
    background-color: rgba(79, 70, 229, 0.2);
    color: var(--pagefind-ui-text);
    padding: 0.1em 0.2em;
    border-radius: 2px;
}

/* Nested results styling */
.pagefind-ui__result-nested {
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 2px solid var(--pagefind-ui-border);
}

/* Button styling */
.pagefind-ui__button {
    background: var(--pagefind-ui-primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--pagefind-ui-border-radius);
    cursor: pointer;
    font-size: 0.875rem;
    margin-top: 1rem;
}

.pagefind-ui__button:hover {
    opacity: 0.9;
}

/* Clear button styling */
.pagefind-ui__search-clear {
    background: var(--pagefind-ui-background);
    color: var(--pagefind-ui-text);
    border: var(--pagefind-ui-border-width) solid var(--pagefind-ui-border);
    padding: 0.25rem 0.5rem;
    border-radius: var(--pagefind-ui-border-radius);
    cursor: pointer;
    font-size: 0.875rem;
}

.pagefind-ui__search-clear:hover {
    background: var(--pagefind-ui-border);
}

/* Ensure consistent drawer behavior */
.pagefind-ui__drawer {
    display: none;
}

.pagefind-ui__drawer.pagefind-ui__hidden {
    display: none;
}

/* Ensure consistent form layout */
.pagefind-ui__form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Ensure consistent message styling */
.pagefind-ui__message {
    color: var(--pagefind-ui-text);
    font-size: 0.875rem;
    margin-bottom: 1rem;
} 