/*
  dumps.fm (rebuild) - Core Styles
  Purpose: Shared variables + page layout primitives for static UI.
  Dependencies: None.
  Dependents: `public/index.html` + future static pages.
*/

@import "./theme-vars.css";

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  background: var(--bg-primary);
  transition: background-color 240ms ease;
}

body {
  margin: 0;
  font-family: var(--font-mono);
  color: var(--text-primary);
  background: transparent;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: background-color var(--theme-fade-ms, 240ms) ease, color var(--theme-fade-ms, 240ms) ease;
}

/* Sunset/Sunrise gradient overlays (lightweight, no GIF). */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  transition: opacity var(--theme-fade-ms, 700ms) ease;
}

body::before {
  opacity: var(--sunset-overlay-opacity, 0);
  background:
    radial-gradient(circle at 22% 88%, var(--sunset-sun), transparent 55%),
    radial-gradient(circle at 74% 82%, var(--sunset-glow), transparent 60%),
    linear-gradient(180deg, transparent 0%, var(--sunset-mid) 44%, var(--sunset-deep) 100%);
}

body::after {
  opacity: var(--sunrise-overlay-opacity, 0);
  background:
    radial-gradient(circle at 24% 10%, var(--sunrise-sun), transparent 60%),
    radial-gradient(circle at 70% 12%, var(--sunrise-glow), transparent 64%),
    linear-gradient(180deg, var(--sunrise-top) 0%, var(--sunrise-fade) 70%);
}

/* Theme fade for key surfaces/borders (Day/Night/Sunset/Sunrise). */
.app-header,
.ticker,
.chat,
.sidebar,
.app-footer,
.composer__input,
.composer__btn,
.tools-drawer__panel,
.webcam-panel,
.fav-drawer__panel {
  transition: background-color var(--theme-fade-ms, 240ms) ease, color var(--theme-fade-ms, 240ms) ease, border-color var(--theme-fade-ms, 240ms) ease;
}

a {
  color: inherit;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-header {
  height: auto;
  border-bottom: 1px solid var(--border-primary);
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 10px;
  position: relative;
  z-index: 2;
}

.app-logo__img {
  display: block;
  height: 32px;
  width: auto;
  image-rendering: auto;
  filter: var(--logo-filter) var(--logo-drop-shadow);
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}

.app-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid transparent;
}

.app-nav__icon {
  width: 16px;
  height: 16px;
  display: block;
  image-rendering: pixelated;
}

.app-nav__link:hover {
  border-bottom-color: var(--border-dark);
}

.app-header__spacer {
  flex: 1;
}

.app-search__input {
  width: 150px;
  height: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 0 6px;
  border: 1px solid var(--border-dark);
  background: var(--bg-primary);
  color: var(--text-primary);
}

.app-tools__select {
  height: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  border: 1px solid var(--border-dark);
  background: var(--bg-primary);
  color: var(--text-primary);
  appearance: auto;
}

.app-header__btn {
  height: 20px;
  padding: 0 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  border: 1px solid var(--border-dark);
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
}

.app-header__btn--link {
  display: inline-flex;
  align-items: center;
}

.app-header__btn:hover {
  background: var(--btn-hover-bg, #f3f3f3);
}

.dfm-primary-btn {
  border-width: 2px;
  font-weight: 800;
  padding: 0 10px;
  height: 26px;
  line-height: 24px;
  outline: 2px solid rgba(255, 0, 255, 0.22); /* accent indicator */
  outline-offset: 1px;
}

body.night-mode .dfm-primary-btn,
body.sunset-mode .dfm-primary-btn {
  outline-color: rgba(255, 0, 255, 0.28);
}

@media (prefers-reduced-motion: reduce) {
  .dfm-primary-btn {
    outline-offset: 0;
  }
}

/* Shared: danger actions (destructive / punitive). */
.dfm-danger-btn {
  border-width: 2px;
  font-weight: 800;
  padding: 0 10px;
  height: 26px;
  line-height: 24px;
  outline: 2px solid rgba(255, 59, 48, 0.32);
  outline-offset: 1px;
}

body.night-mode .dfm-danger-btn,
body.sunset-mode .dfm-danger-btn {
  outline-color: rgba(255, 59, 48, 0.42);
}

/* Shared: close buttons (tools drawer + modal panels). */
.dfm-close-btn {
  color: var(--text-primary) !important;
  font-weight: 800;
}

.ticker {
  position: relative;
  flex-basis: 100%;
  left: auto;
  right: auto;
  bottom: auto;
  height: 16px;
  border-top: 1px solid var(--border-primary);
  background: var(--bg-primary);
  overflow: hidden;
  font-size: 10px;
  line-height: 16px;
  white-space: nowrap;
}

.ticker__move {
  display: inline-block;
  padding-left: 100%;
  animation: ticker-move 16s linear infinite;
}

@keyframes ticker-move {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

.app-main {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden; /* prevent chat feed from spilling into footer/composer */
}

.app-footer {
  border-top: 2px solid var(--border-dark);
  background: var(--bg-primary);
}

.composer {
  height: 40px;
  display: flex;
  align-items: stretch;
  position: relative;
}

.composer__input {
  flex: 1;
  border: 0;
  outline: 0;
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--bg-input);
  color: var(--text-primary);
}

.composer__input::placeholder {
  color: var(--text-secondary);
  opacity: 0.8;
}

.composer__btn {
  border: 0;
  border-left: 1px solid var(--border-dark);
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 0 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.composer__btn:hover {
  background: #f3f3f3;
}

/* Upload: keep the real <input type="file"> offscreen; label triggers it. */
.composer__upload {
  position: relative;
}

.composer__file {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.composer__hint {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 2px;
  font-size: 10px;
  line-height: 1.2;
  color: var(--text-secondary);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.composer__hint--show {
  opacity: 0.95;
}

.composer__icon {
  width: 16px;
  height: 16px;
  display: block;
}

.footer-status {
  height: 18px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border-top: 1px solid var(--border-primary);
  font-size: 10px;
  padding: 0 10px;
  background: var(--bg-primary);
}

.footer-status__center {
  justify-self: center;
  text-transform: lowercase;
}

.footer-status__right {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.footer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
  white-space: nowrap;
}

.footer-toggle input {
  width: 12px;
  height: 12px;
  margin: 0;
  accent-color: var(--border-dark);
}
