/* ======================================== */
/* RESET I OSNOVNI STILOVI - po uzoru na stil1 */
/* ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1a1a1a; /* Tamna pozadina iz stil1 */
    color: #fff; /* Bijeli tekst iz stil1 */
    line-height: 1.6;
}

/* ======================================== */
/* HEADER - miks stil1 i stil2 */
/* ======================================== */
header {
    background-color: #2d2d2d; /* Tamno siva iz stil1 */
    border-bottom: 1px solid #444;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.header-top {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.logo img {
    max-height: 50px;
    width: auto;
}

/* ======================================== */
/* VERTIKALNI DROPDOWN IZBORNIK - iz stil2, ali prilagođen tamnoj temi */
/* ======================================== */
.vertical-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    background: #333; /* Tamnija pozadina za tamnu temu */
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.3s;
    min-width: 250px;
    border: 1px solid #555;
}

.dropdown-btn:hover {
    background: #444;
}

.dropdown-btn i:first-child {
    margin-right: 5px;
}

.dropdown-btn i:last-child {
    margin-left: auto;
    font-size: 0.8rem;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 280px;
    background: #2d2d2d; /* Tamna pozadina za dropdown */
    border-radius: 6px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    list-style: none;
    padding: 8px 0;
    margin-top: 5px;
    display: none;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #444;
}

.vertical-dropdown.active .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    padding: 0;
}

.dropdown-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    text-decoration: none;
    color: #e0e0e0; /* Svjetliji tekst za tamnu pozadinu */
    font-size: 0.95rem;
    transition: all 0.2s;
    gap: 10px;
    border-bottom: 1px solid #3a3a3a;
}

.dropdown-menu li:last-child a {
    border-bottom: none;
}

.dropdown-menu li a i {
    width: 20px;
    color: #888;
    font-size: 0.9rem;
}

.dropdown-menu li a:hover {
    background: #3a3a3a;
    color: #fff;
}

.dropdown-menu li a:hover i {
    color: #fff;
}

.dropdown-menu li a.active {
    background: #444;
    color: #fff;
    font-weight: 500;
    border-left: 3px solid #e74c3c; /* Crvena umjesto plave za tamnu temu */
}

.dropdown-menu li a.active i {
    color: #fff;
}

.dropdown-menu li.divider {
    height: 1px;
    background: #444;
    margin: 8px 0;
}

/* ======================================== */
/* GLAVNA NAVIGACIJA (ostali linkovi) - iz stil2, tamna verzija */
/* ======================================== */
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.main-nav ul li a {
    text-decoration: none;
    color: #e0e0e0; /* Svjetliji tekst */
    font-weight: 500;
    padding: 8px 12px;
    display: block;
    font-size: 14px;
    transition: all 0.3s;
    white-space: nowrap;
    border-radius: 4px;
}

.main-nav ul li a:hover {
    background-color: #444;
    color: #fff;
}

.mobile-menu-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px 12px;
    background: #333;
    color: white;
    border-radius: 4px;
    border: 1px solid #555;
}

/* ======================================== */
/* MAIN CONTENT - prilagođeno tamnoj temi */
/* ======================================== */
main {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    min-height: 500px;
}

.container h1 {
    margin-bottom: 30px;
    color: #fff;
    border-bottom: 2px solid #444;
    padding-bottom: 15px;
    font-size: clamp(1.5rem, 4vw, 2rem);
    word-wrap: break-word;
    text-transform: capitalize;
}

/* ======================================== */
/* GRID PRIKAZ DOKUMENATA - iz stil2, tamna verzija */
/* ======================================== */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 10px;
}

.document-card {
    background: #2d2d2d; /* Tamna pozadina za kartice */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #444;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.document-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.document-thumbnail {
    height: 180px;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #444;
    overflow: hidden;
}

.document-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.document-card:hover .document-thumbnail img {
    transform: scale(1.08);
}

.pdf-icon, .document-icon {
    font-size: 70px;
    color: #e74c3c; /* Crvena za PDF */
}

.document-icon {
    color: #888; /* Siva za ostale dokumente */
}

.document-info {
    padding: 18px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.document-info h3 {
    margin-bottom: 8px;
    color: #fff;
    font-size: clamp(1rem, 3.5vw, 1.2rem);
    word-wrap: break-word;
    line-height: 1.4;
}

.document-info p {
    color: #b0b0b0; /* Svjetlije siva za opis */
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 15px;
    flex-grow: 1;
    word-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.document-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.8rem;
    color: #888;
    flex-wrap: wrap;
}

.document-meta i {
    margin-right: 4px;
}

.document-actions {
    margin-top: auto;
}

.btn-view {
    display: inline-block;
    width: 100%;
    background: #e74c3c; /* Crvena umjesto plave */
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s;
    text-align: center;
    border: none;
    cursor: pointer;
}

.btn-view:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(231, 76, 60, 0.3);
}

