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

:root {
  --primary: #d4a5d4;
  --primary-dark: #a8739b;
  --accent: #f4d4e8;
  --accent-light: #fef0f7;
  --success: #a8d5ba;
  --warning: #f4b896;
  --danger: #e8a5a5;
  --text-dark: #2d2520;
  --text-light: #8a7a6a;
  --border: #e8e0d4;
  --bg-light: #fdf8f0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: linear-gradient(135deg, var(--bg-light) 0%, #fff5eb 100%);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
}

.header {
  text-align: center;
  margin-bottom: 40px;
  padding: 30px 20px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.header h1 {
  font-size: 2.2rem;
  color: var(--primary-dark);
  margin-bottom: 10px;
}

.header p {
  color: var(--text-light);
  font-size: 1.05rem;
  margin-bottom: 15px;
}

.health-score-display {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  padding: 20px 40px;
  border-radius: 50px;
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 10px;
  box-shadow: 0 4px 15px rgba(212, 165, 212, 0.3);
}

.score-number {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 5px;
}

.nav-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  overflow-x: auto;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

.nav-tabs button {
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.nav-tabs button.active {
  color: var(--primary-dark);
  border-bottom-color: var(--primary-dark);
}

.nav-tabs button:hover {
  color: var(--primary-dark);
}

.section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.section.active {
  display: block;
}

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

.card {
  background: white;
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid var(--border);
}

.card h3 {
  color: var(--primary-dark);
  margin-bottom: 15px;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-icon {
  font-size: 1.5rem;
}

.nail-diagram {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.nail-zone {
  aspect-ratio: 1;
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  transition: all 0.3s ease;
  background: var(--accent-light);
}

.nail-zone:hover {
  transform: scale(1.05);
  border-color: var(--primary);
}

.nail-zone.selected {
  background: var(--primary);
  color: white;
  border-color: var(--primary-dark);
}

.symptom-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.symptom-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--accent-light);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}

.symptom-checkbox:hover {
  background: var(--accent);
  border-color: var(--primary);
}

.symptom-checkbox input {
  cursor: pointer;
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.symptom-checkbox label {
  cursor: pointer;
  flex: 1;
  font-weight: 500;
}

.severity-group {
  margin: 20px 0;
  padding: 15px;
  background: var(--accent-light);
  border-radius: 12px;
}

.severity-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--text-dark);
}

.severity-value {
  color: var(--primary-dark);
  font-weight: 700;
}

input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
  -webkit-appearance: none;
  accent-color: var(--primary);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(212, 165, 212, 0.4);
  -moz-appearance: none;
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(212, 165, 212, 0.4);
}

.result-box {
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 100%);
  border-left: 4px solid var(--primary);
  padding: 20px;
  border-radius: 12px;
  margin: 20px 0;
}

.result-box.success {
  border-left-color: var(--success);
  background: linear-gradient(135deg, #f0faf4 0%, #e8f5f0 100%);
}

.result-box.warning {
  border-left-color: var(--warning);
  background: linear-gradient(135deg, #fef5f0 0%, #fef0e8 100%);
}

.result-box.danger {
  border-left-color: var(--danger);
  background: linear-gradient(135deg, #fef5f5 0%, #fef0f0 100%);
}

.result-title {
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.result-text {
  color: var(--text-light);
  line-height: 1.6;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(212, 165, 212, 0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(212, 165, 212, 0.4);
}

.btn-secondary {
  background: var(--accent-light);
  color: var(--primary-dark);
  border: 2px solid var(--primary);
}

.btn-secondary:hover {
  background: var(--accent);
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.9rem;
}

.btn-group {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin: 15px 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  transition: width 0.3s ease;
}

.timeline {
  position: relative;
  padding: 20px 0;
}

.timeline-item {
  display: flex;
  gap: 20px;
  margin-bottom: 25px;
  position: relative;
}

.timeline-dot {
  width: 16px;
  height: 16px;
  background: var(--primary);
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px var(--accent-light);
}

.timeline-content {
  flex: 1;
  background: var(--accent-light);
  padding: 15px;
  border-radius: 8px;
  border-left: 2px solid var(--primary);
}

.timeline-date {
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 5px;
}

.timeline-text {
  color: var(--text-light);
  font-size: 0.95rem;
}

.tracker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.tracker-item {
  background: var(--accent-light);
  padding: 15px;
  border-radius: 12px;
  text-align: center;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tracker-item:hover {
  border-color: var(--primary);
  background: var(--accent);
}

.tracker-item.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary-dark);
}

.tracker-label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.tracker-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.habit-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin: 20px 0;
}

.habit-day {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--accent-light);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.habit-day:hover {
  border-color: var(--primary);
}

.habit-day.completed {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.habit-day.missed {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.feature-list {
  list-style: none;
}

.feature-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

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

.feature-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.feature-content {
  flex: 1;
}

.feature-title {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.feature-desc {
  font-size: 0.9rem;
  color: var(--text-light);
}

input[type="text"],
input[type="date"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-dark);
  transition: border-color 0.3s ease;
  margin-bottom: 15px;
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--accent-light);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

.badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-right: 8px;
  margin-bottom: 8px;
}

.badge-success {
  background: #e8f5f0;
  color: #2a7a5a;
}

.badge-warning {
  background: #fef5f0;
  color: #8a5a2a;
}

.badge-danger {
  background: #fef5f5;
  color: #8a3a3a;
}

.badge-info {
  background: var(--accent-light);
  color: var(--primary-dark);
}

.achievement {
  background: linear-gradient(135deg, #fff9e6 0%, #fffef0 100%);
  border: 2px solid #f4d896;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  margin: 15px 0;
}

.achievement-icon {
  font-size: 3rem;
  margin-bottom: 10px;
}

.achievement-title {
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 5px;
}

.achievement-text {
  color: var(--text-light);
  font-size: 0.9rem;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 15px;
}

.empty-state-text {
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .header h1 {
    font-size: 1.6rem;
  }

  .nav-tabs {
    gap: 5px;
  }

  .nav-tabs button {
    padding: 10px 15px;
    font-size: 0.85rem;
  }

  .nail-diagram {
    grid-template-columns: repeat(3, 1fr);
  }

  .symptom-list {
    grid-template-columns: 1fr;
  }

  .tracker-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .btn-group {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}
