@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; }

.kb-page-wrap {
    font-family: 'Poppins', 'Segoe UI', sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
    color: #1a1a2e;
}

/* ── HERO ── */
.kb-hero {
    position: relative;
    border-radius: 20px;
    padding: 4rem 2rem 3rem;
    text-align: center;
    margin-top: 24px;
    margin-bottom: 2.5rem;
    overflow: visible;
    background-image: url('https://www.youtestme.com/wp-content/uploads/2026/04/Background-YouTestMe.webp');
    background-size: cover;
    background-position: center;
}
.kb-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(10,30,70,0.78) 0%, rgba(15,45,90,0.68) 100%);
    z-index: 0;
    border-radius: 20px;
    pointer-events: none;
}
.kb-hero-inner {
    position: relative;
    z-index: 1;
    overflow: visible;
}

.kb-hero-title {
    font-family: 'Poppins', sans-serif !important;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700 !important;
    color: #fff;
    margin: 0 0 10px;
    letter-spacing: -0.01em;
}
.kb-hero-subtitle {
    font-family: 'Poppins', sans-serif !important;
    font-weight: 400 !important;
    font-size: 1rem;
    color: rgba(255,255,255,0.75);
    margin: 0 0 2rem;
    line-height: 1.6;
}

/* ── SEARCH FORM ── */
.kb-search-form {
    display: flex !important;
    align-items: center !important;
    max-width: 640px !important;
    margin: 0 auto 1.5rem !important;
    background: #ffffff !important;
    border-radius: 12px !important;
    overflow: visible !important;   /* visible da dropdown izađe */
    box-shadow: 0 8px 40px rgba(0,0,0,0.25) !important;
    height: 58px !important;
    border: none !important;
    position: relative !important;
    z-index: 200 !important;
}

/* Vizuelni okvir search forme — odvojen od forme da overflow ne blokira dropdown */
.kb-search-form::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
    background: #fff;
    box-shadow: 0 8px 40px rgba(0,0,0,0.25);
}

/* Clip input elemenata unutar forme */
.kb-search-icon,
.kb-search-input,
.kb-search-select,
.kb-search-btn {
    overflow: hidden;
}

.kb-search-input {
    flex: 1 !important;
    border: none !important;
    outline: none !important;
    padding: 0 1rem !important;
    font-size: 15px !important;
    font-family: 'Poppins', sans-serif !important;
    font-weight: 400 !important;
    color: #1a1a2e !important;
    background: #ffffff !important;
    min-width: 0 !important;
    height: 58px !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}