.btn-view i {
    margin-right: 5px;
}

.no-documents {
    text-align: center;
    padding: 60px 20px;
    background: #2d2d2d;
    border-radius: 12px;
    color: #888;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ======================================== */
/* GALERIJSKI PRIKAZ - iz stil1 */
/* ======================================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    padding: 15px;
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    background-color: #2d2d2d;
    cursor: pointer;
    aspect-ratio: 1;
    border-radius: 4px;
    transition: transform 0.2s;
    border: 1px solid #444;
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    z-index: 10;
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Video indikator */
.video-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1;
    border: 1px solid #e74c3c;
}

/* ======================================== */
/* LIGHTBOX/VIEWER - iz stil1 */
/* ======================================== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 9999;
}

.lightbox.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-img-container {
    position: relative;
    width: 90%;
    height: 60%;
    max-width: 1200px;
    overflow: hidden;
    cursor: move;
}

.lightbox-img,
.lightbox-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.1s ease-out;
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox-video {
    cursor: default;
}

/* Video kontrole */
.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 10001;
}

.lightbox-img-container:hover .video-controls {
    opacity: 1;
}

.video-progress {
    width: 100%;
    height: 5px;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    border-radius: 3px;
    margin-bottom: 10px;
}

.video-progress-filled {
    width: 0%;
    height: 100%;
    background: #e74c3c; /* Crvena umjesto #ff0000 */
    border-radius: 3px;
    transition: width 0.1s;
}

.video-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.video-buttons button {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 3px;
    transition: background-color 0.3s;
}

.video-buttons button:hover {
    background-color: rgba(255,255,255,0.2);
}

.video-time {
    color: white;
    font-size: 14px;
    margin-left: auto;
}

/* Navigacijske strelice */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    font-size: 30px;
    padding: 15px 10px;
    cursor: pointer;
    z-index: 10000;
    transition: background-color 0.3s;
    border-radius: 4px;
}

.nav-arrow:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

.nav-arrow.prev {
    left: 10px;
}

.nav-arrow.next {
    right: 10px;
}

/* Zatvori dugme */
.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    font-size: 24px;
    padding: 8px 15px;
    cursor: pointer;
    z-index: 10000;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Info Bar sa opisom */
.info-bar {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.85);
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    z-index: 10000;
    max-width: 85%;
    min-width: 250px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.counter-container {
    font-weight: bold;
    color: #fff;
    font-size: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 5px;
}

.description-container {
    color: #e0e0e0;
    max-height: 100px;
    overflow-y: auto;
    padding: 5px 0;
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
}

.description-container p {
    margin: 0;
    word-wrap: break-word;
    padding: 0 5px;
}

/* Stil za skrolanje opisa */
.description-container::-webkit-scrollbar {
    width: 6px;
}

.description-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.description-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.description-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Kontrole uvećanja (samo za slike) */
.zoom-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 8px;
    border-radius: 4px;
    z-index: 10000;
    display: flex;
    gap: 5px;
}

.zoom-controls button {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    font-size: 18px;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.zoom-controls button:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

.zoom-controls button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.no-images {
    text-align: center;
    padding: 30px 15px;
    font-size: 16px;
    color: #888;
}

/* ======================================== */
/* PDF VIEWER - iz stil2, tamna verzija */
/* ======================================== */
.pdf-viewer-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 9999;
    display: none;
    padding: 30px;
}

.pdf-viewer-container.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.pdf-viewer {
    width: 100%;
    height: 90%;
    background: #2d2d2d;
    border: none;
    border-radius: 8px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.5);
}

.close-viewer {
    position: absolute;
    top: 15px;
    right: 30px;
    color: white;
    font-size: 50px;
    cursor: pointer;
    z-index: 10000;
    line-height: 1;
    transition: color 0.2s;
}

.close-viewer:hover {
    color: #e74c3c;
}

