<!DOCTYPE html>
<html lang="bs">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Slajder + Meni</title>

<style>
body {
    margin: 0;
    font-family: Arial, sans-serif;
}

/* ===== MENI ===== */
nav {
    background: #222;
    color: white;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav .menu {
    display: flex;
    gap: 15px;
}

nav a {
    color: white;
    text-decoration: none;
}

/* ===== SLIDER ===== */
.slider {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 30px auto;
    overflow: hidden;
}

.slides {
    display: flex;
    transition: transform 0.5s ease;
}

.slides img {
    width: 100%;
}

/* Dugmad */
.btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
}

.prev { left: 10px; }
.next { right: 10px; }

</style>
</head>

<body>

<!-- ===== MENI ===== -->
<nav>
    <div><b>Logo</b></div>
    <div class="menu">
        <a href="#">Početna</a>
        <a href="#">O nama</a>
        <a href="#">Kontakt</a>
    </div>
</nav>

<!-- ===== SLIDER ===== -->
<div class="slider">
    <div class="slides" id="slides">
        <img src="https://picsum.photos/800/300?1">
        <img src="https://picsum.photos/800/300?2">
        <img src="https://picsum.photos/800/300?3">
    </div>

    <button class="btn prev" onclick="prevSlide()">❮</button>
    <button class="btn next" onclick="nextSlide()">❯</button>
</div>

<script>
let index = 0;

function showSlide() {
    const slides = document.getElementById("slides");
    slides.style.transform = "translateX(" + (-index * 100) + "%)";
}

function nextSlide() {
    const total = document.querySelectorAll(".slides img").length;
    index = (index + 1) % total;
    showSlide();
}

function prevSlide() {
    const total = document.querySelectorAll(".slides img").length;
    index = (index - 1 + total) % total;
    showSlide();
}

/* Auto slide */
setInterval(nextSlide, 3000);
</script>

</body>
</html>