:root {
  --bg-primary: #0f0f23;
  --bg-card: #1a1a2e;
  --color-primary: #00d4ff;
  --color-secondary: #7c3aed;
  --color-text: #ffffff;
  --color-text-muted: #a0a0b0;
  --color-success: #10b981;
  --color-error: #ef4444;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  min-height: 100vh;
  color: var(--color-text);
  padding: 20px;
}

.container {
  max-width: 480px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 40px;
}

.logo {
  width: 220px;
  max-width: 100%;
  margin: 0 auto 20px;
}

.logo img {
  width: 100%;
  height: auto;
  display: block;
}

h1 {
  font-size: 24px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.reader-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 32px;
  margin-bottom: 24px;
}

.status-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--color-text-muted);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-text-muted);
  transition: background 0.3s;
}

.status-dot.ready { background: var(--color-success); }
.status-dot.scanning { background: var(--color-primary); animation: pulse 1s infinite; }
.status-dot.success { background: var(--color-success); }
.status-dot.error { background: var(--color-error); }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
}

.scan-btn {
  width: 100%;
  padding: 24px;
  font-size: 18px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: white;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.scan-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 212, 255, 0.4);
}

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

.scan-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.scan-btn.scanning {
  background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
  animation: scanPulse 1.5s infinite;
}

@keyframes scanPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.4); }
  50% { box-shadow: 0 0 40px rgba(0, 212, 255, 0.8); }
}

.scan-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.manual-lookup {
  margin-top: 16px;
}

.manual-serial-input {
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text);
  font-size: 14px;
  outline: none;
}

.manual-serial-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2);
}

.manual-lookup-btn {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
}

.result-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 20px;
  display: none;
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.result-card.visible {
  display: block;
  animation: slideIn 0.3s ease;
}

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

.result-item {
  margin-bottom: 16px;
}

.result-item:last-child { margin-bottom: 0; }

.result-label {
  font-size: 12px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.result-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-primary);
  word-break: break-all;
}

.history-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 24px;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.history-title {
  font-size: 16px;
  font-weight: 600;
}

.clear-btn {
  background: transparent;
  border: 1px solid var(--color-text-muted);
  color: var(--color-text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.clear-btn:hover {
  border-color: var(--color-error);
  color: var(--color-error);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  padding: 12px;
}

.history-serial {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.history-customer {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 4px;
}

.history-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--color-text-muted);
}

.empty-history {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 14px;
  padding: 20px;
}

.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 16px;
  display: none;
}

.error-message.visible {
  display: block;
}

.error-message p {
  color: var(--color-error);
  font-size: 14px;
}

.compatibility-note {
  text-align: center;
  margin-top: 24px;
  padding: 16px;
  color: var(--color-text-muted);
  font-size: 12px;
}

.compatibility-note strong {
  color: var(--color-secondary);
}
