/* Základní styly pro header */
header {
    width: 100%;
    position: fixed;
    z-index: 1000;
    height: 100px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, 
        rgba(30, 30, 35, 0.95) 0%, 
        rgba(40, 40, 45, 0.95) 50%,
        rgba(35, 35, 40, 0.95) 100%);
    padding: 0 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
header img{
    height: 80px;
    margin: 0;
    padding: 0;
}
header a {
    text-decoration: none;
    display: flex;
    flex-direction: row;
    align-self: center;
    align-items: center;  
}

header h1 {
    color: rgba(255, 255, 255, 0.95);
    margin-left: 0px;
    font-size: 1,5rem;
    letter-spacing: 2px;
    display: inline-block;
}

header ul {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
}

/* Stylování jednotlivých položek v menu */
header ul li {
    width: 170px;
    height: 50px;
    list-style-type: none;
    border: 3px solid rgba(255, 122, 32, 0.6);
    background-color: rgba(255, 122, 32, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px); 
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 30px;
    transition: border-color 0.3s ease, background-color 0.3s ease, transform 0.3s ease;
    position: relative;
    /* overflow: visible – motýl musí zůstat nahoře, neřežeme ho */
}

header ul li:hover {
    border-color: rgba(255, 122, 32, 1);
    background-color: rgba(255, 122, 32, 0.25);
    transform: translateY(-2px);
    animation: navbarGlow 2s ease-in-out infinite;
}

@keyframes navbarGlow {
    0%, 100% {
        box-shadow: 
            0 0 12px rgba(255, 122, 32, 0.5),
            0 0 20px rgba(255, 122, 32, 0.3),
            0 0 28px rgba(16, 185, 129, 0.2);
    }
    50% {
        box-shadow: 
            0 0 18px rgba(255, 122, 32, 0.7),
            0 0 28px rgba(255, 122, 32, 0.45),
            0 0 38px rgba(16, 185, 129, 0.35);
    }
}

header ul li a, header ul li button {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.5rem;
    text-align: center;
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
    z-index: 2;
    transition: color 0.3s ease;
}

header ul li:hover a,
header ul li:hover button {
    color: rgba(255, 255, 255, 1);
    background-color: rgba(255, 122, 32, 0.3);
}

/* Aktivní položka menu – stejný glow jako hover, motýl zůstává nad tím */
.active-menu {
    border-color: rgba(255, 122, 32, 1) !important;
    background-color: rgba(255, 122, 32, 0.25) !important;
    animation: navbarGlow 2s ease-in-out infinite;
}

/* Stylování pro mobilní zařízení */
    .menu-icon {
        display: none;
        font-size: 2rem;
        cursor: pointer;
        color: rgba(255, 255, 255, 0.95);
        margin-right: 20px;
    }
/* plynulé rolování */
html { scroll-behavior: smooth; }

/* ať se h3/sekce neschová pod fixed header (100px) */
.section, section[id] { scroll-margin-top: 110px; }

/* motýl – sedí nad odkazem */
/* 1) ukotvit motýla relativně k LI */
header ul li { position: relative; }             /* přidej */
header ul li a { position: static; }             /* nebo tohle nech být, hlavně ať není relative */






/* 2) motýl: místo bottom -> top */
/* ať se motýl kotví k LI */
header ul li { position: relative; }

/* MOTÝL – vždy nahoře nad borderem a box-shadow, přistává na položce */
header ul li a .butterfly {
  position: absolute;
  top: -36px;                 /* doladíš +- pár px podle oka */
  left: 50%;
  transform: translate(-50%, 0);
  width: 62px;
  height: 62px;
  background: url('../img/butterfly_frame_4.png') center/contain no-repeat;
  opacity: 0;
  pointer-events: none;
  z-index: 100;               /* nad všemi hover/glow efekty a borderem */
}

/* Viditelný jen na aktivním – klidový stav */
header ul li.active-menu .butterfly.idle {
  opacity: 1;
  transform: translate(-50%, 0);
  background-image: url('../img/butterfly_frame_4.png');
}

/* „Přílet“ na novou položku */
header ul li a .butterfly.landing {
  animation: fly-in 1.3s forwards ease-out;
}

/* „Odlet“ ze staré položky */
header ul li a .butterfly.fly-out {
  animation: fly-out 0.7s forwards ease-in;
}

