/* ==========================================================================
   QRFixer Master Stylesheet
   Architecture: AI InnoCore Child Site Standard
   Audience: Tier-1 (US, UK, CA, AU) & Worldwide
   Accessibility: WCAG AA High Contrast Compliant
   ========================================================================== */

:root {
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --border-color: #cbd5e1;
  --border-subtle: #e2e8f0;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --success: #059669;
  --success-bg: #ecfdf5;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --header-height: 64px;
  --card-radius: 16px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
}

[data-theme="dark"] {
  --bg-page: #0b0f17;
  --bg-card: #151c28;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --border-color: #334155;
  --border-subtle: #1e293b;
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-light: #172554;
  --success: #10b981;
  --success-bg: #064e3b;
  --danger: #ef4444;
  --danger-bg: #450a0a;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: env(safe-area-inset-bottom);
}

.wrap {
  width: 100%;
  max-width: 1140px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* Header & Navigation Bar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(8px);
  padding-top: env(safe-area-inset-top);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 800;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.brand-logo-img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: contain;
  display: block;
}

.brand-name {
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.925rem;
  font-weight: 600;
  transition: color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  height: 100%;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon:hover {
  background: var(--border-subtle);
}

/* AI InnoCore Network Loader Styling */
[data-network="menu"] {
  display: inline-flex;
  align-items: center;
  height: 100%;
}

[data-network="menu"] .nw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 12px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

[data-network="menu"] .nw-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.nw-pop {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nw-pop::-webkit-scrollbar {
  display: none;
}

.nw-pop .nw-slider-track,
.nw-pop .nw-track,
.nw-pop [class*="arrow"],
.nw-pop [class*="slider-controls"] {
  display: none !important;
}

.nw-pop .nw-grid,
.nw-pop .nw-list {
  display: flex !important;
  flex-direction: column !important;
  overflow: visible !important;
  width: 100% !important;
}

/* Mobile Hamburger Menu */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border-color);
  cursor: pointer;
  padding: 0;
}

.hamburger-bar {
  display: block;
  width: 18px;
  height: 2px;
  background-color: var(--text-main);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.mobile-menu-btn.active .hamburger-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-btn.active .hamburger-bar:nth-child(2) { opacity: 0; }
.mobile-menu-btn.active .hamburger-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav-drawer {
  position: absolute;
  top: var(--header-height);
  left: 0;
  right: 0;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid var(--border-color);
  z-index: 49;
}

.mobile-nav-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: var(--shadow-lg);
  max-width: 440px;
  margin: 0 auto;
}

.mobile-nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mobile-nav-label {
  font-size: 0.725rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
}

.mobile-nav-link {
  display: block;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.15s ease;
}

.mobile-nav-link:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.mobile-nav-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 0.85rem 0;
}

.mobile-nav-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.mobile-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--primary);
  color: #ffffff !important;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: 99px;
  transition: background 0.15s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.mobile-cta-btn:hover { background: var(--primary-hover); }

@media (max-width: 990px) {
  .nav-links { display: none; }
  .mobile-menu-btn { display: flex; }
}

/* Hero Badge Pill */
.hero-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 7px 18px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.08);
}

[data-theme="dark"] .hero-badge-pill {
  background: #1e293b;
  border-color: #3b82f6;
  color: #93c5fd;
}

/* Top Quick Preset Chips Row (Hero) */
.hero-preset-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 1.75rem auto 2rem auto;
  max-width: 900px;
}

.hero-preset-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.hero-preset-chip:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: var(--shadow-md);
}

/* Card Main Tabs (Content vs Style & Branding) */
.card-main-tabs {
  display: flex;
  gap: 2rem;
  border-bottom: 2px solid var(--border-subtle);
  margin-bottom: 1.5rem;
}

.card-tab-btn {
  background: none;
  border: none;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-muted);
  padding: 0 0 0.75rem 0;
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease;
}

.card-tab-btn:hover {
  color: var(--text-main);
}

.card-tab-btn.active {
  color: var(--primary);
}

.card-tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

/* Content Type Chips Grid */
.content-type-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1.5rem;
}

.type-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.type-chip-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.type-chip-btn.active {
  background: #0f172a;
  color: #ffffff !important;
  border-color: #0f172a;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
}

[data-theme="dark"] .type-chip-btn.active {
  background: #2563eb;
  border-color: #2563eb;
}

/* Center Branding Preset Chips */
.preset-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 1.25rem;
}

.preset-chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.825rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-chip:hover {
  border-color: #0f172a;
  color: #0f172a;
}

.preset-chip.active {
  background: #0f172a;
  color: #ffffff !important;
  border-color: #0f172a;
}

[data-theme="dark"] .preset-chip.active {
  background: #38bdf8;
  color: #0f172a !important;
  border-color: #38bdf8;
}

/* Content Container Card Box */
.content-card-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 2rem;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.content-card-box p {
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 1rem;
  text-align: justify;
}

.content-card-box h2 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.content-card-box h2:first-child { margin-top: 0; }

.content-card-box ol,
.content-card-box ul {
  padding-left: 1.5rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.content-card-box li {
  margin-bottom: 0.5rem;
  line-height: 1.55;
}

/* Form Inputs, Selects & Textareas */
.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-main);
  margin-bottom: 0.45rem;
  text-transform: uppercase;
}

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

@media (min-width: 580px) {
  .form-grid { grid-template-columns: repeat(2, 1fr); }
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-family: inherit;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

input[type="color"].form-input {
  height: 44px;
  padding: 4px;
  cursor: pointer;
}

/* QR Canvas Preview Frame */
#qrPreviewContainer {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 280px;
  background: #ffffff;
  border: 1px dashed var(--border-color);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 1rem;
}

#qrCodeCanvas {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

#qrCodeCanvas canvas,
#qrCodeCanvas svg {
  max-width: 100%;
  height: auto !important;
  border-radius: 8px;
}

input[type="range"] { accent-color: var(--primary); }

/* Reusable 3-Column Cards */
.tools-3col-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 1.5rem;
}

@media (min-width: 580px) { .tools-3col-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .tools-3col-grid { grid-template-columns: repeat(3, 1fr); } }

.adguard-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.25rem 1.15rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
  transition: all 0.2s ease;
  min-height: 155px;
}

.adguard-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.adguard-card::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -15px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  opacity: 0.18;
  pointer-events: none;
  filter: blur(12px);
}

.card-accent-blue::after   { background: #2563eb; }
.card-accent-green::after  { background: #059669; }
.card-accent-purple::after { background: #7c3aed; }

.ac-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 0.4rem;
}

.ac-desc {
  font-size: 0.81rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 0.75rem;
}

.ac-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  position: relative;
  z-index: 2;
}

.ac-badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 99px;
  background: var(--bg-page);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.ac-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  transform: translateY(-2px);
}

/* Button UI Components */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.925rem;
  border-radius: 10px;
  padding: 0.75rem 1.4rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff !important;
}

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

/* AdSense Safety & Margin Clearances */
.ad-slot {
  display: none;
  margin-top: 35px;
  margin-bottom: 35px;
  clear: both;
}

.ad-slot.ad-active { display: block; }

.ad-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 6px;
  text-transform: uppercase;
}

/* Site Footer */
.site-footer {
  margin-top: 4rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0 2rem 0;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.footer-credit a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}

.footer-credit a:hover { text-decoration: underline; }

.footer-copy {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: color 0.15s ease;
}

.footer-links a:hover { color: var(--primary); }