/* Pet Cost Calculator Styles */
:root {
  --primary: #4f86ff;
  --primary-light: rgba(79, 134, 255, 0.1);
  --primary-dark: #3a70e3;
  --text-primary: #1a1f2c;
  --text-secondary: #666;
  --text-muted: #8e9196;
  --background: #f9fafb;
  --card-bg: rgba(255, 255, 255, 0.8);
  --card-border: rgba(255, 255, 255, 0.2);
  --input-bg: rgba(255, 255, 255, 0.4);
  --input-border: rgba(255, 255, 255, 0.2);
  --shadow: rgba(0, 0, 0, 0.05);
  --radius: 1rem;
  --radius-sm: 0.5rem;
  --transition: all 0.3s ease;
}

/* Base Styles */
.pet-calculator-app {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  color: var(--text-primary);
  line-height: 1.5;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem;
}

.pet-calculator-app * {
  box-sizing: border-box;
}

/* Header Styles */
.calculator-header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1rem;
}

.header-content {
  max-width: 800px;
  margin: 0 auto;
}

.badge {
  display: inline-block;
  background-color: var(--primary-light);
  color: var(--primary);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.main-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 1rem;
  line-height: 1.2;
}

.subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Main Calculator Styles */
.calculator-main {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.calculator-container {
  width: 100%;
}

.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: 0 10px 25px var(--shadow);
  overflow: hidden;
}

.card-content {
  padding: 2rem;
}

/* Section Styles */
.calculator-section {
  margin-bottom: 2rem;
}

.calculator-section:last-child {
  margin-bottom: 0;
}

.section-header {
  margin-bottom: 1.5rem;
}

.step-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.step-dot {
  width: 6px;
  height: 6px;
  background-color: var(--primary);
  border-radius: 50%;
}

.step-text {
  font-size: 0.875rem;
  color: var(--primary);
  font-weight: 600;
  margin: 0;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

.section-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Pet Selector Grid */
.pet-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (min-width: 576px) {
  .pet-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .pet-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 992px) {
  .pet-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.pet-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.pet-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px var(--shadow);
}

.pet-button.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 134, 255, 0.2);
}

.pet-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.pet-name {
  font-size: 0.875rem;
  font-weight: 500;
}

.pet-description {
  margin-top: 1.5rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Form Controls */
.form-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .form-controls {
    grid-template-columns: repeat(2, 1fr);
  }
}

.form-group {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 1rem;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--text-secondary);
  pointer-events: none;
}

.form-select, .form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  color: var(--text-primary);
  appearance: none;
  transition: var(--transition);
}

.form-select:focus, .form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 134, 255, 0.2);
}

.breed-warning {
  margin-top: 0.5rem;
  color: #e67700;
  font-size: 0.875rem;
}

/* Slider */
.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.age-display {
  font-size: 0.875rem;
  color: var(--primary);
  font-weight: 600;
}

.form-slider {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  appearance: none;
  outline: none;
}

.form-slider::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Switch */
.switch-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-right: 1rem;
}

.switch-info {
  flex: 1;
}

.switch-description {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e2e8f0;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--primary);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--primary);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Comparison Group */
.comparison-group {
  display: flex;
  gap: 0.5rem;
}

.icon-plus {
  font-size: 1.25rem;
  line-height: 1;
  margin-right: 0.25rem;
}

/* Buttons */
.text-button {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

.text-button:hover {
  text-decoration: underline;
}

.button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--primary);
  color: white;
  font-weight: 500;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.button-primary:hover {
  background-color: var(--primary-dark);
}

.button-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.button-destructive {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #ef4444;
  color: white;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.button-destructive:hover {
  background-color: #dc2626;
}

.icon-trash {
  font-size: 1.25rem;
  margin-right: 0.25rem;
}

/* Results Section */
.results-section {
  margin-top: 2rem;
}

.results-tabs {
  margin-top: 1rem;
}

.tabs-header {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 1rem;
}

.tab-button {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

.tab-button.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.results-card {
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
  border-radius: var(--radius);
}

@media (min-width: 768px) {
  .results-card {
    grid-template-columns: 1fr 1fr;
  }
}

.results-primary {
  background-color: var(--primary-light);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.results-label {
  font-size: 1.125rem;
  color: var(--primary);
  margin: 0 0 0.5rem;
  font-weight: 500;
}

.results-amount {
  display: flex;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.currency-symbol {
  font-size: 1.5rem;
  margin-right: 0.25rem;
  font-weight: 500;
}

.cost-value {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
}

.first-year-note {
  font-size: 0.875rem;
  color: var(--primary);
  margin: 0.5rem 0 0;
}

.results-secondary {
  padding: 1.5rem;
}

.results-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.results-data {
  display: flex;
  flex-direction: column;
}

.data-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 0.25rem;
}

.data-amount {
  display: flex;
  align-items: baseline;
}

.secondary-value {
  font-size: 1.25rem;
  font-weight: 600;
}

/* Expense Breakdown */
.expense-card {
  padding: 1.5rem;
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 4px 6px var(--shadow);
}

.expense-categories {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.expense-item {
  margin-bottom: 1rem;
}

.expense-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.expense-name {
  display: flex;
  align-items: center;
  font-weight: 500;
}

.expense-icon {
  margin-right: 0.5rem;
  font-size: 1.25rem;
}

.expense-amount {
  font-weight: 600;
  display: flex;
  align-items: center;
}

.expense-percent {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.progress-container {
  height: 8px;
  background-color: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background-color: var(--primary);
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* Comparison Section */
.comparison-container {
  width: 100%;
  margin-top: 2rem;
}

.comparison-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.comparison-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

.comparison-table-container {
  overflow-x: auto;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.comparison-table th {
  padding: 1rem;
  background-color: #f8fafc;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid #e2e8f0;
}

.comparison-table td {
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.pet-type-cell {
  display: flex;
  align-items: center;
}

.pet-icon-small {
  margin-right: 0.5rem;
}

.saved-pets-container {
  margin-top: 2rem;
}

.saved-pets-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.saved-pets-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.saved-pet-badge {
  display: flex;
  align-items: center;
  background-color: #f1f5f9;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.875rem;
}

.badge-icon {
  margin-right: 0.5rem;
}

.badge-close {
  margin-left: 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.6;
}

.badge-close:hover {
  opacity: 1;
}

.remove-pet-btn {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem;
  opacity: 0.7;
  transition: var(--transition);
}

.remove-pet-btn:hover {
  opacity: 1;
}

/* Footer */
.calculator-footer {
  margin-top: 3rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Helper Classes */
.hidden {
  display: none;
}

/* Animated Numbers */
@keyframes count-up {
  from {
    content: "0";
  }
  to {
    content: attr(data-value);
  }
}

.animated-number::before {
  content: attr(data-value);
  animation: count-up 1s ease-out forwards;
}

/* Responsive Fixes */
@media (max-width: 768px) {
  .card-content {
    padding: 1.5rem;
  }
  
  .main-title {
    font-size: 2rem;
  }
  
  .comparison-group {
    flex-direction: column;
  }
  
  .form-controls {
    gap: 1rem;
  }
  
  .switch-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .results-row {
    gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  .pet-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .section-header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .results-card {
    grid-template-columns: 1fr;
  }
}
