/* =================================================================== */
/* =            CODEBIN LTU - CUSTOM HEADER STYLE                      = */
/* =================================================================== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    margin: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgb(18 18 18 / 76%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column; /* Leidžia baneriui ir navigacijai gulti vienam po kito */
    transition: top 0.3s ease;
}

/* === GLOBALI PRANEŠIMŲ JUOSTA (BANNER) === */
.global-announcement-banner {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    background: linear-gradient(90deg, var(--accent-yellow), #d97706);
    color: #000;
    text-align: center;
    padding: 8px 50px 8px 25px; /* Rezervuojame vietą uždarymo mygtukui dešinėje */
    font-size: 0.9em;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.banner-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.global-announcement-banner i {
    font-size: 1.1em;
}

/* Banerio uždarymo mygtukas */
.close-banner-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #000000;
    opacity: 0.6;
    cursor: pointer;
    font-size: 1.1em;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-banner-btn:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

/* Modern announcement banner override */
.global-announcement-banner {
    position: static;
    width: 100%;
    max-height: 220px;
    box-sizing: border-box;
    color: var(--text-primary);
    text-align: left;
    padding: 0;
    font-size: 1rem;
    font-weight: 600;
    display: block;
    background:
            linear-gradient(135deg, rgba(253, 185, 19, 0.14), rgba(0, 106, 68, 0.08), rgba(193, 39, 45, 0.1)),
            rgba(18, 18, 18, 0.96);
    border-bottom: 1px solid rgba(253, 185, 19, 0.22);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.24);
    overflow: hidden;
    transition: opacity 0.22s ease, transform 0.22s ease, max-height 0.22s ease;
    will-change: max-height, opacity, transform;
}

.global-announcement-banner.is-hiding {
    max-height: 0;
    opacity: 0;
    transform: translateY(-8px);
}

.banner-shell {
    width: min(1240px, 100%);
    min-height: 54px;
    margin: 0 auto;
    padding: 8px clamp(14px, 2.2vw, 28px);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
}

.banner-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: linear-gradient(135deg, #FDB913 0%, #006A44 52%, #C1272D 100%);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
    flex-shrink: 0;
}

.banner-copy {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.banner-label {
    flex-shrink: 0;
    padding: 4px 8px;
    color: #111827;
    background: var(--accent-yellow);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 850;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 0;
}

.banner-text {
    min-width: 0;
    color: var(--text-primary);
    font-size: 0.94rem;
    font-weight: 650;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.global-announcement-banner .close-banner-btn {
    position: static;
    width: 38px;
    height: 38px;
    padding: 0;
    transform: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    opacity: 1;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.global-announcement-banner .close-banner-btn:hover,
.global-announcement-banner .close-banner-btn:focus-visible {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

html.light-theme .global-announcement-banner {
    color: var(--text-primary);
    background:
            linear-gradient(135deg, rgba(253, 185, 19, 0.18), rgba(0, 106, 68, 0.08), rgba(193, 39, 45, 0.08)),
            rgba(255, 255, 255, 0.98);
    border-bottom-color: rgba(17, 24, 39, 0.1);
    box-shadow: 0 12px 24px rgba(17, 24, 39, 0.08);
}

html.light-theme .global-announcement-banner .close-banner-btn {
    color: #4b5563;
    background: rgba(17, 24, 39, 0.05);
    border-color: rgba(17, 24, 39, 0.1);
}

html.light-theme .global-announcement-banner .close-banner-btn:hover,
html.light-theme .global-announcement-banner .close-banner-btn:focus-visible {
    color: #111827;
    background: rgba(17, 24, 39, 0.09);
}

/* Nested layout elements never receive the fixed-header offset. */
.container {
    padding-top: 0;
    box-sizing: border-box;
}

/* The fixed navigation offsets the document once; JS updates it for the announcement banner. */
html {
    scroll-padding-top: calc(var(--header-height, 70px) + 16px);
}

body {
    padding-top: var(--header-height, 70px) !important;
    overflow-x: clip;
}

@supports not (overflow: clip) {
    body {
        overflow-x: hidden;
    }
}

.navbar-content {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 clamp(16px, 2.2vw, 28px);
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: clamp(12px, 2vw, 30px);
    box-sizing: border-box;
}

/* === Logotipas === */
.navbar .logo {
    font-size: 1.6em;
    font-weight: 800;
    text-decoration: none;
    display: flex;
    align-items: center;
    letter-spacing: -0.5px;
}
.navbar .logo-main { color: var(--text-primary); }

/* === Desktop Navigacija === */
.desktop-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.desktop-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9em;
    padding: 8px 11px;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.desktop-nav a:hover, .desktop-nav .nav-main-link:hover {
    color: var(--text-primary);
    background-color: var(--bg-surface-hover);
}

/* === Išskleidžiamas Meniu (Dropdown) === */
.header-dropdown {
    position: relative;
    display: inline-block;
}

.header-dropdown .dropbtn {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
}

.desktop-nav .nav-platform-link {
    color: var(--text-secondary);
    font-weight: 600;
}

.desktop-nav .nav-platform-link > i:first-child {
    color: var(--accent-yellow);
}

.communication-dropdown .dropdown-chevron {
    margin-left: 1px;
    color: var(--text-secondary) !important;
    font-size: 0.68em;
}

.nav-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 12px;
    background: var(--accent-red);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
}

.nav-unread-badge[hidden],
.nav-unread-badge.is-empty,
[data-pwa-unread][hidden],
[data-pwa-count][hidden],
[data-pwa-mobile-count][hidden] {
    display: none !important;
}

.communication-menu {
    min-width: 188px;
}

.communication-menu a {
    justify-content: flex-start;
}

.communication-menu .dropdown-badge {
    margin-left: auto;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.5);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    padding: 8px 0;
    margin-top: 5px;
}

.header-dropdown:hover .dropdown-content,
.header-dropdown:focus-within .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-content a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-secondary);
    font-size: 0.9em;
    text-align: left;
    width: 100%;
}

.dropdown-content a i {
    width: 18px;
    text-align: center;
    color: var(--text-secondary);
}

.desktop-nav .communication-menu a i {
    color: var(--text-secondary);
}

.dropdown-content a:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}

