/* Image Tools Specific Styles */

/* Enhanced colour picker interface */
.color-picker-container {
	display: grid;
	grid-template-columns: 1fr 300px;
	gap: 24px;
	align-items: start;
}

.color-picker-sidebar {
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
	border-radius: 16px;
	padding: 24px;
	border: 1px solid var(--border);
	backdrop-filter: blur(10px);
	position: sticky;
	top: 24px;
}

.color-display {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-bottom: 24px;
}

.color-swatch {
	width: 100%;
	height: 80px;
	border-radius: 12px;
	border: 2px solid var(--border);
	cursor: pointer;
	transition: all 0.25s;
	position: relative;
}

.color-swatch:hover {
	transform: scale(1.02);
	box-shadow: 0 4px 16px rgba(229, 9, 20, 0.2);
}

.color-info {
	font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
	font-size: 14px;
	line-height: 1.4;
}

.color-value {
	font-size: 16px;
	font-weight: 600;
	margin-bottom: 4px;
}

.color-formats {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.format-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 12px;
	background: rgba(0, 0, 0, 0.2);
	border-radius: 8px;
	font-size: 13px;
}

.format-label {
	color: var(--text-muted);
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.format-value {
	font-weight: 600;
	font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
}

.copy-btn {
	background: linear-gradient(90deg, var(--accent-a), var(--accent-b));
	color: white;
	border: none;
	padding: 8px 16px;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
	width: 100%;
	margin-top: 8px;
}

.copy-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3);
}

.copy-btn.copied {
	background: #28a745;
}

.color-history {
	margin-top: 24px;
}

.color-history h4 {
	margin: 0 0 12px 0;
	font-size: 16px;
	font-weight: 700;
	color: var(--text);
}

.color-history-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
	gap: 8px;
	max-height: 200px;
	overflow-y: auto;
	padding-right: 8px;
}

.color-history-item {
	width: 40px;
	height: 40px;
	border-radius: 8px;
	border: 2px solid var(--border);
	cursor: pointer;
	transition: all 0.2s;
	position: relative;
}

.color-history-item:hover {
	transform: scale(1.1);
	box-shadow: 0 2px 8px rgba(229, 9, 20, 0.2);
}

.color-history-item.active {
	border-color: var(--accent-a);
	box-shadow: 0 0 0 2px rgba(229, 9, 20, 0.3);
}

/* Enhanced canvas styles */
.image-canvas {
	max-width: 100%;
	border-radius: 12px;
	border: 2px solid var(--border);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
	transition: all 0.25s;
	cursor: crosshair;
}

.image-canvas:hover {
	border-color: rgba(229, 9, 20, 0.3);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.image-canvas.loading {
	opacity: 0.7;
	cursor: wait;
}

/* Upload area */
.upload-area {
	border: 2px dashed var(--border);
	border-radius: 12px;
	padding: 40px 24px;
	text-align: center;
	transition: all 0.25s;
	cursor: pointer;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
}

.upload-area:hover {
	border-color: var(--accent-a);
	background: rgba(229, 9, 20, 0.05);
}

.upload-area.dragover {
	border-color: var(--accent-a);
	background: rgba(229, 9, 20, 0.1);
	transform: scale(1.02);
}

.upload-icon {
	font-size: 48px;
	margin-bottom: 16px;
	opacity: 0.6;
}

.upload-text {
	font-size: 18px;
	font-weight: 600;
	margin-bottom: 8px;
	color: var(--text);
}

.upload-subtext {
	color: var(--text-muted);
	font-size: 14px;
}

/* Background removal specific styles */
.bg-removal-methods {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
	margin: 24px 0;
}

.method-card {
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
	border-radius: 16px;
	padding: 24px;
	border: 1px solid var(--border);
	transition: all 0.25s;
}

.method-card:hover {
	transform: translateY(-2px);
	border-color: rgba(229, 9, 20, 0.3);
	box-shadow: 0 8px 24px rgba(229, 9, 20, 0.1);
}

.method-icon {
	font-size: 32px;
	margin-bottom: 12px;
}

.method-title {
	font-size: 18px;
	font-weight: 700;
	margin-bottom: 8px;
	color: var(--text);
}

.method-description {
	color: var(--text-muted);
	font-size: 14px;
	line-height: 1.5;
	margin-bottom: 16px;
}

.method-controls {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* Progress indicator */
.progress-container {
	margin: 16px 0;
}

.progress-bar {
	width: 100%;
	height: 8px;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 4px;
	overflow: hidden;
}

.progress-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--accent-a), var(--accent-b));
	border-radius: 4px;
	transition: width 0.3s ease;
}

