/**
 * DS Dokumentacija - Stilovi
 * Version: 1.2.0
 */

/* ===== WRAPPER ===== */
.ds-dok-tabs-wrapper {
    width: 100%;
    position: relative;
}

.ds-dok-tabs-wrapper * {
    box-sizing: border-box;
}

/* ===== NAVIGACIJA ===== */
.ds-dok-nav {
    display: flex !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    border: none !important;
    position: relative;
    flex-wrap: nowrap;
    gap: 0;
    margin-bottom: 6.2vw !important;
}

.ds-dok-tab-item {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
    display: inline-block;
}



/* ===== TAB LINKOVI ===== */
.ds-dok-tab-link {
    background: none !important;
    border: none !important;
    padding: 10px 30px 20px 30px !important;
    font-size: 20px;
    font-family: "Barlow", sans-serif;
    letter-spacing: 0.3px;
    cursor: pointer;
    position: relative !important;
    transition: color 0.35s ease !important; /* maknut scale transition */
    color: #000 !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    text-decoration: none !important;
    line-height: 1.2 !important;
    outline: none !important;
}

.ds-dok-tab-item:first-child .ds-dok-tab-link {
    padding-left: 0 !important;
}

.ds-dok-tab-link:focus {
    outline: none !important;
}

/* ===== UNDERLINE BASE ===== */
.ds-dok-tab-link span {
    position: relative;
    display: inline-block;
}

.ds-dok-tab-link span::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #000;
    transform: scaleX(0);
    transform-origin: left center; /* animacija iz lijeva */
    transition: transform 0.3s ease-out;
}

/* ===== HOVER ===== */


/* ===== AKTIVNI TAB - Desktop ===== */
@media (min-width: 1000px) {
    .ds-dok-tab-link.active-tab {
        color: #000 !important;
        position: relative;
        padding-bottom: 18px !important;
    }

    .ds-dok-tab-link.active-tab span {
        position: relative;
        display: inline-block;
    }

    .ds-dok-tab-link.active-tab span::after {
        transform: scaleX(1); /* uvijek prikazano za active */
    }
}




/* ===== DROPDOWN ===== */
.dropdown-arrow {
    width: 16px !important;
    height: 16px !important;
    transition: transform 0.3s ease;
    margin-top: 2px;
}

.ds-dok-tab-item.dropdown-open .dropdown-arrow {
    transform: rotate(180deg);
}

.external-icon {
    width: 12px;
    height: 12px;
    margin-left: 4px;
}

.ds-dok-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-radius: 0px;
    min-width: 200px;
    max-width: 300px;
    z-index: 1000;
    padding: 0;
    margin-top: 0px;
    max-height: 400px;
    overflow-y: auto;
    margin-left: 22px;
}

.ds-dok-dropdown.active {
    display: block;
}

.ds-dok-dropdown .dropdown-item {
    display: block;
    padding: 10px 20px;
    color: #000;
    text-decoration: none;
    font-size: 14px;
    font-family: "Barlow", sans-serif;
    transition: background-color 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center !important;
}

/* ===== DROPDOWN WITH IMAGES ===== */
.ds-dok-dropdown.with-images {
    max-width: 350px;
}

.ds-dok-dropdown.with-images .dropdown-item {
    display: flex;
    align-items: center;
    padding: 8px 15px;
    text-align: left !important;
    white-space: normal;
}

.ds-dok-dropdown .dropdown-item-image {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    margin-right: 12px;
    overflow: hidden;
    border-radius: 4px;
    background: #f5f5f5;
}

.ds-dok-dropdown .dropdown-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ds-dok-dropdown .dropdown-item-title {
    flex: 1;
    min-width: 0;
}

.ds-dok-dropdown .dropdown-item:hover {
    background-color: #f5f5f5;
}

.ds-dok-dropdown .dropdown-item.active {
    background-color: #f0f0f0;
    font-weight: 600;
}

/* ===== FEATURED IMAGE STYLES ===== */
.ds-dok-featured-wrapper {
    margin-bottom: 30px;
}

.ds-dok-featured-wrapper.position-above {
    text-align: center;
}