.dropdown-content a:hover i {
    color: var(--accent-yellow);
}

/* === Dešinioji pusė (Profilis ir Įrankiai) === */
.navbar-auth {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    padding: 4px 4px 4px 15px;
    border-radius: 50px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    transition: 0.2s;
}

.header-user-profile:hover {
    background: rgba(255,255,255,0.07);
    border-color: rgba(255,255,255,0.1);
}

.user-greeting {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.user-greeting strong { color: var(--text-primary); }

/* Avataro stilizavimas */
.header-avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    overflow: hidden;
    background: #252525;
    border: 2px solid var(--accent-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
}

.header-avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lt-flag-bg {
    background: linear-gradient(to bottom, #FDB913 33.3%, #006A44 33.3%, #006A44 66.6%, #C1272D 66.6%);
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 5px;
}

.header-tools a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #999999;
    text-decoration: none;
    transition: 0.2s;
    font-size: 1.05em;
}

.header-tools a:hover {
    background: rgba(255,255,255,0.05);
    color: #ffffff;
}

.header-tools a.logout-btn:hover {
    color: #ff4d4d;
    background: rgba(255,77,77,0.1);
}

.header-tools .btn-notifications {
    position: relative;
}

.header-tools .btn-notifications .nav-unread-badge {
    position: absolute;
    top: -3px;
    right: -4px;
    min-width: 17px;
    text-align: center;
}

/* === Mobilus Mygtukas === */
.mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1.2em;
    cursor: pointer;
    padding: 0;
    transition: var(--transition);
}

.mobile-menu-toggle:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

