/* Pressline Tools - Design System */
/* Based on dark-first monochromatic design */

@import url("https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;600;700&display=swap");

:root {
	/* Background Layers */
	--bg-primary: #0a0a0a;
	--bg-secondary: #121212;
	--bg-tertiary: #1e1e1e;
	--bg-quaternary: #2a2a2a;
	--bg-hover: #333333;

	/* Text Hierarchy */
	--text-primary: #ffffff;
	--text-secondary: #e0e0e0;
	--text-muted: #a0a0a0;
	--text-disabled: #666666;

	/* Accent & Status Colors */
	--accent: #4a90e2;
	--accent-hover: #357abd;
	--accent-light: rgba(74, 144, 226, 0.1);

	--success: #10b981;
	--danger: #ef4444;
	--warning: #f59e0b;
	--info: #06b6d4;

	/* Border System */
	--border: #333333;
	--border-light: #404040;
	--border-focus: var(--accent);

	/* Border Radius */
	--radius: 16px;
	--radius-md: 12px;
	--radius-sm: 8px;
	--radius-xs: 6px;

	/* Shadows */
	--shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	--shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
	--shadow-focus: 0 0 0 3px var(--accent-light);

	/* Transitions */
	--transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
	--transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
	font-family:
		"Lexend",
		-apple-system,
		BlinkMacSystemFont,
		"Segoe UI",
		"Roboto",
		"Oxygen",
		"Ubuntu",
		"Cantarell",
		sans-serif;
	font-size: 14px;
	line-height: 1.6;
	color: var(--text-secondary);
	background: var(--bg-primary);
	min-height: 100vh;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
	color: var(--text-primary);
	font-weight: 600;
	letter-spacing: -0.02em;
}

h1 {
	font-size: 1.75rem;
}
h2 {
	font-size: 1.35rem;
}
h3 {
	font-size: 1.15rem;
}

a {
	color: var(--accent);
	text-decoration: none;
	transition: var(--transition);
}

a:hover {
	color: var(--accent-hover);
}

/* Header */
.header {
	background: rgba(18, 18, 18, 0.8);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--border);
	padding: 1rem 2rem;
	position: sticky;
	top: 0;
	z-index: 1000;
}

.header-content {
	max-width: 1400px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.logo {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	font-size: 1.35rem;
	font-weight: 600;
	color: var(--text-primary);
	text-decoration: none;
}

.logo iconify-icon {
	color: var(--accent);
}

.nav {
	display: flex;
	gap: 1.5rem;
	align-items: center;
}

.nav a {
	color: var(--text-muted);
	text-decoration: none;
	transition: var(--transition);
	font-size: 14px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.nav a:hover {
	color: var(--text-primary);
}

.nav a.active {
	color: var(--accent);
}

.nav a iconify-icon {
	vertical-align: middle;
}

/* Container */
.container {
	max-width: 1400px;
	margin: 0 auto;
	padding: 2rem;
}

/* Page Header */
.page-header {
	margin-bottom: 2rem;
}

.page-header-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.5rem;
}

.page-title {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.page-subtitle {
	color: var(--text-muted);
	font-size: 14px;
}

/* Buttons */
.btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 10px 18px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: transparent;
	color: var(--text-secondary);
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: var(--transition);
	text-decoration: none;
}

.btn:hover {
	background: var(--bg-tertiary);
	border-color: var(--border-light);
}

.btn-primary {
	background: var(--accent);
	border-color: var(--accent);
	color: #ffffff;
}

.btn-primary:hover {
	background: var(--accent-hover);
	border-color: var(--accent-hover);
}

.btn-icon {
	padding: 8px;
	background: transparent;
	border: 1px solid transparent;
}

.btn-icon:hover {
	background: var(--bg-hover);
}

.btn-sm {
	padding: 6px 12px;
	font-size: 13px;
}

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

/* Cards */
.card {
	background: linear-gradient(135deg, var(--bg-secondary) 0%, #0f0f0f 100%);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 1.5rem;
	transition: var(--transition);
	position: relative;
	overflow: hidden;
}

.card::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 2px;
	background: linear-gradient(
		90deg,
		transparent,
		var(--border-light),
		transparent
	);
}

.card:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow);
	border-color: var(--border-light);
}

.card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1rem;
}

.card-title {
	font-size: 1.15rem;
	font-weight: 600;
	color: var(--text-primary);
}

.card-actions {
	display: flex;
	gap: 0.5rem;
}

/* Tools Grid */
.tools-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 1.5rem;
}

.tool-card {
	cursor: pointer;
}

