/**
 * Affiliate Hub - Gutenberg Block Styles
 *
 * Styles for both the block editor and frontend rendering.
 *
 * @package AffiliateHub
 * @since 1.1.0
 */

/* ==========================================================================
   Editor: Search Interface
   ========================================================================== */

.affiliate-hub-block-search {
	padding: 20px;
	border: 1px solid #ddd;
	border-radius: 4px;
	background: #fff;
}

.affiliate-hub-block-search-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid #e0e0e0;
}

.affiliate-hub-block-icon {
	font-size: 20px;
	color: #2271b1;
}

.affiliate-hub-block-title {
	font-size: 14px;
	font-weight: 600;
	color: #1d2327;
}

.affiliate-hub-block-search .components-text-control__input {
	width: 100%;
}

.affiliate-hub-block-loading {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 0;
	color: #757575;
	font-size: 13px;
}

/* ==========================================================================
   Editor: Results List
   ========================================================================== */

.affiliate-hub-block-results {
	list-style: none;
	margin: 12px 0 0;
	padding: 0;
	max-height: 240px;
	overflow-y: auto;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
}

.affiliate-hub-block-result-item {
	padding: 10px 12px;
	cursor: pointer;
	border-bottom: 1px solid #f0f0f0;
	transition: background-color 0.15s ease;
}

.affiliate-hub-block-result-item:last-child {
	border-bottom: none;
}

.affiliate-hub-block-result-item:hover,
.affiliate-hub-block-result-item:focus {
	background-color: #f0f7fc;
	outline: none;
}

.affiliate-hub-block-result-item:focus {
	box-shadow: inset 0 0 0 2px #2271b1;
}

.affiliate-hub-block-result-title {
	font-size: 13px;
	font-weight: 600;
	color: #1d2327;
	margin-bottom: 2px;
}

.affiliate-hub-block-result-url {
	font-size: 12px;
	color: #757575;
	word-break: break-all;
}

.affiliate-hub-block-result-meta {
	margin-top: 4px;
}

.affiliate-hub-block-result-clicks {
	font-size: 11px;
	color: #2271b1;
	background: #f0f7fc;
	padding: 1px 6px;
	border-radius: 3px;
}

.affiliate-hub-block-no-results {
	padding: 16px 0;
	text-align: center;
	color: #757575;
	font-size: 13px;
	font-style: italic;
}

/* ==========================================================================
   Editor: Selected Link Preview
   ========================================================================== */

.affiliate-hub-block-wrapper {
	border: 1px solid #ddd;
	border-radius: 4px;
	background: #fff;
	overflow: hidden;
}

.affiliate-hub-block-preview {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	background: #f8f9fa;
	border-bottom: 1px solid #e0e0e0;
}

.affiliate-hub-block-preview-icon {
	font-size: 18px;
	color: #2271b1;
	flex-shrink: 0;
}

.affiliate-hub-block-preview-details {
	flex: 1;
	min-width: 0;
}

.affiliate-hub-block-preview-title {
	display: block;
	font-size: 13px;
	color: #1d2327;
	line-height: 1.4;
}

.affiliate-hub-block-preview-url {
	display: block;
	font-size: 12px;
	color: #757575;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.affiliate-hub-block-change-btn {
	flex-shrink: 0;
}

.affiliate-hub-block-text-editor {
	padding: 12px 16px;
}

.affiliate-hub-block-text-editor .affiliate-hub-link {
	font-size: inherit;
	color: #2271b1;
	text-decoration: underline;
	cursor: text;
}

/* ==========================================================================
   Editor: Inspector Sidebar
   ========================================================================== */

.affiliate-hub-block-inspector-info {
	margin-top: 12px;
	padding: 10px;
	background: #f8f9fa;
	border-radius: 4px;
}

.affiliate-hub-block-inspector-info p {
	margin: 4px 0;
	font-size: 12px;
	color: #50575e;
}

.affiliate-hub-block-inspector-info code {
	font-size: 11px;
	word-break: break-all;
}

/* ==========================================================================
   Frontend: Link Styling
   ========================================================================== */

.affiliate-hub-link {
	color: inherit;
	text-decoration: underline;
	text-decoration-color: currentColor;
	text-underline-offset: 2px;
	transition: opacity 0.15s ease;
}

.affiliate-hub-link:hover,
.affiliate-hub-link:focus {
	opacity: 0.8;
}
