/**
 * QMD Semantic Search - Obsidian Plugin Styles
 *
 * These styles are loaded by Obsidian automatically when the plugin is enabled.
 */

/* Utility */
.qmd-hidden {
	display: none !important;
}

/* Search Modal - Input */
.qmd-input-with-pill {
	padding-right: 120px !important;
}

/* Search Modal - Results */
.qmd-search-result {
	padding: 8px 12px;
}

.qmd-search-result-title {
	display: flex;
	align-items: baseline;
	font-weight: 500;
	margin-bottom: 2px;
}

.qmd-search-result-name {
	color: var(--text-normal);
}

.qmd-search-result-path {
	font-size: 0.85em;
	color: var(--text-muted);
	margin-bottom: 4px;
}

.qmd-search-result-snippet {
	font-size: 0.9em;
	color: var(--text-muted);
	margin-bottom: 4px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.qmd-search-result-score {
	font-weight: normal;
	font-style: italic;
	font-size: 0.75em;
	color: var(--text-faint);
}

.qmd-search-result-meta {
	display: flex;
	gap: 12px;
	font-size: 0.8em;
	color: var(--text-faint);
}

.qmd-search-result-mode {
	padding: 1px 6px;
	border-radius: 3px;
	background: var(--background-modifier-hover);
}

.qmd-mode-semantic {
	color: var(--text-accent);
}

.qmd-mode-keyword {
	color: var(--text-muted);
}

/* Search mode pill inside input field */
.qmd-search-mode-indicator {
	position: absolute;
	right: 44px;
	top: 50%;
	transform: translateY(-50%);
	padding: 2px 8px;
	font-size: 0.75em;
	color: rgba(255, 255, 255, 0.85);
	background: rgba(var(--interactive-accent-rgb, 124, 77, 255), 0.5);
	border-radius: 10px;
	pointer-events: none;
	white-space: nowrap;
}

/* Search Modal - Error display */
.qmd-search-error {
	padding: 12px;
	background: var(--background-modifier-error);
	border-radius: 4px;
	cursor: default;
}

.qmd-search-error-title {
	color: var(--text-error);
	font-weight: 500;
}

.qmd-search-error-hint {
	font-size: 0.9em;
	color: var(--text-muted);
	margin-top: 4px;
}

/* Search Modal - Progress bar */
.qmd-progress-container {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 12px;
	background: var(--background-secondary);
	border-bottom: 1px solid var(--background-modifier-border);
}

.qmd-progress-bar {
	flex: 1;
	height: 3px;
	background: var(--background-modifier-border);
	border-radius: 2px;
	overflow: hidden;
}

.qmd-progress-bar-fill {
	height: 100%;
	width: 30%;
	background: var(--text-accent);
	border-radius: 2px;
	animation: qmd-progress-slide 1s ease-in-out infinite;
}

@keyframes qmd-progress-slide {
	0% { transform: translateX(-100%); }
	50% { transform: translateX(333%); }
	100% { transform: translateX(-100%); }
}

.qmd-progress-text {
	font-size: 0.8em;
	color: var(--text-muted);
	white-space: nowrap;
}

/* Search Pane */
.qmd-search-pane {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 8px;
}

.qmd-search-input-container {
	margin-bottom: 8px;
}

.qmd-search-input-wrapper {
	display: flex;
	align-items: center;
	background: var(--background-modifier-form-field);
	border: 1px solid var(--background-modifier-border);
	border-radius: 4px;
	padding: 4px 8px;
}

.qmd-search-icon {
	color: var(--text-muted);
	margin-right: 8px;
}

.qmd-search-input {
	flex: 1;
	border: none;
	background: transparent;
	outline: none;
	color: var(--text-normal);
}

.qmd-search-status {
	padding: 4px 8px;
	font-size: 0.85em;
	margin-bottom: 8px;
	border-radius: 4px;
}

.qmd-status-loading {
	color: var(--text-muted);
	background: var(--background-modifier-hover);
}

.qmd-status-success {
	color: var(--text-success);
}

.qmd-status-error {
	color: var(--text-error);
	background: var(--background-modifier-error);
}

.qmd-search-results {
	flex: 1;
	overflow-y: auto;
}

.qmd-search-result-item {
	padding: 8px;
	margin-bottom: 4px;
	border-radius: 4px;
	cursor: pointer;
	background: var(--background-secondary);
}

.qmd-search-result-item:hover {
	background: var(--background-modifier-hover);
}

.qmd-result-title {
	font-weight: 500;
	color: var(--text-normal);
	margin-bottom: 2px;
}

.qmd-result-path {
	font-size: 0.85em;
	color: var(--text-muted);
	margin-bottom: 4px;
}

.qmd-result-snippet {
	font-size: 0.9em;
	color: var(--text-muted);
	margin-bottom: 4px;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.qmd-result-score {
	font-size: 0.8em;
	color: var(--text-faint);
}

.qmd-search-no-results {
	padding: 16px;
	text-align: center;
	color: var(--text-muted);
}

/* Search Pane - Loading */
.qmd-pane-loading-row {
	display: flex;
	align-items: center;
	gap: 8px;
}

.qmd-pane-spinner {
	width: 12px;
	height: 12px;
	border: 2px solid var(--background-modifier-border);
	border-top-color: var(--text-accent);
	border-radius: 50%;
	animation: qmd-pane-spin 0.8s linear infinite;
}

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

/* Settings Tab */
.qmd-diagnostics {
	padding: 12px;
	background: var(--background-secondary);
	border-radius: 4px;
	margin-bottom: 16px;
}

.qmd-diagnostic-row {
	display: flex;
	justify-content: space-between;
	padding: 4px 0;
}

.qmd-diagnostic-label {
	font-weight: 500;
	color: var(--text-muted);
}

.qmd-diagnostic-value {
	color: var(--text-normal);
	font-family: var(--font-monospace);
	font-size: 0.9em;
}

/* Loading spinner animation */
@keyframes qmd-spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

.qmd-loading-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid var(--background-modifier-border);
	border-top-color: var(--text-accent);
	border-radius: 50%;
	animation: qmd-spin 0.8s linear infinite;
}