.tool-card-body {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.tool-icon {
	width: 100%;
	height: 120px;
	border-radius: var(--radius-sm);
	border: 1px solid var(--border);
	position: relative;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 48px;
	color: var(--accent);
	background: var(--bg-tertiary);
}

.tool-name {
	font-size: 1.15rem;
	font-weight: 600;
	color: var(--text-primary);
}

.tool-description {
	font-size: 13px;
	color: var(--text-muted);
}

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

.form-label {
	display: block;
	margin-bottom: 0.5rem;
	font-weight: 500;
	color: var(--text-primary);
	font-size: 14px;
}

.form-input,
.form-textarea,
.form-select {
	width: 100%;
	padding: 12px 16px;
	background: var(--bg-tertiary);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	color: var(--text-primary);
	font-size: 14px;
	font-family: inherit;
	transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: var(--shadow-focus);
	background: var(--bg-quaternary);
}

.form-textarea {
	resize: vertical;
	min-height: 100px;
}

.form-hint {
	margin-top: 0.5rem;
	font-size: 12px;
	color: var(--text-muted);
}

/* Modal */
.modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.8);
	backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2000;
	animation: fadeIn 0.2s ease;
}

.modal {
	background: var(--bg-secondary);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	max-width: 800px;
	width: 90%;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	animation: slideUp 0.3s ease;
	box-shadow: var(--shadow-lg);
}

.modal-header {
	padding: 1.5rem;
	border-bottom: 1px solid var(--border);
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.modal-title {
	font-size: 1.15rem;
	font-weight: 600;
	color: var(--text-primary);
}

.modal-body {
	padding: 1.5rem;
	overflow-y: auto;
}

.modal-footer {
	padding: 1.5rem;
	border-top: 1px solid var(--border);
	display: flex;
	gap: 0.75rem;
	justify-content: flex-end;
}

/* Alert */
.alert {
	padding: 1rem;
	border-radius: var(--radius-sm);
	margin-bottom: 1.5rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 0.9rem;
}

.alert-danger {
	background: rgba(239, 68, 68, 0.1);
	border: 1px solid rgba(239, 68, 68, 0.3);
	color: #ef4444;
}

.alert-info {
	background: rgba(59, 130, 246, 0.1);
	border: 1px solid rgba(59, 130, 246, 0.3);
	color: #3b82f6;
}

.alert-success {
	background: rgba(16, 185, 129, 0.1);
	border: 1px solid rgba(16, 185, 129, 0.3);
	color: var(--success);
}

/* Login Page */
.login-container {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem;
	background: var(--bg-primary);
}

.login-card {
	width: 100%;
	max-width: 420px;
	background: var(--bg-secondary);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 2.5rem;
	box-shadow: var(--shadow-lg);
}

.login-header {
	text-align: center;
	margin-bottom: 2rem;
}

.login-header h1 {
	margin: 1rem 0 0.5rem;
	font-size: 2rem;
	color: var(--text-primary);
}

.login-subtitle {
	color: var(--text-muted);
	font-size: 0.9rem;
}

.login-form {
	margin-bottom: 1.5rem;
}

.login-divider {
	position: relative;
	text-align: center;
	margin: 1.5rem 0;
}

.login-divider::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 1px;
	background: var(--border);
}

.login-divider span {
	position: relative;
	display: inline-block;
	padding: 0 1rem;
	background: var(--bg-secondary);
	color: var(--text-muted);
	font-size: 0.875rem;
}

/* Animations */
@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes slideUp {
	from {
		transform: translateY(30px) scale(0.96);
		opacity: 0;
	}
	to {
		transform: translateY(0) scale(1);
		opacity: 1;
	}
}

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

/* Loading Spinner */
.spinner {
	animation: spin 1s linear infinite;
}

/* Toast */
.toast {
	position: fixed;
	bottom: 2rem;
	right: 2rem;
	background: var(--bg-secondary);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 1rem 1.5rem;
	box-shadow: var(--shadow-lg);
	color: var(--text-primary);
	z-index: 3000;
	opacity: 0;
	transform: translateY(20px);
	transition: all 0.3s ease;
}

.toast.show {
	opacity: 1;
	transform: translateY(0);
}

/* Responsive */
@media (max-width: 1024px) {
	.tools-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 768px) {
	.container {
		padding: 1rem;
	}

	.header {
		padding: 1rem;
	}

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

	.page-header-top {
		flex-direction: column;
		align-items: flex-start;
		gap: 1rem;
	}
}

/* Tool Page Controls Panel */
.controls {
	position: fixed;
	bottom: 20px;
	left: 20px;
	right: 20px;
	background: rgba(18, 18, 18, 0.95);
	backdrop-filter: blur(20px);
	padding: 20px;
	border-radius: var(--radius);
	box-shadow: var(--shadow-lg);
	border: 1px solid var(--border);
	z-index: 1000;
	height: auto;
	min-height: 120px;
	max-height: fit-content;
	overflow: hidden;
	transition: var(--transition-slow);
	color: var(--text-primary);
}

