/* Pet Meds: small additions to Bootstrap. */

:root {
  --bs-primary: #2f6f62;
  --bs-primary-rgb: 47, 111, 98;
  --bs-link-color: #2f6f62;
  --bs-link-color-rgb: 47, 111, 98;
  --app-bottom-height: 3.75rem;
}
[data-bs-theme="dark"] {
  --bs-primary: #6cc3ae;
  --bs-primary-rgb: 108, 195, 174;
  --bs-link-color: #6cc3ae;
  --bs-link-color-rgb: 108, 195, 174;
}
.btn-primary {
  --bs-btn-bg: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-bg: color-mix(in srgb, var(--bs-primary) 85%, black);
  --bs-btn-hover-border-color: color-mix(in srgb, var(--bs-primary) 85%, black);
  --bs-btn-active-bg: color-mix(in srgb, var(--bs-primary) 75%, black);
  --bs-btn-disabled-bg: var(--bs-primary);
  --bs-btn-disabled-border-color: var(--bs-primary);
}
[data-bs-theme="dark"] .btn-primary { --bs-btn-color: #10201c; --bs-btn-hover-color: #10201c; --bs-btn-active-color: #10201c; }
.btn-outline-primary {
  --bs-btn-color: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-bg: var(--bs-primary);
  --bs-btn-hover-border-color: var(--bs-primary);
  --bs-btn-active-bg: var(--bs-primary);
  --bs-btn-active-border-color: var(--bs-primary);
}
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-hover-color: #10201c; --bs-btn-active-color: #10201c; }
.form-control:focus, .form-select:focus { border-color: var(--bs-primary); box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .25); }

.app-container { max-width: 760px; }
.app-household .btn { max-width: 12rem; }
@media (max-width: 575.98px) { .app-household .btn { max-width: 14rem; } }
.min-w-0 { min-width: 0; }
.login-card { max-width: 380px; }

/* Room for the bottom tabs on phones. */
@media (max-width: 767.98px) {
  main { padding-bottom: calc(var(--app-bottom-height) + 1rem + env(safe-area-inset-bottom)) !important; }
}

.app-tabs .nav-link.active { color: var(--bs-primary); font-weight: 600; }

.app-bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
  display: flex; height: calc(var(--app-bottom-height) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
}
.app-bottom a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-decoration: none; color: var(--bs-secondary-color); font-size: .75rem;
}
.app-bottom a i { font-size: 1.35rem; line-height: 1.1; }
.app-bottom a.active { color: var(--bs-primary); font-weight: 600; }

/* The confirmation dialog can open over an editor dialog: keep it and its backdrop on top. */
#confirm-modal { z-index: 1065; }
.modal-backdrop ~ .modal-backdrop { z-index: 1060; }

/* Pet pictures: the photo cropped to a circle, or the emoji on a tinted disc. */
.pet-avatar {
  flex: none; display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
  border-radius: 50%; background: rgba(var(--bs-primary-rgb), .14); line-height: 1;
}
.pet-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pet-avatar-sm { width: 2rem; height: 2rem; font-size: 1.1rem; }
.pet-avatar-md { width: 2.75rem; height: 2.75rem; font-size: 1.5rem; }
.pet-avatar-lg { width: 4.5rem; height: 4.5rem; font-size: 2.4rem; }
.pet-avatar-xl { width: 6rem; height: 6rem; font-size: 3.2rem; }

