* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #f8f4ff, #f0e6ff, #e0d4ff);
  color: #4c1d95;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.container {
  width: 100%;
  max-width: 500px;
}

.card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid #d8b4fe;
  border-radius: 24px;
  padding: 32px 28px;
  box-shadow: 0 20px 50px rgba(139, 92, 246, 0.15);
}

.header {
  text-align: center;
  margin-bottom: 32px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.shield {
  font-size: 46px;
}

h1 {
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(90deg, #7c3aed, #db2777);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: #6b21a8;
  font-size: 15.5px;
  font-weight: 500;
}

.upload-area {
  border: 3px dashed #a78bfa;
  border-radius: 20px;
  padding: 52px 20px;
  text-align: center;
  transition: all 0.4s;
  cursor: pointer;
  background: white;
}

.upload-area:hover {
  border-color: #7c3aed;
  background: #f3e8ff;
  transform: scale(1.01);
}

.upload-icon {
  font-size: 52px;
  margin-bottom: 18px;
}

.browse-btn {
  background: linear-gradient(90deg, #7c3aed, #db2777);
  color: white;
  border: none;
  padding: 14px 32px;
  border-radius: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 12px;
  box-shadow: 0 8px 25px rgba(124, 58, 237, 0.3);
}

.browse-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(139, 92, 246, 0.4);
}

.preview-container {
  position: relative;
  margin: 24px 0;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid #c4b5fd;
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.1);
}

#preview {
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  background: #f8fafc;
}

.remove-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: white;
  color: #e11d48;
  border: 1px solid #fda4af;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.predict-btn {
  width: 100%;
  padding: 17px;
  background: linear-gradient(90deg, #7c3aed, #db2777);
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 17.5px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 12px;
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.3);
}

.predict-btn:hover:not(:disabled) {
  transform: translateY(-3px);
}

.predict-btn:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}

/* Loading */
.loading {
  text-align: center;
  margin: 20px 0;
  color: #6b21a8;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 4px solid #e0d4ff;
  border-top: 4px solid #7c3aed;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Result */
.result {
  margin-top: 24px;
  padding: 22px;
  border-radius: 18px;
  display: none;
  flex-direction: column;
  gap: 12px;
  border: 1px solid;
  font-size: 16px;
}

.safe {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
}

.adult {
  background: #fef2f2;
  border-color: #ef4444;
  color: #991b1b;
}

/* Confidence Bars */
.confidence-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin: 6px 0;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s ease;
}

.safe .bar-fill { background: #10b981; }
.adult .bar-fill { background: #ef4444; }

/* History */
.history-section {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #ddd6fe;
}

.history-section h3 {
  margin-bottom: 15px;
  color: #6b21a8;
  font-size: 17px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  display: flex;
  gap: 12px;
  background: #f8fafc;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid #e0d4ff;
  font-size: 14px;
}

.history-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 10px;
}

.footer {
  text-align: center;
  margin-top: 40px;
  color: #6b21a8;
  font-size: 13.5px;
  opacity: 0.85;
}

.about-link {
  color: #7c3aed;
  text-decoration: none;
  font-weight: 500;
}

.about-link:hover {
  color: #6b21a8;
}