/* Results area */
.results-area {
	margin-top: 24px;
	padding: 24px;
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
	border-radius: 12px;
	border: 1px solid var(--border);
}

.results-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-top: 16px;
}

.result-item {
	padding: 16px;
	background: rgba(0, 0, 0, 0.2);
	border-radius: 8px;
	text-align: center;
}

.result-label {
	font-size: 12px;
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 4px;
}

.result-value {
	font-size: 16px;
	font-weight: 600;
	font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
}

/* Tool tips */
.tooltip {
	position: relative;
	display: inline-block;
	cursor: help;
}

.tooltip .tooltip-text {
	visibility: hidden;
	width: 200px;
	background-color: rgba(0, 0, 0, 0.8);
	color: #fff;
	text-align: center;
	border-radius: 6px;
	padding: 8px 12px;
	position: absolute;
	z-index: 1;
	bottom: 125%;
	left: 50%;
	margin-left: -100px;
	opacity: 0;
	transition: opacity 0.3s;
	font-size: 12px;
	line-height: 1.4;
}

.tooltip:hover .tooltip-text {
	visibility: visible;
	opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.color-picker-container {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	.color-picker-sidebar {
		position: static;
		order: -1;
	}

	.bg-removal-methods {
		grid-template-columns: 1fr;
	}

	.results-grid {
		grid-template-columns: 1fr;
	}
}

/* Loading states */
.loading-spinner {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	border-top-color: var(--accent-a);
	animation: spin 1s ease-in-out infinite;
	margin-right: 8px;
}

@keyframes spin {
	to { transform: rotate(360deg); }
}

/* Success/error states */
.success-message {
	background: rgba(40, 167, 69, 0.1);
	border: 1px solid rgba(40, 167, 69, 0.3);
	color: #28a745;
	padding: 12px 16px;
	border-radius: 8px;
	margin: 12px 0;
}

.error-message {
	background: rgba(220, 53, 69, 0.1);
	border: 1px solid rgba(220, 53, 69, 0.3);
	color: #dc3545;
	padding: 12px 16px;
	border-radius: 8px;
	margin: 12px 0;
}

/* Background Remover Styles */
.background-remover-container {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 32px;
	margin-bottom: 32px;
}

.method-card {
	background: var(--panel);
	border-radius: 16px;
	padding: 24px;
	border: 1px solid var(--border);
	transition: all 0.25s;
}

.method-card:hover {
	border-color: var(--accent-a);
	box-shadow: 0 4px 16px rgba(229, 9, 20, 0.1);
}

.method-card h3 {
	color: var(--text);
	margin-bottom: 16px;
	display: flex;
	align-items: center;
	gap: 8px;
}

.method-card p {
	color: var(--text-muted);
	margin-bottom: 20px;
	font-size: 14px;
	line-height: 1.5;
}

.method-card button {
	transition: all 0.25s;
}

.method-card button:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3);
}

/* Enhanced Range Slider */
input[type="range"] {
	-webkit-appearance: none;
	appearance: none;
	background: var(--bg-secondary);
	height: 6px;
	border-radius: 3px;
	outline: none;
}

input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--accent-a);
	cursor: pointer;
	border: 2px solid white;
	box-shadow: 0 2px 6px rgba(0,0,0,0.2);
	transition: all 0.25s;
}

input[type="range"]::-webkit-slider-thumb:hover {
	transform: scale(1.1);
	box-shadow: 0 4px 12px rgba(229, 9, 20, 0.4);
}

input[type="range"]::-moz-range-thumb {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--accent-a);
	cursor: pointer;
	border: 2px solid white;
	box-shadow: 0 2px 6px rgba(0,0,0,0.2);
	transition: all 0.25s;
}

input[type="range"]::-moz-range-thumb:hover {
	transform: scale(1.1);
	box-shadow: 0 4px 12px rgba(229, 9, 20, 0.4);
}

/* Enhanced File Input */
input[type="file"] {
	transition: all 0.25s;
}

input[type="file"]:hover {
	border-color: var(--accent-a);
	background: rgba(229, 9, 20, 0.05);
}

/* Enhanced Color Input */
input[type="color"] {
	border: 2px solid var(--border);
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.25s;
}

input[type="color"]:hover {
	border-color: var(--accent-a);
	transform: scale(1.05);
}

/* Instructions List Spacing */
.output ol {
	padding-left: 20px;
}

.output ol li {
	margin-bottom: 8px;
	padding-left: 10px;
	position: relative;
}

.output ol li::marker {
	color: var(--accent-a);
	font-weight: bold;
}

