/* General Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Body Styling */
body {
  background: linear-gradient(135deg, #e3f2fd, #f1f8e9);
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
}

/* Container */
.container {
  background: #fff;
  width: 100%;
  max-width: 900px;
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0px 8px 25px rgba(0, 0, 0, 0.15);
  animation: fadeIn 0.8s ease-in-out;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 30px;
}
header h1 {
  font-size: 2.2rem;
  color: #1976d2;
  margin-bottom: 10px;
}
header .subtitle {
  font-size: 1.1rem;
  color: #555;
}

/* Upload Section */
.upload-section {
  text-align: center;
  margin-bottom: 30px;
}
.upload-box {
  background: #f9f9f9;
  border: 2px dashed #90caf9;
  border-radius: 12px;
  padding: 25px;
  transition: 0.3s;
}
.upload-box:hover {
  background: #e3f2fd;
  border-color: #42a5f5;
}
.file-input input {
  margin-bottom: 15px;
}
button {
  background: #1976d2;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s;
}
button:hover {
  background: #1565c0;
}
button:disabled {
  background: #90caf9;
  cursor: not-allowed;
}

/* Loading Spinner */
.loading {
  text-align: center;
}
.spinner {
  margin: 15px auto;
  width: 40px;
  height: 40px;
  border: 5px solid #ccc;
  border-top: 5px solid #1976d2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Results Section */
.results h2 {
  text-align: center;
  margin-bottom: 20px;
  color: #1976d2;
}
.image-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.image-box {
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 15px;
  text-align: center;
  box-shadow: 0px 4px 12px rgba(0,0,0,0.05);
}
.image-box img {
  max-width: 100%;
  border-radius: 10px;
  margin: 10px 0;
}

/* Prediction Result */
.prediction-result {
  text-align: center;
  margin-bottom: 25px;
}
.prediction-text {
  font-size: 1.3rem;
  font-weight: bold;
}
.prediction-text.normal {
  color: #2e7d32;
}
.prediction-text.malignant {
  color: #c62828;
}

/* Confidence Bars */
.confidence-bars {
  margin-bottom: 20px;
}
.confidence-item {
  margin-bottom: 12px;
}
.confidence-label {
  display: flex;
  justify-content: space-between;
  font-weight: 500;
}
.confidence-bar {
  width: 100%;
  height: 10px;
  background: #e0e0e0;
  border-radius: 6px;
  margin-top: 6px;
  overflow: hidden;
}
.confidence-fill {
  height: 100%;
  transition: width 1s ease-in-out;
}
.normal-fill {
  background: #66bb6a;
}
.pneumonia-fill {
  background: #ef5350;
}

/* File Info */
.file-info {
  background: #f1f8e9;
  border-left: 5px solid #8bc34a;
  padding: 12px 15px;
  border-radius: 8px;
  font-size: 0.95rem;
  margin-top: 20px;
}

/* Error Message */
.error {
  background: #ffebee;
  border: 1px solid #e57373;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  color: #c62828;
  font-weight: bold;
}

/* Animations */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 700px) {
  .image-container {
    grid-template-columns: 1fr;
  }
  header h1 {
    font-size: 1.8rem;
  }
}
