/* theme.css
   Shared branding for the Hostaway Companion Platform, pulled from the
   Sunstone Vacation logo: warm cream/brown desert palette, sunset accent,
   a western display font for headings. Linked by every page - keep
   page-specific overrides in each page's own <style> block, shared
   look-and-feel lives here. */

@import url('https://fonts.googleapis.com/css2?family=Rye&display=swap');

:root {
  /* Brand palette, from the logo */
  --brand-cream: #FBF3E6;
  --brand-cream-deep: #F5E8D3;
  --brand-brown: #3D2314;
  --brand-brown-light: #6B4A32;
  --brand-saddle: #8B4A26;
  --brand-sunset: #D2601E;
  --brand-sunset-light: #E8822C;
  --brand-gold: #E8A23D;
  --brand-sage: #6B8E4E;
  --brand-sky: #3A6C93;

  /* Semantic aliases used across pages */
  --bg: var(--brand-cream);
  --card: #FFFDF9;
  --text: var(--brand-brown);
  --muted: #8B7355;
  --border: #E8D9C0;
  --accent: var(--brand-sunset);
  --accent-hover: var(--brand-saddle);

  /* Status colors - kept clearly red/yellow/green (functional meaning
     the team relies on), bold/saturated so they stand out against the
     warm cream background rather than blending into it. Yellow is a true
     bright yellow (not orange) so it reads distinctly from the sunset-
     orange used on primary buttons - they were too close before. */
  --red: #E0331A;
  --red-bg: #E0331A;
  --red-text: #FFFFFF;
  --orange: #F07D0D;
  --orange-bg: #F07D0D;
  --orange-text: #FFFFFF;
  --yellow: #FFCC00;
  --yellow-bg: #FFCC00;
  --yellow-text: #3D2314;
  --green: #3F8C3F;
  --green-bg: #3F8C3F;
  --green-text: #FFFFFF;
  /* Occupied - deliberately neutral/desaturated rather than another bold
     color: it isn't a warning or a go-ahead, just "guest is here, nothing
     to do." Distinct enough from --muted (which is for secondary text, not
     a status) to not read as the same thing at a glance. */
  --grey: #6B6E76;
  --grey-bg: #6B6E76;
  --grey-text: #FFFFFF;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  /* Clearance for the fixed bottom tab bar (~4rem) plus its iPhone
     safe-area padding, so the last card on any page isn't hidden behind it. */
  padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0));
}

h1, h2, .brand-font {
  font-family: 'Rye', "Segoe UI", serif;
  font-weight: 400;
  letter-spacing: 0.01em;
}

header {
  background: var(--card);
  padding: 1rem;
  padding-right: 7.5rem; /* clearance for the logo pinned top-right */
  border-bottom: 2px solid var(--brand-sunset);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-logo {
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  height: 88px;
  width: auto;
}

header h1 { font-size: 1.25rem; margin: 0; color: var(--brand-brown); }

#identity-bar { margin-top: 0.5rem; }
#identity-bar strong { color: var(--brand-brown); }

/* Bottom tab bar - replaced the old wrapping in-header text-link nav once
   a 6th page (Drafts) made it wrap into two cramped rows fighting the
   logo for width. Fixed to the viewport bottom, one icon+label per
   section, matching the native-app feel the PWA install already gives. */
nav#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: var(--card);
  border-top: 2px solid var(--brand-sunset);
  /* Breathing room from the physical screen edges, not just the notch/
     home-indicator safe areas - the outer two tabs sat flush against the
     bezel on a real phone without this, made worse by any phone case
     whose edge wraps slightly over the screen (something no safe-area
     API can account for, since iOS has no way to know a case is there).
     Generous on purpose so it clears typical case lips, not just bare glass.
     Left is deliberately larger than right - Jason's case intrudes more on
     that side specifically. */
  padding-left: max(2rem, env(safe-area-inset-left, 0));
  padding-right: max(1.25rem, env(safe-area-inset-right, 0));
  padding-bottom: env(safe-area-inset-bottom, 0);
  z-index: 10;
}
nav#bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.5rem 0.2rem 0.4rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.65rem;
  line-height: 1;
  /* align-items only centers the label as a whole block under the icon -
     when a label wraps to two lines (only "Status Board" is long enough
     to), the lines themselves default to left-aligned against each other,
     dragging the shorter word off-center. */
  text-align: center;
}
nav#bottom-nav a svg { width: 22px; height: 22px; }
nav#bottom-nav a.active { color: var(--brand-sunset); font-weight: 700; }

.card {
  background: var(--card);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(61, 35, 20, 0.08);
  border: 1px solid var(--border);
}

button {
  border: none;
  border-radius: 8px;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
button.primary {
  background: linear-gradient(135deg, var(--brand-sunset-light), var(--brand-sunset));
  color: white;
}
button.primary:hover { background: var(--accent-hover); }
button.secondary { background: var(--brand-cream-deep); color: var(--text); }
button:disabled { opacity: 0.5; cursor: default; }

input, select, textarea {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: white;
  color: var(--text);
}
/* Checkboxes/radios must not inherit width:100% above - that was
   stretching them to fill their flex row, shoving their label text far
   away. Keep them their natural small size. */
input[type="checkbox"], input[type="radio"] {
  width: auto;
  padding: 0;
  flex-shrink: 0;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-sunset);
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0.75rem 0 0.3rem 0;
  color: var(--brand-brown-light);
}
label:first-child { margin-top: 0; }

.pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
/* Status Board (red/yellow/green) and recurring due-status (overdue/
   due-soon/ok) share the 3-color scale. */
.pill.red, .pill.overdue { background: var(--red-bg); color: var(--red-text); }
.pill.yellow, .pill.due-soon { background: var(--yellow-bg); color: var(--yellow-text); }
.pill.green, .pill.ok { background: var(--green-bg); color: var(--green-text); }
.pill.grey { background: var(--grey-bg); color: var(--grey-text); }

/* Maintenance priority gets its own full gradient, distinct from the
   status colors above: red -> orange -> yellow -> green. */
.pill.urgent { background: var(--red-bg); color: var(--red-text); }
.pill.high { background: var(--orange-bg); color: var(--orange-text); }
.pill.medium { background: var(--yellow-bg); color: var(--yellow-text); }
.pill.low { background: var(--green-bg); color: var(--green-text); }

#status-msg { text-align: center; padding: 1rem; color: var(--muted); }
