/* =========================
   GLOBAL STYLES (clean)
========================= */

/* box sizing */
*, *::before, *::after { box-sizing: border-box; }

/* ===== Base document ===== */
html, body{
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden; /* body nikdy nescrolluje */
}

body{
  min-height: 100svh;
  color: #eaf0ff;
  font-family: "texts", Cambria, Georgia, serif;
  line-height: 1.4;
}

/* ===== App variables ===== */
:root{
  --bottom-nav-h: 65px;                  /* fallback */
  --safe-bottom: env(safe-area-inset-bottom);
}

/* Background layer (doesn't affect fixed elements) */
body::before{
  content:"";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;

  background:
    radial-gradient(1200px 600px at 80% -20%, rgba(120, 97, 255, 0.25), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(0, 183, 255, 0.20), transparent 60%),
    linear-gradient(180deg, #0b0f16 0%, #0b0f16 100%);
  background-size: cover;

  /* jemný “pulse” bez filter janku */
  opacity: 1;
  animation: bgPulse 12s ease-in-out infinite;
}

@keyframes bgPulse{
  0%, 100%{ opacity: 1; }
  50%{ opacity: .92; }
}

/* ===== Background ===== */
html{
  background:
    radial-gradient(1200px 600px at 80% -20%, rgba(120, 97, 255, 0.25), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(0, 183, 255, 0.20), transparent 60%),
    linear-gradient(180deg, #0b0f16 0%, #0b0f16 100%);
  background-size: cover;
  background-attachment: fixed;
  /*animation: cyberPulse 12s ease-in-out infinite;*/
}

@keyframes cyberPulse{
  0%, 100%{ filter: brightness(1); }
  50%{ filter: brightness(1.08); }
}

/* ===== App shell (fixed viewport) ===== */
.app-shell{
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* navbar/header nikdy nesmí shrinkovat */
.app-shell > *{ flex-shrink: 0; }

/* main je jediný flex child co roste */
.app-shell > main.app-main{
  flex: 1 1 auto;
  min-height: 0;

  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;

  /* prostor pro bottom nav */
  padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 12px);
  scroll-padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 16px);
}

/* ===== Main container (scroller) ===== */
.main-container{
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding: 24px 32px;
  background: none;
}

/* full-bleed varianta */
.main-container--full{
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
  /* bottom padding necháme kvůli nav */
}

/* responsive container padding */
@media (max-width: 768px){
  .main-container{
    max-width: 100%;
    padding: 16px;
  }
}
@media (max-width: 420px){
  .main-container{
    padding-left: 10px;
    padding-right: 10px;
    padding-top: 4px;
  }
}

/* ===== Helpers ===== */
.hidden{ display: none; }

/* efekts */
@keyframes shake{
  0%, 100%{ transform: translateX(0); }
  20%{ transform: translateX(-5px); }
  40%{ transform: translateX(5px); }
  60%{ transform: translateX(-5px); }
  80%{ transform: translateX(5px); }
}

/* ===== Flash messages ===== */
.flash-container{
  position: fixed;
  top: 80px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.flash-msg{
  padding: 14px 20px;
  border-radius: 10px;
  font-family: "texts";
  font-size: 15px;
  color: #eaf0ff;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 14px rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  gap: 14px;
  animation: fade-in 0.35s ease forwards;
  white-space: nowrap;
}

.flash-msg.success{
  background: rgba(30, 170, 255, 0.22);
  border-left: 4px solid #00eaff;
}
.flash-msg.error{
  background: rgba(255, 30, 30, 0.22);
  border-left: 4px solid #ff3737;
}

.flash-close{
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}
.flash-close:hover{ opacity: 1; }

@keyframes fade-in{
  from{ opacity: 0; transform: translateY(-10px); }
  to{ opacity: 1; transform: translateY(0); }
}

/* ===== Font ===== */
@font-face{
  font-family: "texts";
  src: url("/static/fonts/Roboto_Slab/RobotoSlab-VariableFont_wght.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

/* ===== Buttons (single source of truth) ===== */
.btn,
.btn-solid,
.btn-outline,
.btn-ghost,
.btn-danger{
  font-family: "texts";
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;

  padding: 12px 16px;
  border-radius: 12px;

  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  text-decoration: none;
  line-height: 1.1;

  transition:
    transform .15s ease,
    box-shadow .25s ease,
    background .25s ease,
    border-color .25s ease,
    color .25s ease,
    filter .25s ease,
    opacity .2s ease;
}

.btn:focus-visible,
.btn-solid:focus-visible,
.btn-outline:focus-visible,
.btn-ghost:focus-visible,
.btn-danger:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 234, 255, 0.25), 0 0 18px rgba(0, 234, 255, 0.18);
}

.btn[disabled],
.btn-solid[disabled],
.btn-outline[disabled],
.btn-ghost[disabled],
.btn-danger[disabled],
.btn.is-disabled,
.btn-solid.is-disabled,
.btn-outline.is-disabled,
.btn-ghost.is-disabled,
.btn-danger.is-disabled{
  opacity: .55;
  cursor: not-allowed;
  transform: none !important;
  filter: none !important;
  box-shadow: none !important;
}

/* SOLID */
.btn-solid{
  color: #0a0e16;
  background: linear-gradient(90deg, #7a6dff, #3fb8ff);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 0 18px rgba(120,97,255,.25);
}
.btn-solid:hover{ transform: translateY(-1px) scale(1.02); filter: brightness(1.06); }
.btn-solid:active{ transform: translateY(0px) scale(1.00); filter: brightness(1.02); }

/* OUTLINE */
.btn-outline{
  color: #bcd7ff;
  border: 1px solid rgba(140,160,255,.35);
  background: transparent;
}
.btn-outline:hover{
  border-color: rgba(190,210,255,.85);
  color: #eaf0ff;
}
.btn-outline:active{ transform: translateY(0px); }

/* GHOST */
.btn-ghost{
  color: #eaf0ff;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.04);
}
.btn-ghost:hover{
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,.30);
}
.btn-ghost:active{ transform: translateY(0px); }

/* DANGER */
.btn-danger{
  color: #ffb3b3;
  background: rgba(255, 40, 40, 0.18);
  border: 1px solid rgba(255, 80, 80, 0.70);
  box-shadow: 0 0 14px rgba(255, 80, 80, 0.15);
}
.btn-danger:hover{ transform: translateY(-1px); filter: brightness(1.06); }
.btn-danger:active{ transform: translateY(0px); }

.btn-xs{
  padding: 8px 10px;
  border-radius: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  font-size: 12px;
}

a.btn-solid, a.btn-outline, a.btn-ghost, a.btn-danger{ text-decoration: none; }

/* Tap highlight off */
a, button, [role="button"], .clickable{ -webkit-tap-highlight-color: transparent; }
*{ -webkit-tap-highlight-color: transparent; }
a, button, .card-clickable{
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.card-clickable, .card-clickable *{
  -webkit-user-select: none;
  user-select: none;
}

/* Pending */
.is-pending{ opacity: 0.75; cursor: wait !important; }
button.is-pending, input[type="submit"].is-pending{ pointer-events: none; }

/* Form elements inherit font */
button, input, textarea, select{ font: inherit; color: inherit; }

/* Basic margins */
h1,h2,h3,h4,h5,h6,p,ul,ol{ margin: 0; }
a{ color: inherit; text-decoration: none; }

/* ===== Page-managed scroll mode ===== */
body.page-scroll .app-shell > main.app-main{
  overflow: hidden !important;
  padding-bottom: 0 !important;
  scroll-padding-bottom: 0 !important;
}
/* ===== Scrollbar: DESKTOP ONLY ===== */
@media (hover: hover) and (pointer: fine){
  html{
    scrollbar-width: thin;
    scrollbar-color: #3fb8ff #0b0f16;
  }

  ::-webkit-scrollbar{ width: 10px; }
  ::-webkit-scrollbar-track{
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
  }
  ::-webkit-scrollbar-thumb{
    background: linear-gradient(180deg, #7a6dff, #3fb8ff);
    border-radius: 10px;
    box-shadow: 0 0 12px rgba(120,97,255,.35);
  }
  ::-webkit-scrollbar-thumb:hover{ filter: brightness(1.2); }
}

/* ===== Scrollbar: MOBILE HIDE ===== */
@media (hover: none) and (pointer: coarse){
  .app-shell > main.app-main{
    scrollbar-width: none; /* Firefox */
  }
  .app-shell > main.app-main::-webkit-scrollbar{
    width: 0;
    height: 0;
  }
}

body.sheet-open .app-shell > main.app-main{
  overflow: hidden !important;
}