/* Complete professional redesign with semantic design tokens */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  color: var(--foreground);
  background: var(--background);
  min-height: 100vh;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Professional Typography */
h1,
h2,
h3,
h4 {
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  color: var(--foreground);
}

h1 {
  font-size: 2.5rem;
  font-weight: 900;
}
h2 {
  font-size: 1.875rem;
  font-weight: 700;
}
h3 {
  font-size: 1.5rem;
  font-weight: 600;
}
h4 {
  font-size: 1.25rem;
  font-weight: 600;
}

/* Header Styles */
.header {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 40px;
  margin: 32px 0 48px 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.header-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.logo-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 24px;
}

.logo-icon {
  width: 64px;
  height: 64px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon i {
  font-size: 2rem;
  color: var(--primary-foreground);
}

.logo-text h1 {
  color: var(--primary);
  margin-bottom: 4px;
}

.logo-subtitle {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mission-statement {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  font-weight: 400;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* Section Headers */
.section-header {
  text-align: center;
  margin-bottom: 40px;
}

.section-header h2 {
  color: var(--primary);
  margin-bottom: 12px;
}

.section-header p {
  color: var(--muted-foreground);
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Upload Section */
.upload-section {
  margin-bottom: 64px;
}

.upload-container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 64px 32px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  background: var(--background);
}

.upload-area:hover {
  border-color: var(--accent);
  background: var(--muted);
}

.upload-area.dragover {
  border-color: var(--accent);
  background: var(--muted);
  transform: scale(1.01);
}

.upload-icon-wrapper {
  width: 80px;
  height: 80px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px auto;
}

.upload-icon {
  font-size: 2.5rem;
  color: var(--primary-foreground);
}

.upload-content h3 {
  color: var(--foreground);
  margin-bottom: 12px;
}

.upload-content p {
  color: var(--muted-foreground);
  margin-bottom: 24px;
  font-size: 1.125rem;
}

.file-requirements {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.file-requirements span {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  background: var(--muted);
  padding: 6px 12px;
  border-radius: calc(var(--radius) - 2px);
}

.upload-btn {
  background: var(--primary);
  color: var(--primary-foreground);
  border: none;
  padding: 16px 32px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.upload-btn:hover {
  background: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Analysis Section */
.analysis-section {
  margin-bottom: 64px;
}

.analysis-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.image-panel,
.results-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.panel-header {
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.panel-header h3 {
  color: var(--primary-foreground);
  font-size: 1.125rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.image-wrapper {
  position: relative;
  background: var(--background);
  padding: 24px;
}

.image-wrapper img {
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
}

#detectionCanvas {
  position: absolute;
  top: 24px;
  left: 24px;
  pointer-events: none;
  border-radius: calc(var(--radius) - 2px);
}

.results-content {
  padding: 24px;
  min-height: 400px;
}

.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 300px;
  text-align: center;
}

.loading-spinner {
  width: 64px;
  height: 64px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.loading-spinner i {
  font-size: 1.5rem;
  color: var(--primary-foreground);
}

.loading p {
  color: var(--muted-foreground);
  margin-bottom: 20px;
  font-weight: 500;
}

.progress-bar {
  width: 200px;
  height: 4px;
  background: var(--muted);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
  0% {
    width: 0%;
  }
  50% {
    width: 70%;
  }
  100% {
    width: 100%;
  }
}

.detection-item {
  background: var(--muted);
  border-left: 4px solid var(--accent);
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  transition: all 0.2s ease;
}

.detection-item:hover {
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.detection-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.disease-name {
  font-weight: 600;
  color: var(--foreground);
  font-size: 1.125rem;
}

.confidence {
  background: var(--accent);
  color: var(--accent-foreground);
  padding: 6px 16px;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  font-weight: 600;
}

.detection-details {
  color: var(--muted-foreground);
  line-height: 1.6;
}

/* Statistics Section */
.stats-section {
  margin-bottom: 64px;
}

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

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 32px 24px;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-card i {
  font-size: 2.5rem;
  color: var(--accent);
  margin-bottom: 16px;
}

.stat-card h4 {
  color: var(--foreground);
  margin-bottom: 12px;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--accent);
  margin-bottom: 8px;
  font-family: "Montserrat", sans-serif;
}

.stat-label {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Info Section */
.info-section {
  margin-bottom: 64px;
}

.info-container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 40px;
}

.info-card {
  text-align: center;
  padding: 24px;
}

.info-icon {
  width: 80px;
  height: 80px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px auto;
}

.info-icon i {
  font-size: 2rem;
  color: var(--primary-foreground);
}

.info-card h4 {
  color: var(--foreground);
  margin-bottom: 16px;
}

.info-card p {
  color: var(--muted-foreground);
  line-height: 1.7;
  margin-bottom: 20px;
}

.info-metrics {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.metric {
  background: var(--accent);
  color: var(--accent-foreground);
  padding: 6px 12px;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  font-weight: 600;
}

/* Footer */
.footer {
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 32px 0;
  margin-top: 64px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-info p {
  margin-bottom: 4px;
  opacity: 0.9;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--primary-foreground);
  text-decoration: none;
  font-weight: 500;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.footer-links a:hover {
  opacity: 1;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .analysis-container {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .header {
    padding: 32px 24px;
  }

  .logo-section {
    flex-direction: column;
    gap: 16px;
  }

  h1 {
    font-size: 2rem;
  }
  h2 {
    font-size: 1.5rem;
  }

  .upload-container {
    padding: 32px 24px;
  }

  .upload-area {
    padding: 48px 24px;
  }

  .file-requirements {
    flex-direction: column;
    gap: 12px;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.6s ease-out;
}

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

.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}
