
/* ==========================================================================
   Fonts
   ========================================================================== */
@font-face {

  font-family: 'Outfit';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/Outfit.ttf') format('truetype');
}

/* ==========================================================================
   Base Styles & Reset
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, html {
  min-height: 100%;
  font-family: 'Outfit', sans-serif;
  background-color: #FCF9F6;
  color: #2C2C2C;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(255, 228, 225, 0.7) 0%, transparent 50%),
    radial-gradient(circle at 85% 60%, rgba(255, 242, 230, 0.8) 0%, transparent 50%),
    radial-gradient(circle at 50% 100%, rgba(245, 245, 250, 0.6) 0%, transparent 60%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* ==========================================================================
   Layout & Navigation
   ========================================================================== */
.container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 2rem;
  text-align: center;
  position: relative;
}

.top-nav {
  position: absolute;
  top: 2rem;
  left: 0;
  width: 100%;
  padding: 0 4rem;
  display: flex;
  justify-content: space-evenly;
  animation: fadeIn 1s ease-out;
  z-index: 10;
}

.top-nav a {
  text-decoration: none;
  color: #6B6B6B;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.3s ease, opacity 0.3s ease;
}

.top-nav a:hover, .top-nav a.active {
  color: #2C2C2C;
  opacity: 1;
}

.top-nav a.active { font-weight: 600; }

/* ==========================================================================
   Typography
   ========================================================================== */
