/*
 * Global styles for the lifestyle app
 *
 * The updated design evokes a whimsical storybook aesthetic with pastel tones
 * and watercolor textures inspired by Tamagotchi and Studio Ghibli.  All
 * elements use soft colours, rounded corners and subtle shadows.  Animations
 * gently fade in content to create a sense of discovery as you explore
 * different sections of the app.  The overall look and feel should feel
 * playful and calming.
 */

/* Import a friendly handwritten font from Google Fonts.  If the network
   request fails, the browser will fallback to its default sans‑serif font. */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;600&display=swap');

/* Colour palette */
:root {
  /* background colour for the page */
  --bg-color: #FFF9F2;
  /* primary accent used for buttons and highlights */
  --primary-color: #F6C1C1;
  /* secondary accent used for subtle elements */
  --secondary-color: #C1D0E8;
  /* tertiary accent used for hover effects */
  --accent-color: #B6E5D8;
  /* text colours */
  --text-color: #4A4A4A;
  --heading-color: #D98880;
  /* progress bar colours */
  --progress-bg: #F0E5DE;
  --progress-fill-start: #F6C1C1;
  --progress-fill-end: #C1D0E8;
}

body {
  margin: 0;
  font-family: 'Quicksand', sans-serif;
  background: var(--bg-color) url('placeholder_1.png') no-repeat center fixed;
  background-size: cover;
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  line-height: 1.5;
}

header {
  position: sticky;
  top: 0;
  z-index: 100;
  /* Give the header a translucent glass effect */
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  color: var(--text-color);
  padding: 1rem 2rem;
  /* Soft drop shadow for depth */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

header h1 {
  margin: 0;
  font-size: 1.8rem;
  color: var(--heading-color);
}

nav {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  position: relative;
  /* Add a subtle bottom border */
  padding-bottom: 0.3rem;
  /* create extra space for the animated underline */
  margin-bottom: 0.5rem;
}

nav a {
  position: relative;
  color: var(--text-color);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
  /* Use transform to improve animation performance */
  transition: transform 0.2s, color 0.2s;
}

nav a:hover {
  background-color: var(--primary-color);
  color: #fff;
  transform: translateY(-2px);
}

/* Active link styling */
nav a.active {
  color: var(--heading-color);
  font-weight: 700;
}

/* Animated underline element appended via JavaScript */
.nav-underline {
  position: absolute;
  bottom: 0;
  height: 3px;
  background: var(--heading-color);
  border-radius: 2px;
  transition: left 0.3s ease, width 0.3s ease;
}

main {
  flex: 1;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

footer {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  color: var(--text-color);
  text-align: center;
  padding: 0.7rem;
  font-size: 0.8rem;
}

/* Card container used for sections */
.card {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
  max-width: 700px;
  width: 100%;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.05);
  animation: fadeIn 0.8s ease forwards;
  opacity: 0;
}

/* Fade in animation for cards */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

h2 {
  margin-top: 0;
  margin-bottom: 0.8rem;
  color: var(--heading-color);
  font-weight: 600;
}

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

/* Progress bar styling with gradient fill */
.progress-bar {
  width: 100%;
  height: 24px;
  background-color: var(--progress-bg);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.progress {
  height: 100%;
  background-image: linear-gradient(90deg, var(--progress-fill-start), var(--progress-fill-end));
  text-align: center;
  color: #fff;
  line-height: 24px;
  transition: width 0.5s ease;
  border-radius: 12px 0 0 12px;
}

/* Form and input styling */
form label {
  display: block;
  margin-bottom: 0.6rem;
  font-weight: 600;
}

form input[type="number"],
form input[type="text"] {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  box-sizing: border-box;
  margin-top: 0.3rem;
  margin-bottom: 1rem;
}

textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: 'Quicksand', sans-serif;
  font-size: 1rem;
  box-sizing: border-box;
  margin-top: 0.3rem;
  margin-bottom: 1rem;
  resize: vertical;
}

button {
  padding: 0.5rem 1.2rem;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease;
}

button:hover {
  background: var(--accent-color);
}