/* Today */
.slot-group-title {
  font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 600;
  color: var(--bs-secondary-color); margin: 1rem 0 .4rem;
}
.slot-group-title:first-child { margin-top: 0; }
.dose-row { display: flex; align-items: center; gap: .75rem; padding: .7rem .75rem; }
.dose-row + .dose-row { border-top: 1px solid var(--bs-border-color); }
.dose-check {
  flex: none; width: 2.6rem; height: 2.6rem; border-radius: 50%; padding: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
  border: 2px solid var(--bs-border-color); background: transparent; color: transparent;
}
.dose-check:hover { border-color: var(--bs-success); color: rgba(var(--bs-success-rgb), .35); }
.dose-row.given .dose-check { background: var(--bs-success); border-color: var(--bs-success); color: #fff; }
.dose-row.overdue .dose-check { border-color: var(--bs-danger); }
/* Recorded, but not taken (refused, vomited, skipped): amber, so it reads differently from both given and missed. */
.dose-row.not-taken .dose-check { background: var(--bs-warning); border-color: var(--bs-warning); color: #212529; }
.dose-row.not-taken .dose-status { color: var(--bs-warning-text-emphasis); font-weight: 600; }

/* Activity */
.activity-day { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; color: var(--bs-secondary-color); margin: 1rem 0 .4rem; }
.activity-day:first-child { margin-top: 0; }
.activity-entry { padding: .55rem .75rem; font-size: .875rem; }
.activity-entry + .activity-entry { border-top: 1px solid var(--bs-border-color); }
.activity-entry .who { font-weight: 600; }
.activity-entry .when { color: var(--bs-secondary-color); font-variant-numeric: tabular-nums; }
.dose-main { flex: 1; min-width: 0; }
.dose-title { font-weight: 600; }
.dose-row.given .dose-title { color: var(--bs-secondary-color); }
.dose-meta { font-size: .85rem; color: var(--bs-secondary-color); }
.dose-row.overdue .dose-status { color: var(--bs-danger); font-weight: 600; }
.dose-override { color: var(--bs-warning-text-emphasis); font-weight: 600; }
.dose-notes { font-size: .8rem; color: var(--bs-secondary-color); white-space: pre-line; }
.dose-more { flex: none; }

/* Pets */
.med-item + .med-item { border-top: 1px solid var(--bs-border-color); }
.med-archive summary { cursor: pointer; list-style-position: inside; }
.med-item.archived { opacity: .7; }
.slot-chip {
  display: inline-block; font-size: .8rem; padding: .1rem .5rem; margin: .15rem .25rem 0 0;
  border-radius: 1rem; background: var(--bs-secondary-bg); white-space: nowrap;
}
.slot-row .form-control, .slot-row .form-select { min-width: 0; }
/* Wide enough that a 12-hour clock's AM/PM isn't cut off on phones. */
.slot-row .slot-time { flex: 0 0 8.25rem; padding-right: .5rem; }
.slot-row .slot-amount { flex: 1 1 3.5rem; }
.slot-row .slot-unit { flex: 0 0 5rem; padding-right: 1.75rem; background-position: right .5rem center; }

/* History */
.history-day + .history-day { border-top: 1px solid var(--bs-border-color); }
.history-day { padding: .6rem .75rem; }
.history-date { font-weight: 600; font-size: .9rem; }
.history-entry { font-size: .875rem; display: flex; gap: .5rem; align-items: baseline; }
.history-entry.missed { color: var(--bs-danger); }
.history-entry.not-taken { color: var(--bs-warning-text-emphasis); }
.history-entry .t { width: 4.4rem; flex: none; font-variant-numeric: tabular-nums; color: var(--bs-secondary-color); }
.stat-tile { text-align: center; }
.stat-tile .value { font-size: 1.4rem; font-weight: 700; line-height: 1.2; }
.stat-tile .label { font-size: .75rem; color: var(--bs-secondary-color); }

.empty-state { text-align: center; color: var(--bs-secondary-color); padding: 2.5rem 1rem; }
.empty-state i { font-size: 2.5rem; display: block; margin-bottom: .5rem; }

/* Repeats and supplies */
.weekday-btn { min-width: 2.6rem; padding-left: .3rem; padding-right: .3rem; }
.supply-low { color: var(--bs-warning-text-emphasis); font-weight: 600; }
.refill-alert .bi { margin-right: .25rem; }

/* Passwords */
.temp-password { font: 600 2rem/1.2 ui-monospace, Consolas, monospace; letter-spacing: .08em; user-select: all; }
