/**
 * qr-tool.css
 * PakARQ Custom Branded QR Code Studio
 * 100% Native Integration with PakARQ Design System
 */

:root {
  --purple-900: #1c0642;
  --purple-800: #2a0a5e;
  --purple-700: #4b14b8;
  --purple-600: #6a1cff;
  --purple-500: #7c1cff;
  --purple-400: #9a4cff;
  --purple-300: #c9a8ff;
  --purple-200: #e6d8ff;
  --purple-100: #f3ecff;
  --purple-50: #faf6ff;
  --ink: #12071b;
  --ink-2: #2d1f42;
  --muted: #64557d;
  --white: #ffffff;
  --grad-primary: linear-gradient(135deg, #7c1cff 0%, #b070ff 100%);
  --grad-purple: linear-gradient(135deg, #7c1cff 0%, #b070ff 100%);
  --shadow-sm: 0 4px 12px rgba(106, 28, 255, 0.08);
  --shadow-md: 0 12px 25px -10px rgba(106, 28, 255, 0.15);
  --shadow-lg: 0 20px 45px -15px rgba(106, 28, 255, 0.22);
}

/* Ensure FontAwesome and icons render reliably */
.qr-studio-section i.fas,
.qr-studio-section i.fab,
.qr-studio-section i.far,
.qr-studio-section i.fa-solid,
.qr-studio-section i.fa-brands,
.qr-studio-section i.fa-regular,
.page-banner i.fas,
.qr-features-grid i.fas {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  line-height: 1;
  text-rendering: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* WRAPPER & CONTAINER */
.qr-studio-section {
  padding: 20px 0 90px;
  background: #ffffff;
  position: relative;
}

.qr-studio-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

/* MAIN UNIFIED TOOL CARD (LIKE WIKI-CARD) */
.qr-tool-card {
  background: #ffffff;
  border: 1.5px solid var(--purple-100);
  border-radius: 32px;
  box-shadow: 0 24px 70px -15px rgba(106, 28, 255, 0.12);
  padding: 44px;
  display: grid;
  grid-template-columns: 1.2fr 0.95fr;
  gap: 48px;
  align-items: start;
  transition: all 0.3s ease;
}

.qr-tool-card:hover {
  border-color: var(--purple-200);
  box-shadow: 0 30px 80px -15px rgba(106, 28, 255, 0.16);
}

/* LEFT COLUMN: EDITING & CUSTOMIZATION */
.qr-left-col {
  display: flex;
  flex-direction: column;
}

/* TYPE SELECTOR PILLS */
.qr-type-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.qr-type-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--purple-50);
  border: 1.5px solid var(--purple-100);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: all 0.25s ease;
}

.qr-type-btn:hover {
  background: #ffffff;
  border-color: var(--purple-300);
  color: var(--purple-600);
  transform: translateY(-2px);
}

.qr-type-btn.active {
  background: var(--grad-primary, linear-gradient(135deg, #7c1cff 0%, #b070ff 100%)) !important;
  border-color: transparent !important;
  color: #ffffff !important;
  box-shadow: 0 6px 18px -3px rgba(106, 28, 255, 0.35);
  font-weight: 700;
}
.qr-type-btn.active i {
  color: #ffffff !important;
}

/* PANELS */
.qr-input-panel {
  display: none;
  animation: qrFadeIn 0.25s ease forwards;
}

.qr-input-panel.active {
  display: block;
}

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

/* INPUT LABELS & FIELDS */
.qr-field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
}

.qr-field-label i {
  color: var(--purple-600);
  margin-right: 6px;
}

.qr-field-sub {
  font-size: 0.84rem;
  color: var(--muted);
  font-weight: 500;
}

.qr-main-textarea {
  width: 100%;
  padding: 18px 20px;
  border: 2px solid var(--purple-200);
  border-radius: 18px;
  font-size: 1.05rem;
  line-height: 1.6;
  font-family: 'Outfit', sans-serif;
  color: var(--ink);
  background: #ffffff;
  resize: vertical;
  min-height: 120px;
  transition: all 0.25s ease;
  box-sizing: border-box;
}

.qr-main-input {
  width: 100%;
  padding: 15px 20px;
  border: 2px solid var(--purple-200);
  border-radius: 16px;
  font-size: 1rem;
  font-family: 'Outfit', sans-serif;
  color: var(--ink);
  background: #ffffff;
  box-sizing: border-box;
  transition: all 0.25s ease;
}

.qr-main-textarea:focus,
.qr-main-input:focus {
  outline: none;
  border-color: var(--purple-600);
  box-shadow: 0 0 0 4px rgba(124, 28, 255, 0.12);
}

.qr-inputs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

/* LOGO CUSTOMIZATION BLOCK */
.qr-custom-block {
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid var(--purple-100);
}

.qr-block-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 14px;
}

.qr-block-title span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qr-block-title i {
  color: var(--purple-600);
}

/* LOGO UPLOAD BOX */
.logo-upload-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.logo-file-label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--purple-50);
  border: 1.5px dashed var(--purple-300);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logo-file-label:hover {
  background: #ffffff;
  border-color: var(--purple-600);
}

