/* ==========================================================================
   KP Systems Hub - shared app frame
   A consistent header and page shell for every app. Link after base.css.
   In kiosk mode (?kiosk=1) the header is hidden and content fills the screen.
   ========================================================================== */

body.app-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  background: rgba(10, 14, 22, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: var(--z-home-back, 428);
}

.app-header__home {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  color: #f4efe6;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  padding: 0.5rem 0.95rem 0.5rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(8, 12, 22, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  box-shadow:
    0 6px 28px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: border-color var(--transition), color var(--transition), transform var(--transition), background var(--transition), box-shadow var(--transition);
}

.app-header__home svg {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  stroke-width: 2.25;
}

.app-header__home:hover {
  border-color: rgba(201, 168, 124, 0.72);
  color: #fffaf2;
  background: rgba(14, 20, 34, 0.99);
  transform: translateX(-1px);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.62),
    0 0 0 1px rgba(201, 168, 124, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.app-header__home:active {
  transform: translateX(0) scale(0.98);
}

.app-header__titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-header__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.app-header__subtitle {
  font-size: 0.75rem;
  color: var(--text-subtle);
}

.app-header__spacer {
  flex: 1;
}

/* Header-integrated search (Songs, Links…) */
.app-header__lead {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.app-header--with-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(12rem, 36rem) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2);
  padding-block: var(--space-2);
}

.app-header--with-search .app-header__lead {
  grid-column: 1;
  justify-self: start;
}

.app-header--with-search .app-header__spacer {
  display: none;
}

.app-header--with-search .app-header__center {
  grid-column: 2;
  width: 100%;
  max-width: none;
  margin-inline: 0;
  justify-self: center;
}

.app-header--with-search .app-header__lang {
  grid-column: 3;
  justify-self: end;
}

.app-header--with-search .app-header__titles {
  flex-shrink: 1;
  min-width: 0;
}

.app-header--with-search .app-header__title {
  font-size: 0.9375rem;
}

.app-header--with-search .app-header__subtitle {
  font-size: 0.6875rem;
}

.app-header__center {
  min-width: 0;
}

.app-header__center .search {
  width: 100%;
}

.app-header__center .search__input {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  font-size: 0.875rem;
}

.app-header__center .search__icon {
  width: 0.95rem;
  height: 0.95rem;
}

@media (max-width: 720px) {
  .app-header--with-search {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }

  .app-header--with-search .app-header__lead {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .app-header--with-search .app-header__titles {
    display: none;
  }

  .app-header--with-search .app-header__lang {
    grid-column: 2;
    grid-row: 1;
  }

  .app-header--with-search .app-header__center {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

.app-header__badge {
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--border-accent);
  border-radius: 999px;
  padding: 2px 10px;
}

.app-main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin-inline: auto;
  padding: var(--space-6) var(--space-4);
}

/* A small honest note that data is not real yet. */
.mock-note {
  display: inline-block;
  font-size: 0.6875rem;
  color: var(--text-subtle);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  margin-left: var(--space-2);
}

/* Kiosk mode: no header, fill the screen, larger touch targets. */
body.kiosk .app-header {
  display: none;
}

body.kiosk .app-main {
  max-width: none;
  padding: var(--space-6);
}