/* Canvas Container */
.canvas-container {
	background: var(--panel);
	border-radius: 16px;
	padding: 24px;
	border: 1px solid var(--border);
	margin-bottom: 24px;
	text-align: center;
}

.canvas-container canvas {
	max-width: 100%;
	height: auto;
	border-radius: 8px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

/* Status Messages */
.status-message {
	padding: 16px;
	border-radius: 8px;
	margin: 12px 0;
	font-weight: 500;
}

.status-success {
	background: rgba(40, 167, 69, 0.1);
	border: 1px solid rgba(40, 167, 69, 0.3);
	color: #28a745;
}

.status-info {
	background: rgba(0, 123, 255, 0.1);
	border: 1px solid rgba(0, 123, 255, 0.3);
	color: #007bff;
}

.status-warning {
	background: rgba(255, 193, 7, 0.1);
	border: 1px solid rgba(255, 193, 7, 0.3);
	color: #ffc107;
}

.status-error {
	background: rgba(220, 53, 69, 0.1);
	border: 1px solid rgba(220, 53, 69, 0.3);
	color: #dc3545;
}

/* Modern Button Styles */
.btn-modern {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 20px;
	border-radius: 12px;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	border: none;
	cursor: pointer;
	transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
	overflow: hidden;
	text-align: center;
	min-height: 44px;
}

.btn-modern::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;
}

.btn-modern:hover::before {
	left: 100%;
}

.btn-modern:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 25px rgba(229, 9, 20, 0.25);
}

.btn-modern:active {
	transform: translateY(0);
	transition: all 0.1s;
}

.btn-modern:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

.btn-modern:disabled:hover {
	transform: none;
	box-shadow: none;
}

/* Primary Button - Gradient */
.btn-primary {
	background: linear-gradient(135deg, var(--accent-a), var(--accent-b));
	color: white;
	box-shadow: 0 4px 15px rgba(229, 9, 20, 0.2);
}

.btn-primary:hover {
	box-shadow: 0 8px 25px rgba(229, 9, 20, 0.4);
	background: linear-gradient(135deg, var(--accent-b), var(--accent-a));
}

/* Secondary Button */
.btn-secondary {
	background: var(--bg-secondary);
	color: var(--text);
	border: 1px solid var(--border);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
	background: var(--panel);
	border-color: var(--accent-a);
	box-shadow: 0 4px 20px rgba(229, 9, 20, 0.15);
}

/* Success Button */
.btn-success {
	background: linear-gradient(135deg, #28a745, #20c997);
	color: white;
	box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2);
}

