* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
		Ubuntu, sans-serif;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	min-height: 100vh;
	padding: 20px;
}

.container {
	max-width: 1600px;
	margin: 0 auto;
	background: white;
	border-radius: 20px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	padding: 40px;
}

h1 {
	color: #667eea;
	margin-bottom: 10px;
	font-size: 2.5em;
}

.search-section {
	margin: 20px 0;
}

.search-input {
	width: 100%;
	max-width: 500px;
	padding: 12px 20px;
	font-size: 1em;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	transition: all 0.3s;
}

.search-input:focus {
	outline: none;
	border-color: #667eea;
	box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.controls {
	margin: 30px 0;
	display: flex;
	gap: 15px;
	flex-wrap: wrap;
	align-items: center;
}

.btn-group {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.nav-section {
	margin: 20px 0;
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 15px;
}

.btn {
	padding: 12px 25px;
	border: none;
	border-radius: 8px;
	font-size: 1em;
	cursor: pointer;
	background: #f0f0f0;
	transition: all 0.3s;
	font-weight: 600;
}

.btn:hover {
	background: #e0e0e0;
	transform: translateY(-2px);
}

.btn.active {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	color: white;
}

.btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

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

.nav-btn {
	padding: 10px 20px;
	background: #667eea;
	color: white;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-size: 1.2em;
	font-weight: bold;
	transition: all 0.3s;
}

.nav-btn:hover:not(:disabled) {
	background: #5568d3;
	transform: scale(1.05);
}

.nav-btn:disabled {
	background: #ccc;
	cursor: not-allowed;
}

.position-indicator {
	padding: 10px 20px;
	background: #f8f9fa;
	border-radius: 8px;
	font-weight: 600;
	color: #333;
}

.chart-wrapper {
	position: relative;
	background: #f8f9fa;
	border-radius: 12px;
	padding: 20px;
	margin: 20px 0;
}

.chart-container {
	position: relative;
	height: 700px;
	width: 100%;
}

.word-details {
	display: none;
	background: #ffffff;
	padding: 30px;
	border-radius: 12px;
	margin: 30px 0;
	border: 3px solid #667eea;
	animation: slideIn 0.3s ease;
}

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

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.word-details.active {
	display: block;
}

.word-details h2 {
	color: #667eea;
	margin-bottom: 20px;
	font-size: 2.5em;
}

.stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 20px;
	margin: 25px 0;
}

.stat-card {
	text-align: center;
	padding: 25px;
	background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
	border-radius: 12px;
	border: 2px solid #667eea30;
}

.stat-value {
	font-size: 2.5em;
	font-weight: bold;
	color: #667eea;
}

.stat-label {
	color: #666;
	margin-top: 5px;
	font-weight: 600;
}

.detail-section {
	margin: 30px 0;
}

.detail-section h3 {
	color: #333;
	margin-bottom: 15px;
	font-size: 1.5em;
}

.forms-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 15px;
	margin-top: 15px;
}

.form-card {
	background: #f8f9fa;
	padding: 18px;
	border-radius: 10px;
	border-left: 5px solid #667eea;
	transition: all 0.3s;
}

.form-card:hover {
	transform: translateX(5px);
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.form-word {
	font-weight: 700;
	font-size: 1.3em;
	color: #333;
	margin-bottom: 8px;
}

.form-count {
	color: #888;
	font-size: 1em;
	margin-bottom: 8px;
}

.form-expansion {
	color: white;
	background: #667eea;
	padding: 8px 12px;
	border-radius: 6px;
	font-size: 0.9em;
	margin-top: 10px;
	display: inline-block;
}

.close-btn {
	float: right;
	background: #ff6b6b;
	color: white;
	border: none;
	padding: 12px 24px;
	border-radius: 8px;
	cursor: pointer;
	font-size: 1em;
	font-weight: 600;
	transition: all 0.3s;
}

.close-btn:hover {
	background: #ff5252;
	transform: scale(1.05);
}

.search-box {
	flex: 1;
	min-width: 300px;
}

.search-box input {
	width: 100%;
	padding: 12px 20px;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	font-size: 1em;
	transition: border-color 0.3s;
}

.search-box input:focus {
	outline: none;
	border-color: #667eea;
}

.info-text {
	color: #666;
	font-size: 0.95em;
	margin: 10px 0;
}

/* Адаптивный дизайн для мобильных */
@media (max-width: 768px) {
	body {
		padding: 5px;
	}

	.container {
		padding: 10px 5px;
		border-radius: 10px;
	}

	h1 {
		font-size: 1.8em;
	}

	.subtitle-text {
		font-size: 0.75em !important;
		margin-bottom: 15px !important;
	}

	.arrows-hint {
		display: none;
	}

	.controls {
		flex-direction: column;
		align-items: stretch;
	}

	.btn-group {
		width: 100%;
		justify-content: center;
	}

	.btn {
		flex: 1;
		padding: 10px 15px;
		font-size: 0.9em;
	}

	.btn-100 {
		display: none;
	}

	.search-section {
		margin: 15px 0;
	}

	.search-input {
		width: 100%;
		max-width: 100%;
		font-size: 16px; /* Предотвращает зум на iOS */
	}

	.chart-container {
		height: 500px;
		margin: 0;
		padding: 0;
	}

	.chart-wrapper {
		margin: 0;
		padding: 0;
	}

	.nav-section {
		flex-wrap: wrap;
		gap: 10px;
	}

	.nav-btn {
		flex: 1;
		min-width: 100px;
		padding: 12px 15px;
		font-size: 1em;
	}

	.position-indicator {
		width: 100%;
		text-align: center;
		order: -1;
	}

	.forms-grid {
		grid-template-columns: 1fr;
	}

	.word-details {
		padding: 20px;
	}

	.word-details h2 {
		font-size: 1.8em;
	}

	.stat-value {
		font-size: 2em;
	}
}

@media (max-width: 480px) {
	.chart-container {
		height: 400px;
	}

	h1 {
		font-size: 1.5em;
	}

	.btn {
		font-size: 0.85em;
		padding: 8px 12px;
	}
}
