/*
 * Keyword Clustering Tool - Modern CSS
 * Modern, responsive design with gradients, shadows, and animations
 */

/* Import Google Fonts */
/* @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap'); */

/* Global Variables */
:root {
	--primary-color: #0dc270;
	--secondary-color: #77ea10;
	--accent-color: #f093fb;
	--success-color: #10b981;
	--error-color: #ef4444;
	--warning-color: #f59e0b;
	--info-color: #3b82f6;

	--text-primary: #1f2937;
	--text-secondary: #6b7280;
	--text-muted: #9ca3af;

	--bg-primary: #ffffff;
	--bg-secondary: #f8fafc;
	--bg-tertiary: #f1f5f9;

	--border-light: #e5e7eb;
	--border-medium: #d1d5db;

	--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
	--shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1),
		0 2px 4px -2px rgb(0 0 0 / 0.1);
	--shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1),
		0 4px 6px -4px rgb(0 0 0 / 0.1);
	--shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1),
		0 8px 10px -6px rgb(0 0 0 / 0.1);

	--radius-sm: 0.375rem;
	--radius-md: 0.5rem;
	--radius-lg: 0.75rem;
	--radius-xl: 1rem;
}

/* Container and Layout */

/* .axilweb-keyword-clustering::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 300px;
	background: linear-gradient(
		135deg,
		var(--primary-color) 0%,
		var(--secondary-color) 100%
	);
	opacity: 0.1;
	z-index: 0;
} */

.axilweb-keyword-clustering .container {
	position: relative;
	z-index: 1;
}

/* Main Title */
.axilweb-tool-title {
	text-align: center;
	margin-bottom: 3rem;
}

.axilweb-tool-title h1 {
	font-size: 20px;
	font-weight: 700;
	background: linear-gradient(
		135deg,
		var(--primary-color) 0%,
		var(--secondary-color) 100%
	);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	margin-bottom: 1rem;
	line-height: 1.2;
}

.axilweb-tool-title p {
	font-size: 20px;
	color: var(--text-secondary);
	max-width: 600px;
	margin: 0 auto;
	line-height: 1.6;
}

/* Cards */

/* .axilweb-card:hover {
	box-shadow: var(--shadow-xl);
	transform: translateY(-2px);
} */

.axilweb-card-header::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
	opacity: 0.3;
}

.axilweb-card-body {
	padding: 2rem;
}

/* Form Elements */
.axilweb-form-group {
	margin-bottom: 1.5rem;
}

.axilweb-form-control:focus {
	outline: none;
	border-color: var(--primary-color);
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
	transform: translateY(-1px);
}

/* textarea.axilweb-form-control {
	resize: vertical;
	min-height: 180px;
	font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
	line-height: 1.6;
} */

/* Mode Selection Grid */

/* Settings Panels */
.axilweb-settings-panel {
	margin-top: 1.5rem;
	padding: 1.5rem;
	background: var(--bg-secondary);
	border-radius: var(--radius-lg);
	border: 1px solid var(--border-light);
}

/* Progress Bar */
.axilweb-progress-container {
	margin-top: 1rem;
}

.axilweb-progress-bar {
	width: 100%;
	height: 8px;
	background: var(--bg-tertiary);
	border-radius: 4px;
	overflow: hidden;
	position: relative;
}

.axilweb-progress-fill {
	height: 100%;
	background: linear-gradient(
		90deg,
		var(--primary-color) 0%,
		var(--secondary-color) 100%
	);
	border-radius: 4px;
	transition: width 0.3s ease;
	position: relative;
	overflow: hidden;
}

.axilweb-progress-fill::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(
		90deg,
		transparent 0%,
		rgba(255, 255, 255, 0.3) 50%,
		transparent 100%
	);
	animation: progressShimmer 2s infinite;
}

@keyframes progressShimmer {
	0% {
		transform: translateX(-100%);
	}
	100% {
		transform: translateX(100%);
	}
}

.axilweb-progress-text {
	text-align: center;
	margin-top: 0.5rem;
	font-size: 20px;
	color: var(--text-secondary);
	font-weight: 500;
}

/* Collapsible Sections */
.axilweb-collapsible-section {
	margin-bottom: 1.5rem;
}