.ds-dok-featured-wrapper.position-above .ds-dok-featured-image {
    max-width: 100%;
    height: auto;
    display: inline-block;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ds-dok-featured-wrapper.position-left,
.ds-dok-featured-wrapper.position-right {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.ds-dok-featured-wrapper.position-left .ds-dok-featured-image-col,
.ds-dok-featured-wrapper.position-right .ds-dok-featured-image-col {
    flex-shrink: 0;
    width: 300px;
}

.ds-dok-featured-wrapper.position-left .ds-dok-content-col,
.ds-dok-featured-wrapper.position-right .ds-dok-content-col {
    flex: 1;
    min-width: 0;
}

.ds-dok-featured-wrapper.position-left .ds-dok-featured-image,
.ds-dok-featured-wrapper.position-right .ds-dok-featured-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Mobile adjustments for featured images */
@media (max-width: 768px) {
    .ds-dok-featured-wrapper.position-left,
    .ds-dok-featured-wrapper.position-right {
        flex-direction: column;
    }

    .ds-dok-featured-wrapper.position-left .ds-dok-featured-image-col,
    .ds-dok-featured-wrapper.position-right .ds-dok-featured-image-col {
        width: 100%;
    }
}

/* ===== SADRŽAJ ===== */
.ds-dok-content {
    position: relative;
    width: 100%;
}

.ds-dok-panel {
    display: none;
    width: 100%;
}

.ds-dok-panel.active {
    display: block;
    animation: slideUpFast 0.15s ease-out;
}

.ds-dok-panel.no-animation {
    animation: none !important;
}

@keyframes slideUpFast {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== LOADING ===== */
.ds-dok-loading {
    padding: 40px;
    text-align: center;
    color: #999;
    font-size: 14px;
    font-family: "Barlow", sans-serif;
}

.ds-dok-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid #ddd;
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== DOCUMENT CONTENT ===== */
.ds-dok-doc-content {
    padding: 20px 0;
}

.ds-dok-doc-content > *:first-child {
    margin-top: 0;
}

.ds-dok-doc-content > *:last-child {
    margin-bottom: 0;
}

/* ============================================= */
/* RJEŠENJE 2: FLEX WRAP - DVA REDA            */
/* Raspon: 601px - 1410px širine ekrana        */
/* ============================================= */

/* GLAVNI MEDIA QUERY: 601px - 1410px */
@media (max-width: 1410px) and (min-width: 601px) {
    /* Enable flex wrap za navigaciju */
    .ds-dok-nav {
        display: flex !important;
        flex-wrap: wrap !important;
        row-gap: 15px !important;
        column-gap: 0 !important;
        margin-bottom: 3rem !important;
        align-items: flex-start !important;
        padding-left: 0 !important;
    }

    /* Tab items ne smiju se smanjivati */
    .ds-dok-tab-item {
        flex: 0 0 auto;
        display: flex;
        margin-bottom: 0 !important;
        margin-left: 0 !important;
    }

    /* Prilagodi padding za tab linkove - VAŽNO: bez lijevog paddinga! */
    .ds-dok-tab-link {
        padding: 10px 30px 20px 0 !important;
        white-space: nowrap;
        display: inline-flex !important;
        align-items: center;
    }

    /* ISPRAVKA: Svi tabovi počinju od istog mjesta */
    .ds-dok-tab-item .ds-dok-tab-link {
        padding-left: 0 !important;
    }

    /* Popravak za aktivni tab underline u wrap modu */
    .ds-dok-tab-link.active-tab {
        padding-bottom: 18px !important;
        position: relative;
    }

    .ds-dok-tab-link.active-tab span {
        position: relative;
        display: inline-block;
    }

    .ds-dok-tab-link.active-tab span::after {
        content: '';
        position: absolute;
        bottom: -10px;
        left: 0;
        right: 0;
        height: 2px;
        background-color: #000;
        width: 100%;
    }

    /* Hover efekt prilagođen za wrap layout */
    .ds-dok-tab-link:not(.active-tab):hover {
        transform: scale(1.05) !important;
    }
}

/* DODATNO FINO PODEŠAVANJE ZA UŽI RASPON */
/* Za ekrane 601px - 900px */
@media (max-width: 900px) and (min-width: 601px) {
    .ds-dok-tab-link {
        padding: 10px 20px 20px 0 !important;
        font-size: 16px !important;
    }

    /* Osigurava poravnanje */
    .ds-dok-tab-item .ds-dok-tab-link {
        padding-left: 0 !important;
    }
}

/* Za ekrane 601px - 750px - još kompaktniji */
@media (max-width: 750px) and (min-width: 601px) {
    .ds-dok-nav {
        row-gap: 12px !important;
    }

    .ds-dok-tab-link {
        padding: 8px 15px 18px 0 !important;
        font-size: 15px !important;
    }

    /* Osigurava poravnanje */
    .ds-dok-tab-item .ds-dok-tab-link {
        padding-left: 0 !important;
    }

    /* Dropdown arrow malo manja */
    .dropdown-arrow {
        width: 14px !important;
        height: 10px !important;
    }
}

/* ===== MOBILE (<600px) ===== */
@media (max-width: 600px) {
    .ds-dok-nav {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0 !important;
        margin-bottom: 30px !important;
    }

    .ds-dok-tab-item {
        margin-bottom: 0 !important;
    }

    .ds-dok-tab-link {
        width: 100% !important;
        text-align: left !important;
        padding: 15px !important;
        position: relative !important;
        transform: none !important;
        font-size: 16px !important;
    }

    .ds-dok-tab-item:first-child .ds-dok-tab-link {
        padding-left: 15px !important;
    }

    .ds-dok-tab-link:not(.active-tab):hover {
        transform: none !important;
    }

    .ds-dok-tab-link.active-tab {
        padding-left: 23px !important;
        font-weight: 700 !important;
    }

    .ds-dok-tab-link.active-tab::after {
        content: '' !important;
        position: absolute !important;
        width: 3px !important;
        height: 60% !important;
        background-color: #000 !important;
        left: 0 !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        display: block !important;
    }

    .ds-dok-dropdown {
        position: static !important;
        width: 60% !important;
        margin-left: 15px !important;
        margin-top: 10px !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        background: #f9f9f9 !important;
        transform: none !important;
        left: auto !important;
    }

    /* Mobile dropdown with images */
    .ds-dok-dropdown.with-images {
        width: 80% !important;
    }

    .ds-dok-dropdown .dropdown-item-image {
        width: 32px;
        height: 32px;
    }
}

/* ===== SALIENT KOMPATIBILNOST ===== */
.salient .ds-dok-tabs-wrapper .wpb_column:not([class*=vc_col-xs]) {
    margin-bottom: 0px;
}

.ds-dok-tabs-wrapper .wpb_row,
.ds-dok-tabs-wrapper .vc_row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.ds-dok-tabs-wrapper .row-bg-wrap {
    position: relative !important;
}

.ds-dok-tabs-wrapper [class*="nectar"] {
    position: relative;
}