.btn-success:hover {
	box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

/* Warning Button */
.btn-warning {
	background: linear-gradient(135deg, #ffc107, #fd7e14);
	color: #212529;
	box-shadow: 0 4px 15px rgba(255, 193, 7, 0.2);
}

.btn-warning:hover {
	box-shadow: 0 8px 25px rgba(255, 193, 7, 0.4);
}

/* Danger Button */
.btn-danger {
	background: linear-gradient(135deg, #dc3545, #c82333);
	color: white;
	box-shadow: 0 4px 15px rgba(220, 53, 69, 0.2);
}

.btn-danger:hover {
	box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
}

/* Full Width Button */
.btn-full {
	width: 100%;
}

/* Large Button */
.btn-lg {
	padding: 16px 24px;
	font-size: 16px;
	min-height: 52px;
}

/* Small Button */
.btn-sm {
	padding: 8px 16px;
	font-size: 13px;
	min-height: 36px;
}

/* Button Group */
.btn-group {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.btn-group .btn-modern {
	flex: 1;
	min-width: 120px;
}

/* Icon Buttons */
.btn-icon {
	width: 44px;
	height: 44px;
	padding: 0;
	border-radius: 50%;
}

.btn-icon i, .btn-icon svg {
	font-size: 18px;
}

/* Loading State */
.btn-loading {
	position: relative;
	color: transparent;
}

.btn-loading::after {
	content: '';
	position: absolute;
	width: 16px;
	height: 16px;
	top: 50%;
	left: 50%;
	margin-left: -8px;
	margin-top: -8px;
	border: 2px solid transparent;
	border-top: 2px solid currentColor;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* Pulse Animation */
@keyframes pulse {
	0% { transform: scale(1); }
	50% { transform: scale(1.05); }
	100% { transform: scale(1); }
}

.btn-pulse {
	animation: pulse 2s infinite;
}

/* Glassmorphism Button Variant */
.btn-glass {
	background: rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.2);
	color: var(--text);
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-glass:hover {
	background: rgba(255, 255, 255, 0.15);
	border-color: rgba(255, 255, 255, 0.3);
	box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Special AI Button */
.btn-ai {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	position: relative;
}

.btn-ai::before {
	background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.btn-ai:hover {
	box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

/* Special Download Button */
.btn-download {
	background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.btn-download:hover {
	box-shadow: 0 8px 25px rgba(17, 153, 142, 0.4);
}

/* Responsive Button Adjustments */
@media (max-width: 768px) {
	.btn-modern {
		padding: 14px 20px;
		font-size: 15px;
		min-height: 48px;
	}

	.btn-group {
		flex-direction: column;
	}

	.btn-group .btn-modern {
		width: 100%;
	}
}

/* Enhanced File Input */
.file-input-container {
	position: relative;
	margin-bottom: 32px;
}

.file-input-label {
	display: block;
	margin-bottom: 8px;
	font-weight: 500;
	color: var(--text);
	font-size: 14px;
}

.file-input-wrapper {
	position: relative;
	display: inline-block;
	width: 100%;
}

.file-input {
	display: none;
}

.file-input-area {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	width: 100%;
	padding: 20px;
	border: 2px dashed var(--accent);
	border-radius: 12px;
	background: var(--bg);
	color: var(--text);
	cursor: pointer;
	transition: all 0.25s;
	text-align: center;
	min-height: 80px;
}

.file-input-area:hover {
	border-color: var(--accent-a);
	background: rgba(229, 9, 20, 0.05);
	transform: translateY(-1px);
	box-shadow: 0 4px 15px rgba(229, 9, 20, 0.1);
}

.file-input-area.dragover {
	border-color: var(--accent-a);
	background: rgba(229, 9, 20, 0.1);
	box-shadow: 0 8px 25px rgba(229, 9, 20, 0.2);
}

.file-input-icon {
	font-size: 24px;
	color: var(--accent);
}

.file-input-text {
	font-size: 16px;
	font-weight: 500;
	margin: 0;
}

.file-input-subtext {
	font-size: 13px;
	color: var(--text-muted);
	margin: 4px 0 0 0;
}

/* Controls Section */
.controls-section {
	background: var(--panel);
	border-radius: 16px;
	padding: 24px;
	border: 1px solid var(--border);
	margin-bottom: 24px;
}

/* Form Controls */
.form-group {
	margin-bottom: 20px;
}

.form-label {
	display: block;
	margin-bottom: 8px;
	font-weight: 500;
	color: var(--text);
	font-size: 14px;
}

.form-control {
	width: 100%;
	padding: 12px 16px;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: var(--bg);
	color: var(--text);
	font-size: 14px;
	transition: all 0.25s;
}

.form-control:focus {
	outline: none;
	border-color: var(--accent-a);
	box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.1);
}

.form-control:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Color Input Enhancement */
input[type="color"] {
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.25s;
	padding: 0;
	background: none;
	width: 60px;
	height: 40px;
	outline: none;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

input[type="color"]:hover {
	transform: scale(1.05);
	box-shadow: 0 4px 16px rgba(229, 9, 20, 0.3);
	border: 2px solid var(--accent-a);
}

input[type="color"]:focus {
	outline: none;
	border: 2px solid var(--accent-a);
	box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.2);
}

/* Make color input fill entire area */
input[type="color"]::-webkit-color-swatch-wrapper {
	padding: 0;
	border-radius: 6px;
}

input[type="color"]::-webkit-color-swatch {
	border: none;
	border-radius: 6px;
	box-shadow: none;
}

input[type="color"]::-moz-color-swatch {
	border: none;
	border-radius: 6px;
	box-shadow: none;
}

/* Range Input Enhancement */
input[type="range"] {
	-webkit-appearance: none;
	appearance: none;
	background: var(--bg-secondary);
	height: 6px;
	border-radius: 3px;
	outline: none;
	cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--accent-a);
	cursor: pointer;
	border: 2px solid white;
	box-shadow: 0 2px 6px rgba(0,0,0,0.2);
	transition: all 0.25s;
}

input[type="range"]::-webkit-slider-thumb:hover {
	transform: scale(1.1);
	box-shadow: 0 4px 12px rgba(229, 9, 20, 0.4);
}

input[type="range"]::-moz-range-thumb {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--accent-a);
	cursor: pointer;
	border: 2px solid white;
	box-shadow: 0 2px 6px rgba(0,0,0,0.2);
	transition: all 0.25s;
}

input[type="range"]::-moz-range-thumb:hover {
	transform: scale(1.1);
	box-shadow: 0 4px 12px rgba(229, 9, 20, 0.4);
}