/* headerstyle.css - NOVA, SAMOSTALNA VERZIJA */

.book-header {
  background-color: #ffffff;
  padding: 0 5%;
  border-bottom: 1px solid #e9ecef;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 70px;
  font-family: 'Space Grotesk', sans-serif;
}

.header-logo {
  flex-shrink: 0; /* Sprečava da se logo smanjuje */
  margin-right: 20px;
}

.header-logo a {
  font-weight: 700;
  font-size: 1.5rem;
  color: #212529;
  text-decoration: none;
}

/* Dugme za mobilni meni ("Hamburger") */
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1001; /* Uvek iznad ostalih elemenata u headeru */
}
.menu-toggle .bar {
  display: block; width: 25px; height: 3px;
  background-color: #212529;
  margin: 5px 0;
  transition: all 0.3s ease-in-out;
}
/* Animacija hamburgera u "X" */
.book-header.nav-open .menu-toggle .bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.book-header.nav-open .menu-toggle .bar:nth-child(2) {
  opacity: 0;
}
.book-header.nav-open .menu-toggle .bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Navigacija */
.bookshelf {
  flex-grow: 1; /* Dozvoljava navigaciji da zauzme dostupan prostor */
}
.bookshelf ul {
  display: flex;
  justify-content: flex-end; /* Poravnava linkove na desnu stranu */
  align-items: center;
  list-style: none; margin: 0; padding: 0;
  gap: 5px;
}

.book a {
  display: block; padding: 12px 16px;
  color: #333; text-decoration: none;
  font-weight: 500; border-radius: 8px;
  position: relative;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.book a:hover {
  background-color: #f1f3f5;
  color: #4a69ff;
}

/* Badge za poruke */
.badge {
  background-color: crimson; color: white;
  padding: 2px 7px; font-size: 12px;
  border-radius: 10px; margin-left: 4px;
  font-weight: bold; vertical-align: top;
}

/* Padajući meni */
.submenu { position: relative; }
.submenu .pages {
  display: block; position: absolute;
  top: 100%; right: 0; /* Poravnan sa desne strane */
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e9ecef;
  list-style: none; padding: 8px;
  width: 200px; margin-top: 10px;
  opacity: 0; visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease;
}
.submenu:hover .pages, .submenu:focus-within .pages {
  opacity: 1; visibility: visible;
  transform: translateY(0);
}
.submenu .pages li a { padding: 10px 14px; }

/* Responzivni stilovi za mobilne uređaje */
@media (max-width: 992px) {
  .menu-toggle { display: block; order: 2; } /* Hamburger je desno */
  .header-logo { order: 1; } /* Logo je levo */
  .bookshelf {
    order: 3; /* Navigacija ide na kraj */
    position: absolute; top: 100%; left: 0;
    width: 100%; background-color: #ffffff;
    border-top: 1px solid #e9ecef;
    max-height: 0; overflow-y: auto;
    transition: max-height 0.4s ease-in-out;
  }
  .book-header.nav-open .bookshelf { max-height: calc(100vh - 70px); }
  .bookshelf ul { flex-direction: column; align-items: flex-start; padding: 10px 0; }
  .book { width: 100%; }
  .book a { padding: 15px 20px; width: 100%; border-radius: 0; }
  
  .submenu .pages {
    position: static; width: 100%;
    box-shadow: none; border: none;
    border-top: 1px solid #e9ecef;
    border-radius: 0; padding: 10px 0 10px 20px;
    margin-top: 0; opacity: 1; visibility: visible;
    transform: none; max-height: 0;
    overflow: hidden; transition: max-height 0.3s ease;
  }
  .submenu.active-mobile .pages { max-height: 500px; }
  .submenu.active-mobile > a { background-color: #f1f3f5; color: #4a69ff; }
}