* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Page container */
.ar-page {
  max-width: 1500px;
  margin: 0 auto;
  padding: 40px 30px;
  font-family: "Inter", sans-serif;
}

/* Header */
.ar-header {
  margin-bottom: 40px;
}

.ar-header h1 {
  font-size: 2rem;
  font-weight: 600;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  gap: 16px;
}

.ar-header .badge {
  font-size: 0.9rem;
  font-weight: 500;
  color: #2e7d32;
  background: #e8f5e9;
  padding: 6px 14px;
  border-radius: 30px;
}

.ar-header p {
  font-size: 1rem;
  color: #666;
  max-width: 700px;
  line-height: 1.5;
  margin-top: 8px;
}

/* Two-grid layout */
.ar-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(0, 1.6fr);
  gap: 16px;
  align-items: stretch;
  margin-top: 32px;
}

/* Left column */
.ar-left {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 360px;
  gap: 20px;
  min-height: 0;
}

/* Buttons */

.ar-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.scan-qr-btn,
.start-ar-btn {
  display: inline-flex;
  align-items: center;
  align-content: center;
  gap: 8px;
  border: none;
  border-radius: 8px;
  padding: 12px 40px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: "Inter", sans-serif;
  flex: 1 1 0;
  min-width: 150px;
}

.ar-buttons > button {
  flex: 1 1 0;
}

.scan-qr-btn img,
.start-ar-btn img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.scan-qr-btn img {
  filter: invert(100%);
}

.scan-qr-btn {
  background: #2e7d32;
  color: white;
}

.scan-qr-btn:hover {
  background: #1b5e20;
  transform: scale(1.02);
}

.start-ar-btn {
  background: #8ee09250;
  color: #1a3b1a;
  align-items: center;
  align-content: center;
}

.start-ar-btn:hover {
  background: #88dd8cc4;
  transform: scale(1.02);
}

/* Active state (if you want to toggle later) */
/* .scan-qr-btn.active,
.start-ar-btn.active {
    outline: 3px solid #2e7d32;
    outline-offset: 2px;
} */

.scan-qr-btn i {
  font-size: 1.2rem;
}

/* Tree list */
.tree-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 6px;
}

.tree-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f9fafb;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 0 0 auto; /* do not stretch individual cards by default */
}

.tree-card:hover {
  background: #e8f5e9;
  border-color: #2e7d32;
}

.tree-card.active {
  background: #e8f5e9;
  border-color: #2e7d32;
}

.tree-info h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 4px 0;
}

.tree-info {
  width: 100%;
}

.top-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}

.bottom-info {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  gap: 32px;
}

.tree-info p {
  font-size: 0.9rem;
  color: #555;
  margin: 2px 0;
}

.tree-info .label {
  font-weight: 500;
  color: #333;
}

.tree-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.qr-btn {
  background: transparent;
  border: 1px solid #d4d4d4;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  color: #555;
  transition: all 0.2s ease;
  font-size: 1rem;
  flex-shrink: 0;
  margin-left: auto;
}

.qr-btn:hover {
  transform: scale(1.12);
}

.qr-note {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: #666;
  background: #f1f9f1;
  padding: 12px 16px;
  border-radius: 12px;
}

.qr-note i {
  color: #2e7d32c2;
  font-size: 24px;
}

/* Right column */

.ar-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 10px;
}

.simulation-box {
  background: #f5faf5;
  border-radius: 16px;
  border: 1px solid #5e5e5e30;
  height: 640px;
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.3s;
  position: relative;
  overflow: hidden;
}

.simulation-box.active {
  border-color: #2e7d32;
  border-style: solid;
  background: #f0fdf4;
}

.tree-info-overlay {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 10;
  border-radius: 12px;
  max-width: 280px;
  pointer-events: none;
  font-size: 0.8rem;
  line-height: 1.5;
  transition: opacity 0.3s ease;
}

.tree-info-overlay h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #2e7d32;
  margin: 0 0 4px 0;
}

.tree-info-overlay p {
  font-size: 0.8rem;
  color: #2e7d32;
  padding-top: 4px;
}

/* Hide overlay when no tree is selected */
.tree-info-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* .tree-details {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  position: absolute;
  top: 20px;
  color: #333;
  left: 20px;
  z-index: 2;
}

.tree-details i {
  padding-right: 12px;
  font-size: 1.2rem;
} */

#arOverlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.1);
}

#exitArBtn {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 40px;
  font-weight: 600;
  pointer-events: all;
  cursor: pointer;
  z-index: 12;
}

#arHint {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  background: rgba(0, 0, 0, 0.5);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  pointer-events: none;
}

#threeContainer {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.placeholder-content {
  position: relative;
  z-index: 2;
  pointer-events: none; /* allow clicks to pass to Three.js canvas */
}

.simulation-box {
  position: relative;
  overflow: hidden;
}

/* Responsive */
@media (max-width: 1300px) {
  .ar-grid {
    grid-template-columns: minmax(280px, 1fr) minmax(0, 1fr);
  }
  .ar-left {
    max-width: none;
  }
  .scan-qr-btn,
  .start-ar-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 1024px) {
  .ar-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .ar-left {
    display: flex;
    flex-grow: 1;
    margin-right: auto;
  }

  .scan-qr-btn,
  .start-ar-btn {
    width: 100%;
    justify-content: center;
  }

  .simulation-box {
    height: 600px;
  }
}

@media (max-width: 640px) {
  .ar-page {
    padding: 20px 16px;
  }
  .ar-header h1 {
    font-size: 1.6rem;
    flex-wrap: wrap;
  }
  .scan-qr-btn,
  .start-ar-btn {
    width: 100%;
    justify-content: center;
  }
  .tree-card {
    padding: 14px 16px;
    flex-wrap: wrap;
  }
  .tree-actions {
    margin-top: 8px;
  }
  .simulation-box {
    height: 500px;
  }
  .ar-right {
    margin: 0;
    padding: 0;
  }
}
