/**
 * WordPress Plugin: Free QR Barcode Tool
 * Scoped Frontend Styles
 */

.fqbt-unified-wrapper {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  box-sizing: border-box;
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px;
  color: #1e293b;
}

/* Ensure box-sizing across child elements list */
.fqbt-unified-wrapper *,
.fqbt-unified-wrapper *::before,
.fqbt-unified-wrapper *::after {
  box-sizing: border-box;
}

/* TABS CONTAINER NAVIGATION */
.fqbt-tabs-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}

.fqbt-tab-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  background-color: #ffffff;
  color: #475569;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.fqbt-tab-btn:hover {
  background-color: #f8fafc;
  color: #0f172a;
}

.fqbt-tab-btn.fqbt-active {
  background-color: #4f46e5; /* Indigo */
  color: #ffffff;
  border-color: #4f46e5;
  box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2), 0 2px 4px -1px rgba(79, 70, 229, 0.1);
}

/* WORKSPACE STRUCTURAL GRID */
.fqbt-workspace-grid {
  width: 100%;
}

.fqbt-row-layout {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  align-items: start;
}

.fqbt-col-forms {
  grid-column: span 12;
}

.fqbt-col-preview {
  grid-column: span 12;
}

@media (min-width: 1024px) {
  .fqbt-col-forms {
    grid-column: span 7;
  }
  .fqbt-col-preview {
    grid-column: span 5;
  }
}

/* THE CONTAINER CARDS */
.fqbt-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02), 0 1px 2px rgba(0, 0, 0, 0.04);
}

.fqbt-preview-card {
  background-color: #0f172a; /* Slate-900 */
  border: 1px solid #1e293b;
  border-radius: 16px;
  padding: 24px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
}

/* HEADINGS AND METADATA */
.fqbt-section-heading {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #64748b;
  margin-top: 0;
  margin-bottom: 16px;
}

.fqbt-preview-title {
  font-size: 11px;
  font-family: monospace;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #818cf8; /* Light Indigo */
  margin-top: 0;
  margin-bottom: 16px;
}

/* TYPES SUB-BUTTON SELECTION */
.fqbt-mode-buttons-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

@media (min-width: 480px) {
  .fqbt-mode-buttons-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.fqbt-btn-mode {
  padding: 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: bold;
  text-align: center;
  border: 1px solid #e2e8f0;
  background-color: #f8fafc;
  color: #475569;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.1s ease;
}

.fqbt-btn-mode:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.fqbt-btn-mode.fqbt-active {
  background-color: #4f46e5;
  border-color: #4f46e5;
  color: #ffffff;
}

/* INPUTS PANES SECTIONS */
.fqbt-payload-inputs {
  margin-bottom: 24px;
}

.fqbt-input-pane {
  display: none;
}

.fqbt-input-pane.fqbt-active {
  display: block;
  animation: fqbtFade 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.fqbt-input-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.fqbt-input-field {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  font-size: 13.5px;
  color: #1e293b;
  background-color: #ffffff;
  outline: none;
  font-family: inherit;
  transition: border-color  0.15s ease, box-shadow 0.15s ease;
}

.fqbt-input-field:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

textarea.fqbt-input-field {
  resize: vertical;
}

.fqbt-helper-text {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
  margin-bottom: 0;
}

/* GRID ROWS AND COLUMNS */
.fqbt-form-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.fqbt-form-group {
  flex: 1;
}

@media (min-width: 576px) {
  .fqbt-form-row.fqbt-col-2 {
    flex-direction: row;
  }
}

.fqbt-checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
}

.fqbt-checkbox-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: #4f46e5;
}

.fqbt-checkbox-label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  user-select: none;
}

/* CUSTOM SWATCHES AND SPECIAL COMPONENTS */
.fqbt-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  background-color: #eff6ff;
  color: #1e40af;
  margin-bottom: 10px;
}

.fqbt-customizations-group {
  border-t: 1px solid #f1f5f9;
  padding-top: 20px;
  margin-top: 20px;
}

.fqbt-options-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.05em;
  margin-top: 0;
  margin-bottom: 12px;
}

/* COLOR SELECTION PRESET DESIGN */
.fqbt-color-picker-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background-color: #ffffff;
}

.fqbt-color-picker {
  -webkit-appearance: none;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  background: none;
}

.fqbt-color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}

.fqbt-color-picker::-webkit-color-swatch {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}

.fqbt-color-hex {
  font-size: 12px;
  font-family: monospace;
  font-weight: bold;
  color: #475569;
}

/* PRESETS FOR BARCODE SLIDER RANGE */
input[type="range"].fqbt-bc-height {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  width: 100%;
}

input[type="range"].fqbt-bc-height:focus {
  outline: none;
}

