/* QR Maker Studio - Modern Dark Glassmorphic Design System */
:root {
  --bg-main: #090d16;
  --bg-card: rgba(18, 24, 38, 0.78);
  --bg-card-hover: rgba(26, 34, 53, 0.85);
  --bg-input: rgba(11, 15, 26, 0.8);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-active: rgba(99, 102, 241, 0.5);
  --border-glow: 0 0 20px rgba(99, 102, 241, 0.25);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --accent-blue-gradient: linear-gradient(135deg, #2563eb 0%, #38bdf8 100%);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --shadow-card: 0 20px 40px -15px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --shadow-pop: 0 10px 25px -5px rgba(99, 102, 241, 0.35);
  
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.15), transparent 45%),
    radial-gradient(circle at 85% 25%, rgba(168, 85, 247, 0.12), transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(6, 182, 212, 0.08), transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 1.25rem 4rem;
  -webkit-font-smoothing: antialiased;
}

/* Container */
.app-container {
  width: 100%;
  max-width: 1180px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* App Header */
.app-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-full);
  color: #a5b4fc;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.brand-icon {
  width: 15px;
  height: 15px;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
  line-height: 1.15;
}

.brand-title span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 580px;
  margin: 0 auto;
}

/* Quick Presets Bar */
.preset-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.4rem;
}

.preset-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.preset-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.preset-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.preset-chip.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.6);
  color: #c7d2fe;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.25);
}

/* Main Studio Grid Layout */
.studio-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .studio-grid {
    grid-template-columns: 1fr;
  }
}

/* Config Panel Left */
.config-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Tab Navigation */
.type-nav {
  display: flex;
  background: rgba(14, 19, 31, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.35rem;
  gap: 0.35rem;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 0.6rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  background: rgba(99, 102, 241, 0.25);
  color: #ffffff;
  border: 1px solid rgba(99, 102, 241, 0.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Form Container Card */
.form-container, .customization-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

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

/* Form Inputs */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

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

.input-label, .setting-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.input-wrapper:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.input-prefix {
  padding-left: 0.9rem;
  color: #818cf8;
  font-weight: 600;
  font-size: 0.9rem;
  user-select: none;
}

.text-input {
  width: 100%;
  background: transparent;
  border: none;
  color: #fff;
  padding: 0.75rem 0.85rem;
  font-size: 0.95rem;
  font-family: var(--font-body);
  outline: none;
}

.input-group > .text-input,
.select-input,
.textarea-input {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: #fff;
  padding: 0.75rem 0.85rem;
  font-size: 0.95rem;
  font-family: var(--font-body);
  outline: none;
  transition: all 0.2s ease;
}

.input-group > .text-input:focus,
.select-input:focus,
.textarea-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.textarea-input {
  resize: vertical;
  min-height: 80px;
}

.clear-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem 0.8rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.15s ease;
}

.clear-btn:hover {
  color: #fff;
}

.input-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0.75rem;
}

/* Customization Card */
.customization-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.color-picker-box {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.color-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.6rem;
  gap: 0.6rem;
}

input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
}

.hex-text {
  background: transparent;
  border: none;
  color: #fff;
  font-family: monospace;
  font-size: 0.9rem;
  text-transform: uppercase;
  width: 75px;
  outline: none;
}

/* Swatches */
.theme-presets {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.swatches {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.swatch-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  overflow: hidden;
  position: relative;
  display: flex;
  padding: 0;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s;
}

.swatch-btn:hover {
  transform: scale(1.15);
  border-color: #fff;
}

.swatch-half {
  flex: 1;
  height: 100%;
}

/* Icon / Center Emblem */
.icon-selector-area {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.label-with-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.badge-tag {
  font-size: 0.7rem;
  color: #818cf8;
  background: rgba(99, 102, 241, 0.15);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.icon-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.icon-chip, .icon-upload-chip {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.icon-chip:hover, .icon-upload-chip:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.icon-chip.active {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--accent-primary);
  color: #fff;
}

.uploaded-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px dashed rgba(99, 102, 241, 0.4);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: #c7d2fe;
}

.uploaded-badge.hidden {
  display: none;
}

.uploaded-badge button {
  background: transparent;
  border: none;
  color: #f87171;
  font-size: 0.85rem;
  cursor: pointer;
}

/* Right Preview Panel */
.preview-panel {
  position: relative;
}

.preview-sticky-card {
  position: sticky;
  top: 2rem;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.preview-card-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-green);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-green);
  animation: pulse 2s infinite ease-in-out;
}

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

.status-text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.scannable-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  border-radius: var(--radius-full);
}

/* QR Canvas Frame */
.qr-canvas-frame {
  width: 280px;
  height: 280px;
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.qr-canvas-frame:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), 0 0 25px rgba(99, 102, 241, 0.2);
}

#render-canvas {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  display: block;
}

/* Target Summary */
.target-summary {
  width: 100%;
  background: rgba(11, 15, 26, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  overflow: hidden;
}

.summary-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.summary-url {
  font-size: 0.82rem;
  color: #a5b4fc;
  font-family: monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Buttons */
.action-buttons {
  width: 100%;
  display: flex;
  gap: 0.75rem;
}

.btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  transform: translateY(-1.5px);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: #e2e8f0;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1.5px);
}

.preview-footer {
  width: 100%;
  text-align: center;
  padding-top: 0.25rem;
}

.external-link {
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.15s ease;
}

.external-link:hover {
  color: #a5b4fc;
  text-decoration: underline;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #1e1b4b;
  border: 1px solid rgba(99, 102, 241, 0.5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(99, 102, 241, 0.3);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  font-weight: 500;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: #10b981;
  color: #fff;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: bold;
}
