@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&display=swap');

:root {
  --primary-color: #4A90D9;
  --primary-hover: #3b7ac2;
  --primary-light: #eef5fc;
  --bg-color: #F0F4F8;
  --card-bg: #FFFFFF;
  --accent-color: #FF8C42;
  --accent-hover: #e57831;
  --success-color: #52C41A;
  --text-main: #2C3E50;
  --text-muted: #7F8C8D;
  --border-color: #E2E8F0;
  --shadow-sm: 0 2px 8px rgba(74, 144, 217, 0.08);
  --shadow-md: 0 8px 24px rgba(74, 144, 217, 0.12);
  --shadow-lg: 0 16px 32px rgba(44, 62, 80, 0.12);
  --radius-lg: 18px;
  --radius-md: 12px;
  --transition-fast: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(74, 144, 217, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(255, 140, 66, 0.05) 0%, transparent 40%);
}

.app-container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
}

/* Card Styling */
.survey-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
}

/* Header & Progress Bar */
.survey-header {
  text-align: center;
  margin-bottom: 24px;
}

.survey-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.survey-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.progress-container {
  margin-top: 16px;
  background: var(--primary-light);
  border-radius: 20px;
  height: 8px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  width: 25%;
  border-radius: 20px;
  transition: var(--transition-fast);
}

.progress-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 6px;
  font-weight: 500;
}

/* Steps & Question Cards */
.step-container {
  display: none;
  animation: fadeInSlide 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.step-container.active {
  display: block;
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.question-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.question-tag {
  background: var(--primary-light);
  color: var(--primary-color);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 500;
  white-space: nowrap;
  margin-top: 2px;
}

/* Option Grid / List */
.options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.options-grid.single-column {
  grid-template-columns: 1fr;
}

.option-card {
  background: #F8FAFC;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.option-card:hover {
  border-color: var(--primary-color);
  background: var(--primary-light);
  transform: translateY(-1px);
}

.option-card.selected {
  border-color: var(--primary-color);
  background: var(--primary-light);
  color: var(--primary-color);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.option-card .check-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.option-card.selected .check-icon {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* Textarea styling */
.textarea-wrapper {
  margin-bottom: 24px;
}

textarea.form-control {
  width: 100%;
  height: 120px;
  background: #F8FAFC;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-main);
  resize: none;
  transition: var(--transition-fast);
  outline: none;
}

textarea.form-control:focus {
  border-color: var(--primary-color);
  background: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(74, 144, 217, 0.12);
}

/* Button Navigation */
.button-group {
  display: flex;
  gap: 12px;
}

.btn {
  flex: 1;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-secondary {
  background: #F1F5F9;
  color: var(--text-muted);
}

.btn-secondary:hover {
  background: #E2E8F0;
  color: var(--text-main);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-color), #FF7315);
  color: white;
  box-shadow: 0 4px 14px rgba(255, 140, 66, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 140, 66, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Validation Shake */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.shake {
  animation: shake 0.4s ease-in-out;
}

/* Success View */
.success-card {
  text-align: center;
  padding: 40px 20px;
}

.success-icon-wrapper {
  width: 72px;
  height: 72px;
  background: #E6F7ED;
  color: var(--success-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 2.2rem;
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.success-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
}

.success-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Dashboard Report Styling */
.dashboard-card {
  max-width: 900px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-box {
  background: var(--primary-light);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  border: 1px solid rgba(74, 144, 217, 0.15);
}

.stat-number {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primary-color);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 24px;
  margin-bottom: 28px;
}

.chart-card {
  background: #F8FAFC;
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--border-color);
}

.chart-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.comments-list {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-item {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.9rem;
  color: var(--text-main);
  line-height: 1.5;
}

.comment-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.action-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 20px;
}

@media (max-width: 480px) {
  body {
    padding: 10px;
  }

  .survey-card {
    padding: 20px 16px;
  }

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

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