/* ============================================================
   EvvyTools — Tree Age Estimator
   /assets/css/tools/tree-age-estimator.css
   ============================================================ */

.evvy-tae-select {
  border-radius: var(--evvy-radius-lg, 12px);
  padding: 0.875rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--evvy-border-color, #DEE2E6);
  background: var(--bs-body-bg, #fff);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.evvy-tae-select:focus {
  border-color: var(--cluster-dark, #1A237E);
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--cluster-dark, #1A237E) 15%, transparent);
  outline: none;
}
[data-bs-theme="dark"] .evvy-tae-select {
  background: var(--evvy-gray-100, #1E1E1E);
  color: var(--evvy-text-primary, #EAEAEA);
}

/* ============ Lifespan progress bar ============ */
.evvy-tae-lifespan {
  margin-top: 1.5rem;
  padding: 1rem 1.125rem;
  border-radius: var(--evvy-radius-lg, 12px);
  background: var(--bs-body-bg, #fff);
  border: 1px solid var(--evvy-border-color, #DEE2E6);
}
[data-bs-theme="dark"] .evvy-tae-lifespan {
  background: var(--evvy-gray-100, #1E1E1E);
}

.evvy-tae-lifespan-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.625rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--evvy-text-secondary, #6C757D);
}
.evvy-tae-lifespan-header span:last-child {
  font-size: 0.9375rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--cluster-dark, #1A237E);
}
[data-bs-theme="dark"] .evvy-tae-lifespan-header span:last-child {
  color: color-mix(in srgb, var(--cluster-dark, #1A237E) 50%, white);
}

.evvy-tae-stage-pct {
  font-weight: 500;
  font-size: 0.8125rem;
  color: var(--evvy-text-secondary, #6C757D);
}

.evvy-tae-lifespan-bar {
  position: relative;
  height: 14px;
  background: var(--evvy-gray-50, #F8F9FA);
  border-radius: 7px;
  border: 1px solid var(--evvy-border-color, #DEE2E6);
  overflow: visible;
  margin-bottom: 2rem;
}
[data-bs-theme="dark"] .evvy-tae-lifespan-bar {
  background: color-mix(in srgb, #000 30%, var(--evvy-gray-100, #1E1E1E));
  border-color: var(--evvy-border-color, #3A3A3A);
}

.evvy-tae-lifespan-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: linear-gradient(90deg, #84cc16 0%, #22c55e 40%, #eab308 75%, #dc2626 100%);
  border-radius: 6px;
  width: 0%;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.evvy-tae-lifespan-markers {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  height: 1.5rem;
}
.evvy-tae-marker {
  position: absolute;
  transform: translateX(-50%);
  margin-top: 0.375rem;
  font-size: 0.6875rem;
  color: var(--evvy-text-secondary, #6C757D);
  white-space: nowrap;
}
.evvy-tae-marker::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -0.5rem;
  transform: translateX(-50%);
  width: 1px;
  height: 0.375rem;
  background: var(--evvy-border-color, #DEE2E6);
}

.evvy-tae-lifespan-footer {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--evvy-text-secondary, #6C757D);
}
.evvy-tae-lifespan-footer span:last-child {
  color: var(--cluster-dark, #1A237E);
  font-weight: 700;
}
[data-bs-theme="dark"] .evvy-tae-lifespan-footer span:last-child {
  color: color-mix(in srgb, var(--cluster-dark, #1A237E) 50%, white);
}

/* ============ Species info card ============ */
.evvy-tae-species-card {
  margin-top: 1rem;
  padding: 1.125rem;
  border-radius: var(--evvy-radius-lg, 12px);
  background: var(--cluster-surface, #E8EAF6);
  border: 1px solid color-mix(in srgb, var(--cluster-dark, #1A237E) 15%, transparent);
  border-left: 3px solid var(--cluster-dark, #1A237E);
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
[data-bs-theme="dark"] .evvy-tae-species-card {
  background: color-mix(in srgb, var(--cluster-dark-bg, #1A237E) 35%, #1a1a1a);
  color: var(--evvy-text-primary, #EAEAEA);
}

.evvy-tae-species-icon {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--cluster-dark, #1A237E);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}
[data-bs-theme="dark"] .evvy-tae-species-icon {
  background: color-mix(in srgb, var(--cluster-dark, #1A237E) 50%, white);
  color: #1a1a2e;
}

.evvy-tae-species-info {
  flex: 1;
  min-width: 0;
}
.evvy-tae-species-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--evvy-text-primary, #1a1a2e);
}
[data-bs-theme="dark"] .evvy-tae-species-name {
  color: var(--evvy-text-primary, #EAEAEA);
}
.evvy-tae-species-details {
  font-size: 0.875rem;
  line-height: 1.55;
  color: inherit;
}

/* ============ Premium: Inventory ============ */
.evvy-tae-pro {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: var(--evvy-radius-lg, 12px);
  background: var(--bs-body-bg, #fff);
  border: 1px solid var(--evvy-border-color, #DEE2E6);
}
[data-bs-theme="dark"] .evvy-tae-pro {
  background: var(--evvy-gray-100, #1E1E1E);
}

.evvy-tae-pro-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.evvy-tae-pro-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--evvy-subscriber-color, #D4AF37);
  margin-bottom: 0.25rem;
}
.evvy-tae-pro-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--evvy-text-primary, #1a1a2e);
}
[data-bs-theme="dark"] .evvy-tae-pro-title {
  color: var(--evvy-text-primary, #EAEAEA);
}

.evvy-tae-add-btn {
  background: var(--cluster-dark, #1A237E);
  color: #fff;
  border: none;
  padding: 0.5rem 0.875rem;
  border-radius: var(--evvy-radius-md, 10px);
  font-weight: 600;
  font-size: 0.8125rem;
  transition: background-color 0.2s ease, transform 0.15s ease;
}
.evvy-tae-add-btn:hover {
  background: var(--cluster-hover, #121858);
  color: #fff;
  transform: translateY(-1px);
}

.evvy-tae-empty {
  padding: 1.25rem;
  text-align: center;
  color: var(--evvy-text-secondary, #6C757D);
  font-size: 0.9375rem;
  border: 1px dashed var(--evvy-border-color, #DEE2E6);
  border-radius: var(--evvy-radius-md, 10px);
  background: var(--evvy-gray-50, #F8F9FA);
}
[data-bs-theme="dark"] .evvy-tae-empty {
  background: color-mix(in srgb, #000 30%, var(--evvy-gray-100, #1E1E1E));
  border-color: var(--evvy-border-color, #3A3A3A);
}

.evvy-tae-inv-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  background: var(--cluster-surface, #E8EAF6);
  border: 1px solid color-mix(in srgb, var(--cluster-dark, #1A237E) 15%, transparent);
  border-radius: var(--evvy-radius-md, 10px);
  margin-bottom: 0.5rem;
}
[data-bs-theme="dark"] .evvy-tae-inv-row {
  background: color-mix(in srgb, var(--cluster-dark-bg, #1A237E) 40%, #1a1a1a);
}

.evvy-tae-inv-info {
  flex: 1;
  min-width: 0;
}
.evvy-tae-inv-label {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--evvy-text-primary, #1a1a2e);
}
[data-bs-theme="dark"] .evvy-tae-inv-label {
  color: var(--evvy-text-primary, #EAEAEA);
}
.evvy-tae-inv-sub {
  font-size: 0.8125rem;
  color: var(--evvy-text-secondary, #6C757D);
  margin-top: 0.125rem;
}

.evvy-tae-inv-remove {
  background: transparent;
  border: 1px solid var(--evvy-border-color, #DEE2E6);
  color: var(--evvy-text-secondary, #6C757D);
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.evvy-tae-inv-remove:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

.evvy-tae-inventory-summary {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--evvy-border-color, #DEE2E6);
}
[data-bs-theme="dark"] .evvy-tae-inventory-summary {
  border-top-color: var(--evvy-border-color, #3A3A3A);
}
.evvy-tae-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.375rem 0;
  font-size: 0.9375rem;
}
.evvy-tae-summary-row:last-child {
  font-weight: 700;
  color: var(--cluster-dark, #1A237E);
}
[data-bs-theme="dark"] .evvy-tae-summary-row:last-child {
  color: color-mix(in srgb, var(--cluster-dark, #1A237E) 50%, white);
}

/* ============ Mobile ============ */
@media (max-width: 575.98px) {
  .evvy-results-row {
    grid-template-columns: 1fr !important;
  }
  .evvy-tae-pro-header {
    flex-direction: column;
    align-items: stretch;
  }
  .evvy-tae-species-card {
    padding: 0.875rem;
  }
  .evvy-tae-lifespan-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
  }
}
