/* ==========================================================================
   LINK TO QR — REFINED NEO-BRUTALIST DESIGN SYSTEM
   Theme: High-End, Spacious, Uncluttered, Bold Contrast & Tactile Controls
   Deployment: https://qr.ramascript.com/
   Developer: Ramanand Kumar (ramascript.com)
   ========================================================================== */

:root {
  --bg: #f5f2eb;
  --surface: #ffffff;
  --ink: #000000;
  --yellow: #ffe600;
  --yellow-hover: #ffd500;
  --green: #10b981;
  --green-bg: #ecfdf5;
  --red: #ef4444;
  --red-bg: #fef2f2;
  --border-width: 2.5px;
  --shadow-sm: 3px 3px 0px #000000;
  --shadow-md: 5px 5px 0px #000000;
  --shadow-lg: 7px 7px 0px #000000;
  --font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

html, body {
  min-height: 100vh;
}

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background-color: var(--bg);
  background-image: radial-gradient(#000000 0.75px, transparent 0.75px);
  background-size: 24px 24px;
  display: flex;
  flex-direction: column;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

/* ==========================================================================
   LAYOUT CONTAINER
   ========================================================================== */

.app-wrapper {
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 24px 60px;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  gap: 24px;
}

/* ==========================================================================
   TOPBAR
   ========================================================================== */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: var(--border-width) solid var(--ink);
  box-shadow: var(--shadow-md);
  padding: 12px 20px;
  gap: 16px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: var(--yellow);
  padding: 6px 14px;
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0px var(--ink);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.privacy-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f0fdf4;
  border: 2px solid var(--ink);
  padding: 6px 12px;
  box-shadow: 2px 2px 0px var(--ink);
}

.util-btn {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  background: #ffffff;
  border: 2px solid var(--ink);
  padding: 6px 14px;
  cursor: pointer;
  box-shadow: 2px 2px 0px var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.1s ease;
}

.util-btn:hover {
  background: #fee2e2;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px var(--ink);
}

.util-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px var(--ink);
}

/* ==========================================================================
   MAIN WORKSPACE CARD
   ========================================================================== */

.main-container {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.workspace-card {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  background: var(--surface);
  border: var(--border-width) solid var(--ink);
  box-shadow: var(--shadow-lg);
  gap: 0;
}

/* Controls Column (Left) */
.controls-col {
  padding: 32px 34px;
  border-right: var(--border-width) solid var(--ink);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Preview Column (Right) */
.preview-col {
  padding: 32px 34px;
  background: #fafaf8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

/* Section Label */
.col-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--ink);
  margin-bottom: 8px;
  display: block;
}

/* ==========================================================================
   TABS
   ========================================================================== */

.tabs-header {
  display: flex;
  flex-direction: column;
}

.type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab-btn {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  background: #ffffff;
  border: 2px solid var(--ink);
  padding: 8px 13px;
  cursor: pointer;
  box-shadow: 2px 2px 0px var(--ink);
  transition: all 0.1s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tab-btn:hover {
  background: #f4f4f5;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px var(--ink);
}

.tab-btn.active {
  background: var(--yellow);
  box-shadow: 2px 2px 0px var(--ink);
  font-weight: 800;
}

.tab-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px var(--ink);
}

/* ==========================================================================
   INPUT SECTION
   ========================================================================== */

.input-section {
  display: flex;
  flex-direction: column;
}

.input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.char-counter {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: #666666;
}

.input-wrapper {
  position: relative;
  display: flex;
}

#qr-input {
  width: 100%;
  border: var(--border-width) solid var(--ink);
  box-shadow: var(--shadow-sm);
  padding: 14px 44px 14px 14px;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 500;
  background: #ffffff;
  resize: vertical;
  min-height: 96px;
  outline: none;
  transition: background 0.15s, box-shadow 0.15s;
}

#qr-input:focus {
  background: #fffdf2;
  box-shadow: 4px 4px 0px var(--ink);
}

.clear-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 1.5px 1.5px 0px var(--ink);
  transition: all 0.1s ease;
}

.clear-btn:hover {
  background: var(--yellow);
}

.clear-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 0px 0px 0px var(--ink);
}

/* ==========================================================================
   OPTIONS SECTION (UNCLUTTERED ROW)
   ========================================================================== */

.options-section {
  display: flex;
  flex-direction: column;
}

.options-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.opt-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 2px solid var(--ink);
  padding: 6px 10px;
  box-shadow: 2px 2px 0px var(--ink);
}

.opt-field label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
}

.opt-color input[type="color"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--ink);
  background: transparent;
  cursor: pointer;
  padding: 0;
}

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

.opt-color input[type="color"]::-webkit-color-swatch {
  border: none;
}

.opt-select select {
  border: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  padding-right: 4px;
}

/* ==========================================================================
   QR PREVIEW STAGE
   ========================================================================== */

.qr-canvas-card {
  width: 100%;
  background: #ffffff;
  border: var(--border-width) solid var(--ink);
  box-shadow: var(--shadow-md);
  display: grid;
  place-items: center;
  padding: 24px;
  min-height: 270px;
}

