/* ==========================================================================
   Boddu — reusable UI components
   ========================================================================== */

/* --- Logo -------------------------------------------------------------- */

.logo {
  display: block;
  height: 40px;
  width: auto;
}

.logo--sm {
  height: 24px;
}

/* --- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: 16px var(--space-6);
  border-radius: var(--radius-pill);
  font-size: var(--fs-button);
  font-weight: 700;
  white-space: nowrap;
}

.btn-primary {
  background: var(--color-teal);
  color: var(--color-text-on-teal);
  box-shadow: var(--shadow-button);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-on-dark);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
}

.btn-ghost-light {
  background: rgba(30, 44, 74, 0.06);
  color: var(--color-text-primary);
  border: none;
}

/* --- Icon buttons / back nav -------------------------------------------- */

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  flex-shrink: 0;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* --- Cards --------------------------------------------------------------- */

.suggestion-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.suggestion-card {
  position: relative;
  aspect-ratio: 1 / 0.85;
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  text-align: left;
}

.suggestion-card__title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}

.suggestion-card__meta {
  display: block;
  margin-top: var(--space-1);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.85;
}

.suggestion-card--teal {
  background: var(--card-teal-bg);
  color: var(--color-text-on-teal);
}

.suggestion-card--yellow {
  background: var(--card-yellow-bg);
  color: var(--color-navy);
}

.suggestion-card--sage {
  background: var(--card-sage-bg);
  color: var(--color-navy);
}

.suggestion-card--coral {
  background: var(--card-coral-bg);
  color: var(--color-navy);
}

.suggestion-card--mint {
  background: var(--card-mint-bg);
  color: var(--color-navy);
}

.suggestion-card.is-fresh {
  animation: suggestion-pop 320ms ease;
}

@keyframes suggestion-pop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* --- Category chips (break-selection screen) ----------------------------- */

.category-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.category-chip {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-4);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  text-align: left;
}

.category-chip__icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.category-chip__icon svg {
  width: 18px;
  height: 18px;
}

.category-chip__label {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-primary);
}

/* --- Dice card ------------------------------------------------------------ */

.dice-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--color-navy);
  color: var(--color-text-on-dark);
  text-align: left;
}

.dice-card__face {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--color-surface);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 6px;
  gap: 2px;
}

.dice-card__face.is-rolling,
.icon-btn.is-rolling svg {
  animation: dice-roll 0.6s ease;
}

@keyframes dice-roll {
  0% { transform: rotate(0deg) scale(1); }
  40% { transform: rotate(180deg) scale(1.15); }
  70% { transform: rotate(300deg) scale(0.95); }
  100% { transform: rotate(360deg) scale(1); }
}

.dice-dot {
  border-radius: 50%;
  background: var(--color-navy);
}

.dice-card__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dice-card__title {
  font-size: 16px;
  font-weight: 700;
}

.dice-card__subtitle {
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
}

/* --- Tab bar --------------------------------------------------------------- */

.tab-bar.is-hidden {
  display: none;
}

.tab-bar {
  display: flex;
  flex-shrink: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border-subtle);
  padding: var(--space-2) var(--space-4) calc(var(--space-2) + env(safe-area-inset-bottom));
}

.tab-bar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-2) 0;
  color: var(--color-tab-inactive);
}

.tab-bar__item svg {
  width: 22px;
  height: 22px;
}

.tab-bar__item span {
  font-size: 11px;
  font-weight: 500;
}

.tab-bar__item.is-active {
  color: var(--color-tab-active);
}

.tab-bar__item.is-active span {
  font-weight: 600;
}

/* --- Decorative shapes ------------------------------------------------------ */

.shape {
  position: absolute;
  z-index: 0;
  pointer-events: none;
}

.shape--circle { border-radius: 50%; }
.shape--pill { border-radius: var(--radius-pill); }
.shape--half-top { border-radius: 999px 999px 0 0; }
.shape--half-bottom { border-radius: 0 0 999px 999px; }
.shape--rounded-rect { border-radius: var(--radius-md); }

.shape--teal { background: var(--color-teal); }
.shape--navy { background: var(--color-navy); }
.shape--mint { background: var(--color-mint); }
.shape--coral { background: var(--color-coral); }
.shape--yellow { background: var(--color-yellow); }
.shape--cream { background: var(--color-cream); }
.shape--sage { background: var(--color-sage); }

/* --- Mascot ------------------------------------------------------------------ */

.mascot {
  width: 120px;
  height: 110px;
  position: relative;
  margin: 0 auto;
  animation: mascot-bob 3s ease-in-out infinite;
}

