/* SEO Plugin Styles */

/* Center heading for "Files that pass" section */
.seo-heading-center {
	display: flex;
	justify-content: center;
	flex: 1;
}

/* Loading state styles */
.seo-loading-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 2rem;
	text-align: center;
}

.seo-loading-spinner {
	font-size: 2rem;
	margin-bottom: 1rem;
	animation: spin 1s linear infinite;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
}

.seo-loading-title {
	margin: 0 0 0.5rem 0;
	color: var(--text-normal);
}

.seo-loading-message {
	margin: 0;
	color: var(--text-muted);
	font-size: 0.9rem;
}

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

/* Header with flexbox layout */
.seo-issues-header-container {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

/* Collapsible score section */
.seo-score-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1rem;
	padding: 0.5rem 0;
	border-bottom: 1px solid var(--background-modifier-border);
}

.seo-score-text {
	font-size: 0.9rem;
	color: var(--text-normal);
	font-weight: normal;
}

.seo-toggle-icon {
	color: var(--text-muted);
	padding: 0.25rem;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Stats container and audit button */
.seo-stats-container {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

/* Sort button styling */
.seo-sort-btn {
	border: none !important;
	background: none !important;
	box-shadow: none !important;
	cursor: default;
	padding: 0 !important;
	color: var(--text-muted);
	transition: color 0.2s ease;
}

.seo-sort-btn:hover {
	background: none !important;
	color: var(--text-normal);
}

/* Right-align checkmark icons in menu */
.menu .menu-item {
	display: flex !important;
	justify-content: space-between !important;
	align-items: center !important;
}

.menu .menu-item .menu-item-icon {
	margin-left: auto !important;
	order: 2 !important;
}

/* Override any clickable-icon styling */
.seo-sort-btn.clickable-icon {
	border: none !important;
	background: none !important;
	box-shadow: none !important;
	padding: 0 !important;
}

.seo-audit-btn {
	background: none;
	border: none;
	padding: 0.25rem;
	border-radius: 0.25rem;
	color: var(--text-muted);
	cursor: default;
	transition: all 0.2s ease;
}

.seo-audit-btn:hover {
	background: var(--background-modifier-hover);
	color: var(--text-normal);
}

.seo-panel {
	padding: 1rem;
	max-width: 100%;
	box-sizing: border-box;
	height: 100%;
	overflow-y: auto;
	scrollbar-gutter: stable;
	position: relative;
}

.seo-panel-header {
	margin-bottom: 1rem;
}

.seo-panel-header h2 {
	margin: 0;
	color: var(--text-normal);
	font-size: 0.9rem;
	font-weight: 600;
}

.seo-filename {
	font-size: 0.8rem;
	color: var(--text-muted);
	margin-top: 0.25rem;
}

.seo-panel p {
	font-size: 0.85rem;
}

.seo-section {
	margin-bottom: 2rem;
	padding: 1rem;
	background: var(--background-secondary);
	border-radius: 8px;
	border: 1px solid var(--background-modifier-border);
}

.seo-section h3 {
	margin: 0 0 1rem 0;
	color: var(--text-normal);
	font-size: 0.9rem;
	font-weight: 600;
}

.seo-no-results {
	color: var(--text-muted);
	font-style: italic;
}

.seo-no-results p {
	margin: 0.5rem 0;
}

.seo-score {
	font-weight: bold;
	margin-bottom: 1rem;
	padding: 0.5rem;
	background: var(--background-secondary);
	border-radius: 4px;
}

.seo-issues {
	color: var(--text-error);
}

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

.seo-checks {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.seo-check {
	border: 1px solid var(--background-modifier-border);
	border-radius: 4px;
	padding: 1rem;
	transition: all 0.2s ease;
}

/* Color-coded check blocks */
.seo-check.seo-passed {
	background: var(--color-green-bg, rgba(34, 197, 94, 0.1));
	border-left: 4px solid var(--color-green, #22c55e);
	border-color: var(--color-green, #22c55e);
}

.seo-check.seo-warning {
	background: var(--color-yellow-bg, rgba(234, 179, 8, 0.1));
	border-left: 4px solid var(--color-yellow, #eab308);
	border-color: var(--color-yellow, #eab308);
}

.seo-check.seo-notice {
	background: var(--color-blue-bg, rgba(59, 130, 246, 0.1));
	border-left: 4px solid var(--color-blue, #3b82f6);
	border-color: var(--color-blue, #3b82f6);
}

.seo-check.seo-error {
	background: var(--color-red-bg, rgba(239, 68, 68, 0.1));
	border-left: 4px solid var(--color-red, #ef4444);
	border-color: var(--color-red, #ef4444);
}

/* Status icon colors to match the blocks */
.seo-check.seo-passed .seo-status svg {
	color: var(--color-green, #22c55e);
}

.seo-check.seo-warning .seo-status svg {
	color: var(--color-yellow, #eab308);
}

.seo-check.seo-notice .seo-status svg {
	color: var(--color-blue, #3b82f6);
}

.seo-check.seo-error .seo-status svg {
	color: var(--color-red, #ef4444);
}

.seo-check-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.5rem;
	font-weight: 600;
	font-size: 0.85rem;
}

.seo-status {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
}

.seo-status svg {
	width: 16px;
	height: 16px;
}

.seo-results {
	list-style: none;
	padding: 0;
	margin: 0;
}

.seo-result {
	padding: 0.5rem 0;
}

.seo-result:last-child {
	border-bottom: none;
}

.seo-result.seo-error {
	color: var(--text-error);
}

.seo-result.seo-warning {
	color: var(--text-warning);
}

.seo-result.seo-info {
	color: var(--text-muted);
}

.seo-suggestion {
	font-size: 0.9em;
	color: var(--text-muted);
	margin-top: 0.25rem;
	font-style: italic;
}

.seo-top-btn {
	margin: 1rem 0;
	width: 100%;
	padding: 0.75rem 1rem;
	border-radius: 6px;
	font-weight: 500;
	transition: all 0.2s ease;
	border: 1px solid var(--interactive-accent);
}

.seo-top-btn:hover:not(:disabled) {
	background: var(--interactive-accent-hover);
}

.seo-top-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.seo-summary {
	background: var(--background-secondary);
	padding: 1rem;
	border-radius: 4px;
	margin-bottom: 1rem;
}

/* Vault audit stats styling */
.seo-vault-summary {
	background: var(--background-secondary);
	padding: 1.5rem;
	border-radius: 8px;
	margin-bottom: 1.5rem;
	border: 1px solid var(--background-modifier-border);
}

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

.seo-stat-item {
	text-align: center;
	padding: 0.5rem;
}

.seo-stat-number {
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--text-normal);
	margin-bottom: 0.25rem;
	line-height: 1.2;
}

.seo-stat-label {
	font-size: 0.8rem;
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-weight: 500;
}

.seo-file-count {
	text-align: center;
	margin-top: 1rem;
	color: var(--text-muted);
	font-size: 0.9rem;
}

/* Color coding for stats numbers */
.seo-score-excellent {
	color: var(--color-green, #22c55e) !important;
}

.seo-score-good {
	color: var(--color-lime, #84cc16) !important;
}

.seo-score-fair {
	color: var(--color-yellow, #eab308) !important;
}

.seo-score-poor {
	color: var(--color-red, #ef4444) !important;
}

.seo-issues-count {
	color: var(--color-red, #ef4444) !important;
}

.seo-warnings-count {
	color: var(--color-yellow, #eab308) !important;
}

.seo-notices-count {
	color: var(--color-blue, #3b82f6) !important;
}

/* Current note color coding */
.seo-issues-count-text {
	color: var(--color-red, #ef4444) !important;
}

.seo-warnings-count-text {
	color: var(--color-yellow, #eab308) !important;
}

.seo-notices-count-text {
	color: var(--color-blue, #3b82f6) !important;
}

.seo-issues-list {
	margin-top: 1rem;
}

.seo-issues-header-container {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1rem;
}

.seo-sort-buttons {
	display: flex;
	gap: 0.5rem;
}

.seo-file-issue {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0.5rem;
	border-bottom: 1px solid var(--background-modifier-border);
}

.seo-file-stats {
	color: var(--text-muted);
	font-size: 0.8em;
}

.seo-file-link {
	color: var(--text-accent);
	text-decoration: none;
	cursor: pointer;
	font-size: 0.8em;
}

.seo-file-link:hover {
	text-decoration: underline;
}

.seo-issues-header {
	font-size: 0.8rem;
	margin: 0.5rem 0;
	color: var(--text-normal);
}

.seo-status-bar {
	cursor: pointer;
	transition: color 0.2s ease;
}

.seo-status-bar:hover {
	color: var(--text-accent);
}

/* Collapsible check sections */
.seo-collapsible-header {
	cursor: pointer;
	user-select: none;
}

.seo-collapse-icon {
	display: inline-flex;
	align-items: center;
	margin-right: 0.5rem;
	transition: transform 0.2s ease;
}

.seo-collapse-icon svg {
	transition: transform 0.2s ease;
}

/* Refresh button styling */
.seo-refresh-btn {
	margin: 0.5rem 0 0.5rem 0;
	width: 100%;
	padding: 0.75rem 1rem;
	border-radius: 6px;
	font-weight: 500;
	transition: all 0.2s ease;
	border: 1px solid var(--interactive-accent);
}

.seo-refresh-btn:hover:not(:disabled) {
	background: var(--interactive-accent-hover);
}

.seo-refresh-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Files list container for collapsible functionality */
.seo-files-list-container {
	transition: all 0.2s ease;
	overflow: visible;
}

/* Collapsible header for files with issues */
.seo-issues-header-container {
	padding: 0.5rem;
	border-radius: 4px;
	cursor: default;
}

/* Only the collapse icon should be clickable */
.seo-collapse-icon.seo-collapsible-header {
	cursor: default;
	user-select: none;
}

/* Prevent layout shifts */
.seo-panel * {
	box-sizing: border-box;
}

/* Ensure consistent spacing - removed problematic overflow hidden */

/* Text overflow handling for long strings */
.seo-result {
	word-wrap: break-word;
	word-break: break-word;
	overflow-wrap: break-word;
	hyphens: auto;
}

.seo-suggestion {
	word-wrap: break-word;
	word-break: break-word;
	overflow-wrap: break-word;
	hyphens: auto;
}

/* Specific handling for long URLs and links */
.seo-result:has([href*="http"]) {
	word-break: break-all;
}

/* Handle long text in check results */
.seo-check .seo-results {
	max-width: 100%;
	overflow: hidden;
}

.seo-check .seo-result {
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Ensure containers don't overflow */
.seo-panel {
	overflow-x: hidden;
}

.seo-section {
	overflow-x: hidden;
}

.seo-check {
	overflow-x: hidden;
}

/* Clickable navigation styles */
.seo-clickable {
	cursor: pointer !important;
	text-decoration: underline !important;
	color: var(--text-accent) !important;
}

.seo-result-message {
	display: block;
	margin-bottom: 0.25rem;
}

/* Navigation tooltip */
.seo-clickable[title] {
	position: relative;
}

/* Highlight animation for navigation */
@keyframes seo-highlight {
	0% { background-color: var(--color-yellow-bg, rgba(234, 179, 8, 0.3)); }
	100% { background-color: transparent; }
}

.seo-navigation-highlight {
	animation: seo-highlight 2s ease-out;
}

/* Progress indicator styles */
.seo-progress-container {
	display: none;
	margin: 10px 0;
	padding: 10px;
	border: 1px solid var(--background-modifier-border);
	border-radius: 4px;
	background-color: var(--background-secondary);
}

.seo-progress-text {
	margin-bottom: 8px;
	font-size: 14px;
	color: var(--text-normal);
}

.seo-progress-bar-container {
	width: 100%;
	height: 8px;
	background-color: var(--background-modifier-border);
	border-radius: 4px;
	overflow: hidden;
}

.seo-progress-bar {
	height: 100%;
	background-color: var(--interactive-accent);
	width: var(--seo-progress-width, 0%);
	transition: width 0.3s ease;
}

.seo-progress-cancel {
	margin-top: 8px;
	padding: 4px 8px;
	font-size: 12px;
	background-color: var(--background-modifier-error);
	color: var(--text-on-accent);
	border: none;
	border-radius: 3px;
	cursor: pointer;
}

/* Dynamic styles for results display */
.seo-results-list-expanded {
	display: block;
}

.seo-results-list-collapsed {
	display: none;
}

.seo-clickable-message {
	cursor: pointer;
	text-decoration: underline;
}

.seo-collapse-icon-rotated {
	transform: rotate(-90deg);
}

.seo-collapse-icon-normal {
	transform: rotate(0deg);
}

/* Button states */
.seo-btn-disabled {
	opacity: 0.7;
}

.seo-btn-enabled {
	opacity: 1;
}

/* File links in suggestions */
.seo-suggestion a.seo-file-link {
	color: var(--text-accent);
	text-decoration: underline;
	cursor: pointer;
}

.seo-suggestion a.seo-file-link:hover {
	color: var(--text-accent-hover);
	text-decoration: underline;
}

/* Styles for dynamic elements that were previously set via JavaScript */
.seo-header-hidden {
	display: none !important;
}

.seo-header-visible {
	display: block !important;
}

.seo-no-results-message {
	margin-top: 10px;
	padding: 8px;
	background-color: var(--background-secondary);
	border-radius: 4px;
	font-size: 12px;
	color: var(--text-muted);
}

.seo-progress-container-visible {
	display: block !important;
}

.seo-progress-container-hidden {
	display: none !important;
}

.seo-progress-bar-dynamic {
	transition: width 0.3s ease;
}

.seo-warning-message {
	color: #ff6b6b;
	font-weight: bold;
	margin-top: 4px;
}

/* Group settings compatibility styling for older Obsidian builds (< 1.11.0) */
/* Scoped to only this plugin's settings container to avoid affecting other plugins */
.seo-settings-compat .setting-group-heading h3 {
	margin: 0 0 0.75rem;
	padding-bottom: 0.5rem;
	padding-top: 0.5rem;
	font-size: 1rem;
	font-weight: 600;
	border-bottom: none !important;
}