.logo-file-label input[type="file"] {
  display: none;
}

.logo-file-label i {
  font-size: 1.25rem;
  color: var(--purple-600);
}

.logo-file-text {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}

.logo-preview-thumb {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid var(--purple-200);
  padding: 2px;
}

/* LOGO PRESETS */
.logo-presets-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.logo-preset-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--purple-50);
  border: 1px solid var(--purple-200);
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.2s ease;
}

.logo-preset-pill:hover {
  background: #ffffff;
  border-color: var(--purple-400);
}

.logo-preset-pill.active {
  background: var(--grad-primary, linear-gradient(135deg, #7c1cff 0%, #b070ff 100%)) !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: 0 4px 12px rgba(106, 28, 255, 0.25);
}
.logo-preset-pill.active i {
  color: #ffffff !important;
}

.logo-preset-pill img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

/* SLIDER ROW */
.logo-slider-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--purple-50);
  padding: 10px 18px;
  border-radius: 14px;
  border: 1px solid var(--purple-100);
}

.logo-slider-row label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.logo-slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--purple-600);
}

.logo-slider-row span {
  font-family: monospace;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--purple-700);
}

/* THEMES PRESETS (1-CLICK) */
.theme-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.theme-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--purple-50);
  border: 1.5px solid var(--purple-100);
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-pill:hover {
  background: #ffffff;
  border-color: var(--purple-300);
  transform: translateY(-2px);
}

.theme-pill.active {
  border-color: var(--purple-600);
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(106, 28, 255, 0.18);
  font-weight: 700;
}

.theme-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.custom-color-drawer {
  display: none;
  gap: 12px;
  margin-top: 14px;
  align-items: center;
}

.custom-color-drawer input[type="color"] {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: none;
}

/* RIGHT COLUMN: PREVIEW & ACTIONS */
.qr-right-col {
  background: radial-gradient(circle at 50% 0%, #faf6ff 0%, #ffffff 100%);
  border: 1.5px solid var(--purple-100);
  border-radius: 26px;
  padding: 34px 28px;
  text-align: center;
  position: sticky;
  top: 100px;
  box-shadow: 0 10px 30px rgba(42, 10, 94, 0.04);
}

.qr-preview-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.qr-preview-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.qr-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  background: #dcfce7;
  color: #15803d;
  padding: 4px 10px;
  border-radius: 999px;
}

.qr-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  animation: qrLivePulse 1.8s infinite;
}

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

/* QR CANVAS HOLDER */
.qr-canvas-holder {
  background: #ffffff;
  border: 1.5px solid var(--purple-200);
  border-radius: 22px;
  padding: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 10px 30px rgba(106, 28, 255, 0.08);
  min-width: 300px;
  min-height: 300px;
}

.qr-canvas-holder canvas,
.qr-canvas-holder svg {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
}

.pulse-render {
  animation: qrPop 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes qrPop {
  0% { transform: scale(0.96); opacity: 0.85; }
  100% { transform: scale(1); opacity: 1; }
}

/* LIVE SCAN OUTPUT BOX */
.scan-output-card {
  background: var(--purple-50);
  border: 1px solid var(--purple-200);
  border-radius: 14px;
  padding: 14px 16px;
  text-align: left;
  margin-bottom: 20px;
}

.scan-output-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.scan-output-label {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--purple-600);
}

