/* Director de música app — responsive layout, orange / green themes */

:root {
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Orange: approximate “not on Bluetooth speaker” */
body.theme-out {
  --bg: #fff4e6;
  --bg-elevated: #ffe8cc;
  --accent: #e85d04;
  --accent-text: #1a0f00;
  --border: #fdba74;
  --theme-color: #e85d04;
}

/* Green: heuristic match for Bluetooth-like output */
body.theme-bt {
  --bg: #ecfdf5;
  --bg-elevated: #d1fae5;
  --accent: #059669;
  --accent-text: #022c22;
  --border: #6ee7b7;
  --theme-color: #059669;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg, #fff4e6);
  color: var(--accent-text, #1a0f00);
  min-height: 100vh;
  min-height: 100dvh;
  transition: background 0.25s ease, color 0.25s ease;
}

/* Index: footer pinned to bottom of viewport; header + list scroll when needed */
.page-shell--sticky-footer {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.page-shell__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.theme-player {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

a {
  color: var(--accent, #e85d04);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
  padding: 1rem 1.25rem 2rem;
  box-sizing: border-box;
}

.site-header {
  background: var(--bg-elevated, #ffe8cc);
  border-bottom: 1px solid var(--border, #fdba74);
  padding: 1.5rem 1.25rem;
}

.site-header--compact {
  padding: 0.65rem 1.25rem;
}

.site-header__inner {
  max-width: 42rem;
  margin: 0 auto;
}

.site-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.site-title--compact {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.site-tagline {
  margin: 0.35rem 0 0;
  opacity: 0.85;
  font-size: 0.95rem;
}

.site-footer {
  max-width: 42rem;
  margin: 2rem auto;
  padding: 0 1.25rem;
  font-size: 0.9rem;
}

/* Next Tech shared footer (all pages; web component loaded in base.html) */
.page-shell--sticky-footer .site-nexttech-footer {
  flex-shrink: 0;
  margin-top: auto;
}

.site-nexttech-footer {
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  padding: 1rem 1.25rem max(1.25rem, env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  width: 100%;
}

.project-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.project-list__item + .project-list__item {
  margin-top: 0.75rem;
}

.project-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  min-height: 44px;
  border-radius: var(--radius);
  background: var(--bg-elevated, #ffe8cc);
  border: 1px solid var(--border, #fdba74);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
}

.project-card:hover {
  text-decoration: none;
  filter: brightness(0.98);
}

.project-card__name {
  font-weight: 600;
  font-size: 1.05rem;
}

.project-card__cta {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent, #e85d04);
}

.empty-state {
  text-align: center;
  padding: 2rem 0;
  opacity: 0.85;
}

/* Player */
.player-header {
  flex-shrink: 0;
  padding: 1rem 1.25rem 0.5rem;
  background: var(--bg-elevated, #ffe8cc);
  border-bottom: 1px solid var(--border, #fdba74);
}

.back-link {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.player-title {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

body.theme-player {
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Player: scroll area is a column so .player-main can grow with track-buttons--fill */
body.theme-player .page-shell__scroll {
  display: flex;
  flex-direction: column;
}

.player-main {
  padding-top: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-sizing: border-box;
}

.track-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Few tracks (<4): buttons share remaining viewport height for easier taps */
.track-buttons--fill {
  flex: 1;
  min-height: 0;
  gap: 0.75rem;
}

.track-buttons--fill .track-btn {
  flex: 1 1 0;
  min-height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.track-btn {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 1rem 1.25rem;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--accent, #e85d04);
  color: #fff;
  box-shadow: var(--shadow);
  transition: transform 0.08s ease, filter 0.15s ease;
}

.track-btn:hover {
  filter: brightness(1.05);
}

.track-btn:active {
  transform: scale(0.98);
}

.track-btn.is-playing {
  outline: 3px solid var(--accent-text);
  outline-offset: 2px;
}

/* Offline / cache toasts (player page) */
.player-toast {
  position: fixed;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  z-index: 9999;
  max-width: min(22rem, calc(100vw - 2rem));
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--accent-text, #1a0f00);
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.35;
  text-align: center;
  box-shadow: var(--shadow);
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%) translateY(120%);
  transition: opacity 0.28s ease, transform 0.32s ease;
}

.player-toast.player-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Admin */
.admin-page h1 {
  font-size: 1.35rem;
  margin-top: 0;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.admin-toolbar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.admin-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.admin-list__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border, #fdba74);
}

.admin-list__name {
  font-weight: 600;
  flex: 1 1 140px;
}

.admin-list__meta {
  font-size: 0.85rem;
  opacity: 0.8;
}

.admin-list__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.admin-section {
  margin-top: 2rem;
}

.admin-section h2 {
  font-size: 1.1rem;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: 28rem;
}

.admin-form label {
  font-weight: 600;
  font-size: 0.9rem;
}

.admin-form input[type="text"],
.admin-form input[type="password"],
.admin-form input[type="number"],
.admin-form input[type="file"] {
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border, #ccc);
  font-size: 1rem;
}

.admin-form--inline {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  max-width: none;
}

.admin-form--tracks-row {
  align-items: flex-start;
}

.admin-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
  max-width: 36rem;
}

.admin-checkbox input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.admin-checkbox--inline {
  align-items: center;
  font-size: 0.85rem;
  white-space: nowrap;
}

.admin-tracks {
  list-style: none;
  margin: 0;
  padding: 0;
}

.admin-tracks__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border, #fdba74);
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg-elevated);
  color: inherit;
  text-decoration: none;
  box-sizing: border-box;
}

.btn:hover {
  text-decoration: none;
  filter: brightness(0.97);
}

.btn--primary {
  background: var(--accent, #e85d04);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  border-color: var(--border, #ccc);
}

.btn--small {
  min-height: 40px;
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
}

.btn--danger {
  background: #b91c1c;
  color: #fff;
}

.inline-form {
  display: inline;
}

.flash-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.flash {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.35rem;
}

.flash--error {
  background: #fee2e2;
  color: #7f1d1d;
}

.flash--success {
  background: #d1fae5;
  color: #065f46;
}

@media (min-width: 768px) {
  .site-title:not(.site-title--compact) {
    font-size: 1.75rem;
  }

  .track-btn {
    min-height: 64px;
    font-size: 1.15rem;
  }
}
