:root {
  /* Premium Nature Palette */
  --color-bg-main: #f0f4f8;
  --color-bg-card: #ffffff;
  --color-primary: #2d6a4f;
  --color-primary-hover: #1b4332;
  --color-accent: #d8f3dc;
  --color-text-main: #1d3557;
  --color-text-muted: #6c757d;
  --color-border: #e9ecef;

  --color-success: #40916c;
  --color-warning: #ffb703;
  --color-danger: #e63946;

  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;

  --font-family: 'Outfit', sans-serif;
  --transition-fast: 0.2s ease;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-bg-main);
  color: var(--color-text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* Header */
header {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 0;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-primary);
  display: flex;
  align-items: center;
}

.main-content {
  flex: 1;
  padding: 2rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Hero */
.hero {
  text-align: center;
  margin-bottom: 2rem;
}

.hero h1 {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.hero p {
  color: var(--color-text-muted);
  font-size: 1rem;
}

/* Upload Grid */
.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
  margin-bottom: 1.5rem;
}

.upload-slot {
  background: var(--color-bg-card);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
  overflow: hidden;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat;
}

.upload-slot:hover {
  border-color: var(--color-primary);
  background-color: #f8fff9;
}

.upload-slot.filled {
  border-style: solid;
  border-color: var(--color-success);
}

/* Hide content when image is showing */
.upload-slot.filled .slot-content {
  opacity: 0;
}

.upload-slot.filled:hover .slot-content {
  opacity: 1;
  background: rgba(255, 255, 255, 0.8);
  padding: 5px;
  border-radius: 8px;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.slot-input {
  display: none;
}

.slot-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.slot-content span {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

/* Input Section */
.input-section {
  width: 100%;
  margin-bottom: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.input-wrapper label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-text-main);
}

.optional-tag {
  font-weight: 400;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  margin-left: 4px;
}

.input-wrapper input {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-family: inherit;
  font-size: 1rem;
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-accent);
}

/* Buttons */
.btn-primary {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 2rem;
  /* Pill shape */
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: var(--transition-fast);
}

.btn-primary:disabled {
  background: var(--color-border);
  color: var(--color-text-muted);
  cursor: not-allowed;
}

.btn-primary:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(45, 106, 79, 0.2);
}

.btn-secondary {
  background: var(--color-accent);
  color: var(--color-primary);
  border: none;
  padding: 0.75rem;
  border-radius: var(--radius-lg);
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-top: 1rem;
}

.btn-secondary:hover {
  background: #c2eabd;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  padding: 0.75rem;
  border-radius: var(--radius-lg);
  width: 100%;
  margin-top: 2rem;
  cursor: pointer;
}

/* Loader */
.loader {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-accent);
  border-top: 3px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

:root {
  /* Brand Colors based on Logos */
  --primary: #44db5e;
  /* Bright Lime Green from 'Arborist On Demand' */
  --primary-dark: #2ba840;
  --secondary: #004b8d;
  /* ASCA Blue */
  --accent: #f1c40f;
  /* ISA Gold */
  --dark: #2c3e50;
  --light: #f8f9fa;
  --danger: #e74c3c;
  --warning: #f39c12;
  --success: #27ae60;

  --font-heading: 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --radius: 12px;
}

body {
  background-color: #f0f2f5;
  background-image: linear-gradient(135deg, #f0f2f5 0%, #ffffff 100%);
  color: var(--dark);
  font-family: var(--font-body);
  margin: 0;
  min-height: 100vh;
}

.header {
  background: #ffffff;
  border-bottom: 4px solid var(--secondary);
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo-img {
  height: 60px;
  width: auto;
  object-fit: contain;
}

.header h1 {
  color: var(--secondary);
  font-size: 1.5rem;
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.header p {
  color: #666;
  margin: 0;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Updated Buttons to match Brand */
.btn-primary {
  background: var(--secondary);
  color: white;
  padding: 1rem 2rem;
  border-radius: var(--radius);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
  width: 100%;
  margin-top: 1rem;
  box-shadow: 0 4px 6px rgba(0, 75, 141, 0.2);
}

.btn-primary:hover {
  background: #003366;
  /* Darker Blue */
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(0, 75, 141, 0.3);
}

.btn-primary:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--secondary);
  color: var(--secondary);
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  margin-top: 0.5rem;
}

.btn-outline:hover {
  background: #f0f7ff;
}

/* Credentials Bar */
.credentials-bar {
  background: white;
  padding: 1rem;
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  border-bottom: 1px solid #eee;
}

.cred-logo {
  height: 50px;
  opacity: 0.9;
  transition: opacity 0.2s;
}

.cred-logo:hover {
  opacity: 1;
}

/* Card Styling Update */
.card {
  background: white;
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
  border-top: 4px solid var(--primary);
  /* Lime Green Top Border */
}

/* Risk Badge */
.risk-badge {
  background: var(--danger);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9rem;
  display: inline-block;
}

/* Inputs */
input,
select,
textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #dde1e5;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(68, 219, 94, 0.2);
}

/* Valuation Header */
.val-header {
  background: #f8f9fa;
  border-left: 4px solid var(--secondary);
  padding: 1rem;
  margin-bottom: 1.5rem;
  border-radius: 0 8px 8px 0;
}

/* Loader text */
#loader-text {
  font-weight: 600;
  color: var(--secondary);
  margin-top: 1rem;
}