.kb-search-input::placeholder { color: #b0b8c5 !important; font-size: 15px !important; }

.kb-search-icon {
    font-size: 20px !important;
    color: #9aa3b0 !important;
    padding: 0 16px !important;
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    pointer-events: none !important;
    height: 58px !important;
    border-right: 1px solid #eee !important;
    background: #fff !important;
    border-radius: 12px 0 0 12px !important;
    font-family: 'tabler-icons' !important;
}

.kb-search-select {
    border: none !important;
    border-left: 1px solid #eee !important;
    padding: 0 2.5rem 0 1rem !important;
    font-size: 14px !important;
    font-family: 'Poppins', sans-serif !important;
    font-weight: 400 !important;
    color: #555 !important;
    background-color: #f8f9fa !important;
    cursor: pointer !important;
    outline: none !important;
    height: 58px !important;
    flex-shrink: 0 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    min-width: 155px !important;
    max-width: 170px !important;
}

.kb-search-btn {
    background: #185FA5 !important;
    color: #fff !important;
    border: none !important;
    width: 58px !important;
    min-width: 58px !important;
    height: 58px !important;
    font-size: 20px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    transition: background 0.15s !important;
    padding: 0 !important;
    border-radius: 0 12px 12px 0 !important;
    font-family: 'tabler-icons' !important;
}
.kb-search-btn:hover { background: #0e4a84 !important; }

/* ── SEARCH DROPDOWN ── */
.kb-search-results {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    background: #ffffff !important;
    border-radius: 14px !important;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15), 0 4px 12px rgba(0,0,0,0.06) !important;
    border: 1px solid #e8edf2 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-height: 420px !important;
    z-index: 99999 !important;
    text-align: left !important;
    /* Isti border-radius kao search forma */
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
    border-bottom-left-radius: 14px !important;
    border-bottom-right-radius: 14px !important;
    margin-top: 0 !important;
    top: 100% !important;
}
.kb-search-results[hidden] { display: none !important; }

.kb-result-item {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 14px 20px !important;
    border-bottom: 1px solid #f0f2f5 !important;
    text-decoration: none !important;
    color: #1a1a2e !important;
    transition: background 0.1s !important;
}
.kb-result-item:last-child { border-bottom: none !important; }
.kb-result-item:hover { background: #f4f8fd !important; text-decoration: none !important; }

.kb-result-icon {
    width: 38px !important; height: 38px !important; min-width: 38px !important;
    border-radius: 9px !important; background: #E6F1FB !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    font-size: 18px !important; color: #185FA5 !important; flex-shrink: 0 !important;
}
.kb-result-content { flex: 1 !important; min-width: 0 !important; }
.kb-result-title { font-family: 'Poppins', sans-serif !important; font-size: 14px !important; font-weight: 600 !important; color: #1a1a2e !important; margin: 0 0 3px !important; display: block !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
.kb-result-cat { font-family: 'Poppins', sans-serif !important; font-size: 12px !important; color: #8a94a6 !important; font-weight: 400 !important; display: block !important; }
.kb-results-empty { padding: 20px !important; text-align: center !important; font-size: 14px !important; color: #8a94a6 !important; font-family: 'Poppins', sans-serif !important; }
.kb-results-loading { display: flex !important; align-items: center !important; justify-content: center !important; gap: 8px !important; padding: 20px !important; font-size: 14px !important; color: #8a94a6 !important; font-family: 'Poppins', sans-serif !important; }

/* ── POPULAR TAGS ── */
.kb-popular { display: flex; align-items: center; gap: 8px; justify-content: center; flex-wrap: wrap; }
.kb-popular-label { font-family: 'Poppins', sans-serif !important; font-weight: 400 !important; font-size: 13px; color: rgba(255,255,255,0.6); }
.kb-tag { font-family: 'Poppins', sans-serif !important; font-weight: 400 !important; background: rgba(255,255,255,0.15); color: #fff; font-size: 13px; padding: 5px 16px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.3); cursor: pointer; transition: background 0.15s; backdrop-filter: blur(4px); }
.kb-tag:hover { background: rgba(255,255,255,0.28); }

/* ── KATEGORIJE ── */
.kb-cats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 2rem; position: relative;  isolation: isolate; }
.kb-cat-card { background: #fff; border: 1.5px solid #e8edf2; border-radius: 14px; padding: 1.25rem 1rem 1rem; cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s; outline: none; text-align: left; }
.kb-cat-card:hover { border-color: #185FA5; box-shadow: 0 4px 20px rgba(24,95,165,0.1); transform: translateY(-2px); }
.kb-cat-card.active { border: 2px solid #185FA5; box-shadow: 0 4px 24px rgba(24,95,165,0.13); }
.kb-cat-icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 21px; margin-bottom: 12px; transition: transform 0.15s; }
.kb-cat-card:hover .kb-cat-icon { transform: scale(1.08); }
.kb-cat-name { font-family: 'Poppins', sans-serif !important; font-size: 14px; font-weight: 700 !important; color: #1a1a2e; margin: 0 0 5px; line-height: 1.3; }
.kb-cat-desc { font-family: 'Poppins', sans-serif !important; font-size: 12px; color: #6b7585; line-height: 1.45; margin: 0 0 10px; font-weight: 400 !important; }
.kb-cat-count { font-family: 'Poppins', sans-serif !important; font-size: 12px; color: #185FA5; font-weight: 600 !important; }

/* Ikone – zaštiti font */
[class^="ti-"], [class*=" ti-"], .ti { font-family: 'tabler-icons' !important; font-style: normal !important; }

/* ── ARTIKLI ── */
.kb-articles-section { background: #fff; border: 1.5px solid #e8edf2; border-radius: 16px; padding: 1.75rem; scroll-margin-top: 80px; position: relative; z-index: 1; }
.kb-section-label { font-family: 'Poppins', sans-serif !important; font-size: 11px; font-weight: 700 !important; color: #185FA5; letter-spacing: 0.09em; text-transform: uppercase; margin-bottom: 4px; }
.kb-section-title { font-family: 'Poppins', sans-serif !important; font-size: 1.3rem; font-weight: 700 !important; color: #1a1a2e; margin: 0 0 24px; }
.kb-section-desc { font-family: 'Poppins', sans-serif !important; font-size: 14px; color: #6b7585; margin: 0 0 1.25rem; line-height: 1.6; font-weight: 400 !important; }
.kb-articles-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

.kb-article-item { display: flex; align-items: center; gap: 13px; padding: 14px 16px; border: 1px solid #edf0f4; border-radius: 10px; background: #f8fafc; text-decoration: none; color: inherit; transition: border-color 0.15s, background 0.15s, transform 0.12s; animation: kb-fadein 0.2s ease forwards; }
.kb-article-item:hover { border-color: #185FA5; background: #f0f6fd; transform: translateX(3px); text-decoration: none; color: inherit; }
.kb-article-num { width: 32px; height: 32px; min-width: 32px; border-radius: 50%; background: #185FA5; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; font-family: 'Poppins', sans-serif !important; }
.kb-article-text { flex: 1; min-width: 0; }
.kb-article-text h4 { font-family: 'Poppins', sans-serif !important; font-size: 13px; font-weight: 600 !important; color: #1a1a2e; margin: 0 0 2px; }
.kb-article-text p { font-family: 'Poppins', sans-serif !important; font-size: 12px; color: #8a94a6; margin: 0; font-weight: 400 !important; }
.kb-article-arrow { font-size: 15px; color: #c5cdd8; flex-shrink: 0; transition: color 0.15s, transform 0.12s; }
.kb-article-item:hover .kb-article-arrow { color: #185FA5; transform: translateX(2px); }
.kb-no-results { font-family: 'Poppins', sans-serif !important; color: #8a94a6; font-size: 14px; padding: 1rem 0; }

/* Skeleton */
.kb-skeleton { display: flex; align-items: center; gap: 13px; padding: 14px 16px; border: 1px solid #edf0f4; border-radius: 10px; background: #f8fafc; }
.kb-skeleton-circle { width: 32px; height: 32px; min-width: 32px; border-radius: 50%; background: #e2e8f0; animation: kb-sh 0.8s ease-in-out infinite; }
.kb-skeleton-lines { flex: 1; }
.kb-skeleton-line { height: 10px; border-radius: 5px; background: #e2e8f0; margin-bottom: 6px; animation: kb-sh 0.8s ease-in-out infinite; }
.kb-skeleton-line:last-child { width: 55%; margin-bottom: 0; animation-delay: .15s; }

@keyframes kb-sh { 0%,100%{opacity:1} 50%{opacity:.4} }
@keyframes kb-fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) { .kb-cats { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 768px) {
    .kb-page-wrap { padding: 0 1rem 3rem; }
    .kb-hero { padding: 2.5rem 1.25rem 2.25rem; border-radius: 14px; }
    .kb-search-select { display: none !important; }
    .kb-cats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .kb-articles-grid { grid-template-columns: 1fr; }
    .kb-articles-section { padding: 1.25rem 1rem; }
}
@media (max-width: 480px) {
    .kb-hero-title { font-size: 1.6rem; }
    .kb-cats { grid-template-columns: repeat(2, 1fr); }
    .kb-search-form { max-width: 95% !important; }
}