/* Reset and Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', 'Segoe UI', sans-serif;
}

/* Custom Properties */
:root {
  --primary: #00ffcc;
  --primary-dark: #00ddb3;
  --secondary: #2c3e50;
  --accent: #e74c3c;
  --text-light: #ffffff;
  --text-dark: #333333;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Background and Overlay */
body {
  background: linear-gradient(135deg, rgba(0,0,0,0.3), rgba(0,0,0,0.2)),
              url("https://res.cloudinary.com/dp71rx6nx/image/upload/v1750778722/FindMyCrop_bg_llmcit.jpg") no-repeat center center/cover fixed;
  color: var(--text-light);
  min-height: 100vh;
  padding-top: 4rem;
  overflow-x: hidden;
}

.overlay {
  min-height: calc(100vh - 4rem);
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.overlay::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.7) 100%);
  animation: pulse 4s infinite;
}

@keyframes pulse {
  0% { opacity: 0.5; }
  50% { opacity: 0.8; }
  100% { opacity: 0.5; }
}

/* Form Container */
.form-container {
  max-width: 800px;
  width: 100%;
  background: rgba(0, 0, 0, 0.7);
  padding: 2.5rem;
  border-radius: 20px;
  box-shadow: 0 0 30px rgba(0, 255, 204, 0.3);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 255, 204, 0.2);
  animation: fadeInUp 1s ease-out;
}

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

.form-container h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(45deg, var(--primary), #fff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-align: center;
}

.subtitle {
  text-align: center;
  color: #ccc;
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

/* Input Groups and Fields */
.input-group {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.input-field {
  flex: 1;
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  transition: var(--transition);
  overflow: hidden;
}

.input-field.full-width {
  flex: 2;
}

.input-field i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  font-size: 1.2rem;
  transition: var(--transition);
}

.input-field input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  background: transparent;
  border: none;
  color: var(--text-light);
  font-size: 1rem;
  outline: none;
}

.input-field input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.input-field:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.input-field.focused {
  background: rgba(0, 255, 204, 0.1);
  box-shadow: 0 0 20px rgba(0, 255, 204, 0.2);
}

.input-field.focused i {
  transform: translateY(-50%) scale(1.2);
  color: #fff;
}

/* Tooltips */
.input-tooltip {
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #ccc;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  white-space: nowrap;
  z-index: 100;
}

.input-field:hover .input-tooltip {
  opacity: 1;
  visibility: visible;
  bottom: -40px;
}

/* Predict Button */
.predict-button {
  width: 100%;
  padding: 1.2rem;
  background: linear-gradient(45deg, var(--primary), var(--primary-dark));
  border: none;
  border-radius: 12px;
  color: var(--text-dark);
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 2rem;
  position: relative;
  overflow: hidden;
}

.predict-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: 0.5s;
}

.predict-button:hover::before {
  left: 100%;
}

.predict-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 30px rgba(0, 255, 204, 0.4);
}

.predict-button.loading {
  pointer-events: none;
  opacity: 0.8;
}

.predict-button.loading .button-text {
  animation: pulse 1s infinite;
}

