/* =========================
   PROMĚNNÉ
========================= */
:root {

    --topbar-background: linear-gradient(180deg,rgba(250, 241, 230, 1) 0%, rgba(250, 208, 162, 1) 100%);
    --topbar-expanded-height: 170px;
    --topbar-collapsed-height: 60px;
    --topbar-color: black;
    --column-width: 30px;
    --max-width: 1500px;
    --gap: 16px;
    --button-size: 100px;
    
    --page-background: linear-gradient(140deg,rgba(166, 224, 255, 1) 0%, rgba(0, 178, 255, 1) 100%);
    --page-border-width: 15px;
    --header-height: 130px;
    --header-height-minimalized: 30px;
    --border-width: 3px;
    
    --frame-progress: 0; /* 0 = nahoře, 1 = odscrollováno */
    --frame-gradient-size: 7px;
    --frame-black-size: 2px;
}

* {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: #5fb3f7 #eaf4ff;
}

/* ===== Chrome, Edge, Safari ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #eaf4ff;           /* velmi světle modré pozadí */
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(
        180deg,
        #9fd3ff,
        #5fb3f7
    );
    border-radius: 10px;
    border: 2px solid #eaf4ff;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(
        180deg,
        #7cc2ff,
        #3aa0f3
    );
}
head, body {
    margin: 0;
        font-family:
        system-ui,
        -apple-system,
        "Segoe UI",
        Roboto,
        "Helvetica Neue",
        Arial,
        sans-serif;
    font-size: 20px;
}

h1 {
    margin: 0;
    padding: 0;
    display: none;
}


.bordering {
    background: #ffffff;
    box-shadow: 
        inset 0 4px 10px rgba(0,0,0,0.3),
        inset 0 -4px 10px rgba(0,0,0,0.3),
        0 0 0 2px black;
    border-radius: 8px;
}


header {
    position: fixed;
    top: 20px; /* odsazení od horní hrany */
    left: 0;
    width: 100%;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-frame {
    position: relative;
    width: calc(100% - (var(--page-border-width) * 2) - (var(--border-width)*2));
    margin: 0 auto;
    border-radius: 10px;
}

.header-frame::before {
    content: "";
    position: absolute;
    inset: calc(-1 * var(--frame-gradient-size));
    background: var(--page-background);
    border-radius: 14px;
    opacity: var(--frame-progress);
    transform: scale(calc(0.95 + var(--frame-progress) * 0.05));
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
    z-index: -2;
}

.header-frame::after {
    content: "";
    position: absolute;
    inset: calc(
        -1 * (var(--frame-gradient-size) + var(--frame-black-size))
    );
    border: 2px solid black;
    border-radius: 16px;
    opacity: var(--frame-progress);
    transition: opacity 0.2s ease;
    z-index: -1;
}



.header-inner .logo {
    height: 100%;
    display: flex;
    align-items: center;
    margin-right: 50px;
}

.header-inner .logo img {
    height: 80%;
}

.header-inner  {
    width: 100%;
    height: var(--header-height);
    padding: 0 var(--page-border-width);
    display: flex;
    flex-direction: row;
    align-items: center;
    transition: height 0.2s ease;
}

.topmenu {
    height: 80%;
    display: flex;
    align-items: center;
    gap: 24px;
}

/* ITEM */
.topmenu .item {
    height: 100%;
}

/* CELÝ KLIKACÍ BLOK */
.topmenu .item a {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;

    font-size: 70%;
    font-weight: 600;
    color: #000;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.2;
    cursor: pointer;

    transform: translateY(
        calc(var(--frame-progress) * -4px)
    );
    transition: transform 0.2s ease;
}

/* IKONA */
.topmenu .icon {
    position: relative;
    height: calc(80% * (1 - var(--frame-progress)));
    aspect-ratio: 1 / 1;
    flex-shrink: 0;

    opacity: calc(1 - var(--frame-progress));
    transform: scale(calc(1 - var(--frame-progress) * 0.25));
    transition:
        height 0.2s ease,
        opacity 0.2s ease,
        transform 0.2s ease;
}

/* OBRÁZKY */
.topmenu .icon img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.15s ease;
}

.topmenu .icon img.active {
    opacity: 0;
}