/* ======================================== */
/* FOOTER - iz stil2, tamna verzija */
/* ======================================== */
footer {
    background: linear-gradient(to bottom, #222, #111);
    color: #aaa;
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    border-top: 1px solid #333;
}

/* ======================================== */
/* RESPONZIVNI DIZAJN - kombinacija oba */
/* ======================================== */

/* Tablet (768px - 1024px) */
@media screen and (min-width: 768px) and (max-width: 1024px) {
    .documents-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
        padding: 20px;
    }
    
    .lightbox-img-container {
        height: 70%;
    }
    
    .nav-arrow {
        font-size: 35px;
        padding: 20px 15px;
    }
    
    .info-bar {
        max-width: 75%;
    }
}

/* Mobile (≤ 768px) */
@media screen and (max-width: 768px) {
    .header-top {
        padding: 12px 15px;
    }
    
    .main-nav {
        display: none; /* Sakrij ostale linkove na mobitelu */
    }
    
    .dropdown-btn {
        min-width: auto;
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .dropdown-btn span {
        display: none; /* Sakrij tekst na mobitelu, ostavi samo ikone */
    }
    
    .dropdown-btn i:first-child {
        margin-right: 0;
    }
    
    .documents-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .document-card {
        flex-direction: row;
        height: auto;
        max-height: 160px;
    }
    
    .document-thumbnail {
        width: 120px;
        height: 120px;
        border-bottom: none;
        border-right: 1px solid #444;
    }
    
    .pdf-icon, .document-icon {
        font-size: 40px;
    }
    
    .document-info {
        padding: 12px;
    }
    
    .document-info h3 {
        font-size: 1rem;
        margin-bottom: 5px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .document-info p {
        font-size: 0.8rem;
        -webkit-line-clamp: 2;
        margin-bottom: 8px;
    }
    
    .document-meta {
        font-size: 0.7rem;
        gap: 8px;
        margin-bottom: 8px;
    }
    
    .btn-view {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .container h1 {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
    
    .dropdown-menu {
        min-width: 250px;
        max-height: 350px;
    }
    
    /* Galerija na mobitelu */
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
        padding: 10px;
    }
    
    .lightbox-img-container {
        height: 50%;
    }
    
    .nav-arrow {
        font-size: 25px;
        padding: 10px 8px;
    }
    
    .nav-arrow.prev {
        left: 5px;
    }
    
    .nav-arrow.next {
        right: 5px;
    }
    
    .close-btn {
        top: 5px;
        right: 5px;
        font-size: 20px;
        padding: 5px 10px;
    }
    
    .info-bar {
        bottom: 5px;
        padding: 8px 12px;
        min-width: 200px;
    }
    
    .counter-container {
        font-size: 13px;
    }
    
    .description-container {
        max-height: 80px;
        font-size: 12px;
    }
    
    .zoom-controls {
        top: 5px;
        left: 5px;
        padding: 5px;
    }
    
    .zoom-controls button {
        font-size: 14px;
        padding: 4px 8px;
    }
    
    .pdf-viewer-container {
        padding: 15px;
    }
    
    .close-viewer {
        top: 10px;
        right: 20px;
        font-size: 40px;
    }
}

/* Mali mobiteli (≤ 480px) */
@media screen and (max-width: 480px) {
    .document-card {
        flex-direction: column;
        max-height: none;
    }
    
    .document-thumbnail {
        width: 100%;
        height: 150px;
        border-right: none;
        border-bottom: 1px solid #444;
    }
    
    .document-info p {
        -webkit-line-clamp: 3;
    }
    
    .document-meta {
        flex-direction: column;
        gap: 3px;
    }
    
    .dropdown-menu {
        min-width: 220px;
        right: 0;
        left: auto;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 5px;
    }
}

/* Desktop (≥ 992px) - dodatni stilovi za desktop */
@media screen and (min-width: 992px) {
    .documents-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 25px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
        padding: 30px;
    }
    
    .lightbox-img-container {
        height: 80%;
    }
    
    .info-bar {
        max-width: 60%;
    }
    
    .description-container {
        max-height: 150px;
    }
}

/* Veliki ekrani (≥ 1200px) */
@media screen and (min-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
    }
    
    .info-bar {
        max-width: 55%;
    }
}

/* ======================================== */
/* TOUCH-FRIENDLY POBOLJŠANJA - iz stil1 */
/* ======================================== */
@media (hover: none) and (pointer: coarse) {
    .gallery-item:hover {
        transform: none;
    }
    
    .gallery-item:active {
        transform: scale(0.98);
    }
    
    .nav-arrow,
    .close-btn,
    .zoom-controls button {
        min-height: 44px;
        min-width: 44px;
    }
    
    .description-container {
        -webkit-overflow-scrolling: touch;
    }
    
    .video-controls {
        opacity: 1;
        background: rgba(0,0,0,0.5);
    }
}