/* Bottom Panel - Enterprise Professional Design */
.aihc-bottom-panel {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	background: #ffffff;
	box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.15);
	z-index: 999999;
	transform: translateY(100%);
	transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
	max-height: 85vh;
	height: auto;
	border-top: 4px solid #2563eb;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
	display: flex;
	flex-direction: column;
}

.aihc-bottom-panel.aihc-show {
	transform: translateY(0);
}

.aihc-bottom-panel.aihc-minimized {
	transform: translateY(calc(100% - 60px));
	max-height: 60px;
	height: 60px;
	overflow: hidden;
}

/* Header Styling */
.aihc-panel-header {
	background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
	color: white;
	padding: 16px 26px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-shrink: 0;
	border-bottom: none;
	box-shadow: 0 2px 8px rgba(30, 58, 138, 0.1);
}

.aihc-panel-title {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.3px;
}

.aihc-panel-icon {
	font-size: 18px;
	opacity: 0.95;
}

/* Toggle Button */
.aihc-toggle-btn {
	background: rgba(255, 255, 255, 0.15);
	color: white;
	border: none;
	border-radius: 8px;
	width: 36px;
	height: 36px;
	font-size: 18px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.25s ease;
	font-weight: bold;
	flex-shrink: 0;
}

.aihc-toggle-btn:hover {
	background: rgba(255, 255, 255, 0.25);
	transform: scale(1.05);
}

.aihc-toggle-btn:active {
	transform: scale(0.98);
}