.axilweb-section-toggle {
	width: 100%;
	padding: 1rem;
	background: var(--bg-secondary);
	border: 2px solid var(--border-light);
	border-radius: var(--radius-md);
	font-weight: 500;
	color: var(--text-primary);
	cursor: pointer;
	transition: all 0.2s ease;
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-family: inherit;
	font-size: 20px;
}

.axilweb-section-toggle:hover {
	background: var(--bg-tertiary);
	border-color: var(--primary-color);
}

.axilweb-section-toggle.active {
	background: rgba(102, 126, 234, 0.1);
	border-color: var(--primary-color);
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
}

.axilweb-section-toggle .toggle-icon {
	transition: transform 0.2s ease;
	font-size: 20px;
}

.axilweb-section-toggle.active .toggle-icon {
	transform: rotate(180deg);
}

.axilweb-collapsible-content {
	padding: 1.5rem;
	border: 2px solid var(--border-light);
	border-top: none;
	border-bottom-left-radius: var(--radius-md);
	border-bottom-right-radius: var(--radius-md);
	background: var(--bg-primary);
	animation: slideDown 0.3s ease;
}

@keyframes slideDown {
	from {
		opacity: 0;
		max-height: 0;
		padding-top: 0;
		padding-bottom: 0;
	}
	to {
		opacity: 1;
		max-height: 500px;
		padding-top: 1.5rem;
		padding-bottom: 1.5rem;
	}
}

/* Checkbox Labels */
.axilweb-checkbox-label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 20px;
	color: var(--text-primary);
	cursor: pointer;
	white-space: nowrap;
}

.axilweb-checkbox-label input[type='checkbox'] {
	accent-color: var(--primary-color);

	cursor: pointer;
	font-weight: 500;
	color: var(--text-primary);
}

/* Buttons */
.axilweb-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem 1.5rem;
	border-radius: var(--radius-md);
	font-weight: 500;
	font-size: 20px;
	text-decoration: none;
	border: none;
	cursor: pointer;
	transition: all 0.2s ease;
	position: relative;
	overflow: hidden;
	font-family: inherit;
}

.axilweb-btn.axilweb-btn-small {
	padding: 0.3rem 1.5rem 0.2rem;
	font-size: 16px;
}

.axilweb-btn::before {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(
		90deg,
		transparent,
		rgba(255, 255, 255, 0.2),
		transparent
	);
	transition: left 0.5s ease;
}

.axilweb-btn:hover::before {
	left: 100%;
}

.axilweb-btn-primary {
	background: linear-gradient(
		135deg,
		var(--primary-color) 0%,
		var(--secondary-color) 100%
	);
	color: white;
	box-shadow: var(--shadow-md);
}

.axilweb-btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow-lg);
}

.axilweb-btn-secondary {
	background: var(--bg-tertiary);
	color: var(--text-primary);
	border: 2px solid var(--border-light);
}

.axilweb-btn-secondary:hover {
	background: var(--bg-secondary);
	border-color: var(--border-medium);
	transform: translateY(-1px);
}

.axilweb-btn-success {
	background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
	color: white;
	box-shadow: var(--shadow-md);
}

.axilweb-btn-success:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow-lg);
}

.axilweb-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none !important;
}

.axilweb-btn-group {
	display: flex;
	gap: 1rem;
	margin-top: 1rem;
}

/* Processing Message */
.axilweb-processing {
	margin-top: 1rem;
	padding: 1rem;
	border-radius: var(--radius-md);
	background: rgba(59, 130, 246, 0.1);
	border: 1px solid rgba(59, 130, 246, 0.2);
	color: var(--info-color);
	font-weight: 500;
	text-align: center;
	opacity: 0;
	transform: translateY(10px);
	transition: all 0.3s ease;
}

.axilweb-processing.show {
	opacity: 1;
	transform: translateY(0);
}

/* Metrics Summary */

/* Cluster Results */
.axilweb-clusters {
	display: grid;
	gap: 1.5rem;
}

