/* ==========================================
   GLOBAL STYLES & TYPOGRAPHY
   ========================================== */

:root {
  --primary-blue: #0077b6;
  --light-blue-bg: #DBE5E8;
  --button-hover-blue: #005f93;
  --button-red: #AF2811;
  --text-dark: #2d3748;
  --border-color: #cbd5e1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 20px 15px;
  font-family: 'Roboto', sans-serif;
  background-color: #ffffff;
  color: var(--text-dark);
}

.container {
  max-width: 900px;
  margin: 0 auto;
}

h1,
h2 {
  font-family: 'Roboto', sans-serif;
  font-size: 1.85rem;
  font-weight: 700;
  text-align: center;
  margin-top: 0;
  margin-bottom: 12px;
  color: var(--text-dark);
}

h3 {
  font-family: 'Roboto', sans-serif;
  font-size: 1.25rem;
  font-weight: 500;
  margin-top: 0;
  margin-bottom: 10px;
  text-align: center;
}

.subtitle {
  text-align: center;
  font-size: 0.95rem;
  margin-bottom: 20px;
  color: #475569;
}

.divider {
  border: 0;
  height: 1px;
  background: var(--border-color);
  margin: 25px auto;
  max-width: 900px;
}

select,
label,
option {
  font-family: 'Roboto', sans-serif;
}

button {
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: 0;
  border: none;
  cursor: pointer;
  padding: 8px 18px;
  transition:
    background-color 0.2s ease,
    transform 0.1s ease;
}

button:hover {
  opacity: 0.9;
}

button:active {
  transform: translateY(1px);
}

img {
  border-radius: 5px;
  max-width: 100%;
  height: auto;
  display: block;
}


/* ==========================================
   SECTION 1: COLOR GENETICS EXPLORER
   ========================================== */

.selectors {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.selectors select {
  padding: 8px 30px 8px 12px;
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: 0;
  background-color: var(--light-blue-bg);
  color: var(--text-dark);
  text-align: center;
  text-align-last: center;

  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%232D3748%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.4-12.8z%22%2F%3E%3C%2Fsvg%3E');

  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 9px auto;
}

.selectors select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.image-container {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.image-container img {
  max-width: 280px;
  width: 100%;
}

.description {
  text-align: center;
  font-size: 0.95rem;
  max-width: 850px;
  width: 90%;
  margin: 0 auto 15px auto;
  line-height: 1.5;
}

.description p,
#description p {
  display: block;
  margin-top: 0;
  margin-bottom: 1rem;
}

.description p:last-child,
#description p:last-child {
  margin-bottom: 0;
}


/* ==========================================
   SHEEP BUTTONS
   ========================================== */

#sheepButtons {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin: 0 auto 20px auto;
  width: 100%;
}

#sheepButtons.visible {
  display: flex !important;
}

#sheepButtons button {
  background-color: var(--button-red);
  color: #ffffff;
}

#sheepButtons button:hover {
  background-color: #8c200e;
}


/* ==========================================
   SECTION 2: BREEDING CALCULATOR
   ========================================== */

.parents-container {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.parent-card {
  background-color: var(--light-blue-bg);
  padding: 15px;
  flex: 1;
  min-width: 260px;
  max-width: 420px;
  border-radius: 0;
  border: 1px solid #cbd5e1;
}

.input-group {
  margin-bottom: 12px;
}

.input-group label {
  display: block;
  font-weight: 500;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.input-group select {
  width: 100%;
  padding: 6px 10px;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: 0;
  background-color: #ffffff;
  text-align: center;
  text-align-last: center;
}

.allele-pair-stacked {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.calc-button-container {
  text-align: center;
  margin-bottom: 20px;
}


/* ==========================================
   CALCULATE BUTTON
   ========================================== */

#calculateBreed {
  background-color: var(--button-red);
  color: #ffffff;
  font-size: 0.95rem;
  padding: 10px 24px;
}

#calculateBreed:hover {
  background-color: #8c200e;
}


/* ==========================================
   RESULTS / OFFSPRING SECTION
   ========================================== */

.results-container {
  margin-top: 20px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(220px, 1fr)
  );
  gap: 15px;
  margin-top: 15px;
}

.result-card {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  padding: 15px;
  border-radius: 0;
  text-align: center;
}

.result-card img {
  max-width: 160px;
  margin: 0 auto 10px auto;
}

.result-card h4 {
  margin: 8px 0;
}

.result-card p {
  margin: 0;
}


/* ==========================================
   MOBILE RESPONSIVE STYLES
   ========================================== */

@media (max-width: 600px) {
  body {
    padding: 15px 10px;
  }

  .selectors {
    flex-direction: column;
    align-items: center;
  }

  .selectors select {
    width: 100%;
    max-width: 320px;
  }

  #sheepButtons {
    flex-direction: column;
    gap: 8px;
  }

  #sheepButtons button {
    width: 100%;
    max-width: 300px;
  }

  .parent-card {
    width: 100%;
    max-width: none;
  }
}
