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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f8f9fa;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 30px;
  max-width: 900px;
  width: 100%;
  border: 1px solid #e9ecef;
}

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

.header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #000;
  margin-bottom: 10px;
}

.header p {
  font-size: 1.1rem;
  color: #555;
  font-weight: 400;
}

.main-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: start;
}

.drawing-section {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.drawing-section h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #000;
  margin-bottom: 20px;
  width: 100%;
  text-align: center;
}

.drawing-container {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  display: inline-block;
  border: 1px solid #e9ecef;
}

#drawingGrid {
  border: 2px solid #ddd;
  border-radius: 8px;
  background: white;
  cursor: crosshair;
  transition: border-color 0.3s ease;
}

#drawingGrid:hover {
  border-color: #000;
}

.controls {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.btn-primary {
  background: #000;
  color: white;
}

.btn-primary:hover {
  background: #333;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
  background: #f8f9fa;
  color: #555;
  border: 1px solid #ddd;
}

.btn-secondary:hover {
  background: #e9ecef;
  color: #000;
}

.prediction-section {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.prediction-section h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #000;
  margin-bottom: 20px;
  width: 100%;
  text-align: center;
}

.prediction-container {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  height: 315px;
  border: 1px solid #e9ecef;
}

#svg-chart {
  border-radius: 8px;
  background: white;
}

.prediction-info {
  margin-top: 20px;
  padding: 15px;
  background: white;
  border-radius: 8px;
  border-left: 4px solid #000;
}

.prediction-info h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #000;
  margin-bottom: 5px;
}

.prediction-info p {
  font-size: 0.9rem;
  color: #555;
}

.loading {
  display: none;
  text-align: center;
  padding: 20px;
}

.loading.show {
  display: block;
}

.spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #000;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}

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

.footer {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
  color: #666;
  font-size: 0.9rem;
}

.footer a {
  color: #000;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.footer a:hover {
  color: #555;
  text-decoration: underline;
}

@media (max-width: 768px) {
  .container {
    padding: 20px;
    max-width: 95%;
  }

  .main-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .header h1 {
    font-size: 2rem;
  }

  .controls {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 200px;
  }
}

.bar {
  fill: #000;
  transition: all 0.3s ease;
}

.bar:hover {
  fill: #333;
}

.axis text {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  fill: #555;
}

.axis path,
.axis line {
  stroke: #ddd;
}