/* HOVER – přepnutí obrázku */
.topmenu .item:hover .icon img.normal {
    opacity: 0;
}

.topmenu .item:hover .icon img.active {
    opacity: 1;
}

/* TEXT */
.topmenu .label {
    display: block;
}

/* při scrollu ikona zmizí, layout zůstane */
body.scrolled .topmenu .icon {
    pointer-events: none;
}

/* underline */
.topmenu .item:hover a {
    text-decoration: underline;
}

/* -------------------------
   USERBOX – přihlášený uživatel
------------------------- */
.userbox {
    width: 200px;
    margin-left: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: 70%;
    max-height: 100%;
}
.userbox .logined {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.2s ease;

    /* Efekt vnoření do pozadí */
    background: transparent;
    border: none;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.15);
    border-radius: 8px;
}

/* NADPIS – stále viditelný */
.userbox .logined h2 {
    margin: 0;
    font-size: 100%;
    font-weight: 600;
    color: #333;
    text-align: center;
}

/* SEZNAM ODKAZŮ – postupně mizí */
.userbox .logined ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;

    /* efekty pro scroll */
    opacity: calc(1 - var(--frame-progress));
    max-height: calc(100px * (1 - var(--frame-progress))); /* přibližná výška seznamu */
    overflow: hidden;
    transition: opacity 0.2s ease, max-height 0.2s ease;
}

/* ODKAZY */
.userbox .logined ul li a {
    display: block;
    padding: 4px 6px;
    text-decoration: none;
    color: #000;
    font-weight: 500;
    border-radius: 4px;
    transition: background 0.2s ease, color 0.2s ease;

    /* jemné pozadí */
    background-color: rgba(0, 120, 255, 0.08); /* světlá modrá průhledná */
}

.userbox .logined ul li a:hover {
    background-color: rgba(0, 120, 255, 0.18); /* trochu výraznější při hover */
    color: #000; /* nebo jiný kontrastní odstín, pokud chceš */
}

/* Pokud chceš, aby userbox celkově zmenšoval padding při scrollu */
body.scrolled .userbox .logined {
    padding: calc(8px * (1 - var(--frame-progress)));
}


.page {
    border: var(--border-width) solid black;
    min-height: 100vh; /* aby byl scroll */
    background: var(--page-background);
    padding: var(--page-border-width);
    margin: 0;          /* page začíná úplně nahoře */
}


/* -------------------------
   HLAVNÍ STRANA
------------------------- */

.content {
    margin-top: calc(var(--header-height) + var(--page-border-width)); /* výchozí odsazení: výška headeru + 20px */
    transition: margin-top 0.2s ease; /* plynulá změna při scrollu */
    display: flex;
    flex-direction: row;
}

/* =========================
   HLAVNÍ BOX
========================= */
.content-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Stránkování nahoře */
.pages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    font-size: 60%;
}

.pages a {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    text-decoration: none;
    color: #000;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
}

.pages a:hover {
    background-color: rgba(0,120,255,0.15);
    color: #0078ff;
}

.pages a.active {
    background-color: rgba(0,120,255,0.18);
    font-weight: 600;

    /* jemné vystoupení nad ostatní */
    box-shadow: 0 2px 4px rgba(0,0,0,0.2), 0 1px 0 rgba(255,255,255,0.6);
}

.pages .filter-button {
    background-color: rgba(0,120,255,0.08);
    font-weight: 600;
}

.pages .filter-button:hover {
    background-color: rgba(0,120,255,0.18);
}

/* Hlavní box */
.mainbox {
    padding: 16px;
    flex: 1;

    display: flex;          /* aktivuje flexbox */
    flex-direction: column; /* aby se obsah seřadil vertikálně */
    align-items: center;    /* horizontálně na střed */
    justify-content: flex-start; /* vertikálně nahoře */
}

.ajax-box {
    color: #666666;   /* šedá barva textu */
    font-style: italic; /* kurzíva */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 35%;
    
    border: 2px solid #ff4d4d; /* červený rámeček */
    background-color: #ffe6e6; /* světle červené pozadí */
    border-radius: 8px;         /* zaoblené rohy */
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); /* jemný stín */
}

.ajax-box > span {
    display: flex;
    text-align: center; 
}

.ajax-box li {
    text-align: left;
}

