/* Dokumentis portal – custom styles */

:root {
    --primary:       #727cf5;
    --primary-dark:  #6559cc;
    --topbar-h:      56px;
    --mainnav-h:     48px;
    --sidebar-bg:    #313a46;
    --content-bg:    #f4f5f7;
}

body {
    font-family: "Nunito", sans-serif;
    background: var(--content-bg);
    color: #6c757d;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ─── Main nav (sve u jednom) ─── */
#main-nav {
    background: linear-gradient(90deg, #727cf5 0%, #6559cc 100%);
    min-height: 54px;
    z-index: 1030;
}

#main-nav .navbar-brand {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    margin-right: 1.5rem;
}

#main-nav .navbar-brand:hover { color: rgba(255,255,255,0.85); }

#main-nav .nav-link {
    color: rgba(255,255,255,0.85);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.55rem 0.9rem;
    transition: color 0.15s, background 0.15s;
    border-radius: 4px;
}

#main-nav .nav-link:hover,
#main-nav .nav-link.active,
#main-nav .nav-link.show {
    color: #fff;
    background: rgba(255,255,255,0.14);
}

#main-nav .navbar-toggler {
    border: none;
    color: #fff;
    font-size: 1.3rem;
    padding: 0.2rem 0.5rem;
}

/* ─── Prekidač pisma (ćirilica / latinica) ─── */
.script-switch {
    display: inline-flex;
    align-items: center;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 20px;
    padding: 2px;
    gap: 2px;
}

.script-switch-btn {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    border-radius: 16px;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.script-switch-btn:hover {
    color: #fff;
}

.script-switch-btn.active {
    background: rgba(255,255,255,0.9);
    color: var(--primary-dark);
}

#main-nav .btn-light {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.35);
    color: #fff;
}

#main-nav .btn-light:hover {
    background: rgba(255,255,255,0.28);
    color: #fff;
}

/* Dropdown */
#main-nav .dropdown-menu {
    border: none;
    border-radius: 0.375rem;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    margin-top: 0;
    min-width: 220px;
    animation: fadeInDown 0.15s ease;
}

#main-nav .dropdown-item {
    font-size: 0.85rem;
    padding: 0.45rem 1rem;
    color: #343a40;
    font-weight: 500;
}

#main-nav .dropdown-item:hover,
#main-nav .dropdown-item:focus {
    background: rgba(114,124,245,0.08);
    color: var(--primary);
}

#main-nav .dropdown-item.dropdown-toggle::after {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
}

/* Multi-level submenu */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .dropdown-menu.submenu {
    top: 0;
    left: 100%;
    margin-top: 0;
    margin-left: 1px;
}

.dropdown-submenu:hover > .dropdown-menu.submenu {
    display: block;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Portal content ─── */
#portal-content {
    flex: 1 0 auto;
}

.portal-page-header {
    border-bottom: 2px solid #eef0f7;
    padding-bottom: 0.75rem;
}

/* ─── Cards ─── */
.card {
    border: none;
    border-radius: 0.4rem;
    box-shadow: 0 1px 20px rgba(154,161,171,0.12);
    margin-bottom: 1.25rem;
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    padding: 0.7rem 1.25rem;
    font-weight: 700;
    font-size: 0.875rem;
    color: #343a40;
}

/* ─── Documents tree ─── */
.doc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.doc-item {
    padding: 0.6rem 1.1rem;
    border-bottom: 1px solid #f0f2f5;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.doc-item:last-child { border-bottom: none; }

.doc-item-icon {
    color: var(--primary);
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 3px;
}

.doc-item-body { flex-grow: 1; }

.doc-item-title {
    font-weight: 600;
    color: #343a40;
    font-size: 0.88rem;
}

.doc-item-desc {
    font-size: 0.78rem;
    color: #6c757d;
    margin: 0.15rem 0 0.3rem;
}

/* ─── Subcat cards (kategorija stranica) ─── */
.home-cat-card {
    border: 1px solid #eef0f7;
    border-radius: 0.4rem;
    transition: box-shadow 0.15s, border-color 0.15s, transform 0.12s;
    margin-bottom: 0;
}

.home-cat-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 18px rgba(114,124,245,0.15);
    transform: translateY(-2px);
}

