/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
}

header {
  text-align: center;
  padding: 2rem 1rem;
  color: white;
}

header h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
  font-size: 1.2rem;
  opacity: 0.9;
}

/* Hero section with carousel */
.hero {
  max-width: 800px;
  margin: 0 auto 3rem;
  padding: 0 1rem;
}

.carousel {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.carousel-container {
  position: relative;
  height: 400px;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.carousel-slide.active {
  opacity: 1;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 1rem;
  text-align: center;
  font-size: 1.2rem;
  font-weight: bold;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.8);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  transition: all 0.3s;
  z-index: 10;
}

.carousel-btn:hover {
  background: white;
  transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev {
  left: 20px;
}

.carousel-btn.next {
  right: 20px;
}

.carousel-dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: background 0.3s;
}

.dot.active {
  background: white;
}

/* Main content */
main {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

.upload-section {
  background: white;
  border-radius: 15px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.upload-section h2 {
  text-align: center;
  margin-bottom: 2rem;
  color: #2c3e50;
}

/* File upload styling */
.file-upload {
  display: block;
  margin-bottom: 2rem;
  cursor: pointer;
}

.file-upload input[type="file"] {
  display: none;
}

.upload-area {
  border: 3px dashed #bdc3c7;
  border-radius: 10px;
  padding: 3rem 2rem;
  text-align: center;
  transition: all 0.3s;
  background: #f8f9fa;
}

.upload-area:hover {
  border-color: #3498db;
  background: #ecf0f1;
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.upload-text {
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: #2c3e50;
}

.upload-hint {
  color: #e74c3c;
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 0.5rem;
}

/* Detection options */
.detection-options {
  border: 2px solid #ecf0f1;
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  background: #f8f9fa;
}

.detection-options legend {
  font-size: 1.2rem;
  font-weight: bold;
  color: #2c3e50;
  padding: 0 10px;
}

.option {
  display: flex;
  align-items: center;
  padding: 1rem;
  margin: 0.5rem 0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  background: white;
  border: 2px solid transparent;
}

.option:hover {
  border-color: #3498db;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.option input[type="radio"] {
  margin-right: 1rem;
  transform: scale(1.2);
}

.option-icon {
  font-size: 2rem;
  margin-right: 1rem;
}

.option-text {
  font-weight: bold;
  margin-right: 1rem;
  color: #2c3e50;
}

.option-desc {
  color: #7f8c8d;
  font-size: 0.9rem;
}

/* Upload button */
#uploadButton {
  display: block;
  width: 100%;
  padding: 1rem 2rem;
  background: linear-gradient(45deg, #3498db, #2980b9);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

#uploadButton:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

#uploadButton:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
  box-shadow: none;
}

/* Status messages */
.status-message {
  margin-top: 2rem;
  padding: 1rem;
  border-radius: 10px;
  text-align: center;
  font-weight: bold;
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Results section */
.results-section {
  background: white;
  border-radius: 15px;
  padding: 2rem;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  animation: fadeIn 0.5s ease-in;
}

.results-section h2 {
  text-align: center;
  margin-bottom: 2rem;
  color: #2c3e50;
}

.results-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.image-preview {
  text-align: center;
}

.image-preview img {
  max-width: 100%;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.analysis-results {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 1.5rem;
}

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

.result-section h3 {
  color: #2c3e50;
  border-bottom: 3px solid #3498db;
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.result-item {
  background: white;
  margin: 0.5rem 0;
  padding: 1rem;
  border-radius: 8px;
  border-left: 4px solid #3498db;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: transform 0.2s;
}

.result-item:hover {
  transform: translateX(5px);
}

.confidence {
  font-weight: bold;
  color: #27ae60;
  font-size: 1.1rem;
}

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

/* Responsive design */
@media (max-width: 768px) {
  header h1 {
    font-size: 2rem;
  }

  .results-content {
    grid-template-columns: 1fr;
  }

  .carousel-container {
    height: 300px;
  }

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

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

  .option-icon {
    margin-bottom: 0.5rem;
  }
}
