/* ==========================================================================
   Header Styles
   ========================================================================== */

/**
 * Ta datoteka vsebuje stile za glavo (header) spletne strani.
 *
 * 1. Glavni kontejner za glavo
 * 2. Vsebina glave (logotip, navigacija) - POSODOBLJENO
 * 3. Gumbi in akcije v glavi (vključno z izbiro jezika)
 * 4. Stili za namizni "dropdown" meni
 * 5. Stili za mobilno glavo in "accordion" meni
 * 6. Stili za modalno okno za izbiro jezika na mobilnih napravah
 */

/* 1. Glavni kontejner za glavo */
.dropdown-header-navigation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: #FFFFFF;
    border-bottom: 1px solid #F2F4F7;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Header spans the full page width: logo + menus flush left, buttons +
   language flush right. Overrides the shared .container 1280px centering
   for the header only (page content elsewhere stays centered). */
.dropdown-header-navigation .container {
    max-width: none;
    padding: 0 40px;
}
@media (max-width: 768px) {
    .dropdown-header-navigation .container { padding: 0 20px; }
}
/* Desktop split: the right-wrapper fills the row so the menus sit next to the
   logo on the left, and the buttons + language get pushed to the far right. */
@media (min-width: 1025px) {
    .dropdown-header-navigation .header-right-wrapper { flex: 1; }
    .dropdown-header-navigation .header-right-wrapper > nav { margin-left: 40px; }
    .dropdown-header-navigation .navigation-actions { margin-left: auto; }
}

/* 2. Vsebina glave (logotip, navigacija) - POSODOBLJENO */
.logo-link .logo-img {
    height: 32px;
    width: auto;
    display: block; /* Za zanesljivo obnašanje */
}

/* Nov ovoj za desno stran glave */
.header-right-wrapper {
    display: flex;
    align-items: center;
    gap: 24px; /* Razmik med navigacijo in gumbi */
}

/* Osnovna struktura navigacije */
.navigation {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    height: 100%;
    width: 100%;
}

.navigation .menu-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

/* Povezave v glavnem meniju */
.navigation > .menu-item > a {
    text-decoration: none;
    color: #667085;
    font-weight: 600;
    font-size: 14px;
    padding: 0 16px; /* Prilagojen padding */
    height: 100%;
    display: flex;
    align-items: center;
    transition: color 0.2s ease-in-out;
    white-space: nowrap;
}

.navigation > .menu-item > a:hover {
    color: #101828;
}

/* Poudarjanje aktivne strani na namizju */
.navigation .menu-item.active-page > a {
    color: #2D738C;
}

/* Puščica za podmeni */
.navigation .menu-item-has-children > a::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 12px;
    transition: transform 0.3s ease-in-out;
    margin-left: 8px;
}

/* 3. Gumbi in akcije v glavi */
.navigation-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.language-selector {
    position: relative;
    cursor: pointer;
}

