/* ========================================
   QR Code Generator — Styles
   ======================================== */

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

:root {
  --primary: #6366F1;
  --primary-light: #818CF8;
  --accent: #A5B4FC;
  --bg: #111111;
  --bg-card: rgba(24, 24, 30, 0.75);
  --bg-card-hover: rgba(32, 32, 40, 0.85);
  --border: rgba(99, 102, 241, 0.15);
  --border-hover: rgba(99, 102, 241, 0.3);
  --text: #E8E6F2;
  --text-muted: #9B97B0;
  --text-dim: #6B6780;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 250ms ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 50% 40% at 30% 10%, rgba(99, 102, 241, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 40% 50% at 80% 90%, rgba(165, 180, 252, 0.04) 0%, transparent 70%);
  pointer-events: none;
}

.app { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: 0 20px; }

/* Header */
.header { padding: 40px 0 20px; text-align: center; }
.logo { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 6px; }
.logo h1 {
  font-size: 1.6rem; font-weight: 700;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.subtitle { color: var(--text-muted); font-size: 0.9rem; }

/* Sections */
.main { display: flex; flex-direction: column; gap: 20px; padding-bottom: 40px; }

section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(12px);
  transition: border-color var(--transition);
}
section:hover { border-color: var(--border-hover); }

.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-header h2 { font-size: 1rem; font-weight: 600; }

.hidden { display: none !important; }

/* Textarea */
textarea {
  width: 100%; resize: vertical;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text);
  transition: border-color var(--transition);
}
textarea:focus { outline: none; border-color: var(--primary); }
textarea::placeholder { color: var(--text-dim); }

/* Options Grid */
.options-grid { display: flex; flex-direction: column; gap: 12px; }
.option-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.option-label { font-size: 0.9rem; font-weight: 500; }

select {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
}
select:focus { outline: none; border-color: var(--primary); }

/* Color Picker */
.color-wrap { display: flex; align-items: center; gap: 8px; }
.color-wrap input[type="color"] { width: 36px; height: 36px; border: 2px solid var(--border); border-radius: 6px; background: transparent; cursor: pointer; padding: 2px; }
.color-wrap input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-wrap input[type="color"]::-webkit-color-swatch { border: none; border-radius: 4px; }
.color-val { font-size: 0.8rem; color: var(--text-muted); font-family: monospace; }

/* Logo Upload */
.logo-upload-wrap { display: flex; align-items: center; gap: 8px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font); font-size: 0.85rem; font-weight: 500;
  padding: 8px 16px; border-radius: var(--radius-sm);
  border: none; cursor: pointer; transition: all var(--transition);
}
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-ghost { background: rgba(99, 102, 241, 0.08); color: var(--primary-light); border: 1px solid var(--border); }
.btn-ghost:hover { background: rgba(99, 102, 241, 0.15); }
.btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-group { display: flex; gap: 8px; }

/* QR Preview */
.qr-preview {
  display: flex; align-items: center; justify-content: center;
  min-height: 200px;
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}
.qr-placeholder { text-align: center; color: var(--text-dim); font-size: 0.9rem; padding: 20px; }
#qr-canvas { max-width: 100%; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  padding: 10px 20px; background: var(--primary); color: #fff;
  border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 500;
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
  opacity: 0; transition: all 300ms ease; z-index: 100; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Footer */
.footer { text-align: center; padding: 16px 0 32px; color: var(--text-dim); font-size: 0.75rem; }

@media (max-width: 500px) {
  .header { padding: 24px 0 16px; }
  .logo h1 { font-size: 1.3rem; }
  .option-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  section { padding: 14px; }
}