/* Enhanced Prediction Result */
.prediction-result {
  margin-top: 2rem;
  padding: 2rem;
  background: rgba(0, 255, 204, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  animation: slideIn 0.5s ease-out;
  border: 1px solid rgba(0, 255, 204, 0.2);
  backdrop-filter: blur(10px);
  overflow: hidden;
  position: relative;
}

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

.result-icon {
  width: 60px;
  height: 60px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--text-dark);
  animation: bounce 2s infinite;
  flex-shrink: 0;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.result-content {
  flex: 1;
}

.result-content h3 {
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-size: 1.4rem;
}

.crop-name {
  font-size: 2rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 1.5rem;
  text-shadow: 0 0 10px rgba(0, 255, 204, 0.3);
  position: relative;
  z-index: 1;
}

/* Crop Details Section */
.crop-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.detail-item {
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  transition: var(--transition);
  cursor: pointer;
}

.detail-item:hover {
  background: rgba(0, 255, 204, 0.1);
  transform: translateY(-2px);
}

.detail-item i {
  color: var(--primary);
  font-size: 1.2rem;
}

.detail-item span {
  color: #fff;
  font-size: 0.9rem;
}

/* Crop Info Section */
.crop-info {
  background: rgba(0, 0, 0, 0.2);
  padding: 1.5rem;
  border-radius: 8px;
  margin-top: 1.5rem;
}

.crop-info p {
  color: #ccc;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* Crop Stats */
.crop-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}

.stat {
  text-align: center;
  padding: 1rem;
  background: rgba(0, 255, 204, 0.05);
  border-radius: 8px;
  transition: var(--transition);
}

.stat:hover {
  background: rgba(0, 255, 204, 0.1);
  transform: translateY(-2px);
}

.stat-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.3rem;
}

.stat-label {
  font-size: 0.9rem;
  color: #ccc;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 2px 20px rgba(0, 255, 204, 0.1);
  transition: var(--transition);
}

.navbar:hover {
  background: rgba(0, 0, 0, 0.9);
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  text-shadow: 0 0 10px rgba(0, 255, 204, 0.5);
  transition: var(--transition);
}

.logo:hover {
  transform: scale(1.05);
  text-shadow: 0 0 20px rgba(0, 255, 204, 0.8);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-light);
  font-weight: 500;
  position: relative;
  padding: 0.5rem 0;
  transition: var(--transition);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links .active::after {
  width: 100%;
}

.nav-links a:hover,
.nav-links .active {
  color: var(--primary);
}

/* Footer */
footer {
  background: linear-gradient(180deg, rgba(0,0,0,0.9) 0%, rgba(0,0,0,1) 100%);
  color: #ccc;
  padding: 2rem;
  text-align: center;
  position: relative;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.footer-section {
  margin-bottom: 2rem;
}

.footer-section h4 {
  color: var(--primary);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.social-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}

.social-links a {
  color: #ccc;
  font-size: 1.5rem;
  transition: var(--transition);
}

.social-links a:hover {
  color: var(--primary);
  transform: translateY(-3px);
}

/* Scroll To Top Button */
#scrollBtn {
  display: none;
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 100;
  font-size: 20px;
  background: var(--primary);
  color: var(--text-dark);
  border: none;
  padding: 15px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(0, 255, 204, 0.4);
  transition: var(--transition);
}

#scrollBtn:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 30px rgba(0, 255, 204, 0.6);
}

/* Responsive Design */
@media (max-width: 768px) {
  .navbar {
    padding: 1rem;
  }
  
  .nav-links {
    gap: 1rem;
  }
  
  .form-container {
    padding: 1.5rem;
  }
  
  .input-group {
    flex-direction: column;
    gap: 1rem;
  }
  
  .input-field.full-width {
    flex: 1;
  }
  
  .prediction-result {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .crop-details {
    grid-template-columns: 1fr;
  }
  
  .crop-stats {
    grid-template-columns: 1fr;
  }
  
  .detail-item {
    justify-content: center;
  }
  
  .footer-content {
    padding: 0 1rem;
  }
  
  .social-links {
    gap: 1rem;
  }
}

/* Animation for stats */
@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stat {
  animation: countUp 0.5s ease-out forwards;
  opacity: 0;
}

.stat:nth-child(1) { animation-delay: 0.1s; }
.stat:nth-child(2) { animation-delay: 0.2s; }
.stat:nth-child(3) { animation-delay: 0.3s; }

/* Hover effect for detail items */
.detail-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, transparent, rgba(0, 255, 204, 0.1), transparent);
  transform: translateX(-100%);
  transition: 0.5s;
}

.detail-item:hover::after {
  transform: translateX(100%);
}