.scan-output-content {
  font-size: 0.92rem;
  color: var(--ink);
  max-height: 70px;
  overflow-y: auto;
  word-break: break-word;
  white-space: pre-wrap;
  line-height: 1.5;
}

/* DOWNLOAD BUTTONS */
.qr-download-primary {
  width: 100%;
  justify-content: center;
  padding: 16px 28px;
  font-size: 1.05rem;
  margin-bottom: 12px;
  border-radius: 999px;
  cursor: pointer;
}

.qr-secondary-btns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.qr-mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1.5px solid var(--purple-200);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
}

.qr-mini-btn:hover {
  border-color: var(--purple-500);
  color: var(--purple-700);
  background: var(--purple-50);
  transform: translateY(-2px);
}

/* BENTO FEATURES SECTION */
.qr-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 26px;
  margin-top: 40px;
}

.qr-feature-tile {
  background: var(--purple-50);
  border: 1px solid var(--purple-100);
  border-radius: 24px;
  padding: 34px 28px;
  transition: all 0.3s ease;
}

.qr-feature-tile:hover {
  transform: translateY(-5px);
  border-color: var(--purple-300);
  box-shadow: 0 20px 50px -10px rgba(106, 28, 255, 0.12);
  background: #ffffff;
}

.qr-feature-tile .num {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--purple-300);
  display: block;
  margin-bottom: 16px;
}

.qr-feature-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: var(--grad-primary, linear-gradient(135deg, #7c1cff 0%, #b070ff 100%)) !important;
  color: #ffffff !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 18px;
  box-shadow: 0 8px 20px -3px rgba(106, 28, 255, 0.3);
}
.qr-feature-icon i {
  color: #ffffff !important;
}

.qr-feature-tile h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 8px;
}

.qr-feature-tile p {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.6;
}

/* FAQS ACCORDION */
.faq-item {
  background: var(--purple-50);
  border: 1px solid var(--purple-100);
  border-radius: 18px;
  overflow: hidden;
  transition: all 0.3s ease;
  margin-bottom: 14px;
}

.faq-item.open {
  border-color: var(--purple-300);
  box-shadow: var(--shadow-sm);
  background: #ffffff;
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 26px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  transition: color 0.2s;
}

.faq-item.open .faq-question {
  color: var(--purple-600);
}

.faq-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--purple-600);
  font-size: 0.85rem;
  transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
  background: var(--purple-600);
  color: #ffffff;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 26px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

.faq-item.open .faq-answer {
  max-height: 300px;
  padding: 0 26px 22px;
}

/* FAQ GRID RESPONSIVE */
.qr-faq-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 50px;
  align-items: start;
}

.qr-faq-sidebar {
  position: sticky;
  top: 100px;
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 1024px) {
  .qr-tool-card {
    grid-template-columns: 1fr;
    padding: 30px 22px;
    gap: 36px;
  }
  .qr-right-col {
    position: static;
    order: -1;
  }
  .qr-canvas-holder {
    min-width: auto;
    min-height: auto;
  }
}

@media (max-width: 992px) {
  .qr-faq-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .qr-faq-sidebar {
    position: static;
  }
}

@media (max-width: 640px) {
  .qr-tool-card {
    padding: 22px 16px;
    border-radius: 24px;
  }
  .qr-inputs-row {
    grid-template-columns: 1fr;
  }
  .qr-secondary-btns {
    grid-template-columns: 1fr;
  }
  .logo-upload-wrap {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .qr-canvas-holder {
    min-width: unset !important;
    width: 100% !important;
    max-width: 270px !important;
    min-height: 270px !important;
    padding: 12px !important;
  }
  .qr-canvas-holder canvas {
    max-width: 100% !important;
    height: auto !important;
  }
  .qr-tool-card {
    padding: 18px 12px;
    border-radius: 20px;
  }
  .qr-type-btn {
    padding: 8px 12px;
    font-size: 0.82rem;
  }
}
