/* QR Generator CSS */

.mt-2 { margin-top: 8px; }
.mt-large { margin-top: 60px; }
.text-center { text-align: center; }
.text-danger { color: #dc2626; }
.btn--full { width: 100%; display: block; text-align: center; }

/* Grid Layout */
.qr-app {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 40px;
  align-items: start;
}

@media (max-width: 900px) {
  .qr-app {
    grid-template-columns: 1fr;
  }
}

/* Left Column: Preview */
.qr-preview-section {
  position: sticky;
  top: 100px;
  z-index: 10;
}
@media (max-width: 900px) {
  .qr-preview-section {
    position: static;
    order: -1; /* Ensure it's on top */
  }
}

.qr-card {
  background: #fff;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

.qr-canvas-wrap {
  width: 100%;
  max-width: 300px; /* Fixed visual size */
  margin: 0 auto 20px auto;
  aspect-ratio: 1/1;
  background-color: #f9fafb;
  border-radius: 8px;
  border: 1px solid #f3f4f6;
  
  /* Checkerboard for transparency */
  background-image: 
    linear-gradient(45deg, #eee 25%, transparent 25%), 
    linear-gradient(-45deg, #eee 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #eee 75%), 
    linear-gradient(-45deg, transparent 75%, #eee 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden; /* CRITICAL: prevents overflow */
}

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

/* Ensure canvas/img scales down to fit container */
#qrCode canvas, #qrCode img {
  max-width: 100% !important;
  max-height: 100% !important;
  height: auto !important;
  width: auto !important;
  object-fit: contain;
}

/* Right Column: Settings */
.grid-2-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.color-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 8px;
  background: #fff;
}

.color-input-wrap input[type="color"] {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
}

.range-slider {
  width: 100%;
  cursor: pointer;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted, #6b7280);
  margin-top: 4px;
}

.separator {
  border: 0;
  border-top: 1px solid var(--line, #e5e7eb);
  margin: 24px 0;
}

.logo-controls {
  display: flex;
  align-items: flex-end;
  gap: 15px;
}