/* ============================================================
   Swift QR — style.css (Clean & Minimalist Design)
   ============================================================ */

:root {
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-inner: #f1f5f9;
  --border: #e2e8f0;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --success: #10b981;
  --danger: #ef4444;

  --radius-inner: 10px;
  --radius-card: 20px;
  --transition: all 0.2s ease-in-out;
}

/* ── Dark Mode Context ─────────────────────────────────────── */
body.dark-mode {
  --bg-page: #0b0f19;
  --bg-card: #151f32;
  --bg-inner: #1e293b;
  --border: #334155;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  --accent: #3b82f6;
  --accent-light: rgba(59, 130, 246, 0.15);
}

/* ── Global Styles ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
body {
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: system-ui, -apple-system, sans-serif;
  transition: background var(--transition), color var(--transition);
}

.main-layout { padding-top: 3rem; padding-bottom: 3rem; }
@media (max-width: 768px) { .main-layout { padding-top: 1rem; } }

/* ── SVG Helper Styles ─────────────────────────────────────── */
.svg-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  fill: currentColor;
  vertical-align: -0.125em;
}

/* ── Premium Clean Card ─────────────────────────────────────── */
.app-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  overflow: hidden;
}

.app-header {
  padding: 2rem 2.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
@media (max-width: 576px) { .app-header { padding: 1.5rem; } }

.header-brand { display: flex; align-items: center; gap: 1rem; }
.brand-icon {
  width: 45px; height: 45px; background: var(--accent); color: #fff;
  border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}

.app-title { font-size: 1.5rem; font-weight: 700; margin: 0; letter-spacing: -0.03em; }
.app-subtitle { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

.app-body { padding: 2.5rem; }
@media (max-width: 576px) { .app-body { padding: 1.5rem; } }

/* ── Form Items Styling ──────────────────────────────────────── */
.sub-section-title {
  font-size: 0.85rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em; margin: 2rem 0 1rem 0;
}

.custom-label { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text-main); display: block; }
.custom-input, .custom-select {
  border: 1.5px solid var(--border) !important; background: var(--bg-inner) !important;
  color: var(--text-main) !important; border-radius: var(--radius-inner) !important; padding: 0.7rem 1rem !important;
}
.custom-input:focus, .custom-select:focus {
  border-color: var(--accent) !important; box-shadow: 0 0 0 4px var(--accent-light) !important; background: var(--bg-card) !important;
}
.input-hint { font-size: 0.78rem; color: var(--text-muted); display: block; margin-top: 0.35rem; }

/* ── Horizontal Icon Selector ─────────────────────────── */
.icon-selector-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: var(--bg-inner);
  padding: 0.6rem;
  border-radius: var(--radius-inner);
  border: 1px solid var(--border);
}

.icon-option {
  cursor: pointer;
  user-select: none;
}

.icon-option input[type="radio"] {
  display: none;
}

.icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  color: var(--text-main);
  font-size: 1.2rem;
  transition: var(--transition);
}

