
:root {
    --primary-color: #3b5998;
    --primary-hover: #2d4373;
    --bg-color: #f4f6f9;
    --surface-color: #ffffff;
    --text-main: #2c3e50;
    --text-muted: #4a5568; 
    --border-color: #e2e8f0;
    --success-color: #166534; 
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.08);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --z-overlay: 40;
    --z-menu: 50;
    --z-hamburger: 60;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body, h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd {
    margin: 0;
}

ul, ol {
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
}

h1, h2, h3, h4 {
    color: var(--text-main);
    font-weight: 600;
}


.container {
    display: flex;
    width: 100%;
    margin: 0 auto;
    position: relative;
}


.menu-container {
    width: 320px;
    flex-shrink: 0;
    padding: 40px 20px;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
    background: var(--surface-color);
    box-shadow: 2px 0 10px rgba(0,0,0,0.02);
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-menu li {
    list-style: none;
}

.nav-menu a {
    display: block;
    padding: 10px 16px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-menu a:hover {
    background-color: rgba(59, 89, 152, 0.08);
    color: var(--primary-color);
}

.nav-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--primary-color);
    transform: scaleY(0);
    transform-origin: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 4px 4px 0;
}

.nav-menu a.active-nav {
    background-color: rgba(59, 89, 152, 0.08);
    color: var(--primary-color);
}

.nav-menu a.active-nav::before {
    transform: scaleY(1);
}


.nav-menu ul {
    list-style: none;
    margin-left: 20px;
    margin-top: 5px;
    border-left: 2px solid var(--border-color);
    padding-left: 5px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-menu ul a {
    font-size: 0.95rem;
    padding: 8px 14px;
    color: var(--text-muted);
}

.nav-menu ul a.active-nav {
    color: var(--primary-color);
    font-weight: 600;
}


.content-area {
    flex-grow: 1;
    padding: 40px 60px;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.section-heading {
    scroll-margin-top: 40px;
    color: var(--text-main);
}

.level-1.main-title {
    font-size: 2.2rem;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    letter-spacing: -0.5px;
}

.level-2 {
    font-size: 1.6rem;
    margin-top: 50px;
    margin-bottom: 20px;
    color: #1e293b;
}

.level-3 {
    font-size: 1.3rem;
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--text-main);
    font-weight: 600;
}

.level-4 {
    font-size: 1.1rem;
    margin-top: 20px;
    margin-bottom: 10px;
    color: var(--text-muted);
}


.document-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 40px;
}

.document-list .list {
    background: var(--surface-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.document-list .list:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px rgba(0,0,0,0.06);
    border-color: #cbd5e1;
}

.document-list .list::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--primary-color);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.document-list .list:hover::before {
    opacity: 1;
}

.doc-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    padding-right: 50px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
}

.doc-link::before {
    content: "\f15b";
    font-family: "FontAwesome";
    margin-right: 15px;
    font-size: 1.2rem;
    color: var(--primary-color);
    opacity: 0.8;
}

.doc-title {
    flex: 1;
    min-width: 0;
    padding-right: 20px;
    line-height: 1.4;
}

.badge-container {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
    min-width: 200px; 
}