/* Help text */
.help-text {
  font-size: 0.8rem;
  color: #7f8c8d;
  font-weight: normal;
}

/* Disclaimer Box */
.legal-disclaimer {
  background: #fff5f5;
  border-left: 4px solid var(--danger);
  padding: 1rem;
  border-radius: 4px;
  margin-top: 2rem;
}

.legal-disclaimer h4 {
  margin: 0 0 0.5rem 0;
  color: #c0392b;
  font-size: 0.95rem;
}

.legal-disclaimer p,
.legal-disclaimer li {
  font-size: 0.85rem;
  color: #555;
  line-height: 1.4;
}

/* Hide Utility classes */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: 1.5rem;
}

/* Responsive Grid */
@media (min-width: 768px) {
  .grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
}

/* Results */
.result-card {
  display: none;
  background: var(--color-bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  width: 100%;
  animation: slideUp 0.4s ease-out;
}

.result-header {
  background: var(--color-primary);
  color: white;
  padding: 2rem;
  text-align: center;
}

.confidence-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  display: inline-block;
  margin-bottom: 0.5rem;
}

#tree-name {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.scientific-name-light {
  opacity: 0.8;
  font-style: italic;
}

.result-body {
  padding: 1.5rem;
}

/* Health Logic */
.health-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
}

.status-healthy,
.status-low {
  background-color: #dcfce7;
  color: #166534;
}

.status-unhealthy,
.status-critical,
.status-high {
  background-color: #fee2e2;
  color: #991b1b;
}

.status-moderate {
  background-color: #fef9c3;
  color: #854d0e;
}

.risk-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}

.risk-list li {
  font-size: 0.9rem;
  color: var(--color-text-light);
  margin-bottom: 0.25rem;
}

.disclaimer-box {
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-sm);
}

.disclaimer-box small {
  display: block;
  font-size: 0.75rem;
  color: #666;
  margin-top: 0.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding-top: 0.25rem;
}

.separator {
  height: 1px;
  background: var(--color-border);
  margin: 1.5rem 0;
}

/* Facts */
.facts-list {
  list-style: none;
}

.facts-list li {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  display: flex;
  gap: 0.5rem;
}

.facts-list li::before {
  content: '•';
  color: var(--color-primary);
}

/* Calculator */
.calculator-box {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
}

.calc-inputs {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.input-group {
  flex: 1;
}

.input-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
}

.input-group input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  font-family: inherit;
}

.calc-results {
  margin-top: 1rem;
  background: white;
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid var(--color-border);
}

.calc-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.calc-item:last-child {
  margin-bottom: 0;
}

/* Valuation Module */
.valuation-box {
  margin-top: 1.5rem;
  border: 1px solid var(--color-primary);
  background: #f0fff4;
  /* Light green tint */
}

.rating-group {
  background: white;
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.rating-group label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text-main);
  width: 100%;
  margin-bottom: 0.5rem;
}

.help-text {
  font-weight: 400;
  color: var(--color-text-muted);
  font-size: 0.8em;
}

.slider {
  width: 75%;
  margin-right: 1rem;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.rating-group span {
  font-weight: bold;
  color: var(--color-primary);
  font-size: 1.1rem;
  width: 20%;
  text-align: right;
}

.valuation-result {
  background: white;
  padding: 1.5rem;
  border-radius: 0.5rem;
  text-align: center;
  margin-top: 1.5rem;
  border: 2px solid var(--color-primary);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.valuation-result span {
  display: block;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.valuation-result strong {
  display: block;
  font-size: 2.5rem;
  color: var(--color-primary);
  margin-top: 0.5rem;
}

.compact-inputs {
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.styled-select {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-family: inherit;
  background-color: white;
}

.info-box {
  background: #fff3cd;
  border: 1px solid #ffeeba;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  text-align: center;
  color: #856404;
}

.info-box h4 {
  margin-bottom: 0.5rem;
}

.legal-disclaimer {
  margin-top: 1rem;
  padding: 1rem;
  background-color: #f8f9fa;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-warning);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.legal-disclaimer h4 {
  color: var(--color-warning);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
}


.legal-disclaimer h4 {
  color: var(--color-warning);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
}

/* Checkboxes & Toggles */
.checkbox-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  background: white;
  padding: 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}

.compact-checks {
  background: transparent;
  border: none;
  padding: 0;
  margin-bottom: 0.5rem;
  gap: 1.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 500;
}

.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 1rem;
  background: #f0f7ff;
  border-radius: var(--radius-lg);
  border: 1px solid #d0e3ff;
}

.toggle-label {
  font-weight: 600;
  color: var(--color-text-main);
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-round {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked+.slider-round {
  background-color: var(--color-primary);
}

input:checked+.slider-round:before {
  transform: translateX(22px);
}

.full-width {
  grid-column: span 2;
}

/* Utils */
.hidden {
  display: none !important;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal Styling */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: white;
  width: 90%;
  max-width: 500px;
  height: 80vh;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 1rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#close-modal-btn {
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
}

#tree-search-input {
  padding: 1rem;
  border: none;
  border-bottom: 1px solid var(--color-border);
  font-size: 1rem;
  outline: none;
  width: 100%;
}

.tree-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.tree-item {
  padding: 0.75rem;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.2s;
}

.tree-item:hover {
  background: #f9fafb;
}

.tree-item h4 {
  margin: 0;
  color: var(--color-text-dark);
}

.tree-item p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-text-light);
  font-style: italic;
}