
:root{
  --wt-bg: #f5f7fb;
  --wt-card: #ffffff;
  --wt-accent: #347fc9;
  --wt-accent-2: #00bfa6;
  --wt-accent-focus: rgba(52, 127, 201, 0.3);
  --wt-muted: #6b7280;
  --wt-text: #111827;
}

.theme-wrapper.light{
  --wt-bg: #f5f7fb;
  --wt-card: #ffffff;
  --wt-accent: #347fc9;
  --wt-accent-2: #00bfa6;
  --wt-accent-focus: rgba(52, 127, 201, 0.3);
  --wt-muted: #6b7280;
  --wt-text: #111827;
}

.theme-wrapper.dark{
  --wt-bg: #0b1020;
  --wt-card: #071021;
  --wt-accent: #347fc9;
  --wt-accent-2: #00e6c3;
  --wt-accent-focus: rgba(52, 127, 201, 0.35);
  --wt-muted: #9aa4b2;
  --wt-text: #e6eef6;
  --bs-body-color: #e6eef6;
  --bs-secondary-color: #b3bdca;
  --bs-heading-color: #f4f7fb;
  --bs-border-color: #44516a;
  color-scheme: dark;
}

.theme-wrapper {
    background: linear-gradient(180deg, var(--wt-bg), var(--wt-bg));
    padding: 0.5rem;
    min-height: 100vh;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
    color: var(--wt-text);
    transition: background-color 240ms ease, color 240ms ease;
}

.workout-theme{
  background: linear-gradient(180deg, var(--wt-bg), var(--wt-bg));
  padding: 1.5rem;
  min-height: 65vh;
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
  color: var(--wt-text);
  transition: background-color 240ms ease, color 240ms ease;
}

@media (max-width: 575.98px){
  .workout-theme{
    padding-left:0.5rem;
    padding-right:0.5rem;
  }
}

.wt-card{
  background: var(--wt-card);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(35,39,50,0.06);
  border: 1px solid rgba(99,102,241,0.06);
  padding: 1rem;
}

.app-page-heading {
  align-items: center;
  display: inline-flex;
  gap: 0.65rem;
  min-width: 0;
}

.app-page-heading-logo {
  flex: 0 0 auto;
  height: 2.125rem;
  object-fit: contain;
  width: 2.125rem;
}

.app-page-heading h1,
.app-page-heading h2,
.app-page-heading h3 {
  margin-bottom: 0;
}

h3{ color: var(--wt-text); font-weight:600; }
.wt-header{ display:flex; align-items:center; justify-content:space-between; }

