/**
 * Public-facing styles for Kevalshah plugin
 */

/* Add Montserrat font */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap');

/* Table of Contents Styles */
.kevalshah-toc-wrapper {
	font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	width: 100%;
	max-width: 100%;
	margin: 20px 0;
	text-align: left;
}

/* TOC Header/Toggle Button */
.kevalshah-toc-header {
	background-color: #3b64e2;
	color: #ffffff;
	padding: 15px 20px;
	border-radius: 8px 8px 0 0;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 600;
	font-size: 24px;
	font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	user-select: none;
	transition: background-color 0.2s ease;
	line-height: 1.5;
	text-align: left;
	justify-content: flex-start;
}

.kevalshah-toc-header:hover {
	background-color: #2d4fb8;
}

.kevalshah-toc-header:focus {
	outline: 2px solid #3b64e2;
	outline-offset: 2px;
}

/* Toggle Icon - CSS Chevron Down (No Font Awesome) */
.kevalshah-toc-toggle-icon {
	display: inline-block;
	width: 12px;
	height: 12px;
	position: relative;
	margin-right: 10px;
	vertical-align: middle;
	flex-shrink: 0;
	transition: transform 0.3s ease;
}

/* Chevron Down Icon using CSS borders */
.kevalshah-toc-toggle-icon::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -30%) rotate(45deg);
	width: 8px;
	height: 8px;
	border-right: 2px solid #ffffff;
	border-bottom: 2px solid #ffffff;
	box-sizing: border-box;
}

/* Chevron rotates when expanded */
.kevalshah-toc-header[aria-expanded="true"] .kevalshah-toc-toggle-icon {
	transform: rotate(180deg);
}

.kevalshah-toc-header[aria-expanded="false"] .kevalshah-toc-toggle-icon {
	transform: rotate(0deg);
}

.kevalshah-toc-title {
	flex: 1;
	text-align: left;
}

/* TOC Content Area - Start Closed by Default */
.kevalshah-toc-content {
	background-color: #f0f5fa;
	border-left: none;
	border-right: 1px solid #e0e0e0;
	border-bottom: 1px solid #e0e0e0;
	border-top: none;
	border-radius: 0 0 8px 8px;
	overflow: hidden;
	max-height: 0;
	opacity: 0;
	transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
	            opacity 0.4s ease;
	padding: 0;
	position: relative;
}

/* Closed state - hide borders */
.kevalshah-toc-wrapper.closed .kevalshah-toc-content {
	border: none;
}

/* Open State */
.kevalshah-toc-wrapper:not(.closed) .kevalshah-toc-content {
	max-height: 2000px;
	opacity: 1;
	border-left: none;
	border-right: 1px solid #e0e0e0;
	border-bottom: 1px solid #e0e0e0;
	border-top: none;
}

/* Scroll Container with Argyle Pattern Background */
.kevalshah-toc-scroll-container {
	max-height: 800px;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 20px;
	padding-left: 80px;
	position: relative;
	text-align: left;
	background-color: #ffffff;
}

/* Argyle Pattern Background on Left Side with Dark Blue Background */
.kevalshah-toc-scroll-container::before {
	content: '';
	position: absolute;
	left: 0;
	top: 25px;
	bottom: 25px;
	width: 60px;
	height: auto;
	background-color: #4f75e7;
	background-image: url('../partials/image.jpg');
	background-repeat: repeat-y;
	background-position: left top;
	background-size: 60px auto;
	background-blend-mode: multiply;
	filter: brightness(1.1);
	opacity: 0.85;
	border-radius: 6px;
	z-index: 0;
}

.kevalshah-toc-list {
	position: relative;
	z-index: 1;
}

.kevalshah-toc-scroll-container::-webkit-scrollbar {
	width: 12px;
}

.kevalshah-toc-scroll-container::-webkit-scrollbar-track {
	background-image: url('../partials/image.jpg');
	background-size: cover;
	background-repeat: repeat;
	border-radius: 6px;
}

.kevalshah-toc-scroll-container::-webkit-scrollbar-thumb {
	background-color: #4f75e7;
	border-radius: 6px;
	border: 2px solid #ffffff;
}

.kevalshah-toc-scroll-container::-webkit-scrollbar-thumb:hover {
	background-color: #2d4fb8;
}

/* TOC List */
.kevalshah-toc-list {
	list-style: none;
	margin: 0;
	padding: 0;
	text-align: left;
}

.kevalshah-toc-item {
	margin: 0;
	padding: 0;
	line-height: 1.6;
	text-align: left;
}

/* Level 1 Styles */
.kevalshah-toc-item.level-1 {
	margin-bottom: 12px;
	padding: 0;
	text-align: left;
}

.kevalshah-toc-item.level-1 > a {
	display: inline;
	font-weight: 500;
	color: #000000;
	text-decoration: none;
	padding: 0;
	transition: color 0.2s ease;
	line-height: 1.6;
	text-align: left;
}

.kevalshah-toc-item.level-1 > a:hover {
	color: #4f75e7;
}

/* Hover on li item changes text color */
.kevalshah-toc-item.level-1:hover > a {
	color: #4f75e7;
}