.controls.collapsed {
	height: 0;
	min-height: 0;
	padding: 0;
	overflow: hidden;
}

.floating-toggle-btn {
	position: fixed;
	bottom: 140px;
	right: 30px;
	background: rgba(18, 18, 18, 0.95);
	backdrop-filter: blur(20px);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	width: 44px;
	height: 44px;
	color: var(--text-primary);
	font-size: 18px;
	cursor: pointer;
	transition: var(--transition);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1001;
	box-shadow: var(--shadow);
}

.floating-toggle-btn:hover {
	background: var(--bg-hover);
	transform: scale(1.05);
	box-shadow: var(--shadow-lg);
}

.controls-content {
	transition: var(--transition);
	display: flex;
	flex-direction: row;
	gap: 20px;
	width: 100%;
	height: auto;
	overflow-y: hidden;
	overflow-x: auto;
}

.controls.collapsed .controls-content {
	opacity: 0;
	pointer-events: none;
}

.controls-content::-webkit-scrollbar {
	height: 6px;
}

.controls-content::-webkit-scrollbar-track {
	background: var(--bg-tertiary);
	border-radius: 3px;
}

.controls-content::-webkit-scrollbar-thumb {
	background: var(--accent);
	border-radius: 3px;
	border: 1px solid var(--border);
}

.controls-content::-webkit-scrollbar-thumb:hover {
	background: var(--accent-hover);
}

.section-title {
	font-size: 13px;
	font-weight: 600;
	color: var(--text-primary);
	margin-bottom: 20px;
	text-transform: uppercase;
	letter-spacing: 1px;
	padding-left: 0px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.control-section {
	background: transparent;
	border-radius: var(--radius-sm);
	padding: 20px;
	border: none;
	transition: var(--transition);
	flex: 0 0 auto;
	min-width: 280px;
	width: 320px;
}

.control-section:hover {
	background: rgba(255, 255, 255, 0.02);
}

.control-group {
	margin-bottom: 20px;
	background: rgba(255, 255, 255, 0.02);
	padding: 16px;
	border-radius: var(--radius-sm);
	border: none;
	height: auto;
	min-height: 70px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	transition: var(--transition);
}

.control-group:last-child {
	margin-bottom: 0;
}

.control-group:hover {
	background: rgba(255, 255, 255, 0.04);
	transform: translateY(-1px);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.control-group label {
	display: block;
	margin-bottom: 10px;
	font-size: 12px;
	font-weight: 500;
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	display: flex;
	align-items: center;
	gap: 6px;
}

.control-group input[type="range"] {
	width: 100%;
	height: 6px;
	border-radius: 3px;
	background: var(--bg-quaternary);
	outline: none;
	-webkit-appearance: none;
	cursor: pointer;
	margin: 8px 0;
}

.control-group input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--accent);
	cursor: pointer;
	border: 2px solid white;
	box-shadow: 0 2px 8px rgba(74, 144, 226, 0.4);
}

.control-group input[type="range"]::-moz-range-thumb {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--accent);
	cursor: pointer;
	border: 2px solid white;
	box-shadow: 0 2px 8px rgba(74, 144, 226, 0.4);
}

.value-display {
	display: inline-block;
	margin-left: auto;
	font-size: 11px;
	color: var(--accent);
	font-family: monospace;
	font-weight: 600;
	background: var(--accent-light);
	padding: 4px 8px;
	border-radius: var(--radius-xs);
	border: 1px solid rgba(74, 144, 226, 0.2);
}

.button-group {
	display: flex;
	gap: 12px;
	margin-top: 20px;
	flex-wrap: wrap;
}

.button-group button {
	flex: 1;
	min-width: auto;
	padding: 8px 12px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: rgba(255, 255, 255, 0.05);
	color: var(--text-primary);
	font-size: 11px;
	font-weight: 500;
	cursor: pointer;
	transition: var(--transition);
	backdrop-filter: blur(10px);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
}

.button-group button:hover {
	background: rgba(255, 255, 255, 0.1);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
	border-color: var(--border-light);
}

.button-group button:active {
	transform: translateY(0);
}

.button-group button.secondary {
	background: rgba(108, 117, 125, 0.2);
	border-color: rgba(108, 117, 125, 0.3);
}

.button-group button.secondary:hover {
	background: rgba(108, 117, 125, 0.3);
}

.button-group button.success {
	background: rgba(16, 185, 129, 0.2);
	border-color: rgba(16, 185, 129, 0.3);
	color: var(--success);
}

.button-group button.success:hover {
	background: rgba(16, 185, 129, 0.3);
}