.current-lang {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #646E82;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease-in-out;
}
.current-lang:hover { background-color: #F9FAFB; }
.current-lang span { font-weight: 600; }
.current-lang .fa-chevron-down { transition: transform 0.3s ease-in-out; }

.lang-dropdown {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background-color: #FFFFFF;
    border: 1px solid #EAECF0;
    border-radius: 12px;
    box-shadow: 0 20px 24px -4px rgba(16,24,40,0.10), 0 8px 8px -4px rgba(16,24,40,0.04);
    padding: 8px;
    z-index: 1001;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}
.language-selector.active .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.language-selector.active .current-lang .fa-chevron-down { transform: rotate(180deg); }

.lang-dropdown a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: #344054;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    border-radius: 8px;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.lang-dropdown a:hover { background-color: #F5FAFB; }
.lang-dropdown a.is-current { background-color: #F0F6F8; color: #2D738C; }

/* Circular flags (vendored locally) used in the dropdown and the mobile modal */
.lang-flag {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 0 0 1px rgba(16,24,40,0.10);
}
.lang-flag-gb { background-image: url("../../images/flags/gb.svg"); }
.lang-flag-si { background-image: url("../../images/flags/si.svg"); }
.lang-flag-mk { background-image: url("../../images/flags/mk.svg"); }

/* 4. Stili za namizni "dropdown" meni */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    background-color: #FFFFFF;
    border: 1px solid #EAECF0;
    list-style: none;
    margin: 8px 0 0 0;
    padding: 8px;
    min-width: 260px;
    border-radius: 12px;
    box-shadow: 0 12px 24px -4px rgba(16, 24, 40, 0.08);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

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

.navigation .menu-item:hover > a::after {
    transform: rotate(180deg);
}

.dropdown-menu li { padding: 0; }

.dropdown-menu a {
    display: block;
    padding: 12px 16px;
    color: #344054;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    border-radius: 6px;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    white-space: nowrap;
}

.dropdown-menu a:hover {
    background-color: #F9FAFB;
    color: #2D738C;
}

.mobile-menu-icon, .mobile-nav-panel {
    display: none;
}


/* ==========================================================================
   5. Stili za mobilno glavo in "accordion" meni
   ========================================================================== */
@media (max-width: 1024px) {

    .dropdown-header-navigation {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.06);
        border-bottom: none;
        z-index: 1002;
    }
    
    /* Skrij nov ovoj za desno stran na mobilni napravi */
    .header-right-wrapper {
        display: none;
    }

    .mobile-menu-icon {
        display: block;
        font-size: 24px;
        color: #101828;
        cursor: pointer;
        z-index: 1003;
    }
    .mobile-menu-icon .fa-times { display: none; }
    
    html.nav-open .mobile-menu-icon .fa-bars { display: none; }
    html.nav-open .mobile-menu-icon .fa-times { display: block; }
    
    .mobile-nav-panel {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        height: calc(100vh - 60px);
        height: calc(100dvh - 60px); /* use the visible viewport so the bottom (language selector) is reachable */
        background: #FFFFFF;
        padding: 24px;
        box-sizing: border-box;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        z-index: 1001;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    html.nav-open .mobile-nav-panel {
        transform: translateX(0);
    }
    
    .mobile-nav-panel .navigation.mobile-nav {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0;
        padding-bottom: 24px;
        border-bottom: none;
    }

    .mobile-nav .menu-item {
        display: block;
        height: auto;
        border-bottom: 1px solid #EAECF0;
    }
    .mobile-nav .menu-item:first-of-type {
        border-top: 1px solid #EAECF0;
    }
    
    .mobile-nav .menu-item > a {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 16px;
        font-size: 20px;
        color: #101828;
        font-weight: 600;
        height: auto;
        box-sizing: border-box;
    }

    .mobile-nav .menu-item.active-page > a {
        color: #2D738C;
        font-weight: 700;
        border-left: 3px solid #2D738C;
        padding-left: 13px;
        background-color: transparent;
    }
    
    .mobile-nav .dropdown-menu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        border: none;
        background-color: transparent;
        width: 100%;
        min-width: auto;
        margin: 0;
        padding: 0 0 8px 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out;
    }

    .mobile-nav .menu-item.open > .dropdown-menu { max-height: 500px; }
    .mobile-nav .dropdown-menu ul { padding: 0; margin: 0; list-style: none; }
    .mobile-nav .dropdown-menu li { padding: 0; }

    .mobile-nav .dropdown-menu a {
        display: block;
        padding: 12px 16px 12px 45px;
        color: #344054;
        font-weight: 500;
        font-size: 18px;
        border-radius: 6px;
        white-space: normal;
    }
    .mobile-nav .dropdown-menu a:hover { background-color: #F9FAFB; }

    .mobile-nav .menu-item:hover > .dropdown-menu { opacity: 1; visibility: visible; transform: none; }
    .mobile-nav .menu-item:hover > a::after { transform: none; }
    html.nav-open .mobile-nav .menu-item.open > a::after { transform: rotate(180deg); }

    .mobile-nav-panel .navigation-actions {
        display: flex;
        flex-direction: column;
        gap: 16px;
        width: 100%;
        margin-top: 32px;
        padding-top: 32px;
        border-top: 1px solid #EAECF0;
    }

    .mobile-nav-panel .navigation-actions .btn {
        width: 100%;
        max-width: 340px;
        align-self: center;
    }
    
    .mobile-nav-panel .language-selector .current-lang {
        justify-content: center;
        width: 100%;
        max-width: 340px;
        margin: 0 auto;
        background-color: #F9FAFB;
        border: 1px solid #EAECF0;
        box-sizing: border-box;
    }

    .mobile-nav-panel .lang-dropdown { display: none; }
}

/* ==========================================================================
   6. Stili za modalno okno za izbiro jezika
   ========================================================================== */
#language-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(16, 24, 40, 0.6);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#language-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.language-modal-content {
    background-color: #FFFFFF;
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 12px 24px -4px rgba(16, 24, 40, 0.08);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

#language-modal-overlay.active .language-modal-content {
    transform: scale(1);
}

.language-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.language-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #101828;
}

#language-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #667085;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.language-modal-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.language-modal-body a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    text-decoration: none;
    font-size: 17px;
    font-weight: 600;
    color: #344054;
    background-color: #F9FAFB;
    border: 1px solid #EAECF0;
    border-radius: 10px;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.language-modal-body a:hover,
.language-modal-body a.is-current,
.language-modal-body a.active-lang {
    background-color: #FFFFFF;
    border-color: #2D738C;
    color: #2D738C;
}