/* Import Google Fonts */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

/* CSS Custom Properties for consistent theming */
:root {
  --primary-green: #2d5016;
  --secondary-green: #4a7c59;
  --accent-green: #7fb069;
  --light-green: #a7c957;
  --earth-brown: #8b4513;
  --warm-beige: #f5f5dc;
  --soft-gray: #f8f9fa;
  --text-dark: #2c3e50;
  --text-light: #6c757d;
  --success-green: #28a745;
  --warning-orange: #fd7e14;
  --danger-red: #dc3545;
  --excellent-blue: #007bff;
  --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.15);
  --border-radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and base styles */
* {
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, var(--warm-beige) 0%, var(--soft-gray) 100%);
  min-height: 100vh;
  color: var(--text-dark);
  line-height: 1.6;
  margin: 0;
}

/* Navigation Styles */
.navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(45, 80, 22, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--primary-green);
}

.nav-icon {
  font-size: 1.5rem;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: var(--transition);
}

.nav-link:hover {
  background: var(--accent-green);
  color: white;
}

.nav-link.active {
  background: var(--primary-green);
  color: white;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
  color: white;
  padding: 4rem 0;
  text-align: center;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.hero-icon {
  font-size: 3.5rem;
}

.hero-subtitle {
  font-size: 1.3rem;
  margin-bottom: 2.5rem;
  opacity: 0.9;
  line-height: 1.6;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-green);
  color: white;
  text-decoration: none;
  padding: 1rem 2rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  font-size: 1.1rem;
  transition: var(--transition);
  box-shadow: var(--shadow-light);
}

.cta-button:hover {
  background: var(--light-green);
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.cta-button.secondary {
  background: var(--primary-green);
}

.cta-button.secondary:hover {
  background: var(--secondary-green);
}

.button-arrow {
  font-size: 1.2rem;
  transition: var(--transition);
}

.cta-button:hover .button-arrow {
  transform: translateX(4px);
}

/* About Page Styles */
.about-hero {
  background: linear-gradient(135deg, var(--secondary-green) 0%, var(--accent-green) 100%);
  color: white;
  padding: 3rem 0;
  text-align: center;
}

.about-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.about-icon {
  font-size: 3rem;
}

.about-subtitle {
  font-size: 1.2rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

.about-content {
  padding: 4rem 0;
}

.project-overview {
  background: white;
  padding: 3rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  margin-bottom: 4rem;
  text-align: center;
}

.project-overview h2 {
  color: var(--primary-green);
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.project-overview p {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-light);
  max-width: 800px;
  margin: 0 auto;
}

/* Team Section */
.team-section {
  margin-bottom: 4rem;
}

.team-title {
  text-align: center;
  color: var(--primary-green);
  font-size: 2.2rem;
  font-weight: 600;
  margin-bottom: 3rem;
}

.team-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .team-grid {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  }
}

.team-member {
  background: white;
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  display: flex;
  gap: 1.5rem;
  transition: var(--transition);
}

.team-member:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-medium);
}

.member-avatar {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--accent-green), var(--light-green));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-icon {
  font-size: 2.5rem;
}

.member-info {
  flex: 1;
}

.member-name {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--primary-green);
  margin-bottom: 1rem;
}

.member-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.role-badge {
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.role-badge.primary {
  background: var(--primary-green);
  color: white;
}

.role-badge.secondary {
  background: var(--accent-green);
  color: white;
}

.role-badge.tertiary {
  background: var(--light-green);
  color: white;
}

.member-description {
  color: var(--text-light);
  line-height: 1.6;
  font-size: 0.95rem;
}

/* Roles Overview */
.roles-overview {
  margin-bottom: 4rem;
}

.roles-overview h2 {
  text-align: center;
  color: var(--primary-green);
  font-size: 2rem;
  margin-bottom: 2.5rem;
}

.roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.role-card {
  background: white;
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  text-align: center;
  transition: var(--transition);
}

.role-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-medium);
}

