/* ==========================================================================
   AI QR Code Generator - Reusable Components & Navigation
   ========================================================================== */

/* Header & Navigation Bar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

[data-theme="dark"] .site-header {
  background: rgba(11, 15, 25, 0.92);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* Brand Logo */
.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  min-height: 44px;
}

.brand-icon-box {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .brand-logo {
    font-size: 1.1rem;
    gap: 0.5rem;
  }
  .brand-icon-box {
    width: 34px;
    height: 34px;
  }
}

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

@media (min-width: 900px) {
  .nav-links {
    display: flex;
  }
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.15s ease;
  position: relative;
  padding: 0.5rem 0;
}

.nav-link:hover, .nav-link.active {
  color: var(--brand-primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--brand-primary);
  border-radius: var(--radius-full);
}

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

/* On small phones, hide the redundant header CTA button to prevent layout break/wrap */
@media (max-width: 540px) {
  .header-actions a.btn {
    display: none;
  }
  .header-actions {
    gap: 0.4rem;
  }
}

.theme-toggle-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  touch-action: manipulation;
}

.theme-toggle-btn:hover {
  background: var(--bg-surface-active);
  color: var(--brand-primary);
  border-color: var(--border-medium);
}

.mobile-menu-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  touch-action: manipulation;
}

.mobile-menu-btn:active {
  background: var(--bg-surface-active);
}

@media (min-width: 900px) {
  .mobile-menu-btn {
    display: none;
  }
}

/* Mobile Drawer */
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mobile-nav-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  max-width: 86vw;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-medium);
  z-index: 160;
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.25rem 2.5rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: -6px 0 25px rgba(0, 0, 0, 0.3);
}

.mobile-nav-drawer.open {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1rem;
}

.mobile-drawer-title {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mobile-drawer-close {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.15s ease;
}

.mobile-drawer-close:active, .mobile-drawer-close:hover {
  background: var(--bg-surface-active);
  color: var(--brand-primary);
}

.mobile-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.mobile-nav-link {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md);
  min-height: 44px;
  transition: background 0.15s ease, color 0.15s ease;
}

.mobile-nav-link:hover, .mobile-nav-link.active {
  background: var(--bg-surface-elevated);
  color: var(--brand-primary);
}

/* Footer Component */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 4.5rem 0 2rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-bottom: 3.5rem;
}

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

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  }
}

.footer-col-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-link {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: var(--brand-primary);
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
  }
}

/* Feature Cards & Bento Grid */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 3rem;
}

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

@media (min-width: 1024px) {
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow-xs);
}

.feature-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
}

.feature-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--grad-glow);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-primary);
  margin-bottom: 1.25rem;
}

/* QR Types Explorer Grid */
.qr-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
}

.qr-type-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-xs);
}

.qr-type-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-md);
}

.qr-type-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-primary);
  flex-shrink: 0;
}

.qr-type-content {
  flex: 1;
}

.qr-type-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.qr-type-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Comparison Table */
.comparison-table-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  margin-top: 2.5rem;
  box-shadow: var(--shadow-xs);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 600px;
}

.comparison-table th, .comparison-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.comparison-table th {
  background: var(--bg-surface-elevated);
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table td {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.check-icon {
  color: var(--accent-emerald);
  font-weight: bold;
}

.cross-icon {
  color: var(--accent-rose);
  font-weight: bold;
}

/* Style Showcase Cards */
.style-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  margin-top: 2.5rem;
}

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

@media (min-width: 1024px) {
  .style-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .style-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.style-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xs);
}

.style-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-md);
}

.style-card-preview {
  position: relative;
  aspect-ratio: 1;
  background: var(--bg-surface-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.style-card-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.style-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.style-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.style-card-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex: 1;
}

.style-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

/* FAQ Accordions */
.faq-accordion {
  max-width: 860px;
  margin: 3rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--shadow-xs);
}

.faq-item.active {
  border-color: var(--brand-primary);
}

.faq-question {
  width: 100%;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  text-align: left;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  background: none;
  border: none;
}

.faq-icon {
  width: 20px;
  height: 20px;
  color: var(--brand-primary);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0, 1, 0, 1);
}

.faq-answer-inner {
  padding: 0 1.5rem 1.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Toast Notifications Container */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

@media (max-width: 640px) {
  .toast-container {
    bottom: 1.25rem;
    left: 1rem;
    right: 1rem;
    align-items: center;
  }
}

.toast {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

@media (max-width: 640px) {
  .toast {
    width: 100%;
    max-width: 420px;
    justify-content: center;
  }
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--brand-primary);
}

.toast-success .toast-dot { background: var(--accent-emerald); }
.toast-error .toast-dot { background: var(--accent-rose); }
.toast-info .toast-dot { background: var(--brand-primary); }

/* Breadcrumb Navigation */
.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.breadcrumb-nav a {
  color: var(--text-secondary);
}

.breadcrumb-nav a:hover {
  color: var(--brand-primary);
}

/* Popular QR Generators Grid */
.popular-tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 2rem;
}

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

@media (min-width: 1024px) {
  .popular-tools-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.popular-tool-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-xs);
  text-decoration: none;
  color: inherit;
}

.popular-tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-md);
}

.popular-tool-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--grad-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-primary);
  margin-bottom: 1rem;
}

.popular-tool-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.popular-tool-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.popular-tool-cta {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Dedicated Landing Page Embedded Tool */
.landing-tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 3rem;
}

@media (min-width: 992px) {
  .landing-tool-grid {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: start;
    gap: 2rem;
  }
}

.landing-tool-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.landing-preview-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
}

@media (max-width: 640px) {
  .landing-tool-panel, .landing-preview-box {
    padding: 1.25rem;
  }
}

.landing-canvas-wrapper {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.landing-canvas-wrapper canvas {
  width: 100%;
  height: 100%;
  display: block;
}