/* ─── Breadcrumb ─── */
.page-title-box { padding-bottom: 0.75rem; margin-bottom: 1.25rem; }
.page-title-box h4 { font-size: 1.05rem; font-weight: 700; color: #343a40; margin: 0; }
.breadcrumb { background: transparent; padding: 0; margin: 0; font-size: 0.8rem; }

/* ─── Footer ─── */
.footer {
    flex-shrink: 0;
    border-top: 1px solid #e9ecef;
    background: #fff;
    padding: 8px 20px;
    font-size: 12px;
    color: #6c757d;
}

.footer-copy { display: inline-flex; align-items: center; gap: 2px; }

.footer a {
    color: #6c757d;
    text-decoration: none;
}
.footer a:hover { color: var(--primary); }

.go-top {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #f0f2f5;
    border-radius: 50%;
    font-size: 14px;
    transition: background 0.15s, color 0.15s;
}
.go-top:hover { background: var(--primary); color: #fff; }

/* ─── Javni layout (homepage) ─── */
body.public-layout {
    background: #f4f5f7;
}

.public-topbar {
    height: 56px;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    position: sticky;
    top: 0;
    z-index: 100;
}

.public-topbar .navbar-brand {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.public-content { flex: 1 0 auto; }

.public-hero {
    background: linear-gradient(135deg, #727cf5 0%, #6559cc 100%);
    min-height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1rem;
}

.public-hero-inner { max-width: 540px; }

.public-hero-logo {
    width: 68px;
    height: 68px;
    background: rgba(255,255,255,0.18);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    color: #fff;
    margin: 0 auto 1.2rem;
}

.public-hero-title  { font-size: 2rem; font-weight: 700; color: #fff; margin-bottom: 0.5rem; }
.public-hero-desc   { color: rgba(255,255,255,0.85); font-size: 0.95rem; line-height: 1.6; }

.public-feature-card {
    background: #fff;
    border-radius: 0.5rem;
    padding: 2rem 1.5rem;
    box-shadow: 0 2px 16px rgba(154,161,171,0.1);
    height: 100%;
}

/* ─── Javno stablo na homepageu ─── */
.public-tree-wrap { border-radius: 0.4rem; overflow: hidden; }

.public-tree-item  { border-bottom: 1px solid #f0f2f5; }
.public-tree-item:last-child { border-bottom: none; }

.public-tree-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.25rem;
    transition: background 0.1s;
}

.public-tree-row:hover { background: #f8f9fc; }

.depth-0 > .public-tree-row { padding-left: 1.25rem; background: #fafbff; font-weight: 700; color: #343a40; font-size: 0.9rem; }
.depth-1 > .public-tree-row { padding-left: 2.5rem; font-weight: 600; color: #495057; font-size: 0.865rem; }
.depth-2 > .public-tree-row { padding-left: 3.75rem; color: #6c757d; font-size: 0.84rem; }
.depth-3 > .public-tree-row { padding-left: 5rem; color: #868e96; font-size: 0.82rem; }

.public-tree-icon  { color: var(--primary); font-size: 0.95rem; flex-shrink: 0; }
.public-tree-lock  { font-size: 0.75rem; opacity: 0.35; }
.public-tree-children { border-top: 1px solid #f0f2f5; }

/* ─── Login dialog ─── */
.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--topbar-h) - var(--mainnav-h) - 60px);
    padding: 2rem 1rem;
}

.login-card {
    width: 100%;
    max-width: 380px;
}

.login-icon {
    font-size: 2.25rem;
    color: var(--primary);
}

/* ─── Responsive ─── */
@media (max-width: 991px) {
    #main-nav .dropdown-submenu > .dropdown-menu.submenu {
        left: 0;
        top: 100%;
        margin-left: 1rem;
    }
}