h1 {
  font-size: clamp(3rem, 8vw, 6.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #3A3A3A;
  margin: 0;
  line-height: 1.1;
  animation: fadeIn 1.2s ease-out;
}

.footer-content {
  position: absolute;
  bottom: 4rem;
  left: 0;
  right: 0;
  padding: 0 2rem;
  animation: fadeIn 1.5s ease-out;
}

.footer-content p {
  font-size: 1rem;
  font-weight: 300;
  color: #6B6B6B;
  letter-spacing: 0.02em;
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ==========================================================================
   Pomodoro Timer Styles
   ========================================================================== */
.pomodoro-container { justify-content: center; }

.timer-wrapper {
  margin-bottom: 2rem;
  animation: fadeIn 1s ease-out;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timer-mode {
  font-size: clamp(0.9rem, 2vmin, 1.3rem);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6B6B6B;
  margin-bottom: 1.5rem;
}

.timer-visual {
  position: relative;
  width: min(55vmin, 450px);
  height: min(55vmin, 450px);
  min-width: 250px;
  min-height: 250px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.progress-ring { position: absolute; top: 0; left: 0; transform: rotate(-90deg); }

.progress-ring__circle {
  transition: stroke-dashoffset 0.35s linear;
  transform-origin: 50% 50%;
}

.timer-display {
  position: relative;
  z-index: 2;
  font-size: clamp(3rem, 12vmin, 6rem);
  font-weight: 600;
  color: #3A3A3A;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  min-width: 4.2ch;
  text-align: center;
}

.timer-controls {
  display: flex;
  gap: 1rem;
  animation: fadeIn 1.5s ease-out;
  margin-top: 1.5rem;
}

/* ==========================================================================
   Global Button Styles
   ========================================================================== */
button {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  padding: 0.8rem 2rem;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary { background-color: #3A3A3A; color: #FCF9F6; }
.btn-primary:hover { background-color: #2C2C2C; transform: translateY(-2px); }
.btn-secondary {
  background-color: transparent;
  color: #6B6B6B;
  border: 1px solid #D1D1D1;
}
.btn-secondary:hover {
  color: #2C2C2C;
  border-color: #A1A1A1;
  transform: translateY(-2px);
}

/* ==========================================================================
   Settings Button & Modal
   ========================================================================== */
.settings-btn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: transparent;
  border: 1px solid #D1D1D1;
  color: #6B6B6B;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.3s ease;
  z-index: 10;
}

.settings-btn:hover { color: #2C2C2C; border-color: #A1A1A1; transform: rotate(45deg); }

.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-color: rgba(252, 249, 246, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

.modal-overlay.active { display: flex; }

.modal-content {
  background-color: #fff;
  padding: 2.5rem;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
  animation: fadeIn 0.3s ease-out;
}

.modal-content h3 { font-weight: 600; margin-bottom: 1.5rem; font-size: 1.5rem; }

.setting-group { margin-bottom: 1.2rem; text-align: left; }
.setting-group label {
  display: block;
  font-size: 0.9rem;
  color: #6B6B6B;
  margin-bottom: 0.5rem;
}

.setting-group input {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #E0E0E0;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  color: #2C2C2C;
  outline: none;
  transition: border-color 0.3s ease;
}

.setting-group input:focus { border-color: #3A3A3A; }

.modal-actions { display: flex; justify-content: flex-end; gap: 1rem; margin-top: 2rem; }

/* ==========================================================================
   Mood Tracker Styles
   ========================================================================== */
.mood-container {
  padding-top: 6rem;
  padding-bottom: 4rem;
  justify-content: flex-start;
  min-height: 100vh;
}

.mood-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  animation: fadeIn 0.5s ease-out;
}

.mood-screen.active { display: flex; }

.mood-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 0.75rem;
  animation: none;
}

.mood-subtitle {
  font-size: 1rem;
  color: #6B6B6B;
  margin-bottom: 2.5rem;
  font-weight: 300;
}

.mood-hint {
  font-size: 0.85rem;
  color: #A1A1A1;
  margin-top: 1rem;
  font-style: italic;
}

/* User Selection */
.user-select {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.user-btn {
  font-size: 1.5rem;
  font-weight: 600;
  padding: 2rem 4rem;
  border-radius: 20px;
  border: 1px solid #D1D1D1;
  background-color: transparent;
  color: #3A3A3A;
  transition: all 0.3s ease;
}

.user-btn:hover {
  border-color: #3A3A3A;
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

/* PIN Screen */
.pin-display {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2.5rem;
}

.pin-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #D1D1D1;
  transition: all 0.2s ease;
}

.pin-dot.filled {
  background-color: #3A3A3A;
  border-color: #3A3A3A;
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 280px;
  margin: 0 auto 2rem;
}

.pin-btn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 1px solid #D1D1D1;
  background-color: transparent;
  color: #3A3A3A;
  font-size: 1.3rem;
  font-weight: 500;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pin-btn:hover:not(:disabled) {
  border-color: #3A3A3A;
  transform: scale(1.05);
}

.pin-btn-empty { visibility: hidden; }
.pin-btn-back { font-size: 1.2rem; }

.pin-error {
  color: #C9504A;
  font-size: 0.9rem;
  min-height: 1.2rem;
  margin-bottom: 1rem;
}

/* Mood Form */
.mood-question {
  width: 100%;
  max-width: 600px;
  margin-bottom: 2.5rem;
}

.mood-question p {
  font-size: 1.05rem;
  color: #6B6B6B;
  margin-bottom: 1.2rem;
  line-height: 1.4;
}

.rating-scale {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
}

.rating-btn {
  width: 55px;
  height: 55px;
  border-radius: 50%;
  border: 1px solid #D1D1D1;
  background-color: transparent;
  color: #6B6B6B;
  font-size: 1.1rem;
  font-weight: 500;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.rating-btn:hover {
  border-color: #A1A1A1;
  color: #2C2C2C;
  transform: translateY(-2px);
}

.rating-btn.selected {
  background-color: #3A3A3A;
  color: #FCF9F6;
  border-color: #3A3A3A;
  transform: scale(1.05);
}

.form-error {
  color: #C9504A;
  font-size: 0.9rem;
  min-height: 1.2rem;
  margin-bottom: 1rem;
}

.submit-mood-btn {
  margin-top: 1rem;
  padding: 1rem 3rem;
}

/* Waiting Screen */
.waiting-actions {
  margin-top: 2rem;
}

/* Results */
.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  width: 100%;
  max-width: 700px;
  margin-bottom: 2rem;
}

.result-card {
  background-color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(209, 209, 209, 0.5);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  backdrop-filter: blur(10px);
}

.result-card h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #3A3A3A;
  margin-bottom: 1.5rem;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 0;
  border-bottom: 1px solid rgba(209, 209, 209, 0.4);
}

.result-row:last-child { border-bottom: none; }

.result-label {
  font-size: 0.85rem;
  color: #6B6B6B;
  font-weight: 300;
}

.result-score {
  font-size: 1.75rem;
  font-weight: 600;
  color: #3A3A3A;
  font-variant-numeric: tabular-nums;
}

.insights-box {
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 700px;
  margin-bottom: 2rem;
  text-align: left;
}

.insights-box h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #3A3A3A;
  margin-bottom: 1rem;
  text-align: center;
}

.insights-box p {
  font-size: 0.95rem;
  color: #6B6B6B;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.insights-box p:last-child { margin-bottom: 0; }

/* History / Graph */
.graph-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  background-color: rgba(255, 255, 255, 0.5);
  padding: 0.4rem;
  border-radius: 50px;
}

.graph-tab {
  background-color: transparent;
  color: #6B6B6B;
  font-size: 0.9rem;
  padding: 0.6rem 1.5rem;
  border-radius: 50px;
  border: none;
}

.graph-tab.active {
  background-color: #3A3A3A;
  color: #FCF9F6;
}

.graph-container {
  width: 100%;
  max-width: 850px;
  min-height: 300px;
  background-color: rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(10px);
}

.mood-graph {
  width: 100%;
  height: auto;
  display: block;
}

.graph-label {
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  fill: #A1A1A1;
}

.graph-legend {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #6B6B6B;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.empty-graph {
  color: #A1A1A1;
  font-size: 0.95rem;
  padding: 3rem;
  text-align: center;
}

/* Floating Change PIN button (reuses settings-btn positioning) */
.pin-btn-float {
  /* inherits from .settings-btn */
}

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

/* ==========================================================================
   Media Queries
   ========================================================================== */
@media (max-width: 600px) {
  /* ---- Top nav becomes part of the flow on mobile,
         so it scrolls away with the content ---- */
  .top-nav {
    position: static;
    padding: 1rem 0.5rem;
    margin-bottom: 0;
    gap: 0.3rem;
  }

  .top-nav a { font-size: 0.7rem; }

  /* ---- Home page: content sits right below the nav,
         no forced vertical centering ---- */
  .container {
    min-height: auto;
    padding: 1.5rem 1.5rem 3rem;
  }

  /* Home footer becomes part of the flow instead of
     being absolutely pinned to the bottom */
  .footer-content {
    position: static;
    margin-top: 4rem;
    padding: 0 1rem;
  }

  /* ---- Pomodoro: still vertically centered, but accounting
         for the space the nav takes above ---- */
  .pomodoro-container {
    min-height: calc(100vh - 3.5rem);
    justify-content: center;
    padding-top: 1rem;
  }

  /* ---- Mood tracker: top-aligned, compact padding ---- */
  .mood-container {
    min-height: auto;
    padding-top: 1rem;
    padding-bottom: 4rem;
  }

  /* Footer positions */
  .footer-content p { font-size: 0.9rem; }

  /* Pomodoro adjustments */
  .timer-controls { flex-direction: column; width: 100%; max-width: 250px; }
  .timer-controls button { width: 100%; }
  .settings-btn { bottom: 1rem; right: 1rem; }

  /* Mood tracker adjustments */
  .results-grid { grid-template-columns: 1fr; gap: 1rem; }
  .rating-btn { width: 48px; height: 48px; font-size: 1rem; }
  .user-btn { padding: 1.5rem 3rem; font-size: 1.3rem; }
  .graph-tabs { flex-direction: column; width: 100%; }
  .graph-tab { width: 100%; }
}