/* === Mobilaus Meniu Overlay === */
.mobile-menu-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    background-color: rgba(8, 8, 10, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.mobile-menu-container.is-open {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

.mobile-menu-panel {
    width: min(440px, 100%);
    height: 100%;
    margin-left: auto;
    background: var(--bg-main);
    border-left: 1px solid var(--border-color);
    box-shadow: -24px 0 60px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.28s ease;
}

.mobile-menu-container.is-open .mobile-menu-panel {
    transform: translateX(0);
}

.mobile-menu-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.mobile-menu-logo {
    display: inline-flex;
    align-items: baseline;
    gap: 0;
    font-size: 1.25rem;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    text-decoration: none;
}

.mobile-menu-logo:hover {
    opacity: 1;
    text-decoration: none;
}

.mobile-menu-logo strong {
    background: linear-gradient(90deg, #FDB913, #006A44, #C1272D);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.mobile-menu-close {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 1.2em;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-close:hover {
    color: var(--text-primary);
    background: var(--bg-surface-hover);
    transform: none;
}

.mobile-menu-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    padding: 16px 18px 22px;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.mobile-menu-links hr {
    width: 100% !important;
    border: 0 !important;
    border-top: 1px solid var(--border-color) !important;
    margin: 8px 0 !important;
}

.mobile-menu-group-label {
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin: 6px 2px 0;
    text-transform: uppercase;
}

.mobile-menu-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1.25;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-surface);
    transition: 0.2s;
}

.mobile-menu-links a i {
    color: var(--text-secondary);
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.mobile-menu-links a:hover {
    color: var(--text-primary);
    background: var(--bg-surface-hover);
    border-color: rgba(255, 255, 255, 0.16);
    opacity: 1;
    text-decoration: none;
    transform: translateY(-1px);
}

.mobile-menu-links .mobile-academy-link i {
    color: var(--accent-yellow);
}

.mobile-menu-links .mobile-admin-link i {
    color: var(--accent-yellow);
}

.mobile-menu-links a[style*="--accent-red"],
.mobile-menu-links a[style*="accent-red"] {
    border-color: rgba(220, 53, 69, 0.35);
    background: rgba(220, 53, 69, 0.08);
}

.mobile-user-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-bottom: 8px;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: linear-gradient(135deg, var(--bg-surface), rgba(245, 158, 11, 0.08));
}

.mobile-user-info img, .mobile-user-info .mobile-initial {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 0;
    border: 2px solid var(--accent-purple);
    flex-shrink: 0;
}

.mobile-user-info .mobile-initial {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45em;
    color: white;
    font-weight: bold;
}

.mobile-user-text {
    min-width: 0;
}

.mobile-user-info h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-user-info span {
    color: var(--text-secondary);
    font-size: 0.86rem;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-btn {
    font-weight: 700;
    text-align: left;
    width: 100%;
    justify-content: center;
}

/* === Responsive taisyklės mobiliesiems įrenginiams === */
@media (max-width: 1024px) {
    .banner-shell {
        min-height: 58px;
        padding: 9px 15px;
    }

    .banner-copy {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .banner-label {
        font-size: 0.68rem;
    }

    .banner-text {
        font-size: 0.9rem;
        line-height: 1.38;
    }

    .user-greeting { display: none; }
    .desktop-nav { display: none; }
    .header-tools { display: none; }
    .header-user-profile { display: none; }
    .navbar-auth { display: none; }
    .navbar-auth .btn { display: none; }
    .mobile-menu-toggle {
        display: inline-flex;
        margin-left: auto;
    }
    .navbar-content { padding: 0 15px; }
    .navbar .logo { font-size: 1.45em; }
}

@media (min-width: 560px) and (max-width: 1024px) {
    .mobile-menu-panel {
        width: min(520px, 92vw);
    }

    .mobile-menu-links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .mobile-user-info,
    .mobile-menu-group-label,
    .mobile-menu-links hr {
        grid-column: 1 / -1;
    }
}

@media (max-width: 520px) {
    .banner-shell {
        grid-template-columns: minmax(0, 1fr) auto;
        min-height: 0;
        padding: 10px 12px;
        gap: 10px;
    }

    .banner-icon {
        display: none;
    }

    .banner-label {
        width: max-content;
        max-width: 100%;
    }

    .banner-text {
        font-size: 0.86rem;
    }

    .global-announcement-banner .close-banner-btn {
        width: 34px;
        height: 34px;
    }

    .mobile-menu-panel {
        width: 100%;
        border-left: 0;
    }

    .mobile-menu-top {
        padding: 14px 15px;
    }

    .mobile-menu-links {
        padding: 14px 15px 20px;
    }

    .mobile-menu-links a {
        min-height: 46px;
        font-size: 0.93rem;
    }
}