/**
 * DATTs Tartan Finder - Styles v11
 * Auto-suggest and "did you mean" features
 */

:root {
	--datts-accent: #39FF14;
	--datts-accent-hover: #45ff28;
	--datts-accent-dim: rgba(57, 255, 20, 0.15);
}

.datts-tartan-finder {
	max-width: 1400px;
	margin: 0 auto;
	padding: 2rem 1rem;
	font-family: 'Merriweather', Georgia, serif;
	color: #e0e0e0;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

.datts-tartan-finder h1,
.datts-tartan-finder h2,
.datts-tartan-finder h3,
.datts-tartan-finder h4 {
	font-family: 'Special Elite', 'Courier New', monospace;
	font-weight: 400;
	letter-spacing: 0.02em;
}

/* ========================================
   CONTROLS
   ======================================== */

.dtf-controls {
	background: rgba(26, 26, 26, 0.95);
	border: 1px solid #333;
	border-radius: 4px;
	padding: 2rem;
	margin-bottom: 2rem;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.dtf-search-box {
	margin-bottom: 2rem;
}

.dtf-search-label {
	display: block;
	font-family: 'Special Elite', 'Courier New', monospace;
	font-weight: 400;
	margin-bottom: 0.5rem;
	font-size: 0.875rem;
	color: #b0b0b0;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.dtf-search-wrapper {
	position: relative;
}

.dtf-surname-message {
	margin-top: 1rem;
	padding: 1rem 1.25rem;
	background-color: rgba(57, 255, 20, 0.15);
	border-left: 4px solid var(--datts-accent);
	border-radius: 4px;
	font-size: 1rem;
	color: #e0e0e0;
	font-weight: 400;
	line-height: 1.6;
}

/* ========================================
   AUTO-SUGGEST DROPDOWN
   ======================================== */

.dtf-suggest-dropdown {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: #1a1a1a;
	border: 1px solid var(--datts-accent);
	border-top: none;
	border-radius: 0 0 4px 4px;
	max-height: 300px;
	overflow-y: auto;
	z-index: 1000;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.dtf-suggest-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.875rem 1.25rem;
	cursor: pointer;
	transition: background-color 0.15s;
	border-bottom: 1px solid #333;
}

.dtf-suggest-item:last-child {
	border-bottom: none;
}

.dtf-suggest-item:hover,
.dtf-suggest-item-selected {
	background-color: rgba(57, 255, 20, 0.1);
}

.dtf-suggest-text {
	flex: 1;
	font-size: 1rem;
	color: #e0e0e0;
}

.dtf-suggest-type {
	font-size: 1.25rem;
	margin-left: 0.5rem;
	opacity: 0.7;
}

/* ========================================
   DID YOU MEAN
   ======================================== */

.dtf-did-you-mean {
	margin: 2rem 0;
	padding: 1rem 1.25rem;
	background-color: rgba(90, 159, 212, 0.15);
	border-left: 4px solid #5a9fd4;
	border-radius: 4px;
	font-size: 1rem;
	color: #e0e0e0;
	line-height: 1.6;
}

.dtf-did-you-mean-link {
	color: #5a9fd4;
	text-decoration: underline;
	cursor: pointer;
	transition: color 0.2s;
	font-weight: 500;
}

.dtf-did-you-mean-link:hover {
	color: #7bb3e0;
}

/* ========================================
   INPUTS
   ======================================== */

.dtf-input {
	width: 100%;
	padding: 1rem 1.25rem;
	font-size: 1.125rem;
	font-family: 'Merriweather', Georgia, serif;
	background-color: #1a1a1a;
	color: #e0e0e0;
	border: 1px solid #444;
	border-radius: 4px;
	transition: all 0.2s;
}

.dtf-input::placeholder {
	color: #888;
	font-style: italic;
}

.dtf-input:focus {
	outline: none;
	border-color: var(--datts-accent);
	background-color: #222;
	box-shadow: 0 0 0 3px var(--datts-accent-dim);
	border-radius: 4px 4px 0 0;
}

/* ========================================
   FILTERS
   ======================================== */

.dtf-filters {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 1.25rem;
	margin-bottom: 1.5rem;
}

.dtf-filter-group {
	display: flex;
	flex-direction: column;
}

.dtf-filter-group label {
	font-family: 'Special Elite', 'Courier New', monospace;
	font-weight: 400;
	margin-bottom: 0.5rem;
	font-size: 0.875rem;
	color: #b0b0b0;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.dtf-select {
	padding: 0.875rem 2.5rem 0.875rem 1rem;
	font-size: 1rem;
	font-family: 'Merriweather', Georgia, serif;
	background-color: #1a1a1a;
	color: #e0e0e0;
	border: 1px solid #444;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.2s;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 1rem center;
	background-size: 12px;
	line-height: 1.5;
	min-height: 3rem;
}

.dtf-select:hover {
	border-color: #666;
	background-color: #222;
}

.dtf-select:focus {
	outline: none;
	border-color: var(--datts-accent);
	background-color: #222;
	box-shadow: 0 0 0 3px var(--datts-accent-dim);
}

/* ========================================
   COLOURS SECTION
   ======================================== */

.dtf-colours-section {
	margin-bottom: 1.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid #333;
}

.dtf-colours-header {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	margin-bottom: 1rem;
	flex-wrap: wrap;
}

.dtf-colours-header > label,
.dtf-colours-header > span {
	font-family: 'Special Elite', 'Courier New', monospace;
	font-weight: 400;
	margin: 0;
	color: #b0b0b0;
	font-size: 0.875rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.dtf-colour-mode {
	display: flex;
	gap: 1.25rem;
}

.dtf-colour-mode label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-family: 'Merriweather', Georgia, serif;
	font-weight: normal;
	font-size: 0.95rem;
	margin: 0;
	cursor: pointer;
	color: #e0e0e0;
	text-transform: none;
}

.dtf-colour-mode input[type="radio"] {
	cursor: pointer;
	margin: 0;
	width: 18px;
	height: 18px;
	accent-color: #5a9fd4;
}

.dtf-colours-badge {
	display: inline-block;
	background-color: var(--datts-accent-dim);
	color: var(--datts-accent);
	padding: 0.4rem 0.9rem;
	border-radius: 20px;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	border: 1px solid rgba(57, 255, 20, 0.3);
}

.dtf-colours-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
	gap: 0.75rem;
	max-width: 1000px;
}

.dtf-colour-chip {
	position: relative;
	width: 100%;
	height: 50px;
	border-radius: 4px;
	cursor: pointer;
	border: 2px solid transparent;
	transition: all 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.dtf-colour-chip:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

.dtf-colour-chip.selected {
	border-color: var(--datts-accent);
	box-shadow: 0 0 0 2px var(--datts-accent);
}

.dtf-skull-icon {
	opacity: 0;
	transition: opacity 0.2s;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
	pointer-events: none;
}

.dtf-colour-chip.selected .dtf-skull-icon {
	opacity: 1;
}

/* ========================================
   BUTTONS
   ======================================== */

.dtf-actions {
	display: flex;
	gap: 1rem;
	flex-wrap: wrap;
	padding-top: 0.5rem;
}

.dtf-btn {
	padding: 0.875rem 1.75rem;
	font-size: 1rem;
	font-family: 'Special Elite', 'Courier New', monospace;
	font-weight: 400;
	letter-spacing: 0.03em;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.2s;
	min-width: 140px;
	touch-action: manipulation;
	text-transform: uppercase;
}

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

.dtf-btn-primary {
	background-color: var(--datts-accent);
	color: #0a0a0a;
	font-weight: 700;
}

.dtf-btn-primary:hover:not(:disabled) {
	background-color: var(--datts-accent-hover);
	box-shadow: 0 4px 12px rgba(57, 255, 20, 0.4);
	transform: translateY(-1px);
}

.dtf-btn-primary:focus {
	outline: 2px solid var(--datts-accent);
	outline-offset: 2px;
}

.dtf-btn-secondary {
	background-color: rgba(255, 255, 255, 0.05);
	color: #e0e0e0;
	border: 1px solid #444;
}

.dtf-btn-secondary:hover:not(:disabled) {
	background-color: rgba(255, 255, 255, 0.1);
	border-color: #666;
	transform: translateY(-1px);
}

.dtf-btn-secondary:focus {
	outline: 2px solid var(--datts-accent);
	outline-offset: 2px;
}

/* ========================================
   RESULTS
   ======================================== */

.dtf-results {
	margin-bottom: 2rem;
}

.dtf-no-results,
.dtf-error {
	background-color: rgba(26, 26, 26, 0.95);
	border: 1px solid #333;
	padding: 3rem 2rem;
	border-radius: 4px;
	text-align: center;
	color: #888;
	font-size: 1.125rem;
}

.dtf-error {
	background-color: rgba(80, 20, 20, 0.3);
	color: #ff6b6b;
	border-left: 4px solid #ff4444;
}

.dtf-group-heading {
	margin: 2.5rem 0 1.5rem 0;
	padding: 0.875rem 1.25rem;
	background-color: rgba(26, 26, 26, 0.95);
	border-left: 5px solid var(--datts-accent);
	border-radius: 4px;
	font-size: 29px;
	font-family: 'Special Elite', 'Courier New', monospace;
	font-weight: 400;
	color: #e0e0e0;
	letter-spacing: 0.02em;
}

.dtf-group {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 1.5rem;
	margin-bottom: 2rem;
}

/* ========================================
   CARDS
   ======================================== */

.dtf-card {
	background: rgba(26, 26, 26, 0.95);
	border: 1px solid #333;
	border-radius: 4px;
	overflow: hidden;
	transition: all 0.2s;
	display: flex;
	flex-direction: column;
}

.dtf-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
	border-color: var(--datts-accent);
}

.dtf-card-image {
	width: 100%;
	aspect-ratio: 1;
	overflow: hidden;
	background-color: #111;
	display: flex;
	align-items: center;
	justify-content: center;
}

.dtf-card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.dtf-image-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
	color: #555;
	font-size: 0.875rem;
	text-align: center;
	padding: 1rem;
	font-style: italic;
	font-family: 'Special Elite', 'Courier New', monospace;
}