.badge {
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.badge-date {
    background-color: #f8fafc; 
    color: #64748b;
    border: 1px solid #e2e8f0;
    width: 110px; 
}

.badge-points {
    background-color: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(39, 174, 96, 0.2);
    width: 95px; 
    white-space: nowrap; 
}

.badge-hours {
    background-color: #eff6ff; 
    color: #3b82f6; 
    border: 1px solid #bfdbfe;
    width: 95px; 
    white-space: nowrap; 
}



.summary-list {
    list-style: none;
    margin-bottom: 12px;
}

.summary-list li {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.sati_po_kategoriji {
    background-color: #eff6ff;
    color: #3b82f6;
    border: 1px solid #bfdbfe;
}

.bodovi_po_kategoriji {
    background-color: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(39, 174, 96, 0.2);
}


.total-summary-cards {
    display: flex;
    gap: 20px;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid var(--border-color);
}

.total-card {
    background: var(--surface-color);
    color: var(--text-main);
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.total-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.total-label {
    font-size: 1rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.total-value {
    font-size: 3.5rem;
    font-weight: 700;
    margin-top: 5px;
    color: var(--primary-color);
}

.total-card:last-child .total-value {
    color: var(--success-color);
}


.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 45px;
    height: 45px;
    padding: 10px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: var(--z-hamburger);
    box-shadow: var(--shadow-sm);
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background-color: var(--text-main);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}
.hamburger.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.menu-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(3px);
    z-index: var(--z-overlay);
}

.menu-overlay.active {
    display: block;
}


.glow {
    position: relative;
    animation: textPulse 2.5s ease-out forwards;
}

.glow::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 3px;
    border-radius: 2px;
    background-color: #637BAD; 
    transform-origin: left;
    animation: lineSweep 2.5s ease-out forwards;
}

@keyframes textPulse {
    0% { color: #1e293b; }
    15% { color: #637BAD; }
    80% { color: #637BAD; }
    100% { color: #1e293b; }
}

@keyframes lineSweep {
    0% { transform: scaleX(0); opacity: 1; }
    15% { transform: scaleX(1); opacity: 1; }
    70% { transform: scaleX(1); opacity: 1; }
    100% { transform: scaleX(1); opacity: 0; }
}


.admin-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 55px;
    height: 55px;
    background: var(--surface-color);
    border-radius: 50%;
    color: var(--text-main);
    font-size: 20px;
    text-decoration: none;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.admin-login-btn:hover {
    transform: translateY(-5px);
    color: var(--primary-color);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}


.site-footer {
    margin-top: 60px;
    padding-top: 20px;
    text-align: right;
    border-top: 1px solid var(--border-color);
}


@media (max-width: 900px) {
    .container {
        flex-direction: column;
    }
    
    .hamburger {
        display: flex;
    }
    
    .menu-container {
        position: fixed;
        right: -320px;
        top: 0;
        width: 300px;
        padding-top: 80px;
        box-shadow: -5px 0 25px rgba(0,0,0,0.1);
        transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        z-index: var(--z-menu);
    }
    
    .menu-container.active {
        right: 0;
    }
    
    .content-area {
        padding: 25px 20px 40px; 
        width: 100%;
    }
    
    .level-1.main-title {
        font-size: 1.6rem;
        margin-bottom: 20px;
        padding-right: 50px; 
    }
    
    .admin-login-btn {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
    
    .total-summary-cards {
        flex-direction: column;
        margin-top: 30px; 
        padding-top: 20px; 
        gap: 15px; 
    }
    
    .total-card {
        padding: 20px; 
    }
    
    .site-footer {
        margin-top: 30px; 
        padding-top: 20px;
        text-align: center; 
    }
    
    
    .doc-link {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: 12px 15px; 
        padding: 16px;
        padding-right: 45px; 
    }
    
    .doc-link::before {
        grid-column: 1;
        grid-row: 1;
        margin-right: 0; 
        margin-top: 2px; 
    }
    
    .doc-title {
        grid-column: 2;
        grid-row: 1;
        padding-right: 0;
    }
    
    .badge-container {
        grid-column: 2;
        grid-row: 2;
        width: 100%;
        margin-top: 0;
        padding-left: 0; 
        justify-content: flex-start;
        min-width: 0;
    }
    
    .list::after {
        top: 26px; 
    }

    
    .nav-menu ul {
        margin-left: 8px; 
        padding-left: 8px;
        border-left: 1px solid var(--border-color); 
    }
    
    .nav-menu a {
        padding: 10px 10px; 
    }
}


.list::after {
    content: "\f058"; 
    font-family: "FontAwesome"; 
    font-size: 1.3rem;
    display: block;
    color: var(--primary-color); 
    position: absolute; 
    top: 50%; 
    right: 20px; 
    transform: translateY(-50%) scale(0.5);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.list.opened::after {
    transform: translateY(-50%) scale(1);
    opacity: 0.9;
}

/* =========================================
   PRINT OPTIMIZATION
   ========================================= */
@media print {
    /* Eco-friendly, crno-bijelo */
    body {
        background: white !important;
        color: black !important;
    }
    
    /* Sakrivanje svega što ne treba na papiru i kvačica */
    .hamburger, 
    .menu-container, 
    .menu-overlay,
    .site-footer,
    .total-summary-cards i,
    .admin-login-btn,
    .list::after {
        display: none !important;
    }
    
    /* Proširivanje na cijeli papir (A4) */
    .container {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .content-area {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Uklanjanje sjena i boja pozadine radi uštede tinte */
    .section-heading {
        font-size: 14px !important;
        margin: 0 !important;
    }
    
    .category-header {
        margin-top: 15px !important;
        margin-bottom: 5px !important;
    }
    
    .section {
        box-shadow: none !important;
        border: none !important;
        background: white !important;
        padding: 0 !important;
        margin-bottom: 15px !important;
    }
    
    .document-list {
        margin-bottom: 0 !important;
        gap: 0 !important;
    }
    
    .document-list .list {
        page-break-inside: avoid; /* Sprječava prelamanje jedne kartice preko dvije stranice */
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        background: white !important;
        margin-bottom: 4px !important;
        border-radius: 4px !important;
    }
    
    .document-list .list .doc-link {
        color: black !important;
        text-decoration: none !important;
        padding: 4px 8px !important; /* Kompresija visine */
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }
    
    .doc-link::before {
        display: none !important; /* Sakrij ikonu dokumenta za više prostora */
    }
    
    .doc-title {
        font-size: 11px !important;
        padding-right: 10px !important;
        line-height: 1.2 !important;
        flex: 1 !important;
    }
    
    .badge-container {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        min-width: auto !important;
        width: auto !important;
        gap: 5px !important;
        margin: 0 !important;
    }
    
    .badge {
        background: transparent !important;
        color: black !important;
        border: 1px solid #999 !important;
        font-size: 9px !important;
        padding: 2px 5px !important;
    }
    
    /* Zadrži sažetak na okupu u jednom kompaktnom redu */
    .total-summary-cards {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        gap: 40px !important;
        page-break-inside: avoid;
        border: 1px solid #000 !important;
        background: white !important;
        color: black !important;
        padding: 10px 20px !important;
        margin-top: 20px !important;
        border-radius: 4px !important;
    }
    
    .total-card {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 10px !important;
        border: none !important;
        padding: 0 !important;
    }
    
    .total-label {
        font-size: 12px !important;
        font-weight: bold !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        margin: 0 !important;
    }
    
    .total-value {
        font-size: 14px !important;
        font-weight: bold !important;
        margin: 0 !important;
    }
}