.mascot--sm {
  width: 72px;
  height: 66px;
}

.mascot__body {
  width: 100%;
  height: 100%;
  background: var(--color-mint);
  border-radius: 55% 55% 50% 50% / 60% 60% 40% 40%;
  position: relative;
}

.mascot--happy .mascot__body {
  background: var(--color-coral);
}

.mascot__eye {
  position: absolute;
  top: 42%;
  width: 10px;
  height: 10px;
  background: var(--color-navy);
  border-radius: 50%;
}

.mascot--sm .mascot__eye {
  width: 6px;
  height: 6px;
}

.mascot__eye--left { left: 33%; }
.mascot__eye--right { right: 33%; }

.mascot__cheek {
  position: absolute;
  top: 56%;
  width: 14px;
  height: 8px;
  background: var(--color-coral);
  border-radius: 50%;
  opacity: 0.5;
}

.mascot--sm .mascot__cheek {
  width: 8px;
  height: 5px;
}

.mascot--happy .mascot__cheek {
  background: var(--color-yellow);
}

.mascot__cheek--left { left: 14%; }
.mascot__cheek--right { right: 14%; }

.mascot__mouth {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 7px;
  border: 2px solid transparent;
  border-bottom-color: var(--color-navy);
  border-radius: 0 0 10px 10px;
}

.mascot--sm .mascot__mouth {
  width: 9px;
  height: 5px;
  border-width: 1.5px;
  border-radius: 0 0 7px 7px;
}

.mascot--happy .mascot__mouth {
  width: 20px;
  height: 10px;
  border-width: 2.5px;
  border-radius: 0 0 14px 14px;
}

@keyframes mascot-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes mascot-wink {
  0%, 100% { transform: scaleY(1); }
  45%, 65% { transform: scaleY(0.15); }
}

.mascot.is-winking .mascot__eye--right {
  animation: mascot-wink 600ms ease;
  transform-origin: center;
}

@keyframes mascot-jump {
  0% { transform: translateY(0) scaleX(1) scaleY(1); }
  15% { transform: translateY(5px) scaleX(1.1) scaleY(0.88); }
  45% { transform: translateY(-30px) scaleX(0.94) scaleY(1.1); }
  70% { transform: translateY(0) scaleX(1.08) scaleY(0.9); }
  100% { transform: translateY(0) scaleX(1) scaleY(1); }
}

.mascot.is-jumping {
  animation: mascot-jump 650ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Shooting stars (break-start flourish) ------------------------------------ */

.shooting-stars {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.shooting-star {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.shooting-star__mark {
  position: absolute;
  top: 0;
  left: 0;
  width: 50px;
  height: 2px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85));
  transform-origin: right center;
}

.shooting-star__mark::after {
  content: '';
  position: absolute;
  right: -2px;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.85);
}

@keyframes shooting-star-fly {
  0% { transform: translate(0, 0); opacity: 0; }
  12% { opacity: 1; }
  75% { opacity: 1; }
  100% { transform: translate(var(--star-dx), var(--star-dy)); opacity: 0; }
}

.shooting-stars.is-shooting .shooting-star--1 {
  animation: shooting-star-fly 900ms ease-out 600ms;
  animation-fill-mode: backwards;
}

.shooting-stars.is-shooting .shooting-star--2 {
  animation: shooting-star-fly 900ms ease-out 760ms;
  animation-fill-mode: backwards;
}

.shooting-stars.is-shooting .shooting-star--3 {
  animation: shooting-star-fly 900ms ease-out 920ms;
  animation-fill-mode: backwards;
}

/* --- Toast ---------------------------------------------------------------- */

.toast {
  position: absolute;
  left: 50%;
  top: calc(env(safe-area-inset-top) + 16px);
  transform: translateX(-50%) translateY(-10px);
  background: var(--color-navy);
  color: var(--color-text-on-dark);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
  z-index: 30;
  white-space: nowrap;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --- Star rating ------------------------------------------------------------- */

.rating-row {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
}

.rating-row__item {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-tab-inactive);
}

.rating-row__item svg {
  width: 20px;
  height: 20px;
}

.rating-row__item.is-selected {
  background: var(--color-yellow);
  color: var(--color-navy);
}

/* --- Stat cards (profile) ----------------------------------------------------- */

.stat-row {
  display: flex;
  gap: var(--space-3);
}

.stat-card {
  flex: 1;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: var(--space-4);
  text-align: center;
}

