@import url("sps-theme-toggle.css");

/* Shared fixed footer bar — matches desktop app .app-footer (v0.3/app). */
:root {
  --app-footer-bar-h: 48px;
  --app-body-footer-pad: 52px;
  --app-footer-padding-y: 4px;
  --app-footer-surface: rgba(241, 236, 228, 0.96);
  --sps-border-strong: #aea496;
  --sps-muted: #55566a;
}

html[data-sps-theme="dark"] {
  --app-footer-surface: rgba(26, 26, 58, 0.95);
  --sps-border-strong: rgba(245, 211, 122, 0.2);
  --sps-muted: #c8c1b6;
}

body:has(.sps-web-app-footer) {
  padding-bottom: var(--app-body-footer-pad);
}

body:has(.sps-web-app-footer) .site-footer {
  display: none !important;
}

.sps-web-app-footer.app-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999990;
  display: flex;
  align-items: stretch;
  box-sizing: border-box;
  height: var(--app-footer-bar-h);
  min-height: var(--app-footer-bar-h);
  padding: var(--app-footer-padding-y) max(18px, env(safe-area-inset-left, 0px)) var(--app-footer-padding-y)
    max(18px, env(safe-area-inset-right, 0px));
  background: var(--app-footer-surface);
  border-top: 1px solid var(--sps-border-strong);
  backdrop-filter: blur(6px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  pointer-events: none;
}

.sps-web-app-footer .app-footer-inner {
  position: relative;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 0;
  margin: 0;
  flex: 1 1 auto;
  align-self: stretch;
  box-sizing: border-box;
}

.sps-web-app-footer .app-footer-lead {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
  min-width: 0;
  padding-right: 10px;
  pointer-events: auto;
}

/* Theme toggle — footer-docked (canonical across SPS web shells). */
.sps-web-app-footer .app-footer-lead .sps-theme-toggle,
.sps-theme-toggle.sps-theme-toggle--footer-dock,
.sps-theme-toggle.sps-theme-toggle--hub-footer {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  top: auto !important;
  z-index: 1;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #1a1a3a;
  color: #f5d37a;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

html[data-sps-theme="light"] .sps-web-app-footer .app-footer-lead .sps-theme-toggle,
html[data-sps-theme="light"] .sps-theme-toggle.sps-theme-toggle--footer-dock,
html[data-sps-theme="light"] .sps-theme-toggle.sps-theme-toggle--hub-footer {
  background: #f8f5ef;
  color: #1a1a3a;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
}

.sps-web-app-footer .app-footer-lead .sps-theme-toggle:hover,
.sps-theme-toggle.sps-theme-toggle--footer-dock:hover,
.sps-theme-toggle.sps-theme-toggle--hub-footer:hover {
  transform: scale(1.06);
}

.sps-web-app-footer .app-footer-lead .sps-theme-toggle:focus,
.sps-theme-toggle.sps-theme-toggle--footer-dock:focus,
.sps-theme-toggle.sps-theme-toggle--hub-footer:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.sps-web-app-footer .app-footer-center {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: max-content;
  max-width: min(480px, calc(100% - 32px));
  min-width: 0;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 1;
}

.sps-web-app-footer .app-footer-copyright {
  flex: 0 1 auto;
  width: 100%;
  font-size: 11px;
  font-weight: 400;
  color: var(--sps-muted);
  text-align: center;
  line-height: 1.35;
  pointer-events: auto;
}

.sps-web-app-footer .app-footer-trail {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  min-width: 0;
  margin-left: auto;
  padding-left: 10px;
  gap: 8px;
  pointer-events: auto;
}

.sps-web-app-footer .app-footer-trail .ws-aspen-chat-wrap {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  top: auto;
}

.sps-web-app-footer .app-footer-trail .ws-aspen-chat-wrap.ws-aspen-chat-wrap--docked {
  position: relative !important;
  z-index: 3;
  width: auto;
  max-width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  font-family: inherit;
}
