/* Custom Menu Manager - Frontend CSS - PŘESNĚ PODLE VZORU */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Play', sans-serif;
}

body.menu-open {
    overflow: hidden;
}

/* Hlavní navigace */
.main-nav {
    background: transparent;
    position: sticky;
    top: 40px;
    z-index: 999;
    padding: 10px 0;
}

.topbar ~ .main-nav {
    top: 40px;
}

#topbar ~ .main-nav {
    top: 40px;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
    gap: 30px;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    z-index: 1001;
}

.logo img {
    max-height: 70px;
    height: auto;
    width: auto;
}

/* Menu wrapper */
.nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    justify-content: center;
}

/* Mobilní hlavička - skrytá na desktopu */
.mobile-menu-header {
    display: none;
}

/* Navigační seznam */
.nav-list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 3px;
    margin: 0;
    padding: 0;
    flex-shrink: 1;
}

.nav-list > li > a {
    text-decoration: none;
    color: #333;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 400;
    font-family: 'Play', sans-serif;
    transition: all 0.3s ease;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.nav-list > li > a .menu-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-list > li > a .menu-icon svg {
    display: block;
    flex-shrink: 0;
}

.nav-list > li > a .menu-text {
    display: inline;
    flex-shrink: 1;
}

/* Speciální styl pro neproklikávací odkazy */
.nav-list > li > a.no-link {
    cursor: default;
}

.nav-list > li > a.no-link:hover {
    background: transparent;
    color: #333;
}

/* Hover efekt pro proklikávací odkazy */
.nav-list > li > a:not(.no-link):hover {
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    color: white;
}

/* Hover pro dropdown položky s neproklikávacím rodičem */
.has-dropdown:hover > a.no-link {
    color: #764BA2;
}

/* Forum zvýraznění */
.forum-item .forum-link,
.forum-item .forum-item-link {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8787 100%);
    color: white !important;
    font-weight: 500;
    padding: 8px 14px;
}

.forum-item .forum-link .menu-icon svg,
.forum-item .forum-item-link .menu-icon svg {
    stroke: white;
    flex-shrink: 0;
}

