/* === LAYOUT FIX PRO STICKY HEADER + FOOTER === */

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* MAIN SCROLL */
.app-main {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.6rem 0.7rem 0.7rem;
}

/* DESKTOP – pevné okraje */
@media (min-width: 900px) {
  .app-main {
    padding-left: 32px;
    padding-right: 32px;
  }

  .stations-grid {
    gap: 0.8rem;
  }

  :root {
    --radius: 16px;
  }
}

/* ULTRAWIDE */
@media (min-width: 1400px) {
  .app-main {
    padding-left: 48px;
    padding-right: 48px;
  }
}

/* === PROMĚNNÉ === */

:root {
  --bg-main: #111;
  --bg-header: #181818;
  --bg-footer: #181818;
  --bg-tile: #202020;
  --bg-tile-hover: #2a2a2a;
  --accent: #ff3b3b;
  --text-main: #f5f5f5;
  --text-muted: #bbbbbb;
  --radius: 14px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #222 0, #050505 55%);
  color: var(--text-main);
}

/* === HEADER === */

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-header);
  box-shadow: 0 2px 10px rgba(0,0,0,0.6);
  height: 56px;
  padding: 0 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Logo + název aplikace */
.app-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  white-space: nowrap;   /* <<< ZABRÁNÍ ZALOMENÍ */
}

.app-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  pointer-events: none;
}

.app-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
}

/* Menu a spacer zůstávají beze změny */
.menu-button {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  gap: 5px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  justify-content: center;
  cursor: pointer;
}

.menu-button span {
  display: block;
  height: 2.3px;
  border-radius: 999px;
  background: var(--text-main);
}

.header-spacer {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
}

/* === GRID === */

.stations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.6rem;
}

/* === HOVER EFEKTY (desktop) === */

@media (hover: hover) and (pointer: fine) {
  .station-tile {
    transition:
      transform 0.18s ease,
      box-shadow 0.18s ease,
      background 0.18s ease,
      filter 0.18s ease;
  }

  .station-tile:hover {
    background: var(--bg-tile-hover);
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 10px 28px rgba(0,0,0,0.75);
    filter: brightness(1.08);
  }
}

/* === ANIMACE PŘI VÝBĚRU === */

.station-tile:active {
  animation: tile-select 0.18s ease;
}

@keyframes tile-select {
  0%   { transform: scale(1); }
  50%  { transform: scale(0.94); }
  100% { transform: scale(1); }
}

/* === DLAŽDICE === */

.station-tile {
  background: var(--bg-tile);
  border-radius: var(--radius);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.55);
}

.station-logo {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  object-fit: contain;
  background: #222;
  padding: 6px;
}

.station-name {
  font-size: 0.85rem;
  font-weight: 500;
}

.station-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* === NOVÝ FOOTER – BASELINE (MOBIL) === */

.footer {
  background: linear-gradient(to bottom, #1c1c1c, #181818);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.8);
  position: sticky;
  bottom: 0;
  z-index: 20;
  padding: 0.2rem 0; /* menší, kompaktní mobilní footer */
}

/* LOGO VÝROBCE – MOBIL: SKRYTÉ */
.footer-brand {
  display: none;
}

/* MOBIL: ČISTÝ FOOTER BEZ DISPLEJE */
.footer-content {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 0.35rem 0.6rem;
  padding: 0.4rem 0.5rem;

  /* MOBIL: žádné šasi, žádný displej */
  background: none;
  margin: 0;
  border: none;
  box-shadow: none;
  border-radius: 0;
  max-width: none;
}

.footer-logo {
  grid-row: 1 / span 2;
  grid-column: 1;
  width: 90px;
  height: 90px;
  padding: 2px;
  background: #222;
  border-radius: 6px;
  object-fit: contain;
  align-self: start;
}

/* Text nahoře */
.footer-middle {
  grid-row: 1;
  grid-column: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.2rem;
  min-width: 0;
}

.footer-title {
  font-size: 0.9rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.footer-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tlačítka dole */
.footer-controls {
  grid-row: 2;
  grid-column: 2;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.45rem;
}

/* Tlačítka – mobilní velikost */
.footer-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.65rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: white;
  cursor: pointer;
}

.footer-btn svg {
  width: 70%;
  height: 70%;
  fill: currentColor;
}

.footer-btn.disabled {
  opacity: 0.35;
  pointer-events: none;
}


/* === NOVÝ DESKTOP FOOTER === */

@media (min-width: 768px) {

  /* LOGO VÝROBCE – DESKTOP: ZOBRAZIT A UMÍSTIT NA ŠASI */
  .footer-brand {
    display: block;
    position: absolute;
    top: 25px;
    left: 20px;
    width: 110px;
    height: auto;
    opacity: 0.75;
    pointer-events: none;
    filter: brightness(1.2);
  }

  /* DESKTOP: AKTIVACE DISPLEJE */
  .footer-content {
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: 1rem;

    background: #050505;
    max-width: 700px;
    margin: 0.35rem auto;
    padding: 0.6rem 0.7rem;
    border-radius: 12px;

    border: 1px solid rgba(180,200,255,0.22);

    box-shadow:
      inset 0 0 22px rgba(255,255,255,0.10),
      inset 0 0 6px rgba(255,255,255,0.05),
      0 0 18px rgba(0,0,0,0.6);
  }

  .footer-logo {
    grid-row: 1 / span 2;
    grid-column: 1;
    width: 117px;
    height: 117px;
    padding: 5px;
    background: #222;
    border-radius: 15px;
    object-fit: contain;
    align-self: start;
  }

  .footer-middle {
    grid-row: 1;
    grid-column: 2;
  }

  .footer-controls {
    grid-row: 2;
    grid-column: 2 / span 2;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1.2rem;
  }

  .footer-btn {
    width: 56px;
    height: 56px;
    border-radius: 0.7rem;
  }

  .footer-btn svg {
    width: 70%;
    height: 70%;
  }

  .footer-title {
    font-size: 1.1rem;
    line-height: 1.3;
  }

  .footer-meta {
    font-size: 0.9rem;
    line-height: 1.3;
  }
}
