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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

header {
  text-align: center;
  margin-bottom: 3rem;
  color: white;
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

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

.input-section {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

#repo-input {
  flex: 1;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

#repo-input:focus {
  outline: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

#analyze-btn {
  padding: 1rem 2rem;
  background: white;
  color: #667eea;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

#analyze-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

#analyze-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.loading {
  text-align: center;
  padding: 3rem;
  color: white;
}

.loading.hidden {
  display: none;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

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

.error {
  background: #e74c3c;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
  text-align: center;
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.error.hidden {
  display: none;
}

.dashboard {
  animation: fadeIn 0.5s;
}

.dashboard.hidden {
  display: none;
}

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

.repo-header {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.repo-header h2 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  color: #2c3e50;
}

.repo-meta {
  display: flex;
  gap: 1.5rem;
  color: #7f8c8d;
  font-size: 0.9rem;
}

.overall-score {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 2rem;
}

.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: bold;
  color: white;
  flex-shrink: 0;
}

.score-circle.excellent { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.score-circle.good { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.score-circle.fair { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.score-circle.poor { background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%); }
.score-circle.critical { background: linear-gradient(135deg, #434343 0%, #000000 100%); }

.score-info h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #2c3e50;
}

.score-info p {
  color: #7f8c8d;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: white;
  padding: 1.5rem;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.metric-header h4 {
  font-size: 1rem;
  color: #2c3e50;
}

.metric-weight {
  background: #ecf0f1;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  color: #7f8c8d;
  font-weight: 600;
}

.metric-value {
  font-size: 2rem;
  font-weight: bold;
  color: #2c3e50;
  margin-bottom: 1rem;
}

.metric-score {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.score-bar {
  flex: 1;
  height: 8px;
  background: #ecf0f1;
  border-radius: 4px;
  overflow: hidden;
}

.score-fill {
  height: 100%;
  transition: width 0.5s ease;
  border-radius: 4px;
}

.score-fill.excellent { background: #2ecc71; }
.score-fill.good { background: #3498db; }
.score-fill.acceptable { background: #f39c12; }
.score-fill.stable { background: #9b59b6; }
.score-fill.warning { background: #e67e22; }
.score-fill.declining { background: #e74c3c; }
.score-fill.critical { background: #c0392b; }
.score-fill.unknown { background: #95a5a6; }

.metric-score span {
  font-size: 0.9rem;
  color: #7f8c8d;
  font-weight: 600;
  min-width: 50px;
}

.metric-desc {
  font-size: 0.85rem;
  color: #7f8c8d;
}

.recommendations {
  background: white;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.recommendations h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: #2c3e50;
}

.recommendations ul {
  list-style: none;
}

.recommendations li {
  padding: 0.75rem 0;
  border-bottom: 1px solid #ecf0f1;
  color: #555;
}

.recommendations li:last-child {
  border-bottom: none;
}

.recommendations li:before {
  content: "→ ";
  color: #667eea;
  font-weight: bold;
  margin-right: 0.5rem;
}

footer {
  text-align: center;
  margin-top: 3rem;
  padding: 2rem;
  color: white;
  opacity: 0.8;
  font-size: 0.9rem;
}

footer a {
  color: white;
  text-decoration: underline;
}

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

  header h1 {
    font-size: 2rem;
  }

  .input-section {
    flex-direction: column;
  }

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

  .metrics-grid {
    grid-template-columns: 1fr;
  }
}
