/* ==========================================================================
   Genetics & Calculator Specialized Stylesheet
   Mendelian Punnett Squares, Loci Selectors, Color Swatches
   ========================================================================== */

.calc-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .calc-layout {
    grid-template-columns: 1fr;
  }
}

/* Card Wrappers */
.calc-card {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

.calc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.calc-card-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Breed Quick Presets Selector */
.preset-selector-bar {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.preset-selector-bar label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy-dark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.preset-pills-wrap {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.preset-pill {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-pill:hover {
  border-color: var(--pink-accent);
  color: var(--pink-accent);
}

.preset-pill.active {
  background: var(--pink-accent);
  color: #FFFFFF;
  border-color: var(--pink-accent);
}

/* Dual Column Sire & Dam Inputs */
.parents-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 640px) {
  .parents-grid {
    grid-template-columns: 1fr;
  }
}

.parent-box {
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.parent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.parent-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy-dark);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.parent-title.sire {
  color: #1E40AF;
}

.parent-title.dam {
  color: #BE185D;
}

.locus-item {
  margin-bottom: 1rem;
}

.locus-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.locus-name {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-main);
}

.locus-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.locus-select {
  width: 100%;
  font-family: var(--font-main);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.55rem 0.75rem;
  background: #FFFFFF;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--navy-dark);
  outline: none;
  transition: border-color 0.2s ease;
}

.locus-select:focus {
  border-color: var(--pink-accent);
}

/* Action Buttons */
.calc-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.btn-calc-large {
  flex: 1;
  background: linear-gradient(135deg, var(--pink-accent), var(--pink-deep));
  color: #FFFFFF;
  border: none;
  font-family: var(--font-main);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.9rem 1.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(194, 105, 125, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-calc-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(194, 105, 125, 0.5);
}

.btn-reset {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-reset:hover {
  background: var(--border-light);
}

/* Results Sticky Panel */
.results-panel {
  position: sticky;
  top: 90px;
}

.results-card {
  background: #FFFFFF;
  border: 2px solid var(--pink-mid);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.results-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--navy-dark);
}

.summary-stat-box {
  background: var(--pink-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.summary-stat-val {
  font-size: 2rem;
  font-weight: 800;
  color: var(--pink-deep);
  line-height: 1;
}

.summary-stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-top: 0.25rem;
}

/* Phenotype Distribution List */
.phenotype-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.phenotype-item {
  background: var(--bg-page);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1rem;
  transition: all 0.2s ease;
}

.phenotype-item:hover {
  border-color: var(--pink-mid);
  box-shadow: var(--shadow-sm);
}

.phenotype-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.phenotype-name-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.color-swatch-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.phenotype-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy-dark);
}

.phenotype-percent {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--pink-accent);
}

.progress-track {
  height: 8px;
  background: #E5E7EB;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #F8BBD0, #C2697D);
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.phenotype-genotype-code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.market-val-tag {
  display: inline-block;
  background: #FEF3C7;
  color: #B45309;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  margin-left: 0.5rem;
}

/* Warnings and Alerts */
.warning-alert-box {
  background: #FEF2F2;
  border: 1.5px solid #FCA5A5;
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.warning-icon {
  font-size: 1.25rem;
  color: #DC2626;
  flex-shrink: 0;
}

.warning-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #991B1B;
  margin-bottom: 0.25rem;
}

.warning-text {
  font-size: 0.8rem;
  color: #B91C1C;
  line-height: 1.45;
}

/* Carriers Box */
.carrier-tags-box {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.carrier-tags-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #1E40AF;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.carrier-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.carrier-pill {
  background: #FFFFFF;
  border: 1px solid #93C5FD;
  color: #1D4ED8;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

/* PDF Report Upsell Box in Results */
.report-upsell-card {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy-mid));
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
}

.report-upsell-badge {
  display: inline-block;
  background: var(--gold-accent);
  color: var(--navy-dark);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.report-upsell-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.report-upsell-desc {
  font-size: 0.825rem;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 1.25rem;
}

.btn-download-pdf {
  display: inline-block;
  width: 100%;
  background: var(--pink-accent);
  color: #FFFFFF;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-download-pdf:hover {
  background: var(--pink-deep);
}

/* Punnett Square Table */
.punnett-table-wrap {
  overflow-x: auto;
  margin-top: 1.5rem;
}

.punnett-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: center;
}

.punnett-table th, .punnett-table td {
  border: 1px solid var(--border-light);
  padding: 0.75rem 0.5rem;
}

.punnett-table th {
  background: var(--bg-subtle);
  color: var(--navy-dark);
  font-weight: 700;
}

.punnett-table td {
  background: #FFFFFF;
}

.punnett-cell-geno {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--navy-dark);
}

.punnett-cell-pheno {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Article & Content Body on Tool Pages */
.tool-content-body {
  max-width: 850px;
  margin: 3rem auto;
  line-height: 1.8;
}

.tool-content-body h2 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--navy-dark);
  margin: 2.5rem 0 1rem;
}

.tool-content-body h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--navy-dark);
  margin: 1.75rem 0 0.75rem;
}

.tool-content-body p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
}

.tool-content-body ul, .tool-content-body ol {
  margin: 1rem 0 1.5rem 1.5rem;
  color: var(--text-secondary);
}

.tool-content-body li {
  margin-bottom: 0.5rem;
}

.faq-card-item {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  overflow: hidden;
}

.faq-question-btn {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 1.25rem;
  font-family: var(--font-main);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy-dark);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-answer-content {
  padding: 0 1.25rem 1.25rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}