/* LET – tvoje pořadí snímků, scale = 1 */
@keyframes fly-in {
  0%   { opacity: 0;   transform: translate(-150%, -140%); background-image: url('../img/butterfly_frame_2.png'); }
  10%  { opacity: .15; transform: translate(-135%, -130%); background-image: url('../img/butterfly_frame_3.png'); }
  20%  { opacity: .30; transform: translate(-120%, -110%); background-image: url('../img/butterfly_frame_4.png'); }
  30%  { opacity: 1;   transform: translate(-105%, -90%);  background-image: url('../img/butterfly_frame_3.png'); }
  40%  { opacity: 1;   transform: translate(-85%,  -70%);  background-image: url('../img/butterfly_frame_2.png'); }
  50%  { opacity: 1;   transform: translate(-65%,  -50%);  background-image: url('../img/butterfly_frame_1.png'); }
  60%  { opacity: 1;   transform: translate(-45%,  -25%);  background-image: url('../img/butterfly_frame_2.png'); }
  80%  { opacity: 1;   transform: translate(-50%,  -10%);  background-image: url('../img/butterfly_frame_3.png'); }
  100% { opacity: 1;   transform: translate(-50%,  0%);    background-image: url('../img/butterfly_frame_4.png'); }
}

/* ODLET – opačný směr + vyhasnutí */
@keyframes fly-out {
  0%   { opacity: 1;   transform: translate(-50%, 0);      background-image: url('../img/butterfly_frame_4.png'); }
  20%  { opacity: .9;  transform: translate(-40%, -15%);   background-image: url('../img/butterfly_frame_3.png'); }
  40%  { opacity: .7;  transform: translate(-20%, -35%);   background-image: url('../img/butterfly_frame_2.png'); }
  60%  { opacity: .45; transform: translate(-5%,  -60%);   background-image: url('../img/butterfly_frame_1.png'); }
  100% { opacity: 0;   transform: translate(30%, -120%);   background-image: url('../img/butterfly_frame_2.png'); }
}

/* just in case, ať nic neusekne obsah nad headerem */
header { overflow: visible; }










@media (max-width: 1860px) {
    header ul {
        position: absolute;
        top: 7vh;
        right: 0px;
        background: linear-gradient(135deg, 
            rgba(30, 30, 35, 0.98) 0%, 
            rgba(40, 40, 45, 0.98) 50%,
            rgba(35, 35, 40, 0.98) 100%);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px); 
        padding: 0;
        width: 100%;
        height: 93vh;
        z-index: 2000;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-100%);
        transition: transform 0.8s ease, opacity 0.8s ease, visibility 0.7s;
        flex-direction: column; /* Změna směru na sloupec */
    }

    header ul.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        width: 100%;
        margin-block-start: 0;
        margin-block-end: 0;
    }

    header .menu-icon {
        display: block;
        z-index: 4000;
    }

    header {
        padding: 0 10px;
    }

    header h1 {
        margin-left: 10px;
        font-size: 2rem;
        color: rgba(255, 255, 255, 0.95);
    }

    header ul li {
        margin: 15px 0;
        width: 80%;
        border-color: rgba(255, 122, 32, 0.6);
        background-color: rgba(255, 122, 32, 0.15);
        transition: all 0.3s ease;
    }
    
    header ul li:hover, header ul li:active {
        border-color: rgba(255, 122, 32, 0.9);
        background-color: rgba(255, 122, 32, 0.3);
    }
    
    header ul li a:hover, header ul li a:active,
    header ul li button:hover, header ul li button:active {
        color: rgba(255, 255, 255, 1);
        background-color: rgba(255, 122, 32, 0.3);
        border-radius: 10px;
    }
}
@media (min-width: 409px) and (max-width: 839px) {



    header {
        width: 100%;
        position: fixed;
        z-index: 1000;
        height: 70px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: linear-gradient(135deg, 
            rgba(30, 30, 35, 0.95) 0%, 
            rgba(40, 40, 45, 0.95) 50%,
            rgba(35, 35, 40, 0.95) 100%);
        padding: 0 0px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    header img{
        height: 50px;
        margin: 0;
        padding: 0;
        padding-left: 20px;
    }
    header a {
        text-decoration: none;
        display: flex;
        flex-direction: row;
        align-self: center;
        align-items: center;  
    }
    
    header h1 {
        color: rgba(255, 255, 255, 0.95);
        margin-left: 0px;
        font-size: 0.9rem;
        letter-spacing: 2px;
        display: inline-block;
    }



}
@media (min-width: 250px) and (max-width: 408px) {
    header h1 {
        color: rgba(255, 255, 255, 0.95);
        margin-left: 0px;
        font-size: 0.9rem;
        letter-spacing: 1px;
        display: inline-block;
        padding-right: 8px;
        max-width: 55vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Responzivita – hamburger menu položky (dotykové zóny) */
@media (max-width: 1860px) {
    header ul li {
        min-height: 48px;
        padding: 0px 0;
    }
}