/* Tool Hero Section - Required by tool-page-structure.mdc */
.tool-hero {
	display: flex;
	flex-wrap: wrap;
	gap: 32px;
	align-items: flex-start;
	margin-bottom: 2rem;
}

.hero-text {
	flex: 1;
	min-width: 260px;
}

.hero-text h1 {
	font-size: 40px;
	font-weight: 700;
	line-height: 1.2;
	margin-bottom: 0;
}

.hero-subtitle {
	font-size: 18px;
	color: var(--text-muted);
	max-width: 640px;
	margin-bottom: 1rem;
	margin-top: 0;
}

@media (max-width: 767px) {
	.hero-text h1 {
		font-size: clamp(1.75rem, 5vw, 2.5rem);
	}
	
	.hero-subtitle {
		font-size: clamp(1rem, 3vw, 1.125rem);
	}
}

/* Reverse Hex Interface */
.reverse-hex-interface {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2rem;
	margin-bottom: 3rem;
	align-items: start;
}

/* Card Styles */
.hex-card {
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	overflow: hidden;
	transition: box-shadow 0.3s ease, transform 0.2s ease;
	display: flex;
	flex-direction: column;
	height: 100%;
}

.hex-card:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.result-card {
	opacity: 1;
	transform: translateY(0);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.result-card.show {
	opacity: 1;
	transform: translateY(0);
}

.card-header {
	padding: 1.5rem 1.5rem 1rem;
	border-bottom: 1px solid #f0f0f0;
	position: relative;
}

.card-title {
	font-size: 1.5rem;
	font-weight: 600;
	margin: 0 0 0.5rem 0;
	color: #1a1a1a;
}

.card-description {
	font-size: 0.9rem;
	color: #666;
	margin: 0;
}

.card-body {
	padding: 1.5rem;
	flex: 1;
	display: flex;
	flex-direction: column;
	transition: opacity 0.3s ease;
}

/* Input Styles */
.input-group {
	margin-bottom: 1.5rem;
}

.input-label {
	display: block;
	font-size: 0.9rem;
	font-weight: 500;
	color: #333;
	margin-bottom: 0.5rem;
}

.hex-input {
	width: 100%;
	padding: 1rem;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	
	font-size: 1rem;
	resize: vertical;
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
	background: #fafafa;
}

.hex-input:focus {
	outline: none;
	border-color: #4a90e2;
	box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
	background: #ffffff;
}

.hex-input::placeholder {
	color: #999;
}

.input-hint {
	display: block;
	font-size: 0.85rem;
	color: #666;
	margin-top: 0.5rem;
}

/* Options Group */
.options-group {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	margin-bottom: 1.5rem;
}

.option-item {
	display: flex;
	flex-direction: column;
}

.option-label {
	font-size: 0.9rem;
	font-weight: 500;
	color: #333;
	margin-bottom: 0.5rem;
}

.option-select {
	width: 100%;
	padding: 0.75rem 1rem;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	font-size: 0.95rem;
	background: #ffffff;
	cursor: pointer;
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.option-select:focus {
	outline: none;
	border-color: #4a90e2;
	box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* Checkbox Styles */
.checkbox-label {
	display: flex;
	align-items: center;
	cursor: pointer;
	user-select: none;
}

.checkbox-input {
	width: 20px;
	height: 20px;
	margin-right: 0.75rem;
	cursor: pointer;
	accent-color: #4a90e2;
}

.checkbox-text {
	font-size: 0.95rem;
	color: #333;
}

/* Action Buttons */
.action-buttons {
	display: flex;
	gap: 1rem;
	flex-wrap: wrap;
	margin-top: auto;
}

.btn-primary,
.btn-secondary {
	padding: 0.875rem 2rem;
	border: none;
	border-radius: 8px;
	font-size: 1rem;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.3s ease;
	flex: 1;
	min-width: 140px;
}

.btn-primary {
	background: linear-gradient(135deg, #4a90e2 0%, #357abd 100%);
	color: #ffffff;
	box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.btn-primary:hover {
	background: linear-gradient(135deg, #357abd 0%, #2a5f8f 100%);
	box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
	transform: translateY(-1px);
}

.btn-primary:active {
	transform: translateY(0);
}

.btn-secondary {
	background: #f5f5f5;
	color: #333;
	border: 2px solid #e0e0e0;
}

.btn-secondary:hover {
	background: #e8e8e8;
	border-color: #d0d0d0;
}

.btn-secondary.copied {
	background: #10b981;
	color: #ffffff;
	border-color: #10b981;
}

/* Result Card */
.result-info {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	flex: 1;
}

.info-row {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.info-label {
	font-size: 0.9rem;
	font-weight: 500;
	color: #666;
}

.info-value {
	
	font-size: 0.95rem;
	color: #1a1a1a;
	word-break: break-all;
	padding: 0.5rem;
	background: #f8f8f8;
	border-radius: 6px;
}

.hex-output {
	width: 100%;
	padding: 1rem;
	border: 2px solid #e0e0e0;
	border-radius: 8px;
	
	font-size: 1rem;
	resize: vertical;
	background: #f8f8f8;
	color: #1a1a1a;
	cursor: text;
}

.hex-output:focus {
	outline: none;
	border-color: #4a90e2;
	box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
	background: #ffffff;
}

/* Stats */
.info-stats {
	display: flex;
	gap: 1.5rem;
	flex-wrap: wrap;
	padding-top: 1rem;
	border-top: 1px solid #f0f0f0;
}

.stat-item {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.stat-label {
	font-size: 0.85rem;
	color: #666;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.stat-value {
	font-size: 1.1rem;
	font-weight: 600;
	color: #4a90e2;
}

/* Loader */
.result-loader {
	display: none;
	width: 24px;
	height: 24px;
	border: 3px solid #f3f3f3;
	border-top: 3px solid #4a90e2;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
	position: absolute;
	right: 1.5rem;
	top: 1.5rem;
}

.result-loader.show {
	display: block;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 991px) {
	.reverse-hex-interface {
		grid-template-columns: 1fr;
		gap: 1.5rem;
	}
}

@media (max-width: 767px) {
	.reverse-hex-interface {
		gap: 1.5rem;
	}

	.card-header {
		padding: 1.25rem 1.25rem 0.875rem;
	}

	.card-body {
		padding: 1.25rem;
	}

	.card-title {
		font-size: 1.25rem;
	}

	.hex-input,
	.hex-output {
		font-size: 0.9rem;
		padding: 0.875rem;
	}

	.action-buttons {
		flex-direction: column;
	}

	.btn-primary,
	.btn-secondary {
		width: 100%;
		min-width: unset;
	}

	.info-stats {
		flex-direction: column;
		gap: 1rem;
	}

	.stat-value {
		font-size: 1rem;
	}
}

@media (max-width: 480px) {
	.tool-hero {
		margin-bottom: 1.5rem;
	}

	.hex-card {
		border-radius: 12px;
	}

	.card-header {
		padding: 1rem 1rem 0.75rem;
	}

	.card-body {
		padding: 1rem;
	}

	.options-group {
		gap: 1rem;
	}

	.input-group {
		margin-bottom: 1.25rem;
	}
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
	.hex-card {
		background: #1a1a1a;
		border: 1px solid #333;
	}

	.card-header {
		border-bottom-color: #333;
	}

	.card-title {
		color: #ffffff;
	}

	.card-description {
		color: #aaa;
	}

	.hex-input,
	.hex-output {
		background: #2a2a2a;
		border-color: #444;
		color: #ffffff;
	}

	.hex-input:focus,
	.hex-output:focus {
		background: #333;
		border-color: #4a90e2;
	}

	.input-label,
	.option-label,
	.checkbox-text {
		color: #e0e0e0;
	}

	.input-hint,
	.info-label {
		color: #aaa;
	}

	.info-value {
		background: #2a2a2a;
		color: #ffffff;
	}

	.option-select {
		background: #2a2a2a;
		border-color: #444;
		color: #ffffff;
	}

	.btn-secondary {
		background: #2a2a2a;
		border-color: #444;
		color: #e0e0e0;
	}

	.btn-secondary:hover {
		background: #333;
		border-color: #555;
	}

	.info-stats {
		border-top-color: #333;
	}
}
