/* ===========================
   Love Them Longer Custom Styles
   Most styling via Tailwind —
   this file covers what it can't.
   =========================== */

/* ---------- Cost bar gradient ---------- */
.cost-bar {
  background: linear-gradient(
    to right,
    #16A34A 0%,
    #22C55E 20%,
    #D4A053 50%,
    #EF4444 80%,
    #DC2626 100%
  );
}

/* ---------- Breakdown proportional bar ---------- */
.breakdown-bar {
  background: linear-gradient(
    to right,
    #1B4332 0%,
    #2D6A4F 100%
  );
  border-radius: 4px;
  height: 6px;
  transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ---------- Card hover transitions ---------- */
.emergency-card {
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.emergency-card:hover {
  transform: translateY(-2px);
  border-color: #1B4332;
  box-shadow: 0 4px 12px rgba(27, 67, 50, 0.12);
}

.emergency-card:active {
  transform: translateY(0);
}

/* ---------- Pet type toggle selected states ---------- */
.pet-toggle-btn {
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.pet-toggle-btn[aria-pressed="true"] {
  background-color: #1B4332;
  color: #FFFFFF;
  border-color: #1B4332;
  box-shadow: 0 2px 8px rgba(27, 67, 50, 0.25);
}

.pet-toggle-btn[aria-pressed="false"] {
  background-color: #FFFFFF;
  color: #1A1A1A;
  border-color: #E5E7EB;
}

.pet-toggle-btn[aria-pressed="false"]:hover {
  border-color: #1B4332;
  color: #1B4332;
}

/* ---------- Loading spinner ---------- */
.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #E5E7EB;
  border-top-color: #1B4332;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.loading-spinner-sm {
  width: 20px;
  height: 20px;
  border: 2px solid #E5E7EB;
  border-top-color: #1B4332;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Accordion animation ---------- */
.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.accordion-content.open {
  max-height: 200px;
}

.accordion-chevron {
  transition: transform 0.2s ease;
}

.accordion-chevron.open {
  transform: rotate(180deg);
}

/* ---------- Share button success flash ---------- */
.share-success {
  border-color: #16A34A !important;
  color: #16A34A !important;
}

/* ---------- Severity badge colors ---------- */
.severity-mild {
  background-color: #DCFCE7;
  color: #166534;
}

.severity-moderate {
  background-color: #FEF3C7;
  color: #92400E;
}

.severity-severe {
  background-color: #FFEDD5;
  color: #9A3412;
}

.severity-critical {
  background-color: #FEE2E2;
  color: #991B1B;
}

.severity-minor {
  background-color: #DBEAFE;
  color: #1E40AF;
}

/* ---------- Time sensitivity colors ---------- */
.time-immediate {
  color: #DC2626;
}

.time-hours {
  color: #D4A053;
}

.time-same-day {
  color: #16A34A;
}

.time-monitor {
  color: #1E40AF;
}

/* ---------- Smooth page transition ---------- */
body {
  opacity: 1;
  transition: opacity 0.15s ease;
}

/* ---------- Focus styles ---------- */
input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid #1B4332;
  outline-offset: 2px;
}

/* ---------- Custom select arrow ---------- */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236B7280' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 01.708 0L8 8.293l2.646-2.647a.5.5 0 01.708.708l-3 3a.5.5 0 01-.708 0l-3-3a.5.5 0 010-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px;
  padding-right: 2.5rem;
}

/* ---------- Print styles ---------- */
@media print {
  /* Hide non-essential elements */
  nav,
  .print\\:hidden,
  #share-btn,
  #financing-section,
  .affiliate-btn,
  #zip-update-form,
  #emergency-link-section {
    display: none !important;
  }

  /* Clean white background, readable font sizes */
  body {
    background: white !important;
    font-size: 12pt;
    color: #1A1A1A;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  h1 { font-size: 18pt; }
  h2 { font-size: 14pt; }
  h3 { font-size: 12pt; }
  p, li, span { font-size: 10pt; }

  /* Remove shadows and borders from cards */
  .bg-white,
  section {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }

  /* Preserve color badges and cost bar */
  .cost-bar {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .severity-mild,
  .severity-moderate,
  .severity-severe,
  .severity-critical,
  .severity-minor {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .breakdown-bar {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Expand all accordion content so breakdown is fully visible */
  .accordion-content {
    max-height: none !important;
    overflow: visible !important;
  }

  .accordion-chevron {
    display: none !important;
  }

  /* Layout adjustments */
  main {
    max-width: 100%;
    padding: 0;
  }

  /* Footer styling */
  footer {
    border-top: 1px solid #ccc;
    padding-top: 1rem;
  }

  footer button {
    display: none !important;
  }

  /* Add "Printed from LoveThemLonger.com" after main content */
  main::after {
    content: "Printed from LoveThemLonger.com";
    display: block;
    text-align: center;
    font-size: 9pt;
    color: #6B7280;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
  }
}

/* ---------- Card fade-in animation ---------- */
@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.card-animate .emergency-card {
  animation: cardFadeIn 0.2s ease-out forwards;
}

/* ---------- Scrollbar styling ---------- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #FDF8F0;
}

::-webkit-scrollbar-thumb {
  background: #D1D5DB;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9CA3AF;
}
