/**
 * Content Indexing settings page styles for Agentorie Chat.
 *
 * @package    Agentorie_Chat
 * @subpackage Agentorie_Chat/admin/css
 * @since      1.0.0
 */

/* ==========================================================================
   Hidden utility class
   ========================================================================== */

.agentorie-card.hidden {
	display: none;
}

/* ==========================================================================
   Usage Stats Box
   ========================================================================== */

.content-usage-box {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 20px;
	background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	margin-bottom: 24px;
}

.usage-icon {
	width: 48px;
	height: 48px;
	background: linear-gradient(135deg, #6366f1, #4f46e5);
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 24px;
}

.usage-details {
	flex: 1;
}

.usage-label {
	font-size: 13px;
	color: #64748b;
	margin-bottom: 4px;
}

.usage-value {
	font-size: 20px;
	font-weight: 700;
	color: #1e293b;
}

.usage-value .limit {
	font-weight: 400;
	color: #64748b;
}

.usage-ai-info {
	font-size: 13px;
	color: #64748b;
	font-weight: 400;
}

.usage-bar-container {
	margin-top: 8px;
}

.usage-bar {
	height: 6px;
	background: #e2e8f0;
	border-radius: 3px;
	overflow: hidden;
}

.usage-bar-fill {
	height: 100%;
	background: linear-gradient(90deg, #6366f1, #8b5cf6);
	border-radius: 3px;
	transition: width 0.3s ease;
}

.usage-bar-fill.warning {
	background: linear-gradient(90deg, #f59e0b, #d97706);
}

.usage-bar-fill.danger {
	background: linear-gradient(90deg, #ef4444, #dc2626);
}

.usage-hint {
	margin-top: 8px;
	font-size: 12px;
	color: #64748b;
	line-height: 1.5;
}

.usage-hint a {
	color: #6366f1;
	text-decoration: none;
}

.usage-hint a:hover {
	text-decoration: underline;
}

.usage-hint .dashicons-external {
	font-size: 14px;
	width: 14px;
	height: 14px;
	vertical-align: middle;
}

.usage-upgrade {
	margin-left: auto;
}

.usage-upgrade .button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

/* ==========================================================================
   Indexing Mode Selector
   ========================================================================== */

.indexing-mode-title {
	margin-top: 0;
	margin-bottom: 16px;
	font-size: 14px;
	color: #1e293b;
}

.indexing-mode-selector {
	display: flex;
	gap: 16px;
	margin-bottom: 20px;
}

.mode-option {
	flex: 1;
	position: relative;
}

.mode-option input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.mode-option label {
	display: block;
	padding: 20px;
	border: 2px solid #e2e8f0;
	border-radius: 12px;
	cursor: pointer;
	transition: all 0.2s ease;
	background: #fff;
}

.mode-option label:hover {
	border-color: #a5b4fc;
	background: #fafafe;
}

.mode-option input:checked + label {
	border-color: #6366f1;
	background: linear-gradient(135deg, #faf5ff 0%, #f5f3ff 100%);
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.mode-option input:disabled + label {
	opacity: 0.6;
	cursor: not-allowed;
}

.mode-header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
}

.mode-icon {
	width: 36px;
	height: 36px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
}

.mode-option.mode-auto .mode-icon {
	background: #dcfce7;
	color: #166534;
}

.mode-option.mode-manual .mode-icon {
	background: #fef3c7;
	color: #92400e;
}

.mode-title {
	font-size: 15px;
	font-weight: 600;
	color: #1e293b;
}

.mode-description {
	font-size: 13px;
	color: #64748b;
	line-height: 1.5;
	padding-left: 46px;
}

/* ==========================================================================
   URL Textarea
   ========================================================================== */

.url-textarea-wrapper {
	position: relative;
}

.url-textarea {
	width: 100%;
	min-height: 120px;
	padding: 12px 14px;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
	font-size: 13px;
	line-height: 1.6;
	resize: vertical;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.url-textarea:focus {
	outline: none;
	border-color: #6366f1;
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.url-textarea::placeholder {
	color: #94a3b8;
}

.url-textarea:disabled {
	background: #f8fafc;
	color: #94a3b8;
	cursor: not-allowed;
}

.url-count {
	position: absolute;
	bottom: 8px;
	right: 12px;
	font-size: 12px;
	color: #94a3b8;
	background: #fff;
	padding: 2px 6px;
	border-radius: 4px;
}

.url-count.warning {
	color: #d97706;
}

.url-count.error {
	color: #dc2626;
}

/* ==========================================================================
   Conditional Sections
   ========================================================================== */

.conditional-section {
	margin-top: 20px;
	padding: 20px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	display: none;
}

.conditional-section.active {
	display: block;
	animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.conditional-section h4 {
	margin: 0 0 12px;
	font-size: 14px;
	font-weight: 600;
	color: #1e293b;
	display: flex;
	align-items: center;
	gap: 8px;
}

.conditional-section h4 .dashicons {
	color: #6366f1;
}

/* ==========================================================================
   Index Status Card
   ========================================================================== */

.index-status-card {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	padding: 20px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	margin-top: 20px;
}

.index-status-card.status-enabled {
	border-left: 4px solid #10b981;
}

.index-status-card.status-disabled {
	border-left: 4px solid #94a3b8;
}

.status-icon-large {
	width: 44px;
	height: 44px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	flex-shrink: 0;
}

.status-enabled .status-icon-large {
	background: #dcfce7;
	color: #166534;
}

.status-disabled .status-icon-large {
	background: #f1f5f9;
	color: #64748b;
}

.status-details {
	flex: 1;
}

.status-title {
	font-size: 15px;
	font-weight: 600;
	color: #1e293b;
	margin-bottom: 4px;
}

.status-meta {
	font-size: 13px;
	color: #64748b;
	margin-bottom: 12px;
}

.status-meta span {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-right: 16px;
}

.status-actions {
	display: flex;
	gap: 10px;
}

.status-actions .button .dashicons {
	vertical-align: middle;
	margin-right: 4px;
}

/* ==========================================================================
   Indexed Pages Section
   ========================================================================== */

.indexed-pages-section {
	margin-top: 20px;
}

.indexed-pages-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.indexed-pages-header h4 {
	margin: 0;
	font-size: 14px;
	color: #1e293b;
	display: flex;
	align-items: center;
	gap: 8px;
}

.indexed-pages-header h4 .dashicons {
	vertical-align: middle;
}

#toggle-indexed-list {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

#toggle-indexed-list .dashicons {
	transition: transform 0.2s ease;
}

#toggle-indexed-list.active .dashicons {
	transform: rotate(180deg);
}

#toggle-woo-indexed-list {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

#toggle-woo-indexed-list .dashicons {
	transition: transform 0.2s ease;
}

#toggle-woo-indexed-list.active .dashicons {
	transform: rotate(180deg);
}

/* Badges */
.ai-usage-badge {
	font-size: 11px;
	background: #dbeafe;
	color: #1d4ed8;
	padding: 2px 8px;
	border-radius: 4px;
	font-weight: 500;
}

.total-count-badge {
	font-size: 11px;
	background: #e5e7eb;
	color: #374151;
	padding: 2px 8px;
	border-radius: 4px;
	font-weight: 500;
}

/* ==========================================================================
   Service Hint (for pages over limit)
   ========================================================================== */

.service-hint {
	margin-bottom: 12px;
	padding: 10px 14px;
	background: #f0f9ff;
	border-left: 4px solid #3b82f6;
	border-radius: 4px;
	font-size: 13px;
	color: #1e40af;
	line-height: 1.5;
}

.service-hint .dashicons {
	color: #3b82f6;
	vertical-align: middle;
	margin-right: 6px;
}

.service-hint a {
	color: #1d4ed8;
	text-decoration: none;
	font-weight: 500;
}

.service-hint a:hover {
	text-decoration: underline;
}

/* ==========================================================================
   Indexed Pages List Table
   ========================================================================== */

.indexed-pages-list {
	display: none;
}

.indexed-pages-list.visible {
	display: block;
}

#woo-indexed-pages-list {
	display: none;
}

#woo-indexed-pages-list.visible {
	display: block;
}

.indexed-pages-list table {
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	overflow: hidden;
}

.indexed-pages-list th {
	background: #f8fafc;
	font-weight: 600;
	color: #475569;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.indexed-pages-list td {
	vertical-align: middle;
	padding: 10px 12px;
}

/* Column widths */
.indexed-pages-list .column-indicator {
	width: 5%;
}

.indexed-pages-list .column-title {
	width: 35%;
}

.indexed-pages-list .column-url {
	width: 45%;
}

.indexed-pages-list .column-type {
	width: 15%;
}

.indexed-pages-list a {
	color: #3b82f6;
	text-decoration: none;
	word-break: break-all;
}

.indexed-pages-list a:hover {
	text-decoration: underline;
}

.indexed-pages-list a .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
	vertical-align: middle;
	margin-left: 4px;
}

.indexed-type {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 500;
	text-transform: uppercase;
}

.indexed-type-page {
	background: #dbeafe;
	color: #1d4ed8;
}

.indexed-type-post {
	background: #dcfce7;
	color: #166534;
}

/* ==========================================================================
   AI Usage Indicators
   ========================================================================== */

.ai-indicator {
	display: inline-block;
	width: 20px;
	height: 20px;
	line-height: 20px;
	text-align: center;
	border-radius: 50%;
	background: #dcfce7;
	color: #166534;
	font-size: 12px;
}

.ai-indicator.not-used {
	background: #f1f5f9;
	color: #94a3b8;
}

tr.not-used-by-ai td {
	opacity: 0.6;
}

tr.not-used-by-ai:hover td {
	opacity: 1;
}

/* ==========================================================================
   Upgrade Hint (for pages over limit)
   ========================================================================== */

.upgrade-hint {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
	padding: 12px 16px;
	background: linear-gradient(135deg, #fef3c7 0%, #fef9c3 100%);
	border: 1px solid #fde68a;
	border-radius: 8px;
	font-size: 13px;
	color: #92400e;
	line-height: 1.5;
}

.upgrade-hint .dashicons {
	color: #d97706;
	flex-shrink: 0;
}

.upgrade-hint a {
	color: #92400e;
	font-weight: 600;
	text-decoration: underline;
}

.upgrade-hint a:hover {
	color: #78350f;
}

/* ==========================================================================
   Custom Post Types Checkboxes
   ========================================================================== */

.cpt-checkboxes-list {
	display: none;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}

.cpt-checkboxes-list.visible {
	display: flex;
}

.cpt-checkbox-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
	font-size: 13px;
}

.cpt-checkbox-item:hover {
	border-color: #a5b4fc;
	background: #fafafe;
}

.cpt-checkbox-item input[type="checkbox"]:checked ~ .cpt-label {
	color: #4f46e5;
	font-weight: 600;
}

.cpt-checkbox-item input[type="checkbox"]:checked ~ .cpt-slug {
	background: rgba(99, 102, 241, 0.1);
	color: #4f46e5;
}

.cpt-label {
	color: #1e293b;
	font-weight: 500;
}

.cpt-slug {
	font-size: 11px;
	color: #94a3b8;
	background: #f1f5f9;
	padding: 1px 6px;
	border-radius: 4px;
	font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* Generic CPT type badge (fallback for non page/post types) */
.indexed-type:not(.indexed-type-page):not(.indexed-type-post) {
	background: #fef3c7;
	color: #92400e;
}

/* ==========================================================================
   Help Tips
   ========================================================================== */

.help-tip {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 14px 16px;
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	border-radius: 8px;
	margin-top: 16px;
}

.help-tip .dashicons {
	color: #3b82f6;
	flex-shrink: 0;
	margin-top: 2px;
}

.help-tip-content {
	font-size: 13px;
	color: #1e40af;
	line-height: 1.5;
}

.help-tip-content code {
	background: rgba(59, 130, 246, 0.1);
	padding: 2px 6px;
	border-radius: 4px;
	font-size: 12px;
}

/* ==========================================================================
   Feature Badge
   ========================================================================== */

.feature-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 10px;
	background: linear-gradient(135deg, #6366f1, #8b5cf6);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	border-radius: 20px;
	margin-left: 8px;
}

.feature-badge.free {
	background: linear-gradient(135deg, #10b981, #059669);
}

.feature-badge.optional {
	background: linear-gradient(135deg, #64748b, #475569);
}

/* ==========================================================================
   Introduction Section
   ========================================================================== */

.intro-section {
	max-width: 800px;
}

.intro-text {
	font-size: 15px;
	line-height: 1.7;
	color: #475569;
	margin-bottom: 20px;
}

.intro-example {
	display: flex;
	gap: 14px;
	padding: 16px 20px;
	background: linear-gradient(135deg, #fef3c7 0%, #fef9c3 100%);
	border: 1px solid #fde68a;
	border-radius: 10px;
	margin-bottom: 20px;
}

.intro-example .example-icon {
	font-size: 28px;
	flex-shrink: 0;
}

.intro-example .example-content {
	font-size: 14px;
	line-height: 1.6;
	color: #78350f;
}

.intro-example .example-content strong {
	color: #92400e;
}

.intro-benefits {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 20px;
}

.intro-benefits .benefit {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 500;
	color: #166534;
}

.intro-benefits .benefit-icon {
	font-size: 16px;
}

.intro-note {
	display: flex;
	gap: 12px;
	padding: 14px 18px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	font-size: 13px;
	line-height: 1.6;
	color: #475569;
}

.intro-note .dashicons {
	color: #6366f1;
	flex-shrink: 0;
	margin-top: 2px;
}

.intro-note a {
	color: #6366f1;
	text-decoration: none;
	font-weight: 500;
}

.intro-note a:hover {
	text-decoration: underline;
}

/* ==========================================================================
   Validation Messages
   ========================================================================== */

.validation-message {
	display: none;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	border-radius: 6px;
	font-size: 13px;
	margin-top: 10px;
}

.validation-message.show {
	display: flex;
}

.validation-message.error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #991b1b;
}

.validation-message.success {
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	color: #166534;
}

.validation-message .dashicons {
	flex-shrink: 0;
}

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

@media screen and (max-width: 782px) {
	.content-usage-box {
		flex-direction: column;
		align-items: stretch;
		text-align: center;
	}

	.usage-icon {
		margin: 0 auto;
	}

	.usage-upgrade {
		margin: 16px auto 0;
	}

	.indexing-mode-selector {
		flex-direction: column;
	}

	.mode-description {
		padding-left: 0;
	}

	.index-status-card {
		flex-direction: column;
	}

	.status-actions {
		flex-direction: column;
	}

	.status-actions .button {
		width: 100%;
		justify-content: center;
	}

	.indexed-pages-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}

	.indexed-pages-list .column-indicator,
	.indexed-pages-list .column-type {
		display: none;
	}

	.indexed-pages-list .column-title,
	.indexed-pages-list .column-url {
		width: 50%;
	}
}