.qr-target {
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-target canvas,
.qr-target img {
  display: block;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0px var(--ink);
  background: #ffffff;
}

/* ==========================================================================
   STATUS BAR
   ========================================================================== */

.status-bar {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  background: #ffffff;
  border: 2px solid var(--ink);
  padding: 7px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 2px 2px 0px var(--ink);
}

.status-dot {
  width: 8px;
  height: 8px;
  background-color: var(--green);
  border-radius: 50%;
  border: 1px solid var(--ink);
  display: inline-block;
  flex-shrink: 0;
}

.status-bar.error .status-dot {
  background-color: var(--red);
}

.status-bar.error {
  background: var(--red-bg);
}

.status-bar.updated {
  background: var(--green-bg);
}

/* ==========================================================================
   ACTIONS GROUP (ONLY DOWNLOAD & COPY IMAGE)
   ========================================================================== */

.actions-group {
  width: 100%;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 800;
  cursor: pointer;
  border: var(--border-width) solid var(--ink);
  text-decoration: none;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  user-select: none;
  padding: 13px 16px;
}

.btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-hover);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0px var(--ink);
}

.btn-download {
  background: var(--yellow);
  color: var(--ink);
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
}

.btn-download:hover {
  background: var(--yellow-hover);
  box-shadow: 4px 4px 0px var(--ink);
}

.btn-generate {
  width: 100%;
  background: var(--ink);
  color: #ffffff;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-sm);
  display: flex;
  justify-content: space-between;
  padding: 13px 18px;
}

.btn-generate:hover {
  background: #18181b;
  color: var(--yellow);
  box-shadow: 4px 4px 0px var(--ink);
}

.btn-kbd {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 3px 7px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #ffffff;
}

.btn-generate:hover .btn-kbd {
  border-color: var(--yellow);
  color: var(--yellow);
}

.btn-copy-img {
  background: #ffffff;
  color: var(--ink);
  font-size: 0.85rem;
  box-shadow: var(--shadow-sm);
  font-family: var(--font-mono);
}

.btn-copy-img:hover {
  background: #f4f4f5;
  box-shadow: 4px 4px 0px var(--ink);
}

/* ==========================================================================
   SEMANTIC SEO SECTION
   ========================================================================== */

.seo-section {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.seo-card {
  background: var(--surface);
  border: var(--border-width) solid var(--ink);
  box-shadow: var(--shadow-md);
  padding: 28px 32px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 10px;
}

.step-card {
  background: #fafaf8;
  border: 2px solid var(--ink);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
  background: var(--yellow);
  border: 1.5px solid var(--ink);
  padding: 2px 7px;
  width: fit-content;
  box-shadow: 1px 1px 0px var(--ink);
}

.step-title {
  font-size: 1rem;
  font-weight: 800;
  margin-top: 4px;
}

.step-desc {
  font-size: 0.82rem;
  color: #555555;
  line-height: 1.5;
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.faq-item {
  border: 2px solid var(--ink);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  transition: all 0.1s ease;
}

.faq-item[open] {
  background: #fffdf5;
  box-shadow: 3px 3px 0px var(--ink);
}

.faq-question {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.92rem;
  font-weight: 800;
  user-select: none;
  gap: 12px;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-toggle {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 800;
  border: 1.5px solid var(--ink);
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  background: var(--yellow);
  box-shadow: 1px 1px 0px var(--ink);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.faq-item[open] .faq-toggle {
  transform: rotate(45deg);
  background: var(--ink);
  color: #ffffff;
}

.faq-answer {
  padding: 0 18px 14px 18px;
  font-size: 0.85rem;
  color: #333333;
  line-height: 1.6;
}

/* ==========================================================================
   CLEAN FOOTER
   ========================================================================== */

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--surface);
  border: var(--border-width) solid var(--ink);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.footer-badge {
  background: var(--yellow);
  border: 1.5px solid var(--ink);
  padding: 2px 7px;
  font-weight: 800;
}

.footer-domain {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 700;
}

.footer-dev {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dev-label {
  color: #666666;
}

.dev-link {
  color: var(--ink);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dev-link:hover {
  background: var(--yellow);
}

.dev-sep {
  color: #aaaaaa;
}

.dev-email {
  color: var(--ink);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  background: #f4f4f5;
  border: 1.5px solid var(--ink);
  padding: 2px 8px;
  box-shadow: 1.5px 1.5px 0px var(--ink);
  transition: all 0.1s ease;
}

.dev-email:hover {
  background: var(--yellow);
  transform: translate(-1px, -1px);
  box-shadow: 2px 2px 0px var(--ink);
}

.dev-email:active {
  transform: translate(1px, 1px);
  box-shadow: 0px 0px 0px var(--ink);
}

.icon-inline {
  vertical-align: middle;
  flex-shrink: 0;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 860px) {
  .workspace-card {
    grid-template-columns: 1fr;
  }

  .controls-col {
    border-right: none;
    border-bottom: var(--border-width) solid var(--ink);
    padding: 24px;
  }

  .preview-col {
    padding: 24px;
  }

  .steps-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 580px) {
  .app-wrapper {
    padding: 16px 14px 40px;
    gap: 16px;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px;
  }

  .topbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .actions-group {
    grid-template-columns: 1fr;
  }

  .seo-card {
    padding: 20px 18px;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
