/* Import theme system */
@import url('../../theme.css');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
  font-family: "Poppins", sans-serif;
  line-height: 1.6;
  color: var(--text-primary, #333);
  background-color: var(--bg-secondary, #f5f5f5);
  min-height: 100vh;
  padding-top: 80px;
  position: relative;
  overflow-x: hidden;
}

#canvas-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.3;
}

#three-canvas {
  display: block;
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: #2e7d32;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: all 0.3s ease;
}

.back-btn {
  color: white;
  text-decoration: none;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(-2px);
}

.navbar-title {
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 600;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  background: var(--bg-primary, white);
  border-radius: 20px;
  box-shadow: 0 20px 40px var(--shadow-medium, rgba(0, 0, 0, 0.1));
  margin-bottom: 2rem;
  animation: slideUp 0.8s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

h1 {
  text-align: center;
  margin-bottom: 0.5rem;
  color: #333;
  font-size: 2.5rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
  text-align: center;
  margin-bottom: 3rem;
  color: #666;
  font-size: 1.1rem;
  font-weight: 400;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.form-group {
  position: relative;
  animation: fadeInUp 0.6s ease forwards;
  animation-delay: calc(var(--delay, 0) * 0.1s);
  opacity: 0;
  transform: translateY(20px);
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-group:nth-child(1) {
  --delay: 1;
}
.form-group:nth-child(2) {
  --delay: 2;
}
.form-group:nth-child(3) {
  --delay: 3;
}
.form-group:nth-child(4) {
  --delay: 4;
}
.form-group:nth-child(5) {
  --delay: 5;
}
.form-group:nth-child(6) {
  --delay: 6;
}
.form-group:nth-child(7) {
  --delay: 7;
}
.form-group:nth-child(8) {
  --delay: 8;
}
.form-group:nth-child(9) {
  --delay: 9;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #333;
  font-size: 0.95rem;
  transition: color 0.3s ease;
}

input,
select {
  width: 100%;
  padding: 1rem;
  border: 2px solid #e1e5e9;
  border-radius: 12px;
  font-size: 1rem;
  background: var(--bg-primary, white);
  color: var(--text-primary, #333);
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

input:focus,
select:focus {
  outline: none;
  border-color: #2e7d32;
  box-shadow: 0 0 0 4px rgba(46, 125, 50, 0.1);
  transform: translateY(-2px);
}

input::placeholder {
  color: var(--text-muted, #999);
  font-style: italic;
}

.predict-btn {
  width: 100%;
  max-width: 400px;
  margin: 2rem auto;
  display: block;
  padding: 1.2rem 2rem;
  background-color: #2e7d32;
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(46, 125, 50, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.predict-btn:hover {
  background-color: #1b5e20;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(46, 125, 50, 0.4);
}

.predict-btn:active {
  transform: translateY(0);
}

#result-container {
  background: #f1f8e9;
  border-radius: 16px;
  padding: 2rem;
  margin-top: 2rem;
  border: 1px solid rgba(46, 125, 50, 0.1);
  animation: slideIn 0.5s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.hidden {
  display: none;
}

#result-container h2 {
  color: #333;
  font-size: 1.8rem;
  margin-bottom: 1rem;
  text-align: center;
}

#result-text {
  font-size: 1.3rem;
  font-weight: 600;
  color: #2e7d32;
  text-align: center;
  margin-bottom: 2rem;
  padding: 1rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#guide-title {
  color: #333;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
  font-weight: 600;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.guide-item {
  background: var(--bg-primary, white);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px var(--shadow-light, rgba(0, 0, 0, 0.08));
  transition: all 0.3s ease;
  border: 1px solid rgba(46, 125, 50, 0.1);
  position: relative;
  overflow: hidden;
}

.guide-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: #2e7d32;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.guide-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.guide-item:hover::before {
  transform: translateX(0);
}

.guide-item h4 {
  color: var(--text-primary, #333);
  font-size: 1.1rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.guide-item p {
  color: var(--text-secondary, #666);
  line-height: 1.6;
  font-size: 0.95rem;
}

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.form-progress {
  position: fixed;
  top: 80px;
  left: 0;
  height: 3px;
  background: #2e7d32;
  transition: width 0.3s ease;
  z-index: 999;
}

@media (max-width: 768px) {
  .container {
    margin: 1rem;
    padding: 1.5rem;
    border-radius: 16px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  h1 {
    font-size: 2rem;
  }

  .navbar {
    padding: 1rem;
  }

  .navbar-title {
    font-size: 1.2rem;
  }
}

/* Form validation styles */
.form-group.error input,
.form-group.error select {
  border-color: #e74c3c;
  box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1);
}

.form-group.success input,
.form-group.success select {
  border-color: #27ae60;
}

.error-message {
  color: #e74c3c;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  display: none;
}

.form-group.error .error-message {
  display: block;
}
