:root {
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --card-foreground: 240 10% 3.9%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  --border: 240 5.9% 90%;
  --primary: 262 83% 58%;
  --primary-foreground: 0 0% 100%;
  --accent: 240 4.8% 95.9%;
  --accent-foreground: 240 5.9% 10%;
}

.dark {
  --background: 240 10% 3.9%;
  --foreground: 0 0% 98%;
  --card: 240 10% 3.9%;
  --card-foreground: 0 0% 98%;
  --muted: 240 3.7% 15.9%;
  --muted-foreground: 240 5% 64.9%;
  --border: 240 3.7% 15.9%;
  --primary: 263 70% 50%;
  --primary-foreground: 0 0% 100%;
  --accent: 240 3.7% 15.9%;
  --accent-foreground: 0 0% 98%;
}

body {
  font-family: 'Inter', sans-serif;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  min-height: 100vh;
}

.glass-card {
  background: hsl(var(--card) / 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid hsl(var(--border));
}

.input-tab {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  background: transparent;
  color: hsl(var(--muted-foreground));
  border: none;
}

.input-tab:hover {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.input-tab.active {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-outline {
  background: transparent;
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
}

.btn-outline:hover {
  background: hsl(var(--accent));
}

.btn-ghost {
  background: transparent;
  color: hsl(var(--foreground));
}

.btn-ghost:hover {
  background: hsl(var(--accent));
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: hsl(var(--primary));
}

.form-input::placeholder {
  color: hsl(var(--muted-foreground));
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: hsl(var(--foreground));
}

.color-input {
  width: 3rem;
  height: 2.5rem;
  padding: 0.25rem;
  border-radius: 0.375rem;
  border: 1px solid hsl(var(--border));
  cursor: pointer;
  background: transparent;
}

.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  cursor: pointer;
  border-radius: 0.5rem;
  transition: background 0.2s;
}

.collapsible-header:hover {
  background: hsl(var(--accent));
}

.collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.collapsible-content.open {
  max-height: 1000px;
}

.corner-btn {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid hsl(var(--border));
  background: transparent;
  color: hsl(var(--foreground));
  cursor: pointer;
  transition: all 0.2s;
}

.corner-btn:first-child {
  border-radius: 0.375rem 0 0 0.375rem;
}

.corner-btn:last-child {
  border-radius: 0 0.375rem 0.375rem 0;
}

.corner-btn.active {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

.frame-btn {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  border: 1px solid hsl(var(--border));
  background: transparent;
  color: hsl(var(--foreground));
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.frame-btn.active {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

.frame-btn:hover:not(.active) {
  background: hsl(var(--accent));
}

.range-slider {
  width: 100%;
  height: 0.5rem;
  border-radius: 0.25rem;
  background: hsl(var(--muted));
  appearance: none;
  cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
  appearance: none;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: hsl(var(--primary));
  cursor: pointer;
}

.range-slider::-moz-range-thumb {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: hsl(var(--primary));
  cursor: pointer;
  border: none;
}

.qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 16rem;
  height: 16rem;
  border: 2px dashed hsl(var(--border));
  border-radius: 0.5rem;
  background: hsl(var(--muted) / 0.2);
}

.logo-preview {
  position: relative;
  width: 5rem;
  height: 5rem;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid hsl(var(--border));
}

.logo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.error-level-btn {
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  border: 1px solid hsl(var(--border));
  background: transparent;
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.error-level-btn.active {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

.error-level-btn:hover:not(.active) {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

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

.animate-spin {
  animation: spin 1s linear infinite;
}
