/**
 * Reference Category Menu Widget Styles
 * 
 * Beautiful sidebar navigation with icons, colors, and hover effects
 * Supports both vertical and horizontal layouts
 * 
 * @package GRPCMedia
 * @since 1.0.0
 */

/* ===== MENU CONTAINER ===== */
.reference-category-menu {
	background: #ffffff;
	border-radius: 0;
	padding: 0;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	border: none;
	margin-bottom: 30px;
}

/* ===== MENU TITLE ===== */
.reference-category-menu-title {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: #333333;
	padding: 18px 20px;
	background: #f5f5f5;
	border-bottom: 1px solid #dddddd;
	letter-spacing: 0;
	text-transform: none;
}

/* ===== CATEGORY LIST ===== */
.reference-category-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* ===== CATEGORY ITEM ===== */
.reference-category-item {
	margin: 0;
	padding: 0;
	border-bottom: 1px solid #ffffff;
}

.reference-category-item:last-child {
	border-bottom: none;
}

/* ===== CATEGORY ITEM LINK - ESK Style ===== */
.reference-category-item a {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 15px 20px;
	color: #333333;
	text-decoration: none;
	background: #eef0f3;
	border-left: 5px solid #eef0f3;
	font-weight: 700;
	font-size: 14px;
	transition: all 0.15s ease;
	line-height: 1.5;
	min-height: 50px;
}

.reference-category-item a:hover {
	background: #ffffff;
	border-left-color: #2F2483;
	color: #333333;
}

/* ===== ACTIVE STATE - ESK Style ===== */
.reference-category-item.active a {
	background: #ffffff;
	border-left-color: #2F2483;
	color: #2F2483;
	font-weight: 700;
}

/* ===== CATEGORY ICON ===== */
.reference-category-item a i {
	font-size: 16px;
	color: #999999;
	flex-shrink: 0;
	min-width: 20px;
	text-align: center;
	margin-top: 2px;
}

.reference-category-item a:hover i {
	color: #2F2483;
}

/* Active state icon - MOR (aktif durumda) */
.reference-category-item.active a i {
	color: #2F2483;
}

/* ===== CATEGORY NAME ===== */
.reference-category-item .category-name {
	flex: 1;
	font-size: 14px;
	font-weight: inherit;
	text-align: left;
	white-space: normal;
	line-height: 1.4;
	word-wrap: break-word;
}

/* ===== CATEGORY COUNT ===== */
.reference-category-item .category-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	background: #d5d9dd;
	color: #666666;
	font-size: 10px;
	font-weight: 600;
	border-radius: 9px;
	flex-shrink: 0;
	margin-top: 2px;
}

.reference-category-item a:hover .category-count,
.reference-category-item.active .category-count {
	background: #2F2483;
	color: #ffffff;
}

/* ===== BACK BUTTON - ESK Style ===== */
.reference-back-button {
	margin-top: 30px;
}

.btn-back-to-references {
	display: block;
	padding: 18px 20px;
	background: #2F2483;
	color: #ffffff !important;
	text-decoration: none;
	font-weight: 700;
	font-size: 15px;
	text-align: center;
	border-radius: 0;
	transition: all 0.2s ease;
	border: none;
	box-shadow: 0 2px 8px rgba(47, 36, 131, 0.25);
}

.btn-back-to-references:hover {
	background: #1e1850;
	box-shadow: 0 4px 12px rgba(47, 36, 131, 0.35);
}

.btn-back-to-references i {
	margin-right: 8px;
	font-size: 14px;
}

/* ===== HORIZONTAL LAYOUT ===== */
.reference-category-menu.layout-horizontal {
	padding: 20px 30px;
}

.reference-category-menu.layout-horizontal .reference-category-menu-title {
	margin-bottom: 15px;
}

.reference-category-menu.layout-horizontal .reference-category-list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.reference-category-menu.layout-horizontal .reference-category-item {
	margin-bottom: 0;
}

.reference-category-menu.layout-horizontal .reference-category-item a {
	padding: 10px 16px;
	white-space: nowrap;
}

/* ===== EMPTY STATE ===== */
.reference-category-menu-empty {
	padding: 40px 20px;
	text-align: center;
	color: #999999;
	font-size: 14px;
	background: #f9f9f9;
	border-radius: 8px;
	border: 2px dashed #dddddd;
}

/* ===== LOADING STATE (AJAX) ===== */
.reference-category-menu.loading {
	position: relative;
	pointer-events: none;
	opacity: 0.6;
}

.reference-category-menu.loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 30px;
	height: 30px;
	margin: -15px 0 0 -15px;
	border: 3px solid #f3f3f3;
	border-top: 3px solid #2F2483;
	border-radius: 50%;
	animation: category-spin 1s linear infinite;
}

@keyframes category-spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

