/* ==========================================================================
   Backport Styles — Modern UI components for legacy font generators
   Vanilla CSS equivalents of the base-font-generator TailwindCSS components
   ========================================================================== */

/* ---------- Bootstrap Utility Classes ---------- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-white { color: #fff; }

/* ---------- Options Panel ---------- */
.options-panel {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  margin-bottom: 0;
}
.options-panel:first-child {
  border-radius: 8px 8px 0 0;
}
.options-panel:last-child {
  border-radius: 0 0 8px 8px;
}

.options-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 16px;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
  background: #fff;
  box-shadow: 0 4px 6px -10px rgba(0, 0, 0, 0.1);
  font-family: Arial, Helvetica, sans-serif;
}

.options-body {
  background: linear-gradient(to bottom, #e5e7eb, #e5e7eb);
  padding: 12px;
}

/* ---------- Options Grid ---------- */
.option-grid {
  display: grid;
  gap: 12px;
  width: 100%;
  font-size: 1rem;
}
.option-grid.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}
.option-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}
.option-grid.cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.option-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.option-item > label:last-child {
  font-size: 1rem;
  margin-top: 4px;
  text-align: center;
  font-weight: 600;
}

/* ---------- CSS Toggle Switch ---------- */
.toggle-switch {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.toggle-switch input[type='checkbox'] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.toggle-track {
  display: block;
  width: 52px;
  height: 28px;
  border-radius: 9999px;
  background-color: #d1d5db;
  position: relative;
  transition: background-color 0.3s ease;
}
.toggle-switch input:checked + .toggle-track {
  background-color: #059669;
}
.toggle-dot {
  position: absolute;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 9999px;
  top: 3px;
  left: 3px;
  transition: transform 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.toggle-switch input:checked + .toggle-track .toggle-dot {
  transform: translateX(24px);
}

/* ---------- Range Slider ---------- */
.modern-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 9999px;
  background: #d1d5db;
  outline: none;
  cursor: pointer;
}
.modern-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #059669;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.modern-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #059669;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

/* ---------- Floating Action Buttons ---------- */
.floating-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  border: none;
  outline: none;
  cursor: pointer;
  padding: 0;
  font-size: 1.5rem;
  line-height: 1;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.15),
    0 2px 4px -2px rgba(0, 0, 0, 0.1);
  transition:
    background-color 0.15s ease,
    transform 0.15s ease;
  background-color: #059669;
  color: #fff;
}
.floating-btn:hover {
  background-color: #2ac292;
  transform: scale(1.05);
}
.floating-btn.reset {
  background: #ef4444;
  color: #fff;
}
.floating-btn.reset:hover {
  background: #dc2626;
}

.action-bar {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
}

/* ---------- Color Swatch ---------- */
.color-swatch {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 0;
  width: 44px;
  height: 44px;
  cursor: pointer;
}
.color-swatch::-webkit-color-swatch-wrapper {
  padding: 0;
}
.color-swatch::-webkit-color-swatch {
  border: 2px solid #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.color-swatch::-moz-color-swatch {
  border: 2px solid #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.color-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.color-item label {
  font-size: 1rem;
  color: #4b5563;
  font-weight: 600;
}

/* ---------- Tailwind Utility Fallbacks (for shared includes) ---------- */
.tw-grid { display: grid; }
.tw-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.tw-gap-2 { gap: 0.5rem; }
.tw-rounded-md { border-radius: 0.375rem; }
.tw-relative { position: relative; }
.tw-hidden { display: none; }
.tw-max-w-screen-lg { max-width: 1024px; }
.tw-mx-auto { margin-left: auto; margin-right: auto; }
.tw-mb-4 { margin-bottom: 1rem; }
.tw-inline-block { display: inline-block; }

@media (min-width: 768px) {
  .md\:tw-inline-block { display: inline-block; }
}

/* ---------- Footer & Citation Layout Fix ---------- */
#footer .clearfix,
#citation .clearfix {
  display: flex;
  flex-wrap: wrap;
}

#citation .clearfix > .col-lg-12 {
  flex: 0 0 100%;
  max-width: 100%;
}

#citation blockquote {
  padding: 1rem;
  margin: 1rem 0;
}

#footer .list-group-item {
  background: transparent;
  border: none;
  padding: 0;
}

/* ---------- Related Tools / Cite Overlap Fix ---------- */
.ot_tools_wrapper {
  position: relative;
  z-index: 1;
  clear: both;
  overflow: visible;
  margin-bottom: 20px;
}

.writeup {
  overflow: visible;
}

/* ---------- Bootstrap Grid Fallback (for generators without Bootstrap CSS) ---------- */
.row {
  display: flex;
  flex-wrap: wrap;
}

.col-md-6,
.col-md-12,
.col-lg-3,
.col-lg-12 {
  box-sizing: border-box;
  min-height: 1px;
}

.form-container .row {
  min-width: 0;
  max-width: 100%;
}

.form-container .col-md-6 {
  box-sizing: border-box;
}

.form-container .row::before,
.form-container .row::after {
  display: none;
}

@media (min-width: 768px) {
  .col-md-6 { flex: 1 1 0%; max-width: 50%; }
  .col-md-12 { flex: 0 0 100%; max-width: 100%; }
  .form-container .col-md-6 {
    flex: 1 1 0% !important;
    max-width: none !important;
  }
}

@media (min-width: 992px) {
  .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
  .col-lg-12 { flex: 0 0 100%; max-width: 100%; }
}

@media (max-width: 991px) {
  .col-lg-3 { flex: 0 0 50%; max-width: 50%; }
}

@media (max-width: 767px) {
  .col-md-6 { flex: 0 0 100% !important; max-width: 100% !important; }
  .col-lg-3 { flex: 0 0 100%; max-width: 100%; }
  .form-container .col-md-6 {
    margin-left: 0 !important;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .option-grid.cols-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  .option-grid.cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .tw-grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}