.form-control{ border-radius:8px; border-color: rgba(16,24,40,0.06); }
.form-label{ font-size:0.8rem; color:var(--wt-muted); }
.btn-primary{ background: linear-gradient(90deg,var(--wt-accent),#2c6fb2); border:none; }
.btn-outline-primary{ color:var(--wt-accent); border-color: rgba(52,127,201,0.35); }

html,
body{
  background: var(--wt-bg);
  max-width:100%;
  overflow-x:hidden;
  transition: background-color 240ms ease;
}

.wt-exercise-title{ color:var(--wt-text); font-weight:600; }
.muted{ color:var(--wt-muted); }
.white-space-pre-line{ white-space:pre-line; }
.simple-formatted-text > :last-child{ margin-bottom:0; }
.simple-formatted-text h3{
  color:var(--wt-text);
  margin:1rem 0 0.5rem;
}
.simple-formatted-text h3:first-child{ margin-top:0; }
.simple-formatted-text p{ margin:0 0 0.75rem; }
.simple-formatted-text ul,
.simple-formatted-text ol{
  margin:0 0 0.85rem 1.25rem;
  padding-left:1rem;
}
.simple-formatted-text li{ margin-bottom:0.35rem; }

.workout-rest-timer{
  position:fixed !important;
  left:auto !important;
  right:0.85rem !important;
  top:auto !important;
  bottom:calc(var(--mobile-bottom-nav-safe-height, 4.95rem) + 0.75rem) !important;
  transform:none !important;
  z-index:2060 !important;
  box-sizing:border-box;
  width:min(5.35rem, calc(100vw - 1.5rem));
  max-width:calc(100vw - 1.5rem);
  border:1px solid rgba(255, 255, 255, 0.28);
  border-radius:8px;
  background:#ff755f;
  color:#ffffff;
  box-shadow:0 0.9rem 2.2rem rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
  padding:0.45rem 0.5rem;
  text-align:center;
}

.workout-rest-timer.is-expired{
  border-color:#ffe3e0;
  background:#ff3d35;
  color:#fff;
  box-shadow:0 0.9rem 2.2rem rgba(255, 61, 53, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.18) inset;
}

.workout-rest-timer-label{
  color:#fff4ef;
  font-size:0.64rem;
  font-weight:800;
  line-height:1.1;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.workout-rest-timer.is-expired .workout-rest-timer-label{
  color:#ffffff;
}

.workout-rest-timer-time{
  font-size:1.22rem;
  font-weight:900;
  line-height:1.1;
  margin-top:0.1rem;
}

@media (min-width:769px){
  .workout-rest-timer{ display:none; }
}

/* Replace table layout with card lists */
.list-card{
  display:flex; flex-direction:column; gap:0.75rem;
}
.list-card .item{
  background: var(--wt-card);
  border-radius:10px;
  padding:0.75rem;
  display:flex; align-items:center; justify-content:space-between;
  border:1px solid rgba(16,24,40,0.04);
}
.item .meta{ color:var(--wt-muted); font-size:0.9rem; }

@media (max-width:767px){
  .workout-theme{ padding:1rem; }
}

/* Stronger global overrides for dark mode to override Bootstrap defaults */
.theme-wrapper.dark {
  background: var(--wt-bg) !important;
  color: var(--wt-text) !important;
}

.theme-wrapper.dark .page,
.theme-wrapper.dark .workout-theme {
  background: var(--wt-bg) !important;
  color: var(--wt-text) !important;
}

.theme-wrapper.dark .navbar,
.theme-wrapper.dark .top-row {
  background: transparent !important;
  color: var(--wt-text) !important;
}

.theme-wrapper.dark .sidebar { background: var(--wt-card) !important; }

.theme-wrapper.dark .nav-link,
.theme-wrapper.dark .nav-link.active,
.theme-wrapper.dark .nav-link:focus {
  color: var(--wt-text) !important;
}

.theme-wrapper.dark .btn-primary {
  background: linear-gradient(90deg,var(--wt-accent),var(--wt-accent)) !important;
  color: #fff !important;
  border: none !important;
}

.theme-wrapper.dark .wt-card,
.theme-wrapper.dark .list-card .item {
  color: var(--wt-text);
}

.theme-wrapper.dark h1,
.theme-wrapper.dark h2,
.theme-wrapper.dark h3,
.theme-wrapper.dark h4,
.theme-wrapper.dark h5,
.theme-wrapper.dark h6,
.theme-wrapper.dark .form-check-label {
  color: var(--wt-text) !important;
}

.theme-wrapper.dark .form-label {
  color: #b3bdca !important;
}

.theme-wrapper.dark .form-check-input {
  background-color: #111a2e;
  border-color: #8290a8;
}

.theme-wrapper.dark .form-check-input:checked {
  background-color: var(--wt-accent);
  border-color: var(--wt-accent);
}

.theme-wrapper.dark .form-check-input:focus {
  border-color: #a99fff;
  box-shadow: 0 0 0 0.2rem var(--wt-accent-focus);
}

.theme-wrapper.dark .form-control,
.theme-wrapper.dark .form-select {
  color: var(--wt-text);
  background-color: #10192b;
  border-color: #44516a;
}

.theme-wrapper.dark .form-control::placeholder {
  color: #8995a8;
  opacity: 1;
}

.theme-wrapper.dark .form-select option {
  color: var(--wt-text);
  background-color: #10192b;
}

.theme-wrapper.dark .validation-message,
.theme-wrapper.dark .text-danger {
  color: #ff9ba5 !important;
}

.auth-page {
  display: grid;
  place-items: center;
  padding: 1rem;
}

.auth-shell {
  width: min(100%, 430px);
}

.auth-card {
  background: var(--wt-card);
  border: 1px solid rgba(52, 127, 201, 0.28);
  border-radius: 12px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
  padding: 1.5rem;
}

.auth-brand {
  color: var(--wt-accent-2);
  display: inline-flex;
  font-weight: 700;
  margin-bottom: 1.25rem;
  text-decoration: none;
}

.auth-brand:hover,
.auth-card a {
  color: var(--wt-accent-2);
}

.auth-card h1 {
  color: var(--wt-text);
  font-size: 2rem;
  margin-bottom: 0.35rem;
}

.auth-muted,
.auth-footer {
  color: var(--wt-muted);
}

.auth-footer {
  margin-bottom: 0;
  margin-top: 1rem;
  text-align: center;
}
