/* ==========================================================================
   Cooking Time & Temperature Tools — v1.0
   All styles scoped under .cttt-root. No global selectors. Mobile-first.
   Styled to match the Kitchen Converters / Baking Calculators family.
   Accent colour: indigo #4f46e5
   ========================================================================== */

/* ---- Reset inside plugin ---- */

.cttt-root,
.cttt-root *,
.cttt-root *::before,
.cttt-root *::after {
  box-sizing: border-box;
}

.cttt-root {
  max-width: 720px;
  margin: 0 auto;
  padding: 0;
  font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #111827;
}

/* ---- Loading / No JS ---- */

.cttt-root .cttt-loading {
  text-align: center;
  padding: 40px 16px;
  font-size: 15px;
  color: #6b7280;
}

.cttt-root .cttt-noscript {
  text-align: center;
  padding: 32px 16px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
}

.cttt-root .cttt-noscript p {
  margin: 0;
  font-size: 14px;
  color: #991b1b;
}

/* ---- Tool Navigation ---- */

.cttt-root .cttt-nav {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 8px;
  padding: 0 0 16px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0;
}

.cttt-root .cttt-nav::-webkit-scrollbar {
  display: none;
}

.cttt-root .cttt-nav-btn {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 14px;
  min-width: 80px;
  min-height: 56px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  color: #374151;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  line-height: 1.2;
}

.cttt-root .cttt-nav-btn:hover {
  background: #f3f4f6;
  border-color: #c7d2fe;
}

.cttt-root .cttt-nav-btn:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

.cttt-root .cttt-nav-btn--active {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
  font-weight: 600;
}

.cttt-root .cttt-nav-btn--active:hover {
  background: #4338ca;
  border-color: #4338ca;
}

.cttt-root .cttt-nav-icon {
  font-size: 20px;
  line-height: 1;
}

.cttt-root .cttt-nav-label {
  white-space: nowrap;
  font-size: 11px;
  letter-spacing: -0.01em;
}

@media (min-width: 768px) {
  .cttt-root .cttt-nav {
    flex-wrap: wrap;
    overflow-x: visible;
    justify-content: center;
    gap: 10px;
    padding: 0 0 20px 0;
  }

  .cttt-root .cttt-nav-btn {
    min-width: 90px;
    min-height: 60px;
  }

  .cttt-root .cttt-nav-icon {
    font-size: 22px;
  }

  .cttt-root .cttt-nav-label {
    font-size: 12px;
  }
}

/* ---- Tool Section ---- */

.cttt-root .cttt-tool {
  display: none;
}

.cttt-root .cttt-tool--active {
  display: block;
}

/* ---- Form ---- */

.cttt-root .cttt-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.cttt-root .cttt-form-heading {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  line-height: 1.3;
}

.cttt-root .cttt-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cttt-root .cttt-field label {
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
}

.cttt-root .cttt-field select,
.cttt-root .cttt-field input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  transition: border-color 0.15s, box-shadow 0.15s;
  line-height: 1.4;
}

.cttt-root .cttt-field select:focus,
.cttt-root .cttt-field input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.cttt-root .cttt-field input.cttt-input--error,
.cttt-root .cttt-field select.cttt-input--error {
  border-color: #dc2626;
}

.cttt-root .cttt-field input.cttt-input--error:focus,
.cttt-root .cttt-field select.cttt-input--error:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.cttt-root .cttt-field-error {
  color: #dc2626;
  font-size: 13px;
  margin-top: 2px;
}

/* ---- Submit Button ---- */

.cttt-root .cttt-submit {
  align-self: flex-start;
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: #4f46e5;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  min-height: 44px;
  line-height: 1.3;
}

.cttt-root .cttt-submit:hover {
  background: #4338ca;
}

.cttt-root .cttt-submit:active {
  background: #3730a3;
}

.cttt-root .cttt-submit:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .cttt-root .cttt-submit {
    width: 100%;
    text-align: center;
  }
}

/* ---- Result Card ---- */

.cttt-root .cttt-result {
  padding: 18px 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  margin-top: 16px;
}

.cttt-root .cttt-result-heading {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 14px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid #4f46e5;
}

.cttt-root .cttt-result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 0;
  font-size: 14px;
  border-bottom: 1px solid #f3f4f6;
}

.cttt-root .cttt-result-row:last-of-type {
  border-bottom: none;
}

.cttt-root .cttt-result-label {
  font-weight: 500;
  color: #6b7280;
  flex-shrink: 0;
  margin-right: 12px;
}

.cttt-root .cttt-result-value {
  font-weight: 700;
  color: #111827;
  text-align: right;
}

@media (max-width: 480px) {
  .cttt-root .cttt-result-row {
    flex-direction: column;
    gap: 2px;
  }

  .cttt-root .cttt-result-value {
    text-align: left;
  }
}

/* ---- Result Error State ---- */

.cttt-root .cttt-result--error {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
  padding: 16px;
  font-size: 14px;
}

/* ---- Result Notes ---- */

.cttt-root .cttt-result-note {
  font-size: 13px;
  color: #6b7280;
  margin: 10px 0 0 0;
  line-height: 1.5;
}

.cttt-root .cttt-result-range {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 0;
  font-size: 14px;
  border-bottom: 1px solid #f3f4f6;
}

.cttt-root .cttt-result-range:last-of-type {
  border-bottom: none;
}

.cttt-root .cttt-result-range-label {
  font-weight: 500;
  color: #6b7280;
  flex-shrink: 0;
  margin-right: 12px;
}

.cttt-root .cttt-result-range-value {
  font-weight: 700;
  color: #111827;
  text-align: right;
}

@media (max-width: 480px) {
  .cttt-root .cttt-result-range {
    flex-direction: column;
    gap: 2px;
  }

  .cttt-root .cttt-result-range-value {
    text-align: left;
  }
}

/* ---- Safety Bar (Tier 3 — below result) ---- */

.cttt-root .cttt-safety-bar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-left: 4px solid #f97316;
  border-radius: 6px;
  margin-top: 16px;
  font-size: 13px;
  line-height: 1.5;
  color: #7c2d12;
}

.cttt-root .cttt-safety-icon {
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1.2;
}

/* ---- Thermometer Verification Line (Tier 1 — inside result) ---- */

.cttt-root .cttt-thermo-warning {
  color: #b91c1c;
  font-size: 14px;
  font-weight: 500;
  margin: 12px 0 4px 0;
  padding: 8px 10px;
  background: #fef2f2;
  border-radius: 4px;
  line-height: 1.5;
}

/* ---- Estimate Notice ---- */

.cttt-root .cttt-estimate-note {
  font-size: 13px;
  font-style: italic;
  color: #6b7280;
  margin: 8px 0 0 0;
  line-height: 1.5;
}

/* ---- Doneness Warning (Tier 2) ---- */

.cttt-root .cttt-doneness-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 13px;
  color: #92400e;
  margin: 12px 0;
  line-height: 1.5;
}

/* ---- Oil Info Note ---- */

.cttt-root .cttt-oil-note {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #3b82f6;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 13px;
  color: #1e40af;
  margin: 12px 0;
  line-height: 1.5;
}

/* ---- Oil Safety Warning ---- */

.cttt-root .cttt-oil-safety {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid #dc2626;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 13px;
  color: #991b1b;
  margin: 12px 0 0 0;
  line-height: 1.5;
}

/* ---- Check-Early Note (Turkey, Air Fryer) ---- */

.cttt-root .cttt-check-note {
  font-size: 13px;
  color: #374151;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-left: 4px solid #0ea5e9;
  padding: 10px 12px;
  border-radius: 4px;
  margin: 12px 0;
  line-height: 1.5;
}

/* ---- Inline Field Group (hours + minutes side by side) ---- */

.cttt-root .cttt-field-group {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.cttt-root .cttt-field-group .cttt-field {
  flex: 1;
}

.cttt-root .cttt-field-separator {
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  padding-bottom: 12px;
}

/* ---- Hidden utility ---- */

.cttt-root .cttt-hidden {
  display: none !important;
}