.role-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.role-card h3 {
  color: var(--primary-green);
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.role-card p {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Project Stats */
.project-stats {
  background: white;
  padding: 3rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  margin-bottom: 4rem;
}

.project-stats h2 {
  text-align: center;
  color: var(--primary-green);
  font-size: 2rem;
  margin-bottom: 2.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.stat-item {
  text-align: center;
  padding: 1.5rem;
  background: var(--soft-gray);
  border-radius: var(--border-radius);
}

.stat-number {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary-green);
  margin-bottom: 0.5rem;
}

.stat-label {
  color: var(--text-light);
  font-weight: 500;
}

/* Content Section */
.content-section {
  padding: 4rem 0;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-bottom: 4rem;
}

@media (min-width: 768px) {
  .content-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

.content-card {
  background: white;
  padding: 2.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  text-align: center;
  transition: var(--transition);
}

.content-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
}

.card-icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
}

.content-card h2 {
  color: var(--primary-green);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.content-card p {
  color: var(--text-light);
  line-height: 1.7;
}

/* Features Section */
.features-section {
  background: white;
  padding: 3rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  margin-bottom: 4rem;
}

.features-title {
  text-align: center;
  color: var(--primary-green);
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 2rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--soft-gray);
  border-radius: 8px;
  transition: var(--transition);
}

.feature-item:hover {
  background: var(--accent-green);
  color: white;
  transform: translateX(5px);
}

.feature-icon {
  font-size: 1.5rem;
}

.feature-text {
  font-weight: 500;
}

/* CTA Section */
.cta-section {
  text-align: center;
  padding: 3rem;
  background: linear-gradient(135deg, var(--light-green) 0%, var(--accent-green) 100%);
  border-radius: var(--border-radius);
  color: white;
}

.cta-section h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.cta-section p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

/* Footer */
.footer {
  background: var(--primary-green);
  color: white;
  text-align: center;
  padding: 2rem 0;
  margin-top: 2rem;
}

/* Analyzer Page Specific Styles */
.analyzer-container {
  padding-top: 2rem;
}

.analyzer-header {
  text-align: center;
  margin-bottom: 3rem;
}

.analyzer-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-green);
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Container and layout */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 2rem;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-light);
  font-weight: 400;
  max-width: 700px;
  margin: 0 auto;
}

/* Main content card */
main {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-medium);
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
}

main::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-green), var(--accent-green), var(--light-green));
}

/* Form styles */
.form-section {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #e9ecef;
}

.form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--primary-green);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title::before {
  content: "🌱";
  font-size: 1.5rem;
}

.form-section:nth-child(2) .section-title::before {
  content: "🌍";
}

/* Grid layout */
.row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.row:last-child {
  margin-bottom: 0;
}

@media (min-width: 768px) {
  .row {
    grid-template-columns: 1fr 1fr;
  }
}

/* Input group styling */
.input-group {
  position: relative;
  margin-bottom: 1.5rem;
}

.form-label {
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  display: block;
  font-size: 0.95rem;
}

.form-control {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid #e9ecef;
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
  background: white;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px rgba(127, 176, 105, 0.1);
  transform: translateY(-1px);
}

.form-control:valid {
  border-color: var(--success-green);
}

.form-control:invalid:not(:placeholder-shown) {
  border-color: var(--danger-red);
}

/* Form help text */
.form-text {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.form-text::before {
  content: "ℹ️";
  font-size: 0.8rem;
}

/* Input icons */
.input-group::after {
  content: "";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background-size: contain;
  opacity: 0.5;
  pointer-events: none;
}

#ph-container::after {
  content: "⚗️";
  font-size: 1.2rem;
}

#potassium-container::after {
  content: "🧪";
  font-size: 1.2rem;
}

#nitrogen-container::after {
  content: "🌿";
  font-size: 1.2rem;
}

#phosphorus-container::after {
  content: "💎";
  font-size: 1.2rem;
}

#organic-matter-container::after {
  content: "🍂";
  font-size: 1.2rem;
}

#soil-moisture-container::after {
  content: "💧";
  font-size: 1.2rem;
}