/* Hover effect on Level 1 icon color */
.kevalshah-toc-item.level-1:hover .kevalshah-toc-icon {
	border-left-color: #4f75e7;
}

/* Level 1 Icon - CSS Play Icon (Triangle) */
.kevalshah-toc-icon {
	display: inline-block;
	width: 0;
	height: 0;
	border-left: 6px solid #3b64e2;
	border-top: 4px solid transparent;
	border-bottom: 4px solid transparent;
	margin-right: 8px;
	vertical-align: middle;
	position: relative;
	flex-shrink: 0;
	transition: border-left-color 0.2s ease;
}

/* Level 2-6 Base Styles */
.kevalshah-toc-item.level-2,
.kevalshah-toc-item.level-3,
.kevalshah-toc-item.level-4,
.kevalshah-toc-item.level-5,
.kevalshah-toc-item.level-6 {
	margin-bottom: 6px;
	padding: 0;
	text-align: left;
}

.kevalshah-toc-item.level-2 > a,
.kevalshah-toc-item.level-3 > a,
.kevalshah-toc-item.level-4 > a,
.kevalshah-toc-item.level-5 > a,
.kevalshah-toc-item.level-6 > a {
	display: inline;
	text-decoration: none;
	padding: 0;
	transition: color 0.2s ease;
	line-height: 1.6;
	text-align: left;
}

/* Level-specific font weights and colors */
.kevalshah-toc-item.level-2 > a {
	font-weight: 400;
	color: #000000 !important;
	font-size: 14px;
}

.kevalshah-toc-item.level-3 > a {
	font-weight: 400;
	color: #333333 !important;
	font-size: 13px;
}

.kevalshah-toc-item.level-4 > a {
	font-weight: 400;
	color: #555555 !important;
	font-size: 12px;
}

.kevalshah-toc-item.level-5 > a {
	font-weight: 400;
	color: #777777 !important;
	font-size: 11px;
}

.kevalshah-toc-item.level-6 > a {
	font-weight: 400;
	color: #999999 !important;
	font-size: 10px;
}

/* Hover effects for all levels */
.kevalshah-toc-item.level-2:hover > a,
.kevalshah-toc-item.level-3:hover > a,
.kevalshah-toc-item.level-4:hover > a,
.kevalshah-toc-item.level-5:hover > a,
.kevalshah-toc-item.level-6:hover > a {
	color: #4f75e7 !important;
}

/* Level-specific margins for indentation */
.kevalshah-toc-item.level-2 {
	margin-left: 0;
}

.kevalshah-toc-item.level-3 {
	margin-left: 15px;
}

.kevalshah-toc-item.level-4 {
	margin-left: 30px;
}

.kevalshah-toc-item.level-5 {
	margin-left: 45px;
}

.kevalshah-toc-item.level-6 {
	margin-left: 60px;
}

/* Sub-list (Level 2+) */
.kevalshah-toc-sublist {
	list-style: none;
	margin: 6px 0 0 0;
	padding: 0;
	text-align: left;
}

/* Secondary icon - Circle with > symbol inside (lighter blue) using CSS */
.kevalshah-toc-icon-sub {
	display: inline-block;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background-color: #90caf9;
	margin-right: 6px;
	vertical-align: middle;
	position: relative;
	text-align: center;
	line-height: 16px;
	box-sizing: border-box;
	transition: background-color 0.2s ease;
}

/* > Symbol Icon using Pure CSS (no text) - Creates two diagonal lines */
.kevalshah-toc-icon-sub::after {
	content: '';
	position: absolute;
	top: 35%;
	left: 50%;
	width: 6px;
	height: 2px;
	background-color: #ffffff;
	transform: translate(-50%, -50%) rotate(45deg);
	border-radius: 1px;
}

.kevalshah-toc-icon-sub::before {
	content: '';
	position: absolute;
	top: 65%;
	left: 50%;
	width: 6px;
	height: 2px;
	background-color: #ffffff;
	transform: translate(-50%, -50%) rotate(-45deg);
	border-radius: 1px;
}

/* Responsive Design */
@media (max-width: 768px) {
	.kevalshah-toc-header {
		padding: 12px 16px;
		font-size: 14px;
	}
	
	.kevalshah-toc-scroll-container {
		padding: 16px;
		max-height: 600px;
	}
	
	.kevalshah-toc-item.level-1 > a {
		font-size: 14px;
	}
	
	.kevalshah-toc-item.level-2 > a {
		font-size: 13px;
	}
	
	.kevalshah-toc-item.level-3 > a {
		font-size: 12px;
	}
	
	.kevalshah-toc-item.level-4 > a {
		font-size: 11px;
	}
	
	.kevalshah-toc-item.level-5 > a {
		font-size: 10px;
	}
	
	.kevalshah-toc-item.level-6 > a {
		font-size: 9px;
	}
	
	/* Reduce indentation on mobile */
	.kevalshah-toc-item.level-3 {
		margin-left: 10px;
	}
	
	.kevalshah-toc-item.level-4 {
		margin-left: 20px;
	}
	
	.kevalshah-toc-item.level-5 {
		margin-left: 30px;
	}
	
	.kevalshah-toc-item.level-6 {
		margin-left: 40px;
	}
}