.dtf-card-content {
	padding: 1.25rem;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.dtf-card-title {
	font-size: 1.125rem;
	font-family: 'Special Elite', 'Courier New', monospace;
	font-weight: 400;
	color: #e0e0e0;
	line-height: 1.4;
	margin-bottom: 0.25rem;
}

.dtf-card-meta {
	font-size: 0.95rem;
	color: #999;
	line-height: 1.5;
}

.dtf-card-weight {
	font-size: 0.875rem;
	color: #777;
}

.dtf-card-composition {
	font-size: 0.875rem;
	color: #777;
}

.dtf-card-badge {
	display: inline-block;
	padding: 0.35rem 0.7rem;
	border-radius: 3px;
	font-size: 0.75rem;
	font-family: 'Special Elite', 'Courier New', monospace;
	font-weight: 400;
	text-transform: uppercase;
	margin-top: 0.5rem;
	width: fit-content;
	letter-spacing: 0.03em;
}

.dtf-badge-discontinued {
	background-color: rgba(180, 50, 50, 0.3);
	color: #ff6b6b;
	border: 1px solid rgba(255, 70, 70, 0.4);
}

/* ========================================
   PAGINATION
   ======================================== */

.dtf-pagination {
	background: rgba(26, 26, 26, 0.95);
	border: 1px solid #333;
	border-radius: 4px;
	padding: 1.5rem 2rem;
	margin-bottom: 2rem;
}

.dtf-pagination-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 2rem;
	flex-wrap: wrap;
}