.axilweb-cluster {
	margin-bottom: 25px;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.axilweb-cluster:hover {
	transform: translateY(-2px);
	box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.axilweb-cluster-header {
	padding: 16px 20px;
	background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
	border-bottom: 1px solid #dee2e6;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}

.axilweb-cluster-title {
	margin: 0;
	font-size: 17px;
	font-weight: 600;
	color: #2c3e50;
	display: flex;
	align-items: center;
	gap: 8px;
}

.axilweb-cluster-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 6px;
	font-size: 13px;
	color: #6c757d;
}

.axilweb-cluster-stat {
	display: inline-flex;
	align-items: center;
	background: rgba(255, 255, 255, 0.7);
	padding: 3px 10px;
	border-radius: 12px;
	font-size: 12px;
	color: #495057;
}

.axilweb-cluster-body {
	padding: 18px 20px;
	background-color: #fff;
}

.axilweb-cluster-keywords {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
	padding: 0;
}

.axilweb-keyword-item {
	background: #f1f8ff;
	padding: 6px 14px;
	border-radius: 20px;
	font-size: 14px;
	color: #1a73e8;
	display: inline-flex;
	align-items: center;
	border: 1px solid #d0e3ff;
	transition: all 0.2s ease;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.axilweb-keyword-item:hover {
	background: #e1f0ff;
	transform: translateY(-1px);
	box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.axilweb-cluster-actions {
	display: flex;
	gap: 8px;
	margin-left: auto;
	flex-shrink: 0;
}

.axilweb-cluster-action {
	padding: 6px 14px;
	border: 1px solid #dee2e6;
	background: #fff;
	border-radius: 20px;
	cursor: pointer;
	font-size: 13px;
	font-weight: 500;
	color: #495057;
	transition: all 0.2s ease;
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.axilweb-cluster-action:hover {
	background: #f8f9fa;
	border-color: #ced4da;
	transform: translateY(-1px);
}

.axilweb-cluster-action[data-action='copy'] {
	color: #1a73e8;
	border-color: #d0e3ff;
	background-color: #f1f8ff;
}

.axilweb-cluster-action[data-action='export-csv'] {
	color: #0d6efd;
	border-color: #cfe2ff;
	background-color: #f0f5ff;
}

.axilweb-message {
	padding: 14px 18px;
	margin-bottom: 25px;
	border-radius: 8px;
	font-size: 14px;
	line-height: 1.5;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.axilweb-message.success {
	background-color: #e8f5e9;
	color: #1b5e20;
	border: 1px solid #c8e6c9;
}

.axilweb-message.error {
	background-color: #ffebee;
	color: #c62828;
	border: 1px solid #ffcdd2;
	font-weight: 500;
}

.axilweb-cluster[data-cluster-key='unclustered'] {
	border: 1px dashed #ff9800;
}

.axilweb-cluster[data-cluster-key='unclustered'] .axilweb-cluster-header {
	background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
	border-bottom: 1px solid #ffe0b2;
}

.axilweb-cluster[data-cluster-key='unclustered'] .axilweb-cluster-title {
	color: #e65100;
}

.axilweb-cluster[data-cluster-key='unclustered'] .axilweb-keyword-item {
	background: #fff3e0;
	border-color: #ffe0b2;
	color: #e65100;
}

.axilweb-cluster[data-cluster-key='unclustered'] .axilweb-keyword-item:hover {
	background: #ffe0b2;
}

/* Loading Animation */
.axilweb-loading {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 3px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	border-top-color: white;
	animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

/* Responsive Design */
@media (max-width: 768px) {
	.axilweb-tool-title h1 {
		font-size: 20px;
	}

	.axilweb-tool-title p {
		font-size: 20px;
	}

	.axilweb-card-body {
		padding: 1.5rem;
	}

	.axilweb-btn-group {
		flex-direction: column;
	}

	.axilweb-radio-group {
		flex-direction: column;
	}

	.axilweb-metrics {
		grid-template-columns: repeat(2, 1fr);
	}

	.axilweb-cluster-keywords {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 480px) {
	.axilweb-keyword-clustering {
		padding: 1rem 0;
	}

	.axilweb-metrics {
		grid-template-columns: 1fr;
	}
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
	:root {
		--text-primary: #f9fafb;
		--text-secondary: #d1d5db;
		--text-muted: #9ca3af;

		--bg-primary: #1f2937;
		--bg-secondary: #111827;
		--bg-tertiary: #374151;

		--border-light: #374151;
		--border-medium: #4b5563;
	}
}

/* Focus Styles for Accessibility */

/* Print Styles */
@media print {
	.axilweb-keyword-clustering {
		background: white;
		padding: 0;
	}

	.axilweb-card {
		box-shadow: none;
		border: 1px solid #ccc;
	}

	.axilweb-btn {
		display: none;
	}
}
