/* 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;
}

:root {
  --primary-green: #1a5f1a;
  --secondary-green: #2e8b2e;
  --accent-green: #4caf50;
  --light-green: #81c784;
  --pale-green: #c8e6c9;
  --gradient-primary: linear-gradient(
    135deg,
    #1a5f1a 0%,
    #2e8b2e 50%,
    #4caf50 100%
  );
  --gradient-card: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(255, 255, 255, 0.7) 100%
  );
  --text-dark: #1a1a1a;
  --text-medium: #4a4a4a;
  --text-light: #6a6a6a;
  --background: #f8fffe;
  --surface: rgba(255, 255, 255, 0.95);
  --shadow-light: 0 2px 10px rgba(26, 95, 26, 0.08);
  --shadow-medium: 0 8px 30px rgba(26, 95, 26, 0.12);
  --shadow-heavy: 0 20px 60px rgba(26, 95, 26, 0.15);
  --border-radius: 16px;
  --border-radius-large: 24px;
  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-secondary, #f8fffe);
  color: var(--text-primary, #333);
  line-height: 1.8;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Animated background */
.background-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.leaf {
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--accent-green);
  border-radius: 0 100% 0 100%;
  opacity: 0.1;
  animation: float 15s infinite ease-in-out;
}

.leaf:nth-child(1) {
  left: 10%;
  animation-delay: 0s;
}
.leaf:nth-child(2) {
  left: 20%;
  animation-delay: 2s;
}
.leaf:nth-child(3) {
  left: 30%;
  animation-delay: 4s;
}
.leaf:nth-child(4) {
  left: 40%;
  animation-delay: 6s;
}
.leaf:nth-child(5) {
  left: 50%;
  animation-delay: 8s;
}
.leaf:nth-child(6) {
  left: 60%;
  animation-delay: 10s;
}
.leaf:nth-child(7) {
  left: 70%;
  animation-delay: 12s;
}
.leaf:nth-child(8) {
  left: 80%;
  animation-delay: 14s;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(100vh) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

/* Header */
.header {
  background: var(--gradient-primary);
  padding: 1rem 0;
  box-shadow: var(--shadow-medium);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
}

.logo i {
  font-size: 2rem;
  color: var(--pale-green);
}

/* Main content */
.main-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.hero-section {
  text-align: center;
  margin-bottom: 3rem;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-medium);
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Upload card */
.upload-card {
  background: var(--bg-primary, rgba(255, 255, 255, 0.9));
  backdrop-filter: blur(20px);
  border-radius: var(--border-radius-large);
  padding: 3rem;
  box-shadow: 0 20px 60px var(--shadow-heavy, rgba(0, 0, 0, 0.15));
  border: 1px solid rgba(255, 255, 255, 0.3);
  margin-bottom: 2rem;
  animation: fadeIn 1s ease-in-out;
}

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

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* File upload area */
.file-upload-area {
  position: relative;
  border: 3px dashed var(--light-green);
  border-radius: var(--border-radius);
  padding: 3rem 2rem;
  text-align: center;
  transition: var(--transition);
  background: rgba(200, 230, 201, 0.1);
  cursor: pointer;
}

.file-upload-area:hover {
  border-color: var(--accent-green);
  background: rgba(200, 230, 201, 0.2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.file-upload-area.dragover {
  border-color: var(--primary-green);
  background: rgba(200, 230, 201, 0.3);
  transform: scale(1.02);
}

.upload-icon {
  font-size: 4rem;
  color: var(--accent-green);
  margin-bottom: 1rem;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

.upload-text {
  font-size: 1.2rem;
  color: var(--text-medium);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.upload-subtext {
  color: var(--text-light);
  font-size: 0.9rem;
}

#file-input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

/* File preview */
.file-preview {
  display: none;
  text-align: center;
  padding: 1rem;
  background: rgba(76, 175, 80, 0.1);
  border-radius: var(--border-radius);
  border: 1px solid var(--light-green);
}

.file-preview.show {
  display: block;
}

.preview-image {
  max-width: 200px;
  max-height: 200px;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  box-shadow: var(--shadow-light);
}

.file-info {
  color: var(--text-medium);
  font-size: 0.9rem;
}

.remove-file {
  background: none;
  border: none;
  color: #e74c3c;
  cursor: pointer;
  margin-left: 1rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: var(--transition);
}

.remove-file:hover {
  background: rgba(231, 76, 60, 0.1);
}

/* Submit button */
.submit-btn {
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  disabled: opacity 0.7;
}

.submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

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

.submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-text {
  position: relative;
  z-index: 2;
}

/* Loading animation */
.loading-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Features section */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.feature-card {
  background: var(--bg-primary, rgba(255, 255, 255, 0.95));
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 10px var(--shadow-light, rgba(0, 0, 0, 0.08));
  text-align: center;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
  background: var(--surface);
}

.feature-icon {
  font-size: 2.5rem;
  color: var(--accent-green);
  margin-bottom: 1rem;
}

.feature-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary, #333);
}

.feature-description {
  color: var(--text-secondary, #666);
  font-size: 0.9rem;
}

/* Footer */
.footer {
  background-color: #f2f2f2;
  color: #666;
  padding: 2rem;
  text-align: center;
  margin-top: 3rem;
}

/* Responsive design */
@media (max-width: 768px) {
  .main-container {
    padding: 2rem 1rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .upload-card {
    padding: 2rem 1.5rem;
  }

  .file-upload-area {
    padding: 2rem 1rem;
  }

  .features {
    grid-template-columns: 1fr;
  }
}