.button-group button.warning {
	background: rgba(245, 158, 11, 0.2);
	border-color: rgba(245, 158, 11, 0.3);
	color: var(--warning);
}

.button-group button.warning:hover {
	background: rgba(245, 158, 11, 0.3);
}

.button-group button.active {
	background: var(--accent-light);
	border-color: var(--accent);
	color: var(--accent);
}

.button-group button.active:hover {
	background: rgba(74, 144, 226, 0.3);
}

/* Color Palette */
.color-palette {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 6px;
	margin-top: 10px;
}

.color-option {
	width: 100%;
	height: 28px;
	border-radius: var(--radius-xs);
	cursor: pointer;
	border: none;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
	transition: var(--transition);
	position: relative;
}

.color-option:hover {
	transform: scale(1.05);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.color-option.selected {
	transform: scale(1.08);
	box-shadow: 0 0 0 2px var(--accent);
}

.color-input-group {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 10px 0;
}

.color-input-group input[type="color"] {
	width: 36px;
	height: 36px;
	border: none;
	border-radius: var(--radius-sm);
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	transition: var(--transition);
}

.color-input-group input[type="color"]:hover {
	transform: scale(1.05);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.color-input {
	flex: 1;
	padding: 8px 12px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	font-family: "SF Mono", "Monaco", "Inconsolata", "Roboto Mono", monospace;
	font-size: 11px;
	background: var(--bg-tertiary);
	color: var(--text-primary);
	transition: var(--transition);
}

.color-input:focus {
	outline: none;
	border-color: var(--accent);
	background: var(--bg-quaternary);
	box-shadow: var(--shadow-focus);
}

.color-input::placeholder {
	color: var(--text-muted);
}

/* Checkbox Group */
.checkbox-group {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 10px 0;
}

.checkbox-group input[type="checkbox"] {
	width: 18px;
	height: 18px;
	accent-color: var(--accent);
}

/* Status Display */
.status-display {
	background: var(--bg-tertiary);
	padding: 8px 12px;
	border-radius: var(--radius-xs);
	font-family: monospace;
	font-size: 11px;
	margin-top: 10px;
	border-left: 3px solid var(--accent);
	color: var(--text-muted);
}

/* Progress Bar */
.progress-bar {
	width: 100%;
	height: 6px;
	background: var(--bg-quaternary);
	border-radius: 3px;
	overflow: hidden;
	margin: 10px 0;
}

.progress-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--accent), var(--accent-hover));
	width: 0%;
	transition: width 0.3s ease;
}

.hidden {
	display: none;
}

/* Mobile Responsive for Controls */
@media (max-width: 768px) {
	.controls {
		bottom: 10px;
		left: 10px;
		right: 10px;
		height: 50vh;
		border-radius: var(--radius);
	}

	.controls-content {
		flex-direction: row;
		gap: 12px;
		height: auto;
	}

	.control-section {
		min-width: 250px;
		width: 280px;
		padding: 12px;
	}

	.button-group {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
		gap: 6px;
	}

	.section-title {
		font-size: 11px;
		margin-bottom: 8px;
	}

	.control-group label {
		font-size: 10px;
		margin-bottom: 4px;
	}

	.button-group button {
		padding: 6px 8px;
		font-size: 10px;
		min-height: 32px;
	}

	.floating-toggle-btn {
		bottom: 60vh;
		right: 15px;
		width: 36px;
		height: 36px;
		font-size: 16px;
	}
}

@media (max-width: 480px) {
	.controls {
		bottom: 5px;
		left: 5px;
		right: 5px;
		padding: 15px;
		height: 45vh;
	}

	.controls-content {
		gap: 10px;
		flex-direction: row;
	}

	.control-section {
		padding: 10px;
		min-width: 220px;
		width: 250px;
	}

	.section-title {
		font-size: 10px;
		margin-bottom: 6px;
	}

	.button-group {
		grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
		gap: 4px;
	}

	.button-group button {
		padding: 4px 6px;
		font-size: 9px;
		min-height: 28px;
	}

	.floating-toggle-btn {
		bottom: 55vh;
		right: 10px;
		width: 32px;
		height: 32px;
		font-size: 14px;
	}
}

/* Back to Index Link */
.back-link {
	position: fixed;
	top: 20px;
	left: 20px;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 10px 16px;
	background: rgba(18, 18, 18, 0.95);
	backdrop-filter: blur(20px);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	color: var(--text-secondary);
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	z-index: 1001;
	transition: var(--transition);
}

.back-link:hover {
	background: var(--bg-hover);
	color: var(--text-primary);
	border-color: var(--border-light);
}

.back-link iconify-icon {
	font-size: 16px;
}