input[type="range"].fqbt-bc-height::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  background: #cbd5e1;
  border-radius: 3px;
}

input[type="range"].fqbt-bc-height::-webkit-slider-thumb {
  height: 18px;
  width: 18px;
  border-radius: 50%;
  background: #10b981;
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: -6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.1s ease;
}

input[type="range"].fqbt-bc-height::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  background: #059669;
}

/* GRAPHIC OUTPUT STAGE */
.fqbt-graphics-stage {
  background-color: #ffffff;
  padding: 24px;
  border-radius: 12px;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}

.fqbt-graphics-stage canvas,
.fqbt-graphics-stage svg {
  max-width: 100%;
  height: auto;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fqbt-graphics-stage canvas:hover,
.fqbt-graphics-stage svg:hover {
  transform: scale(1.02);
}

/* METADATA DISPLAYS */
.fqbt-meta-panel {
  background-color: #030712;
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 12px;
  margin-top: 20px;
}

.fqbt-meta-title {
  display: block;
  font-size: 8px;
  font-family: monospace;
  color: #94a3b8;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.fqbt-meta-value {
  font-size: 11px;
  font-family: monospace;
  color: #cbd5e1;
  word-break: break-all;
  max-height: 60px;
  overflow-y: auto;
  line-height: 1.4;
}

/* BUTTONS PLATFORMS */
.fqbt-btn-primary {
  width: 100%;
  padding: 12px;
  font-size: 13px;
  font-weight: 800;
  border-radius: 10px;
  border: none;
  background-color: #4f46e5;
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.15s ease;
  margin-top: 8px;
}

.fqbt-btn-primary:hover {
  background-color: #4338ca;
}

.fqbt-actions-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.fqbt-btn-sec {
  padding: 10px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid #334155;
  background-color: #1e293b;
  color: #cbd5e1;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fqbt-btn-sec:hover {
  background-color: #334155;
  color: #ffffff;
}

.fqbt-btn-accent {
  padding: 10px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid #4f46e5;
  background-color: #4f46e5;
  color: #ffffff;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.15);
}

.fqbt-btn-accent:hover {
  background-color: #4338ca;
  border-color: #4338ca;
}

/* SECTION TOGGLE LOGIC */
.fqbt-section-qr,
.fqbt-section-barcode {
  display: none !important;
}

.fqbt-section-qr.fqbt-active-pane,
.fqbt-section-barcode.fqbt-active-pane {
  display: block !important;
}

/* EXTRAS CHECKOUT CODES */
.fqbt-warning-alert {
  padding: 10px 14px;
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 12px;
}

.d-none {
  display: none !important;
}

/* SHORTCODE INJECTIONS SPECIFIC LAYOUT FORCING */

/* If type is "barcode", display ONLY barcode */
.fqbt-unified-wrapper[data-type="barcode"] .fqbt-section-barcode {
  display: block !important;
}
.fqbt-unified-wrapper[data-type="barcode"] .fqbt-section-qr {
  display: none !important;
}

/* If single mode parameters chosen on shortcode list, hide tabs and mode selections */
.fqbt-unified-wrapper[data-type="url"] .fqbt-mode-selector,
.fqbt-unified-wrapper[data-type="text"] .fqbt-mode-selector,
.fqbt-unified-wrapper[data-type="email"] .fqbt-mode-selector,
.fqbt-unified-wrapper[data-type="phone"] .fqbt-mode-selector,
.fqbt-unified-wrapper[data-type="sms"] .fqbt-mode-selector,
.fqbt-unified-wrapper[data-type="whatsapp"] .fqbt-mode-selector,
.fqbt-unified-wrapper[data-type="wifi"] .fqbt-mode-selector,
.fqbt-unified-wrapper[data-type="vcard"] .fqbt-mode-selector {
  display: none !important;
}

/* Support active specific QR layout defaults */
.fqbt-unified-wrapper[data-type="url"] .fqbt-section-qr,
.fqbt-unified-wrapper[data-type="text"] .fqbt-section-qr,
.fqbt-unified-wrapper[data-type="email"] .fqbt-section-qr,
.fqbt-unified-wrapper[data-type="phone"] .fqbt-section-qr,
.fqbt-unified-wrapper[data-type="sms"] .fqbt-section-qr,
.fqbt-unified-wrapper[data-type="whatsapp"] .fqbt-section-qr,
.fqbt-unified-wrapper[data-type="wifi"] .fqbt-section-qr,
.fqbt-unified-wrapper[data-type="vcard"] .fqbt-section-qr {
  display: block !important;
}

/* Hide fallback headers when non-all modes are active */
.fqbt-unified-wrapper:not([data-type="all"]) .fqbt-hide-if-all {
  display: none !important;
}