.stat-card__value {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-navy);
  display: block;
}

.stat-card__label {
  margin-top: 2px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

/* --- List rows (journal / settings) -------------------------------------------- */

.list-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border-subtle);
  text-align: left;
}

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

.list-row__icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-sage);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.list-row__icon svg {
  width: 16px;
  height: 16px;
  color: var(--color-navy);
}

.list-row__icon--teal { background: var(--color-teal); }
.list-row__icon--teal svg { color: #fff; }

.list-row__icon--navy { background: var(--color-navy); }
.list-row__icon--navy svg { color: #fff; }

.list-row__icon--coral { background: var(--color-coral); }
.list-row__icon--yellow { background: var(--color-yellow); }
.list-row__icon--mint { background: var(--color-mint); }
.list-row__icon--sage { background: var(--color-sage); }

.list-row__text {
  flex: 1;
}

.list-row__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.list-row__subtitle {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.list-row__note {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-secondary);
  font-style: italic;
}

.list-row__chevron {
  width: 16px;
  height: 16px;
  color: var(--color-tab-inactive);
  flex-shrink: 0;
  transition: transform 200ms ease;
}

.list-row__chevron.is-open {
  transform: rotate(90deg);
}

.list-row__value {
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* --- Expandable settings row (shared wrapper) ------------------------------- */

.settings-row {
  border-bottom: 1px solid var(--color-border-subtle);
}

.settings-row .list-row {
  border-bottom: none;
}

/* --- Shared collapsible settings panel --------------------------------------- */

.settings-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 300ms ease;
}

.settings-panel.is-open {
  max-height: var(--panel-open-height, 240px);
  margin-top: var(--space-3);
  padding-bottom: var(--space-3);
}

/* --- Default break duration picker ----------------------------------------- */

.duration-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) 0 var(--space-3) 48px;
  text-align: left;
  font-size: 14px;
  color: var(--color-text-primary);
}

.duration-option__dot {
  position: relative;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--color-tab-inactive);
  flex-shrink: 0;
}

.duration-option.is-selected {
  font-weight: 600;
}

.duration-option.is-selected .duration-option__dot {
  border-color: var(--color-teal);
}

.duration-option.is-selected .duration-option__dot::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: var(--color-teal);
}

/* --- Text input --------------------------------------------------------------- */

.text-input {
  width: 100%;
  padding: 14px var(--space-4);
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-surface);
  font-family: var(--font-family-base);
  font-size: 15px;
  color: var(--color-text-primary);
}

.text-input::placeholder {
  color: var(--color-tab-inactive);
}

.text-input:focus {
  outline: 2px solid var(--color-teal);
  outline-offset: 2px;
}

/* --- Friends ------------------------------------------------------------------- */

.friend-add-row {
  display: flex;
  gap: var(--space-2);
}

.friend-add-row .text-input {
  flex: 1;
  min-width: 0;
}

.friend-add-row .btn {
  flex-shrink: 0;
}

.friend-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.friend-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}

.friend-chip__name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
}

.friend-chip__remove {
  font-size: 18px;
  line-height: 1;
  color: var(--color-tab-inactive);
  padding: 0 var(--space-1);
}

.friends-panel .friend-add-row {
  margin-bottom: var(--space-3);
}

/* --- Notification toggle switch ------------------------------------------------ */

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.switch__track {
  position: absolute;
  inset: 0;
  background: var(--color-tab-inactive);
  border-radius: var(--radius-pill);
  transition: background 200ms ease;
}

.switch__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 200ms ease;
}

.switch input:checked + .switch__track {
  background: var(--color-teal);
}

.switch input:checked + .switch__track .switch__thumb {
  transform: translateX(18px);
}

.switch input:disabled {
  cursor: default;
}

.switch input:disabled + .switch__track {
  opacity: 0.5;
}

.switch--sm {
  width: 36px;
  height: 21px;
}

.switch--sm .switch__thumb {
  width: 15px;
  height: 15px;
}

.switch--sm input:checked + .switch__track .switch__thumb {
  transform: translateX(15px);
}

.icon-chevron-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2);
  margin: calc(var(--space-2) * -1);
  flex-shrink: 0;
}

.notif-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  transition: opacity 200ms ease;
}

.notif-option.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.notif-option__label {
  font-size: 13px;
  color: var(--color-text-primary);
}

/* --- Home greeting --------------------------------------------------------------- */

.home-greeting {
  font-size: var(--fs-h2);
  font-weight: 600;
  color: var(--color-navy);
  text-align: center;
}