/* Panel Content Layout */
.aihc-panel-content {
	display: flex;
	flex-direction: column;
	gap: 0;
	padding: 0;
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

/* Current Score Section */
.aihc-current-score-section {
	padding: 24px 26px;
	background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
	border-bottom: 1px solid #e2e8f0;
	flex-shrink: 0;
}

.aihc-current-score-display {
	text-align: center;
}

.aihc-current-score-title {
	font-size: 11px;
	font-weight: 700;
	color: #1e3a8a;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	margin-bottom: 12px;
	opacity: 0.8;
}

.aihc-score-display {
	font-size: 56px;
	font-weight: 800;
	color: white;
	border-radius: 12px;
	padding: 12px 18px;
	margin: 10px 0;
	line-height: 1;
	box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
	display: inline-block;
	min-width: 120px;
	letter-spacing: -1px;
}

.aihc-score-subtitle {
	font-size: 13px;
	color: #1e40af;
	margin-top: 8px;
	font-weight: 700;
}

.aihc-score-recommendation {
	font-size: 11px;
	color: #475569;
	margin-top: 6px;
	font-weight: 500;
	letter-spacing: 0.2px;
}

.aihc-score-metadata {
	display: flex;
	justify-content: center;
	gap: 18px;
	margin-top: 10px;
	font-size: 11px;
	color: #64748b;
	flex-wrap: wrap;
}

.aihc-score-date,
.aihc-score-words {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

/* No Score Display */
.aihc-no-score {
	padding: 24px 16px;
	color: #94a3b8;
	font-size: 12px;
	text-align: center;
}

.aihc-no-score-icon {
	font-size: 28px;
	display: block;
	margin-bottom: 10px;
}

/* Controls Section */
.aihc-controls-section {
	padding: 16px 26px;
	background: #ffffff;
	border-bottom: 1px solid #e2e8f0;
	flex-shrink: 0;
}

.aihc-panel-controls {
	display: flex;
	gap: 10px;
	align-items: center;
}

/* Algorithm Selector */
.aihc-algorithm-select {
	flex: 1;
	padding: 9px 12px;
	border: 1.5px solid #cbd5e1;
	border-radius: 8px;
	font-size: 12px;
	font-weight: 500;
	background: white;
	cursor: pointer;
	transition: all 0.2s ease;
	color: #1e293b;
	min-width: 0;
}

.aihc-algorithm-select:hover {
	border-color: #2563eb;
	background: #f8fafc;
}

.aihc-algorithm-select:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.aihc-algorithm-select option {
	background: #ffffff;
	color: #1e293b;
	padding: 8px;
}

/* Check Button */
.aihc-check-btn {
	padding: 9px 14px;
	background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
	color: white;
	border: none;
	border-radius: 8px;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
	transition: all 0.25s ease;
	display: flex;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
	letter-spacing: 0.3px;
	box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
	flex-shrink: 0;
}

.aihc-check-btn .aihc-icon {
	font-size: 14px;
}

.aihc-check-btn .aihc-text {
	font-weight: 700;
}

.aihc-check-btn:hover:not(:disabled) {
	transform: translateY(-3px);
	box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
	background: linear-gradient(135deg, #1d4ed8 0%, #1e3a8a 100%);
}

.aihc-check-btn:active:not(:disabled) {
	transform: translateY(-1px);
}

.aihc-check-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* History Section */
.aihc-history-section {
	padding: 16px 26px;
	background: #fafbfc;
	border-bottom: 1px solid #e2e8f0;
	flex-shrink: 0;
	max-height: 280px;
	display: flex;
	flex-direction: column;
}

.aihc-history-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
	cursor: pointer;
	user-select: none;
	flex-shrink: 0;
}

.aihc-history-title {
	font-size: 12px;
	font-weight: 700;
	color: #1e3a8a;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.aihc-history-toggle {
	font-size: 16px;
	color: #2563eb;
	font-weight: bold;
	transition: transform 0.2s ease;
	width: 20px;
	text-align: center;
}

.aihc-history-list {
	list-style: none;
	padding: 0;
	margin: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	flex: 1;
	min-height: 0;
}

.aihc-history-list.aihc-collapsed {
	display: none;
}

.aihc-history-item {
	padding: 10px;
	background: white;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	margin-bottom: 8px;
	font-size: 11px;
	color: #475569;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
}

.aihc-history-item:last-child {
	margin-bottom: 0;
}

.aihc-history-item-left {
	flex: 1;
	min-width: 0;
}

.aihc-history-item-text {
	font-weight: 500;
	color: #1e293b;
	margin-bottom: 4px;
	word-break: break-word;
}

.aihc-history-item-meta {
	font-size: 10px;
	color: #94a3b8;
}

.aihc-history-item-score {
	font-size: 14px;
	font-weight: 700;
	color: white;
	background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
	padding: 3px 7px;
	border-radius: 6px;
	min-width: 45px;
	text-align: center;
	flex-shrink: 0;
}

.aihc-history-empty {
	padding: 12px;
	text-align: center;
	color: #cbd5e1;
	font-size: 11px;
	font-style: italic;
}

.aihc-history-clear-btn {
	margin-top: 10px;
	width: 100%;
	padding: 8px;
	background: transparent;
	color: #e74c3c;
	border: 1px solid #fed7d7;
	border-radius: 6px;
	font-size: 11px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	letter-spacing: 0.3px;
	flex-shrink: 0;
}

.aihc-history-clear-btn:hover {
	background: #fee;
	border-color: #e74c3c;
}

/* Criteria Section */
.aihc-criteria-section {
	padding: 16px 26px;
	background: #ffffff;
	border-top: 1px solid #e2e8f0;
	flex-shrink: 0;
}

.aihc-criteria-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0;
	cursor: pointer;
	user-select: none;
}

.aihc-criteria-title {
	font-size: 12px;
	font-weight: 700;
	color: #1e3a8a;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.aihc-criteria-toggle {
	font-size: 14px;
	color: #2563eb;
	font-weight: bold;
	transition: transform 0.2s ease;
}

.aihc-criteria-content {
	margin-top: 12px;
	padding: 12px;
	background: #f8fafc;
	border-radius: 8px;
	border: 1px solid #e2e8f0;
}

.aihc-criteria-content.aihc-collapsed {
	display: none;
}

.aihc-criteria-list {
	list-style: none;
	padding: 0;
	margin: 0;
	font-size: 11px;
	color: #475569;
}

.aihc-criteria-item {
	padding: 6px 0;
	border-bottom: 1px solid #e2e8f0;
}

.aihc-criteria-item:last-child {
	border-bottom: none;
}

.aihc-criteria-item-name {
	font-weight: 600;
	color: #1e293b;
	display: inline-block;
	min-width: 140px;
}

.aihc-criteria-item-explanation {
	display: block;
	font-size: 10px;
	color: #64748b;
	margin-top: 2px;
}

/* Notification Area */
.aihc-notification {
	position: fixed;
	top: 20px;
	right: 20px;
	background: white;
	border-left: 4px solid #2563eb;
	padding: 16px 20px;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	z-index: 1000000;
	font-size: 13px;
	color: #1e293b;
	font-weight: 500;
	max-width: 320px;
	animation: slideIn 0.3s ease;
}

.aihc-notification.aihc-success {
	border-left-color: #10b981;
	background: #f0fdf4;
	color: #047857;
}

.aihc-notification.aihc-error {
	border-left-color: #ef4444;
	background: #fef2f2;
	color: #dc2626;
}

.aihc-notification.aihc-warning {
	border-left-color: #f59e0b;
	background: #fffbeb;
	color: #d97706;
}

@keyframes slideIn {
	from {
		transform: translateX(400px);
		opacity: 0;
	}
	to {
		transform: translateX(0);
		opacity: 1;
	}
}

/* Responsive Design */
@media (max-width: 768px) {
	.aihc-bottom-panel {
		max-height: 95vh;
	}

	.aihc-panel-header {
		padding: 14px 20px;
	}

	.aihc-current-score-section {
		padding: 18px 20px;
	}

	.aihc-score-display {
		font-size: 48px;
		padding: 10px 16px;
		min-width: 100px;
	}

	.aihc-controls-section {
		padding: 12px 20px;
	}

	.aihc-panel-controls {
		gap: 8px;
	}

	.aihc-algorithm-select {
		padding: 8px 10px;
		font-size: 11px;
	}

	.aihc-check-btn {
		padding: 8px 12px;
		font-size: 11px;
	}

	.aihc-history-section {
		padding: 12px 20px;
		max-height: 200px;
	}

	.aihc-criteria-section {
		padding: 12px 20px;
	}
}

/* Scrollbar Styling */
.aihc-panel-content::-webkit-scrollbar,
.aihc-history-list::-webkit-scrollbar {
	width: 6px;
}

.aihc-panel-content::-webkit-scrollbar-track,
.aihc-history-list::-webkit-scrollbar-track {
	background: transparent;
}

.aihc-panel-content::-webkit-scrollbar-thumb,
.aihc-history-list::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 3px;
}

.aihc-panel-content::-webkit-scrollbar-thumb:hover,
.aihc-history-list::-webkit-scrollbar-thumb:hover {
	background: #94a3b8;
}

/* Loading State */
.aihc-loading {
	opacity: 0.6;
	pointer-events: none;
}

/* Animations */
@keyframes pulse {
	0%, 100% {
		opacity: 1;
	}
	50% {
		opacity: 0.5;
	}
}

.aihc-checking {
	animation: pulse 1.5s ease-in-out infinite;
}
