/* Plant Scanner - Base Styles */

:root {
  --primary-color: #22c55e;
  --primary-hover: #16a34a;
  --background: #f8fafc;
  --surface: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 100%;
  overflow: hidden;
}

/* Header */
.app-header {
  background: var(--primary-color);
  color: white;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow);
  z-index: 10;
}

.app-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

/* View Container */
#view-container {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  padding-bottom: 80px;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  padding: 0.5rem 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  z-index: 100;
}

.nav-btn {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  color: var(--primary-color);
}

.nav-btn.active {
  color: var(--primary-color);
  font-weight: 600;
}

.nav-btn sl-icon {
  font-size: 1.5rem;
}

/* Card Component */
.card {
  background: var(--surface);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.card h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.card p {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

/* Garden Header */
.garden-header {
  margin-bottom: 1rem;
}

.garden-search {
  margin: 1rem 0;
}

.garden-search sl-input {
  width: 100%;
}

.garden-stats {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--background);
  border-radius: 8px;
  margin-top: 1rem;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.stat-item sl-icon {
  font-size: 1.25rem;
  color: var(--primary-color);
}

/* Plant Grid */
.plant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.plant-card {
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.plant-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.plant-card-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  background: var(--background);
}

.plant-card-content {
  padding: 1rem;
}

.plant-card-content h3 {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.plant-scientific {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 0.5rem;
}

.plant-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.plant-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.plant-card-body {
  padding: 1rem;
}

.plant-card-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.plant-card-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.empty-state sl-icon {
  font-size: 4rem;
  opacity: 0.3;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.empty-state p {
  margin-bottom: 1.5rem;
}

/* Loading Spinner */
.loading {
  text-align: center;
  padding: 2rem;
}

.loading sl-spinner {
  font-size: 3rem;
  --track-width: 4px;
}

/* Camera View */
.camera-container {
  position: fixed;
  top: 70px; /* Below header */
  left: 0;
  right: 0;
  bottom: 80px; /* Above bottom nav */
  background: #000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.camera-view {
  flex: 1;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

#camera-feed {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-controls {
  position: absolute;
  bottom: 2rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  padding: 0 1rem;
  z-index: 10;
}

#capture-btn {
  --sl-button-circle-size-large: 80px;
}

/* Results View */
.results-container {
  max-width: 800px;
  margin: 0 auto;
}

.result-photo-container {
  margin-bottom: 1rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.result-photo {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  display: block;
}

.plant-name-section {
  margin-bottom: 1rem;
}

.plant-common-name {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.plant-scientific-name {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.scan-metadata {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* USDA Data */
.usda-data {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.data-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.data-item sl-icon {
  font-size: 1.5rem;
  color: var(--primary-color);
  flex-shrink: 0;
  margin-top: 0.25rem;
}

.data-item strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.data-item span {
  color: var(--text-secondary);
}

/* Care Tips */
.care-section {
  margin-bottom: 1.5rem;
}

.care-section:last-child {
  margin-bottom: 0;
}

.care-section h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.care-section p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 0.5rem;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.action-buttons sl-button {
  flex: 1;
  min-width: 150px;
}

/* Plant Details Modal */
.plant-details-modal {
  --width: 90vw;
  --max-width: 600px;
}

.plant-details {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.plant-details-photo {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 8px;
}

.plant-details-info h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.plant-details-info .scientific-name {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.detail-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.plant-details-info h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1rem 0 0.5rem;
}

.plant-details-info .usda-data p {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.plant-details-info .usda-data strong {
  color: var(--text-primary);
  margin-right: 0.25rem;
}

/* Responsive */
@media (max-width: 640px) {
  .plant-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .app-header {
    padding: 0.75rem 1rem;
  }

  .app-title {
    font-size: 1.25rem;
  }

  .camera-container {
    top: 60px;
  }

  .plant-common-name {
    font-size: 1.5rem;
  }

  .plant-scientific-name {
    font-size: 1rem;
  }

  .action-buttons {
    flex-direction: column;
  }

  .action-buttons sl-button {
    width: 100%;
  }
}