.icon-option input[type="radio"]:checked + .icon-box {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.icon-box:hover {
  border-color: var(--accent);
}

/* ── Color Pickers Row ───────────────────────────────────────── */
.color-picker-row {
  display: flex; gap: 1rem; background: var(--bg-inner); padding: 1rem; border-radius: var(--radius-inner); border: 1px solid var(--border);
}
.color-box { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.35rem; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.color-box input[type="color"] { appearance: none;
  -webkit-appearance: none; border: none; width: 100%; height: 35px; border-radius: 6px; cursor: pointer; background: none;
}
.color-box input[type="color"]::-webkit-color-swatch { border-radius: 6px; border: 1px solid rgba(0,0,0,0.1); }

/* Range bar styling */
.custom-range { height: 6px; border-radius: 3px; }
.badge-thickness { font-size: 0.8rem; background: var(--accent-light); color: var(--accent); padding: 0.1rem 0.5rem; border-radius: 20px; font-weight: 700; }

/* ── Toggle switch styles ────────────────────────────────────── */
.toggle-card {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem; background: var(--bg-inner); border-radius: var(--radius-inner); border: 1px solid var(--border); cursor: pointer;
}
.toggle-title { font-size: 0.9rem; font-weight: 600; display: block; }
.toggle-desc { font-size: 0.78rem; color: var(--text-muted); }

/* Upload image zone */
.upload-box {
  border: 2px dashed var(--border); padding: 2rem; border-radius: var(--radius-inner); text-align: center; cursor: pointer; display: block; background: var(--bg-inner); transition: var(--transition);
}
.upload-box:hover { border-color: var(--accent); background: var(--bg-card); }
.upload-icon { font-size: 1.8rem; color: var(--accent); margin-bottom: 0.5rem; }
.upload-limit { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ── Buttons (Clean Actions) ──────────────────────────────────── */
.action-grid { display: flex; gap: 0.75rem; }
.btn-generate {
  flex: 1; background: var(--accent); color: #fff; border: none; padding: 0.9rem 1.5rem; border-radius: var(--radius-inner); font-weight: 600; transition: var(--transition);
}
.btn-generate:hover { filter: brightness(1.1); box-shadow: 0 4px 15px var(--accent-light); }
.btn-clear {
  width: 55px; background: var(--bg-inner); border: 1px solid var(--border); color: var(--danger); border-radius: var(--radius-inner); transition: var(--transition);
}
.btn-clear:hover:not(:disabled) { background: var(--danger); color: #fff; }
.btn-clear:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Right Panel: Sticky & Preview ────────────────────────────── */
.sticky-sidebar { position: sticky; top: 2rem; display: flex; flex-direction: column; gap: 1.5rem; }
.preview-card, .result-card {
  background: var(--bg-inner); border: 1px solid var(--border); border-radius: var(--radius-inner); padding: 1.5rem; text-align: center;
}
.preview-badge {
  font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem;
}
.dot-blink { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; display: inline-block; animation: blink 1.5s infinite; }
@keyframes blink { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

.canvas-holder { background: #ffffff; padding: 1rem; border-radius: 8px; display: inline-block; max-width: 100%; box-shadow: 0 2px 10px rgba(0,0,0,0.02); }

.canvas-holder canvas,
.canvas-holder svg {
  max-width: 100% !important;
  height: auto !important;
  display: block;
  margin: 0 auto;
}

.success-banner { color: var(--success); font-weight: 700; font-size: 0.95rem; margin-bottom: 1rem; }
.btn-download {
  width: 100%; background: var(--success); color: #fff; border: none; padding: 0.85rem; border-radius: var(--radius-inner); font-weight: 600; transition: var(--transition);
}
.btn-download:hover { filter: brightness(1.1); }

/* ── Darkmode toggle switch customization ─────────────────────── */
.theme-switch-wrapper { display: flex; align-items: center; }
#darkModeToggle { display: none; }
.theme-label { width: 40px; height: 40px; background: var(--bg-inner); border: 1px solid var(--border); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-muted); transition: var(--transition); }
.theme-label:hover { border-color: var(--accent); color: var(--accent); }
body.dark-mode .theme-label { color: #facc15; }

/* ── Custom Micro Dialog Modal ───────────────────────────────── */
.custom-modal {
  display: none; position: fixed; inset: 0; z-index: 1050; background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(5px); align-items: center; justify-content: center; padding: 1rem; opacity: 0; transition: opacity var(--transition);
}
.custom-modal.show { display: flex; opacity: 1; }
.modal-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-card); width: 100%; max-width: 420px; overflow: hidden; transform: translateY(10px); transition: transform 0.3s ease; }
.custom-modal.show .modal-box { transform: translateY(0); }
.modal-header-custom { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-title-custom { font-size: 1.1rem; font-weight: 700; margin: 0; }
.modal-body-custom { padding: 1.5rem; }
.modal-hint { font-size: 0.78rem; color: var(--text-muted); }
.modal-footer-custom { padding: 1rem 1.5rem; background: var(--bg-inner); border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 0.5rem; }

.btn-modal-cancel { background: none; border: none; color: var(--text-muted); font-weight: 600; padding: 0.5rem 1rem; }
.btn-modal-confirm { background: var(--accent); color: #fff; border: none; font-weight: 600; padding: 0.5rem 1.25rem; border-radius: 8px; }

/* ── Animations ────────────────────────────────────────────── */
.fade-in { animation: fadeIn 0.4s ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }