/* ============================================================
   Dog Age Calculator — WordPress Plugin Stylesheet
   Matches the Lovelable React app color schema exactly.
   All selectors are prefixed with .dac- to avoid conflicts.
   ============================================================ */

/* ---------- Reset / Base ---------- */
.dac-wrap *,
.dac-wrap *::before,
.dac-wrap *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.dac-wrap {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #0f172a;
  background: linear-gradient(to bottom, rgba(255,247,237,0.4) 0%, #ffffff 100%);
  -webkit-font-smoothing: antialiased;
}

.dac-hidden { display: none !important; }

/* ---------- Hero ---------- */
.dac-hero {
  background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
  color: #fff;
}
.dac-hero-inner {
  max-width: 1152px;
  margin: 0 auto;
  padding: 48px 16px;
  display: grid;
  gap: 32px;
  align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .dac-hero-inner { grid-template-columns: 1fr 1fr; padding: 64px 16px; }
}

.dac-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  border-radius: 9999px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
}
.dac-hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.dac-hero-sub {
  margin-top: 16px;
  max-width: 540px;
  color: rgba(255,255,255,0.9);
  font-size: 15px;
}
.dac-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}
.dac-tag {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  border-radius: 9999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
}
.dac-hero-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 224px;
  height: 224px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  font-size: 88px;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .dac-hero-icon { width: 256px; height: 256px; }
}

/* ---------- Sections ---------- */
.dac-section {
  max-width: 1152px;
  margin: 0 auto;
  padding: 48px 16px;
}
.dac-section-last { padding-bottom: 64px; }
.dac-section-head {
  text-align: center;
  margin-bottom: 24px;
}
.dac-section-title {
  font-size: 1.875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.dac-section-sub {
  font-size: 13px;
  color: #64748b;
  margin-top: 4px;
}

/* Two-col grid for calculator */
.dac-two-col {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .dac-two-col { grid-template-columns: 1fr 1fr; }
}

/* ---------- Cards ---------- */
.dac-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  overflow: hidden;
}
.dac-form-card,
.dac-result-card {
  padding: 24px;
}
@media (min-width: 768px) {
  .dac-form-card,
  .dac-result-card { padding: 32px; }
}

.dac-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.dac-icon-lg {
  font-size: 28px;
}
.dac-card-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}
.dac-card-sub {
  font-size: 13px;
  color: #64748b;
  margin-top: 2px;
}

/* ---------- Form Elements ---------- */
.dac-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 6px;
}
.dac-opt {
  font-weight: 400;
  font-size: 12px;
  color: #94a3b8;
}
.dac-input {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  color: #0f172a;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.dac-input:focus {
  border-color: #fb923c;
  box-shadow: 0 0 0 3px rgba(251,146,60,0.2);
}
.dac-input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}
.dac-field {
  margin-top: 20px;
}

/* ---------- Mode Toggle ---------- */
.dac-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}
.dac-mode-btn {
  border: none;
  cursor: pointer;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
  background: #f1f5f9;
  color: #64748b;
}
.dac-mode-btn:hover {
  background: #e2e8f0;
}
.dac-mode-active {
  background: linear-gradient(to right, #6366f1, #a855f7) !important;
  color: #fff !important;
  box-shadow: 0 4px 6px rgba(99,102,241,0.3);
}

/* ---------- Size Buttons ---------- */
.dac-size-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
}
.dac-size-hint {
  font-size: 11px;
  color: #94a3b8;
}
.dac-size-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 8px;
}
.dac-size-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 6px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.dac-size-btn:hover { border-color: #fed7aa; }
.dac-size-active {
  border-color: #fb923c !important;
  box-shadow: 0 0 0 3px rgba(251,146,60,0.15);
}
.dac-size-emoji { font-size: 24px; }
.dac-size-name  { font-size: 13px; font-weight: 700; margin-top: 4px; }
.dac-size-sub   { font-size: 11px; color: #94a3b8; }

/* ---------- Formula Buttons ---------- */
.dac-formula-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
}
.dac-learn-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #ea580c;
  padding: 0;
}
.dac-learn-btn:hover { color: #c2410c; text-decoration: underline; }
.dac-formula-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}
.dac-formula-btn {
  display: flex;
  flex-direction: column;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  text-align: left;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.dac-formula-btn:hover { border-color: #fed7aa; }
.dac-formula-active {
  border-color: #fb923c !important;
  box-shadow: 0 0 0 3px rgba(251,146,60,0.15);
}
.dac-formula-name { font-size: 13px; font-weight: 700; }
.dac-formula-sub  { font-size: 11px; color: #94a3b8; margin-top: 2px; }

/* ---------- Warning Alert ---------- */
.dac-alert {
  margin-top: 20px;
  border: 1px solid #fcd34d;
  background: #fffbeb;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13px;
  color: #78350f;
}
.dac-alert strong { display: block; font-weight: 600; margin-bottom: 6px; }
.dac-alert ul {
  padding-left: 20px;
  list-style: disc;
}
.dac-alert li { margin-top: 4px; }

/* ---------- Action Buttons ---------- */
.dac-calc-btn {
  display: block;
  width: 100%;
  margin-top: 24px;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(to right, #fb923c, #f97316);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(249,115,22,0.35);
  transition: background 0.15s, box-shadow 0.15s;
}
.dac-calc-btn:hover {
  background: linear-gradient(to right, #f97316, #ea580c);
  box-shadow: 0 6px 10px rgba(249,115,22,0.4);
}
.dac-reset-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  color: #94a3b8;
  transition: color 0.15s;
}
.dac-reset-btn:hover { color: #0f172a; }

/* ---------- Result Card ---------- */
.dac-result-card { position: relative; }
.dac-paw-bg {
  position: absolute;
  right: 16px;
  top: 80px;
  font-size: 120px;
  opacity: 0.05;
  pointer-events: none;
  user-select: none;
}
.dac-result-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.dac-result-icon-wrap {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.dac-result-number-wrap { margin-top: 32px; }
.dac-result-value {
  font-size: 72px;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, #fb923c, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.dac-result-unit {
  margin-top: 4px;
  font-size: 18px;
  color: #64748b;
}
.dac-stage-wrap { margin-top: 24px; }
.dac-stage-badge {
  display: inline-block;
  background: #fff7ed;
  color: #c2410c;
  border-radius: 9999px;
  padding: 6px 18px;
  font-size: 14px;
  font-weight: 600;
}
.dac-stage-note {
  margin-top: 12px;
  font-size: 14px;
  color: #64748b;
}
.dac-formula-note {
  margin-top: 24px;
  border: 1px dashed #fed7aa;
  background: rgba(255,247,237,0.6);
  border-radius: 12px;
  padding: 14px;
  font-size: 12px;
  color: #64748b;
}
.dac-formula-note-title { font-weight: 600; color: #0f172a; margin-bottom: 4px; }
.dac-formula-note-disc  { margin-top: 4px; }

/* ---------- Life Stages ---------- */
.dac-stages-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (min-width: 768px) {
  .dac-stages-grid { grid-template-columns: repeat(4, 1fr); }
}
.dac-stage-card {
  border-radius: 16px;
  padding: 20px;
  color: #fff;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.dac-stage-orange  { background: linear-gradient(135deg, #fb923c, #f97316); }
.dac-stage-sky     { background: linear-gradient(135deg, #38bdf8, #0ea5e9); }
.dac-stage-purple  { background: linear-gradient(135deg, #c084fc, #a855f7); }
.dac-stage-amber   { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.dac-stage-icon    { font-size: 36px; }
.dac-stage-name    { font-size: 18px; font-weight: 700; margin-top: 12px; }
.dac-stage-range   { font-size: 14px; color: rgba(255,255,255,0.9); margin-top: 4px; }

/* ---------- Conversion Chart ---------- */
.dac-table-card { overflow: hidden; }
.dac-table-scroll { overflow-x: auto; }
.dac-table {
  width: 100%;
  border-collapse: collapse;
}
.dac-table-head {
  background: linear-gradient(to right, #6366f1, #a855f7);
}
.dac-table-head th {
  padding: 14px 16px;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}
.dac-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.1s;
}
.dac-table tbody tr:hover { background: #fafafa; }
.dac-table tbody td {
  padding: 12px 16px;
  font-size: 14px;
  color: #0f172a;
}
.dac-table tbody td:first-child { font-weight: 600; }

/* ---------- Fun Facts ---------- */
.dac-facts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (min-width: 768px) {
  .dac-facts-grid { grid-template-columns: repeat(4, 1fr); }
}
.dac-fact-card {
  text-align: center;
  padding: 20px 16px;
}
.dac-fact-icon { font-size: 32px; }
.dac-fact-text { margin-top: 12px; font-size: 13px; color: #64748b; }

/* ---------- Sources ---------- */
.dac-sources-grid {
  display: grid;
  gap: 16px;
  margin-top: 24px;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .dac-sources-grid { grid-template-columns: 1fr 1fr; }
}
.dac-source-box {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
}
.dac-source-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.dac-source-title { font-weight: 700; font-size: 14px; }
.dac-source-text  { font-size: 13px; color: #64748b; margin-top: 8px; }
.dac-source-list  {
  margin-top: 8px;
  padding-left: 20px;
  list-style: disc;
  font-size: 13px;
  color: #64748b;
}
.dac-source-list li { margin-top: 4px; }
.dac-mono {
  margin-top: 8px;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 8px 12px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 13px;
}
.dac-disclaimer {
  margin-top: 24px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 12px;
  padding: 16px;
  font-size: 13px;
  color: #78350f;
  line-height: 1.6;
}
.dac-sources-credit {
  margin-top: 16px;
  font-size: 11px;
  color: #94a3b8;
}

/* ---------- Modal ---------- */
.dac-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.dac-modal {
  background: #fff;
  border-radius: 16px;
  max-width: 520px;
  width: 100%;
  padding: 28px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  max-height: 90vh;
  overflow-y: auto;
}
.dac-modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #94a3b8;
  line-height: 1;
}
.dac-modal-close:hover { color: #0f172a; }
.dac-modal-title   { font-size: 20px; font-weight: 700; padding-right: 32px; }
.dac-modal-tagline { font-size: 13px; color: #64748b; margin-top: 4px; }
.dac-modal-body    { margin-top: 20px; }
.dac-modal-summary { font-size: 14px; color: #64748b; }
.dac-modal-assumptions-title { display: block; font-weight: 600; font-size: 14px; margin: 16px 0 8px; }
.dac-modal-assumptions-list {
  padding-left: 20px;
  list-style: disc;
  font-size: 13px;
  color: #64748b;
}
.dac-modal-assumptions-list li { margin-top: 4px; }
.dac-modal-source {
  margin-top: 16px;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: #64748b;
}
