/* FontAwesome Control Styles */
.kirki-fontawesome-control {
	position: relative;

	.input-group {
		display: flex;
		align-items: center;
		border: 1px solid #ddd;
		border-radius: 4px;
		background: #fff;

		.kirki-fontawesome-input {
			flex: 1;
			padding: 8px 12px;
			border: none;
			outline: none;
			font-size: 14px;
			background: transparent;
		}

		.kirki-fontawesome-input::placeholder {
			color: #999;
		}

		.kirki-fontawesome-preview {
			display: flex;
			align-items: center;
			justify-content: center;
			width: 40px;
			height: 40px;
			border-left: 1px solid #ddd;
			background: #f9f9f9;
		}

		.kirki-fontawesome-preview i {
			font-size: 16px;
			color: #333;
		}

		.kirki-fontawesome-preview i:empty {
			display: none;
		}

		.kirki-fontawesome-picker-btn {
			display: flex;
			align-items: center;
			justify-content: center;
			width: 40px;
			height: 40px;
			border: none;
			border-left: 1px solid #ddd;
			background: #f9f9f9;
			cursor: pointer;
			transition: background-color 0.2s ease;
		}

		.kirki-fontawesome-picker-btn:hover {
			background: #e9e9e9;
		}

		.kirki-fontawesome-picker-btn .dashicons {
			font-size: 16px;
			color: #666;
		}
	}

	.kirki-fontawesome-picker-popover {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		z-index: 999999;
		background: #fff;
		border: 1px solid #ddd;
		border-radius: 4px;
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
		margin-top: 4px;
		display: none;

		&.active {
			display: block;
		}

		.kirki-fontawesome-picker-header {
			padding: 12px;
			border-bottom: 1px solid #eee;

			.kirki-fontawesome-search {
				width: 100%;
				padding: 8px 12px;
				border: 1px solid #ddd;
				border-radius: 4px;
				font-size: 14px;
				outline: none;

				&:focus {
					border-color: #0073aa;
					box-shadow: 0 0 0 1px #0073aa;
				}
			}
		}

		.kirki-fontawesome-picker-content {
			.kirki-fontawesome-picker-tabs {
				display: flex;
				border-bottom: 1px solid #eee;

				.kirki-fontawesome-tab {
					flex: 1;
					padding: 10px 16px;
					border: none;
					background: #f9f9f9;
					cursor: pointer;
					font-size: 14px;
					transition: background-color 0.2s ease;

					&:hover {
						background: #e9e9e9;
					}

					&.active {
						background: #fff;
						color: #0073aa;
						font-weight: 600;
					}

					&:not(:last-child) {
						border-right: 1px solid #eee;
					}
				}
			}

			.kirki-fontawesome-icons-container {
				max-height: 300px;
				overflow-y: auto;

				.kirki-fontawesome-icons-tab {
					display: none;
					padding: 16px;

					&.active {
						display: block;
					}

					i {
						display: inline-block;
						width: 32px;
						height: 32px;
						line-height: 32px;
						text-align: center;
						margin: 2px;
						border: 1px solid transparent;
						border-radius: 4px;
						cursor: pointer;
						font-size: 16px;
						color: #333;
						transition: all 0.2s ease;

						&:hover {
							background: #f0f0f0;
							border-color: #ddd;
							transform: scale(1.1);
						}

						&:active {
							background: #e0e0e0;
							transform: scale(1.05);
						}
					}
				}
			}
		}
	}
}

/* Repeater specific styles */
.customize-control-kirki-repeater {
	.kirki-fontawesome-control {
		.kirki-fontawesome-picker-popover {
			z-index: 999999;
		}
	}
}

/* Responsive adjustments */
@media (max-width: 782px) {
	.kirki-fontawesome-control {
		.kirki-fontawesome-picker-popover {
			.kirki-fontawesome-icons-container {
				max-height: 200px;

				.kirki-fontawesome-icons-tab {
					padding: 12px;

					i {
						width: 28px;
						height: 28px;
						line-height: 28px;
						font-size: 14px;
					}
				}
			}
		}
	}
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
	.kirki-fontawesome-control {
		.input-group {
			border-color: #555;
			background: #2c2c2c;

			.kirki-fontawesome-input {
				color: #fff;
				
				&::placeholder {
					color: #aaa;
				}
			}

			.kirki-fontawesome-preview,
			.kirki-fontawesome-picker-btn {
				border-color: #555;
				background: #3c3c3c;

				i, .dashicons {
					color: #fff;
				}
			}
		}

		.kirki-fontawesome-picker-popover {
			background: #2c2c2c;
			border-color: #555;

			.kirki-fontawesome-picker-header {
				border-color: #555;

				.kirki-fontawesome-search {
					background: #3c3c3c;
					border-color: #555;
					color: #fff;

					&::placeholder {
						color: #aaa;
					}
				}
			}

			.kirki-fontawesome-picker-content {
				.kirki-fontawesome-picker-tabs {
					border-color: #555;

					.kirki-fontawesome-tab {
						background: #3c3c3c;
						color: #fff;

						&.active {
							background: #2c2c2c;
						}

						&:not(:last-child) {
							border-color: #555;
						}
					}
				}

				.kirki-fontawesome-icons-container {
					.kirki-fontawesome-icons-tab {
						i {
							color: #fff;

							&:hover {
								background: #4c4c4c;
								border-color: #666;
							}
						}
					}
				}
			}
		}
	}
}