#rainfall-container::after {
  content: "🌧️";
  font-size: 1.2rem;
}

#tree-age-container::after {
  content: "🌳";
  font-size: 1.2rem;
}

/* Submit button */
.btn-analyze {
  background: linear-gradient(135deg, var(--primary-green), var(--secondary-green));
  border: none;
  color: white;
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-light);
  position: relative;
  overflow: hidden;
  min-width: 250px;
}

.btn-analyze:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.btn-analyze:active {
  transform: translateY(0);
}

.btn-analyze:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Loading state */
.btn-analyze.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.btn-analyze.loading .button-text {
  opacity: 0;
}

@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Results section */
.result-container {
  margin-top: 2.5rem;
  padding: 2rem;
  border-radius: var(--border-radius);
  text-align: center;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: var(--transition);
  position: relative;
}

.result-container.show {
  animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Result status styles */
.result-excellent {
  background: linear-gradient(135deg, rgba(0, 123, 255, 0.1), rgba(127, 176, 105, 0.1));
  border: 2px solid var(--excellent-blue);
}

.result-good {
  background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(127, 176, 105, 0.1));
  border: 2px solid var(--success-green);
}

.result-moderate {
  background: linear-gradient(135deg, rgba(253, 126, 20, 0.1), rgba(255, 193, 7, 0.1));
  border: 2px solid var(--warning-orange);
}

.result-poor {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(255, 107, 107, 0.1));
  border: 2px solid var(--danger-red);
}

#result {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.result-excellent #result {
  color: var(--excellent-blue);
}

.result-good #result {
  color: var(--success-green);
}

.result-moderate #result {
  color: var(--warning-orange);
}

.result-poor #result {
  color: var(--danger-red);
}

/* Result icons */
.result-excellent #result::before {
  content: "🏆";
  font-size: 2rem;
}

.result-good #result::before {
  content: "✅";
  font-size: 2rem;
}

.result-moderate #result::before {
  content: "⚠️";
  font-size: 2rem;
}

.result-poor #result::before {
  content: "❌";
  font-size: 2rem;
}

/* Additional result info */
.result-details {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--text-light);
  max-width: 600px;
  line-height: 1.6;
}

/* Responsive design */
@media (max-width: 768px) {
  .nav-container {
    padding: 1rem;
  }
  
  .nav-links {
    gap: 1rem;
  }

  .hero-title, .about-title {
    font-size: 2.2rem;
    flex-direction: column;
    gap: 0.5rem;
  }

  .hero-subtitle, .about-subtitle {
    font-size: 1.1rem;
  }

  .container {
    padding: 0 1rem;
  }

  .analyzer-header h1 {
    font-size: 2rem;
  }

  main {
    padding: 1.5rem;
  }

  .form-control {
    padding: 0.75rem;
  }

  .btn-analyze {
    width: 100%;
    padding: 1rem;
    min-width: auto;
  }

  #result {
    font-size: 1.5rem;
  }

  .content-card, .role-card {
    padding: 2rem;
  }

  .features-section, .project-stats {
    padding: 2rem;
  }

  .team-member {
    flex-direction: column;
    text-align: center;
  }

  .member-avatar {
    align-self: center;
  }
}

@media (max-width: 480px) {
  .hero-title, .about-title {
    font-size: 1.8rem;
  }

  .analyzer-header h1 {
    font-size: 1.75rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  main {
    padding: 1rem;
  }

  .nav-brand {
    font-size: 1rem;
  }

  .nav-links {
    gap: 0.5rem;
  }

  .nav-link {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }

  .project-overview, .features-section, .project-stats {
    padding: 1.5rem;
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for keyboard navigation */
.form-control:focus,
.btn-analyze:focus,
.nav-link:focus,
.cta-button:focus {
  outline: 2px solid var(--accent-green);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  body {
    background: white;
  }

  .navbar,
  .footer {
    display: none;
  }

  main {
    box-shadow: none;
    border: 1px solid #ccc;
  }

  .btn-analyze {
    display: none;
  }
}