/* =========================
   PRAVÉ MENU
========================= */
.content-right {
    width: 250px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-left: 16px;
}

.content-right .fixed {
    position: fixed;
    width: 250px;
    top: calc(var(--header-height) + var(--page-border-width) + var(--page-border-width) + var(--border-width)); /* odsazení od headeru */
    right: calc(var(--page-border-width) + var(--border-width)); /* odsazení od pravého okraje containeru */
    max-height: calc(100vh - var(--header-height-minimalized) - var(--page-border-width));
    overflow-y: auto;
}

/* PRAVÉ MENU – NADPISY VYSTUPUJÍCÍ NAD POVRCH */
.content-right h2 {
    margin: 0 0 8px 0;
    font-size: 120%;
    font-weight: 600;
    color: #333;
    text-align: center;
    line-height: 1.2;

    /* box-shadow místo text-shadow pro vystoupení */
    padding: 4px 8px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2), 0 1px 0 rgba(255,255,255,0.6);
    background: transparent; /* žádné pozadí, jen stín */
}

/* PRAVÉ MENU – odkazy vyhloubené do webu */
.content-right .links ul li a,
.content-right .couriers ul li {
    display: block;
    padding: 6px 10px;
    border-radius: 6px;

    /* efekt vyhloubení (inset) */
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
    background: transparent;

    text-decoration: none;
    color: #000;
    font-weight: 500;
    transition: box-shadow 0.2s ease, color 0.2s ease;
}

.content-right .links ul li a:hover,
.content-right .couriers ul li:hover {
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.2);
    color: #0078ff;
}


/* Menu links */
.content-right .links ul,
.content-right .couriers ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.content-right .links ul li a,
.content-right .couriers ul li {
    display: block;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: #000;
    font-weight: 500;
    transition: all 0.2s ease;

    /* efekt vnoření do pozadí */
    background: transparent;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.15),
                inset 0 -2px 4px rgba(255,255,255,0.15);
}

/* hover efekty – mírně výraznější hloubka */
.content-right .links ul li a:hover,
.content-right .couriers ul li:hover {
    box-shadow: inset 0 4px 6px rgba(0,0,0,0.2),
                inset 0 -4px 6px rgba(255,255,255,0.2);
    color: #0078ff; /* nebo jiný kontrastní odstín */
}

/* Kurýři */
.content-right .couriers ul li {
    display: flex;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 6px;
    background-color: rgba(255,255,255,0.6);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
    font-size: 60%;
    font-weight: 500;
}

.content-right .couriers ul li span {
    display: inline-block;
}

/*
    ERROR BOX 
*/
#error-overlay {
  position: fixed;
  top:0; left:0; right:0; bottom:0;
  background: rgba(0,0,0,0.5);
  display:flex;
  justify-content:center;
  align-items:center;
  z-index:10000;
}
#error-box {
  background:white;
  padding:20px;
  border-radius:8px;
  max-width:400px;
  width:90%;
  text-align:center;
}
#error-box h2 {
  margin-top:0;
}
#error-box .actions {
  margin-top:20px;
  display:flex;
  justify-content:center;
  gap:10px;
}

/*
FILTRY POPUP
*/

/*
TLAČÍTKA NA PŘEHRÁVÁNÍ
*/

.btn-music {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background-color: #4caf50;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 60%;
  transition: background-color 0.2s;
}

.btn-music:hover {
  background-color: #45a049;
}

.btn-music span {
  pointer-events: none; /* aby kliknutí šlo jen na button */
}

/* OVERLAY */
.filter-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

/* POPUP */
.filter-popup {
    background: #fff;
    width: 420px;
    max-width: calc(100% - 24px);
    margin: 10vh auto;
    padding: 16px 18px;
    border-radius: 12px;
    
}

/* NADPIS */
.filter-popup h2 {
    margin: 0 0 12px;
    font-size: 120%;
}

/* FORM */
.filter-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-row label {
    flex: 1;
}

label.block {
    display: flex;
    flex-direction: column;
}

label.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

input, select {
    padding: 6px 8px;
    font-size: 100%;
}

/* TLAČÍTKA */
.actions {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}

.btn-primary {
    background: #0078ff;
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-secondary {
    background: #eee;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-filter {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    cursor: pointer;
}