.forum-item .forum-link:hover,
.forum-item .forum-item-link:hover {
    background: linear-gradient(135deg, #FF5252 0%, #FF6B6B 100%);
}

/* Kvízy zvýraznění */
.quiz-item .quiz-link,
.quiz-item .quiz-item-link {
    background: linear-gradient(135deg, #FFB74D 0%, #FF9800 100%);
    color: white !important;
    font-weight: 500;
    padding: 8px 14px;
}

.quiz-item .quiz-link .menu-icon svg,
.quiz-item .quiz-item-link .menu-icon svg {
    stroke: white;
    flex-shrink: 0;
}

.quiz-item .quiz-link:hover,
.quiz-item .quiz-item-link:hover {
    background: linear-gradient(135deg, #FFA726 0%, #FB8C00 100%);
}

/* Shop zvýraznění */
.shop-item .shop-link,
.shop-item .shop-item-link {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white !important;
    font-weight: 500;
    padding: 8px 14px;
}

.shop-item .shop-link .menu-icon svg,
.shop-item .shop-item-link .menu-icon svg {
    stroke: white;
    flex-shrink: 0;
}

.shop-item .shop-link:hover,
.shop-item .shop-item-link:hover {
    background: linear-gradient(135deg, #45a049 0%, #388E3C 100%);
}

/* Speciální zvýraznění */
.special-item .special-link,
.special-item .special-item-link {
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    color: white !important;
    font-weight: 500;
    padding: 8px 14px;
}

.special-item .special-link .menu-icon svg,
.special-item .special-item-link .menu-icon svg {
    stroke: white;
    flex-shrink: 0;
}

.special-item .special-link:hover,
.special-item .special-item-link:hover {
    background: linear-gradient(135deg, #5568D3 0%, #6A3D93 100%);
}

/* Badge count */
.badge-count {
    background: #FF5252;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 5px;
}

/* Dropdown */
.has-dropdown {
    position: relative;
}

.dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: white;
    min-width: 220px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 8px;
    margin-top: 10px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    list-style: none;
    z-index: 100;
}

.has-dropdown:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown li {
    list-style: none;
}

.dropdown li a {
    display: block;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.dropdown li a:hover {
    background: #f5f3ff;
    color: #764BA2;
    transform: translateX(5px);
}

/* Pravá část menu */
.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Vyhledávání */
.search-container {
    position: relative;
}

.search-toggle {
    background: none;
    border: none;
    color: #764BA2;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-text {
    display: none;
}

.search-toggle:hover {
    background: rgba(118, 75, 162, 0.1);
    transform: scale(1.1);
}

.search-form {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    background: white;
    border-radius: 35px;
    border: 2px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 4px;
    opacity: 0;
    visibility: hidden;
    width: 0;
    transition: all 0.3s ease;
    overflow: hidden;
}

.search-form.active {
    opacity: 1;
    visibility: visible;
    width: 350px;
}

.search-input {
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    flex: 1;
    outline: none;
    background: transparent;
}

.search-input:focus {
    outline: none;
}

.search-submit {
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    border: none;
    border-radius: 30px;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
    font-size: 14px;
}

.search-submit:hover {
    transform: scale(1.05);
}

/* Auth tlačítka */
.auth-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-login, .btn-register, .btn-dashboard {
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 400;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    position: relative;
    overflow: visible;
}

.btn-logout {
    background: transparent;
    border: 1px solid #e0e0e0;
    color: #999;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    text-decoration: none;
}

.btn-logout:hover {
    background: #fff;
    color: #FF5252;
    border-color: #FF5252;
}

.btn-logout svg {
    width: 16px;
    height: 16px;
}

.btn-logout::after {
    content: 'Odhlásit';
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.btn-logout:hover::after {
    opacity: 1;
}

.btn-logout-mobile {
    width: 100%;
    background: transparent;
    color: #999;
    border: 1px solid #e0e0e0;
    padding: 12px 20px;
    border-radius: 30px;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 14px;
}

.btn-logout-mobile:hover {
    background: #fff;
    color: #FF5252;
    border-color: #FF5252;
}

.btn-logout-mobile svg {
    width: 18px;
    height: 18px;
}

.btn-login, .btn-dashboard {
    background: rgba(255, 255, 255, 0.9);
    color: #764BA2;
    border: 2px solid transparent;
    background-image: linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9)),
                      linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    backdrop-filter: blur(10px);
}

.btn-login span, .btn-dashboard span {
    margin-left: 4px;
}

.btn-login:hover, .btn-dashboard:hover {
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    color: white;
}

.btn-dashboard {
    background-image: linear-gradient(rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.9)),
                      linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.btn-dashboard:hover {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.message-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #FF5252;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 7px;
    border-radius: 12px;
    min-width: 22px;
    text-align: center;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
}

.btn-register {
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    color: white;
    border: 2px solid transparent;
}

.btn-register::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 28px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.btn-register::after {
    content: 'Registrace';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #764BA2;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.btn-register:hover::before,
.btn-register:hover::after {
    opacity: 1;
}

.btn-register:hover span {
    opacity: 0;
}

.btn-register span {
    position: relative;
    z-index: 1;
    transition: opacity 0.3s ease;
}

/* Hamburger menu */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 999;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: #764BA2;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Mobile overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* Responzivní design pro střední obrazovky */
@media (max-width: 1400px) {
    .nav-container {
        max-width: 100%;
    }

    .nav-list > li > a {
        padding: 8px 10px;
        font-size: 13px;
    }

    .logo img {
        height: 60px;
    }
}

@media (max-width: 1280px) {
    .nav-container {
        gap: 20px;
    }

    .nav-menu {
        gap: 15px;
    }

    .nav-list {
        gap: 2px;
    }

    .nav-list > li > a {
        padding: 6px 8px;
        font-size: 13px;
    }


    .auth-buttons {
        gap: 5px;
    }

    .btn-login, .btn-register, .btn-dashboard {
        padding: 6px 12px;
        font-size: 12px;
    }

    .btn-login span, .btn-dashboard span {
        display: none;
    }

    .btn-logout {
        width: 30px;
        height: 30px;
    }

    .search-form.active {
        width: 300px;
    }
}

@media (max-width: 1100px) {
    .logo img {
        height: 50px;
    }

    .nav-list > li > a {
        padding: 6px 6px;
        font-size: 12px;
    }

    .dropdown {
        min-width: 200px;
    }

    .dropdown li a {
        font-size: 13px;
        padding: 8px 12px;
    }
}

/* Mobilní design */
@media (max-width: 1024px) {
    .main-nav {
        position: relative;
        top: 0;
        padding: 8px 0;
        background: transparent;
        backdrop-filter: none;
        box-shadow: none;
        overflow: visible;
    }

    body {
        padding-top: 0;
    }

    .nav-container {
        padding: 0 5px;
        min-height: 60px;
    }

    .logo img {
        height: 50px;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        max-width: none;
        height: 100vh;
        height: 100dvh;
        background: white;
        flex-direction: column;
        padding: 0;
        gap: 0;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        overflow-x: hidden;
        box-shadow: none;
        z-index: 9999;
        align-items: stretch;
        justify-content: flex-start;
    }

    .nav-menu.active {
        right: 0;
    }

    .mobile-menu-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 15px 20px;
        border-bottom: 1px solid #e0e0e0;
        background: white;
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .mobile-logo img {
        height: 40px;
        width: auto;
    }

    .mobile-menu-close {
        background: #f5f3ff;
        border: none;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .mobile-menu-close:hover {
        transform: rotate(90deg);
        background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    }

    .mobile-menu-close:hover svg {
        color: white;
    }

    .mobile-menu-close svg {
        color: #764BA2;
    }

    .nav-list {
        flex-direction: column;
        width: 100%;
        gap: 0;
        padding: 10px 0;
    }

    .nav-list > li {
        width: 100%;
    }

    .nav-list > li > a {
        width: 100%;
        padding: 14px 20px;
        font-size: 15px;
        justify-content: space-between;
        border-radius: 0;
    }

    .nav-list > li > a.no-link {
        cursor: pointer;
    }

    .forum-item .forum-link,
    .forum-item .forum-item-link,
    .quiz-item .quiz-link,
    .quiz-item .quiz-item-link,
    .shop-item .shop-link,
    .shop-item .shop-item-link {
        justify-content: flex-start !important;
    }

    .forum-item .forum-link .menu-text,
    .forum-item .forum-item-link .menu-text,
    .quiz-item .quiz-link .menu-text,
    .quiz-item .quiz-item-link .menu-text,
    .shop-item .shop-link .menu-text,
    .shop-item .shop-item-link .menu-text {
        margin-left: 0;
    }

    .forum-item .forum-link .menu-icon,
    .forum-item .forum-item-link .menu-icon,
    .quiz-item .quiz-link .menu-icon,
    .quiz-item .quiz-item-link .menu-icon,
    .shop-item .shop-link .menu-icon,
    .shop-item .shop-item-link .menu-icon {
        display: flex;
        align-items: center;
    }

    /* Dropdown */
    .dropdown {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: none !important;
        background: #f5f3ff;
        margin: 0 !important;
        width: 100% !important;
        border-radius: 0 !important;
        padding: 0 !important;
        list-style: none;
        display: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .has-dropdown.active .dropdown {
        display: block;
        max-height: 500px;
    }

    .dropdown li {
        opacity: 1 !important;
        transform: none !important;
    }

    .dropdown li a {
        padding: 12px 20px 12px 40px;
        border-radius: 0;
    }

    .nav-right {
        flex-direction: column;
        width: 100%;
        gap: 0;
        padding: 10px 0;
        border-top: 1px solid #e0e0e0;
    }

    .search-container {
        width: 100%;
        padding: 10px 20px;
    }

    .search-toggle {
        width: 100%;
        justify-content: flex-start;
        padding: 14px 16px;
        border-radius: 8px;
        background: #f5f3ff;
        gap: 10px;
    }

    .search-toggle.hidden {
        display: none;
    }

    .search-text {
        display: block;
    }

    .search-form {
        position: static;
        width: 100% !important;
        opacity: 0;
        visibility: hidden;
        height: 0;
        transform: none;
        margin: 0;
        transition: all 0.3s ease;
        border: 2px solid #e0e0e0;
    }

    .search-form.active {
        opacity: 1;
        visibility: visible;
        height: auto;
        margin-top: 10px;
    }

    .auth-buttons {
        width: 100%;
        flex-direction: column;
        gap: 10px;
        padding: 10px 20px 20px;
    }

    .btn-login, .btn-register, .btn-dashboard {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
        font-size: 14px;
    }

    .btn-logout-mobile {
        display: flex;
        width: 100%;
    }

    .btn-login span, .btn-dashboard span {
        display: inline;
        margin-left: 6px;
    }

    .btn-logout {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .logo img {
        height: 40px;
    }

    .nav-container {
        min-height: 50px;
    }

    .nav-menu {
        width: 100%;
        max-width: 100vw;
        right: -100vw;
    }

    .nav-menu.active {
        right: 0;
    }

    .mobile-logo img {
        height: 35px;
    }
}