/**
 * Article Enhancements Styles
 * 
 * TOC, related articles, feedback system, social sharing.
 * 
 * @package Devora_KB_Hub
 * @since 1.0.0
 */

/* ===========================
   Table of Contents (Injected)
   =========================== */

.kb-article-toc {
	background: var(--dkh-bg-secondary, #f9f9f9);
	border-left: 4px solid var(--dkh-link-color, #0073aa);
	padding: var(--dkh-spacing-lg, 24px);
	margin: var(--dkh-spacing-xl, 30px) 0;
	border-radius: var(--dkh-border-radius, 8px);
	position: relative;
}

.kb-article-toc--sticky {
	position: sticky;
	top: 20px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	z-index: 10;
}

.kb-article-toc--sticky .kb-toc-nav {
	max-height: calc(100vh - 120px);
	overflow-y: auto;
}

.kb-toc-title {
	font-size: var(--dkh-font-size-lg, 18px);
	font-weight: var(--dkh-font-weight-bold, 700);
	margin: 0 0 var(--dkh-spacing-md, 16px) 0;
	color: var(--dkh-heading-color, #1a1a1a);
}

.kb-toc-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.kb-toc-item {
	margin: 8px 0;
}

.kb-toc-item--h2 {
	margin-left: 0;
	font-size: 15px;
}

.kb-toc-item--h3 {
	margin-left: 24px;
	font-size: 14px;
}

.kb-toc-link {
	display: block;
	padding: var(--dkh-spacing-xs, 6px) var(--dkh-spacing-sm, 12px);
	color: var(--dkh-text-color, #646970);
	text-decoration: none;
	border-radius: var(--dkh-border-radius-sm, 4px);
	transition: all var(--dkh-transition-duration, 0.2s) ease;
}

.kb-toc-link:hover {
	background: var(--dkh-bg-primary, white);
	color: var(--dkh-link-color, #0073aa);
	padding-left: var(--dkh-spacing-md, 16px);
}

.kb-toc-link.is-active {
	background: var(--dkh-link-color, #0073aa);
	color: white;
	font-weight: var(--dkh-font-weight-semibold, 600);
}

/* ===========================
   Related Articles
   =========================== */

.kb-related-articles {
	margin: 40px 0;
	padding: 30px 0;
	border-top: 2px solid #f0f0f0;
}

.kb-related-title {
	font-size: 24px;
	font-weight: 700;
	margin: 0 0 24px 0;
	color: #1a1a1a;
}

.kb-related-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 24px;
}

.kb-related-card {
	background: white;
	border: 1px solid #e0e0e0;
	border-radius: 12px;
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	transition: all 0.3s ease;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.kb-related-card:hover {
	border-color: #0073aa;
	box-shadow: 0 4px 16px rgba(0, 115, 170, 0.15);
	transform: translateY(-4px);
}

.kb-related-image {
	position: relative;
	overflow: hidden;
	height: 160px;
}

.kb-related-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.kb-related-card:hover .kb-related-image img {
	transform: scale(1.05);
}

.kb-related-content {
	padding: 20px;
}

.kb-related-article-title {
	font-size: 16px;
	font-weight: 600;
	margin: 0 0 8px 0;
	color: #1a1a1a;
	line-height: 1.4;
}

.kb-related-card:hover .kb-related-article-title {
	color: #0073aa;
}

.kb-related-excerpt {
	font-size: 14px;
	color: #646970;
	margin: 0;
	line-height: 1.5;
}

/* ===========================
   Feedback System
   =========================== */

.kb-article-feedback {
	margin: 40px 0;
	padding: 30px;
	background: #f8f9fa;
	border-radius: 12px;
	text-align: center;
}

.kb-feedback-title {
	font-size: 20px;
	font-weight: 600;
	margin: 0 0 20px 0;
	color: #1a1a1a;
}

.kb-feedback-buttons {
	display: flex;
	gap: 16px;
	justify-content: center;
	flex-wrap: wrap;
}

.kb-feedback-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	background: white;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
}

.kb-feedback-btn:hover {
	border-color: #0073aa;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 115, 170, 0.15);
}

.kb-feedback-btn--yes:hover {
	background: #d4edda;
	border-color: #28a745;
}

.kb-feedback-btn--no:hover {
	background: #f8d7da;
	border-color: #dc3545;
}

.kb-feedback-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.kb-feedback-icon {
	font-size: 20px;
}

.kb-vote-count {
	font-size: 14px;
	color: #999;
	font-weight: normal;
}

.kb-feedback-thanks {
	font-size: 16px;
	color: #28a745;
	font-weight: 600;
	margin: 0;
}

.kb-feedback-message {
	margin-top: 16px;
	padding: 12px 20px;
	border-radius: 6px;
}

.kb-feedback-message--success {
	background: #d4edda;
	color: #28a745;
	border: 1px solid #28a745;
}

.kb-feedback-message--error {
	background: #f8d7da;
	color: #dc3545;
	border: 1px solid #dc3545;
}

/* ===========================
   Social Sharing
   =========================== */

.kb-social-sharing {
	margin: 30px 0;
	padding: 24px;
	background: white;
	border: 1px solid #e0e0e0;
	border-radius: 12px;
}

.kb-social-title {
	font-size: 16px;
	font-weight: 600;
	margin: 0 0 16px 0;
	color: #1a1a1a;
}

.kb-social-buttons {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.kb-social-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	background: white;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
	color: #1a1a1a;
	text-decoration: none;
	cursor: pointer;
	transition: all 0.2s ease;
}

.kb-social-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.kb-social-btn--twitter {
	background: #1da1f2;
	color: white;
	border-color: #1da1f2;
}

.kb-social-btn--twitter:hover {
	background: #1a91da;
}

.kb-social-btn--facebook {
	background: #1877f2;
	color: white;
	border-color: #1877f2;
}

.kb-social-btn--facebook:hover {
	background: #166fe5;
}

.kb-social-btn--linkedin {
	background: #0077b5;
	color: white;
	border-color: #0077b5;
}

.kb-social-btn--linkedin:hover {
	background: #006399;
}

.kb-social-btn--copy {
	background: #f0f0f0;
}

.kb-social-btn--copy:hover {
	background: #e0e0e0;
}

.kb-social-btn--copy.copied {
	background: #d4edda;
	border-color: #28a745;
	color: #28a745;
}

.kb-social-btn--print {
	background: #f0f0f0;
}

.kb-social-btn--print:hover {
	background: #e0e0e0;
}

/* ===========================
   Responsive Design
   =========================== */

@media (max-width: 768px) {
	.kb-related-grid {
		grid-template-columns: 1fr;
	}

	.kb-feedback-buttons {
		flex-direction: column;
	}

	.kb-feedback-btn {
		width: 100%;
	}

	.kb-social-buttons {
		flex-direction: column;
	}

	.kb-social-btn {
		width: 100%;
		justify-content: center;
	}

	.kb-article-toc {
		padding: 16px;
	}

	.kb-toc-item--h3 {
		margin-left: 16px;
	}
}

/* ===========================
   Print Styles
   =========================== */

@media print {
	.kb-article-feedback,
	.kb-social-sharing,
	.kb-article-toc {
		display: none;
	}

	.kb-related-articles {
		page-break-before: always;
	}
}

/* ===========================
   Accessibility
   =========================== */

.kb-feedback-btn:focus,
.kb-social-btn:focus {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

.kb-toc-link:focus {
	outline: 2px solid var(--dkh-link-color, #0073aa);
	outline-offset: -2px;
}

