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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #fff5f5 0%, #ffe0e0 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  background: #fffafa;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(255, 182, 193, 0.2);
  overflow: hidden;
}

.header {
  background: linear-gradient(135deg, #ffb6c1 0%, #ffc0cb 100%);
  color: #8b4513;
  padding: 30px;
  text-align: center;
}

.header h1 {
  font-size: 2.5em;
  margin-bottom: 10px;
}

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

.main-content {
  padding: 40px;
}

.api-config {
  background: #fef5f5;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 30px;
  border: 1px solid #f4a460;
}

.api-config h3 {
  color: #8b4513;
  margin-bottom: 15px;
}

.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #8b4513;
}

.input-group input,
.input-group textarea,
.input-group select {
  width: 100%;
  padding: 12px;
  border: 2px solid #f4a460;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s;
  font-family: inherit;
  background: #fffafa;
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
  outline: none;
  border-color: #ffb6c1;
}

.input-group textarea {
  min-height: 120px;
  resize: vertical;
}

.analyze-btn {
  background: linear-gradient(135deg, #ffb6c1 0%, #ffc0cb 100%);
  color: #8b4513;
  border: none;
  padding: 15px 30px;
  font-size: 18px;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  width: 100%;
  margin-bottom: 30px;
}

.analyze-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(255, 182, 193, 0.3);
}

.analyze-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.results-container {
  display: none;
  margin-top: 30px;
}

.results-container.show {
  display: block;
  animation: fadeIn 0.5s ease-in;
}

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

.sentiment-overview {
  background: #fef5f5;
  border: 2px solid #f4a460;
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 25px;
  text-align: center;
}

.sentiment-score {
  font-size: 3em;
  font-weight: 700;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.sentiment-score.positive {
  color: #32cd32;
}
.sentiment-score.negative {
  color: #ff6347;
}
.sentiment-score.neutral {
  color: #ffa500;
}

.sentiment-label {
  font-size: 1.5em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 15px;
}

.confidence-score {
  font-size: 1.1em;
  color: #8b4513;
  margin-bottom: 20px;
}

.sentiment-meter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding: 15px;
  background: #fff;
  border-radius: 10px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.meter-label {
  font-weight: 600;
  color: #8b4513;
  min-width: 80px;
}

.meter-bar {
  flex: 1;
  height: 20px;
  background: #f0f0f0;
  border-radius: 10px;
  margin: 0 15px;
  position: relative;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 1s ease-out;
}

.meter-fill.positive {
  background: linear-gradient(90deg, #90ee90, #32cd32);
}
.meter-fill.negative {
  background: linear-gradient(90deg, #ffa07a, #ff6347);
}
.meter-fill.neutral {
  background: linear-gradient(90deg, #ffd700, #ffa500);
}

.meter-value {
  font-weight: 600;
  color: #8b4513;
  min-width: 50px;
  text-align: right;
}

.detailed-analysis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 25px;
}

.analysis-card {
  background: #fff;
  border: 1px solid #f4a460;
  border-radius: 10px;
  padding: 20px;
}

.analysis-card h4 {
  color: #8b4513;
  margin-bottom: 15px;
  font-size: 1.2em;
}

.emotion-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 8px;
  background: #fef5f5;
  border-radius: 5px;
}

.emotion-name {
  font-weight: 500;
  color: #8b4513;
}

.emotion-score {
  font-weight: 600;
  color: #d2691e;
}

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

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #ffe0e0;
  border-top: 4px solid #ffb6c1;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

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

.error {
  background: #ffe4e1;
  color: #8b0000;
  padding: 15px;
  border-radius: 8px;
  margin-top: 20px;
  border: 1px solid #ffb6c1;
  display: none;
}

.text-stats {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #f4a460;
  font-size: 14px;
  color: #8b4513;
}

@media (max-width: 768px) {
  .detailed-analysis {
    grid-template-columns: 1fr;
  }
}