.dtf-pagination-info {
	font-family: 'Special Elite', 'Courier New', monospace;
	font-weight: 400;
	color: #e0e0e0;
	font-size: 1rem;
}

/* ========================================
   DEBUG PANEL
   ======================================== */

.dtf-debug {
	background: #0a0a0a;
	color: var(--datts-accent);
	border: 1px solid #333;
	border-radius: 4px;
	padding: 1.5rem;
	margin-top: 2rem;
	overflow-x: auto;
}

.dtf-debug pre {
	margin: 0;
	font-family: 'Courier New', Courier, monospace;
	font-size: 0.8rem;
	line-height: 1.6;
	white-space: pre-wrap;
	word-wrap: break-word;
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border-width: 0 !important;
}

.dtf-skip-link {
	position: absolute;
	left: -9999px;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
	z-index: -999;
}

.dtf-skip-link:focus,
.dtf-skip-link:active {
	position: fixed;
	top: 10px;
	left: 10px;
	width: auto;
	height: auto;
	overflow: auto;
	z-index: 99999;
	padding: 1rem 1.5rem;
	background: var(--datts-accent);
	color: #0a0a0a;
	text-decoration: none;
	border-radius: 4px;
	font-weight: bold;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

*:focus-visible {
	outline: 2px solid var(--datts-accent);
	outline-offset: 2px;
}

.dtf-btn:focus-visible,
.dtf-input:focus-visible,
.dtf-select:focus-visible {
	box-shadow: 0 0 0 3px var(--datts-accent-dim);
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

@media (min-width: 768px) {
	.datts-tartan-finder {
		padding: 2rem;
	}

	.dtf-colours-grid {
		grid-template-columns: repeat(11, 1fr);
		max-width: 100%;
	}

	.dtf-group {
		grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	}
}

@media (min-width: 1024px) {
	.dtf-filters {
		grid-template-columns: repeat(5, 1fr);
	}

	.dtf-group {
		grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	}
}

@media (min-width: 1280px) {
	.datts-tartan-finder {
		max-width: 1600px;
	}
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
	.dtf-controls,
	.dtf-pagination,
	.dtf-debug,
	.dtf-suggest-dropdown,
	.dtf-did-you-mean {
		display: none;
	}

	.dtf-card {
		break-inside: avoid;
	}

	body {
		background: white;
	}

	.datts-tartan-finder {
		color: #000;
	}
}

/* ========================================
   TOUCH IMPROVEMENTS
   ======================================== */

@media (hover: none) and (pointer: coarse) {
	.dtf-btn,
	.dtf-select,
	.dtf-input {
		min-height: 48px;
	}

	.dtf-colour-chip {
		min-height: 60px;
	}

	.dtf-suggest-item {
		min-height: 52px;
	}
}