/* ===== RESPONSIVE: MOBILE - Accordion ===== */
@media (max-width: 768px) {
	/* Title becomes clickable toggle button */
	.reference-category-menu-title {
		font-size: 15px;
		padding: 15px 18px;
		cursor: pointer;
		position: relative;
		user-select: none;
		transition: background 0.2s ease;
	}
	
	.reference-category-menu-title:hover {
		background: #e9ecef;
	}
	
	/* Toggle icon (chevron) */
	.reference-category-menu-title::after {
		content: '\f078'; /* fa-chevron-down */
		font-family: 'Font Awesome 6 Free';
		font-weight: 900;
		position: absolute;
		right: 18px;
		top: 50%;
		transform: translateY(-50%);
		transition: transform 0.3s ease;
		color: #2F2483;
		font-size: 14px;
	}
	
	/* When menu is open */
	.reference-category-menu.is-open .reference-category-menu-title::after {
		transform: translateY(-50%) rotate(180deg);
	}
	
	/* Category list - hidden by default on mobile */
	.reference-category-list {
		max-height: 0;
		overflow: hidden;
		transition: max-height 0.4s ease-out;
	}
	
	/* When menu is open */
	.reference-category-menu.is-open .reference-category-list {
		max-height: 2000px; /* Large enough to fit all items */
		transition: max-height 0.5s ease-in;
	}
	
	/* Back button also hidden by default */
	.reference-back-button {
		max-height: 0;
		overflow: hidden;
		transition: max-height 0.4s ease-out;
		margin-top: 0;
	}
	
	.reference-category-menu.is-open + .reference-back-button,
	.reference-category-menu.is-open ~ .reference-back-button {
		max-height: 200px;
		margin-top: 15px;
		transition: max-height 0.5s ease-in;
	}

	.reference-category-item a {
		padding: 10px 12px;
		gap: 10px;
		font-size: 14px;
	}

	.reference-category-item a i {
		font-size: 16px;
	}

	.reference-category-item .category-count {
		min-width: 16px;
		height: 16px;
		font-size: 9px;
		padding: 0 4px;
	}

	/* Horizontal layout on mobile */
	.reference-category-menu.layout-horizontal .reference-category-list {
		overflow-x: auto;
		flex-wrap: nowrap;
		scrollbar-width: thin;
		scrollbar-color: #2F2483 #f0f0f0;
		-webkit-overflow-scrolling: touch;
	}

	.reference-category-menu.layout-horizontal .reference-category-list::-webkit-scrollbar {
		height: 6px;
	}

	.reference-category-menu.layout-horizontal .reference-category-list::-webkit-scrollbar-track {
		background: #f0f0f0;
		border-radius: 3px;
	}

	.reference-category-menu.layout-horizontal .reference-category-list::-webkit-scrollbar-thumb {
		background: #2F2483;
		border-radius: 3px;
	}

	.reference-category-menu.layout-horizontal .reference-category-item a:hover {
		transform: none;
	}
}

/* ===== RESPONSIVE: TABLET ===== */
@media (min-width: 769px) and (max-width: 1024px) {
	.reference-category-item a {
		padding: 13px 18px;
	}
}

/* ===== FORCED LIGHT MODE (No Dark Mode!) ===== */
.reference-category-menu,
.reference-category-menu *,
.reference-category-item a,
.reference-category-menu-title {
	color-scheme: light !important;
}

@media (prefers-color-scheme: dark) {
	.reference-category-menu {
		background: #ffffff !important;
		box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
		border-color: #f0f0f0 !important;
	}

	.reference-category-menu-title {
		color: #1a1a1a !important;
		border-bottom-color: #e9ecef !important;
	}

	.reference-category-item a {
		color: #495057 !important;
		background: transparent !important;
	}

	.reference-category-item a:hover {
		color: #2F2483 !important;
		background: linear-gradient(to right, rgba(47, 36, 131, 0.08), rgba(47, 36, 131, 0.02)) !important;
	}

	.reference-category-item .category-count {
		background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
		color: #495057 !important;
		border-color: #dee2e6 !important;
	}

	.reference-category-menu-empty {
		background: #f9f9f9 !important;
		color: #999999 !important;
		border-color: #dddddd !important;
	}

	.reference-category-item.active a {
		background: linear-gradient(135deg, #2F2483 0%, #1e1850 100%) !important;
		color: #ffffff !important;
	}
}

/* ===== PRINT STYLES ===== */
@media print {
	.reference-category-menu {
		box-shadow: none;
		border: 1px solid #ddd;
	}

	.reference-category-item a {
		color: #000000 !important;
		background: none !important;
	}

	.reference-category-item .category-count {
		display: none;
	}
}

/* ===== ACCESSIBILITY ===== */
.reference-category-item a:focus {
	outline: 2px solid #2F2483;
	outline-offset: 2px;
}

.reference-category-item a:focus:not(:focus-visible) {
	outline: none;
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
	.reference-category-menu {
		border: 2px solid #333333;
	}

	.reference-category-item a {
		border: 1px solid transparent;
	}

	.reference-category-item a:hover,
	.reference-category-item.active a {
		border-color: #2F2483;
	}

	.reference-category-item .category-count {
		border: 1px solid #666666;
	}
}

/* ===== ANIMATION ===== */
.reference-category-item {
	animation: slideInLeft 0.4s ease forwards;
	opacity: 0;
}

.reference-category-item:nth-child(1) {
	animation-delay: 0.05s;
}

.reference-category-item:nth-child(2) {
	animation-delay: 0.1s;
}

.reference-category-item:nth-child(3) {
	animation-delay: 0.15s;
}

.reference-category-item:nth-child(4) {
	animation-delay: 0.2s;
}

.reference-category-item:nth-child(5) {
	animation-delay: 0.25s;
}

.reference-category-item:nth-child(6) {
	animation-delay: 0.3s;
}

.reference-category-item:nth-child(7) {
	animation-delay: 0.35s;
}

.reference-category-item:nth-child(8) {
	animation-delay: 0.4s;
}

@keyframes slideInLeft {
	from {
		opacity: 0;
		transform: translateX(-20px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

/* Disable animation in Elementor editor */
.elementor-editor-active .reference-category-item {
	animation: none;
	opacity: 1;
	transform: none;
}

