* {
  /*box-sizing: border-box;*/
}

html {
  scroll-behavior: smooth;
}


body {
  margin: 0;
  padding: 0;
  
  background-image: url("images/bg.jpg");
  background-repeat: no-repeat;
  /*background-position: center top;*/
  background-position: fixed center top;
  background-size: auto;
  background-attachment: scroll;
  background-color: #831518; /* fallback */

  /* Mobilni prikaz */
  @media (width < 767px) {
      background: url("images/bg_tall.jpg");
      background-size: 100% auto;
      background-repeat: no-repeat;
      background-color: #831518;
  }
}



.logo{
  position: absolute;
  top: 20px;
  left: 20px;
  /* Mobilni prikaz */
  @media (width < 767px) {
      top: 10px;
      left: 10px;
  }

}
.logo img{
  width: 20rem;
  @media (width < 767px)
  {
    max-width: 40%;
  }
}

.main-title{
  margin-top: 635px;
  margin-bottom: 50px;
  color: white;
  text-align: center;
  font-size: 2.5em;
  text-shadow: 2px 2px 2px black;
  /* Mobilni prikaz */
  @media (width < 767px) {
      margin-top: 420px;
      margin-bottom: 20px;
      font-size: 1.5em;
      text-shadow: 2px 2px 2px black;
  }
}

.down-arrow{
  width: 100px;
  margin: 25px auto;
  color: white;
  text-align: center;
  font-size: 2em;
  transform: scaleX(1.8);
  transform-origin: center;
  text-shadow: 2px 2px 2px black;
  /* Mobilni prikaz */
  @media (width < 767px) {
      width: 100px;
      margin: 12px auto;
      margin-bottom: 20px;
      color: white;
      text-align: center;
      font-size: 1em;
      transform: scaleX(1.8);
      transform-origin: center;
      text-shadow: 2px 2px 2px black;
  }
}


.down-arrow a, .down-arrow a:visited {
  text-decoration: none;
  color: white;
}

.posters-bg-wrapper {
  position: relative;
  height: 840px;
  width: calc(100% - 10rem);
  margin: 50px auto;
  overflow: hidden;
  background-color: rgba(139, 0, 0, 0.7);
  @media (width < 767px) {
      height: 300px;
      width: calc(100% - 5rem);
      margin: 20px auto;
  }
}

.rules-bg-wrapper {
  position: relative;
  height: 500px;
  width: calc(100% - 10rem);
  margin: 50px auto;
  overflow: hidden;
  background-color: rgba(139, 0, 0, 0.7); /* providna crvena */
  margin-bottom: 420px;
  /* Mobilni prikaz */
  @media (width < 767px) {
      height: 300px;
      width: calc(100% - 5rem);
      margin: 20px auto;
  }
}

/* 3. SCROLL DIV sa fade maskom */
.posters-list-fade-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;

  overflow-y: scroll;
  padding: 20px;

  /* FADE ka providnosti na dnu */
  -webkit-mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 85%, transparent 100%);
  mask-mode: match-source;
  mask-repeat: no-repeat;
  mask-size: 100% 100%;
}


/* 3. SCROLL DIV sa fade maskom */
.rules-text-fade-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;

  overflow-y: scroll;
  padding: 20px;

  /* FADE ka providnosti na dnu */
  -webkit-mask-image: linear-gradient(to bottom, black 75%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 75%, transparent 100%);
  mask-mode: match-source;
  mask-repeat: no-repeat;
  mask-size: 100% 100%;
}


.poster-list {
  margin-top: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: center;
  padding-bottom: 50px;
  /* Mobilni prikaz */
  @media (width < 767px) {
      margin-top: 10px;
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      justify-content: center;
  }
}

.rules-text {
  color: white;
  font-size: 2em;
  /* Mobilni prikaz */
  @media (width < 767px) {
    color: white;
    font-size: 1em;
    padding-bottom: 50px;
  }
}

.rules-text h1{
  text-align: center;
}

/* 5. STIL SLIKA POSTERA */
.poster {
  cursor: pointer;
  width: 12rem;
  box-shadow: 10px 10px 14px -4px rgba(0, 0, 0, 0.75);
  -webkit-box-shadow: 10px 10px 14px -4px rgba(0, 0, 0, 0.75);
  -moz-box-shadow: 10px 10px 14px -4px rgba(0, 0, 0, 0.75);
  /* Mobilni prikaz */
  @media (width < 767px) {
      width: 5rem;
      box-shadow: 5px 5px 7px -2px rgba(0, 0, 0, 0.75);
      -webkit-box-shadow: 5px 5px 7px -2px rgba(0, 0, 0, 0.75);
      -moz-box-shadow: 5px 5px 7px -2px rgba(0, 0, 0, 0.75);
  }
}

.poster:hover{
  outline: 2px solid #DA4145;
}


/* 🎨 Custom scrollbar za WebKit browsere (Chrome, Edge, Safari) */
.posters-list-fade-wrapper::-webkit-scrollbar {
  width: 8px;
}

.posters-list-fade-wrapper::-webkit-scrollbar-track {
  background: rgba(139, 0, 0, 0.1); /* svetlo crvena pozadina */
  border-radius: 4px;
}

.posters-list-fade-wrapper::-webkit-scrollbar-thumb {
  background: #B23636; /* tamna crvena */
  border-radius: 4px;
}

.posters-list-fade-wrapper::-webkit-scrollbar-thumb:hover {
  background: #b30000; /* svetlija na hover */
}

/* 🎨 Custom scrollbar za WebKit browsere (Chrome, Edge, Safari) */
.rules-text-fade-wrapper::-webkit-scrollbar {
  width: 8px;
}

.rules-text-fade-wrapper::-webkit-scrollbar-track {
  background: rgba(139, 0, 0, 0.1); /* svetlo crvena pozadina */
  border-radius: 4px;
}

.rules-text-fade-wrapper::-webkit-scrollbar-thumb {
  background: #B23636; /* tamna crvena */
  border-radius: 4px;
}

.rules-text-fade-wrapper::-webkit-scrollbar-thumb:hover {
  background: #b30000; /* svetlija na hover */
}

.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2;
}

.popup-content {
  position: absolute;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 20px;

  width: 50vw;
  max-width: 1200px;
  height: 500px;
  max-height: 500px;
  padding: 20px;

  background: white;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
  /*overflow: hidden;*/

  transform: scale(0);
  opacity: 0;
  transition: transform 0.6s ease, opacity 0.6s ease, top 0.6s ease, left 0.6s ease;

  background-image: url('images/popup-bg-w.jpg');
  background-repeat: no-repeat;
  background-position: center;       /* (opciono) da centriramo sliku */
  background-size: 100% 100%;
  @media (width < 767px) {
    background-image: url('images/popup-bg-t.jpg');
    background-size: cover;
    background-size: 103% 100%;
  }
}

.popup-content.show {
  transform: scale(1);
  opacity: 1;
}

.popup-left{
  display: flex;
  flex-direction: column;
}

.popup-content img {
  max-width: 300px;
  max-height: auto;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 4px;
  box-shadow: 0 0 10px black;
}

.popup-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  height: 100%;
  overflow: hidden;
}

.popup-title{
  text-align: center;
}

.popup-text {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-right: 10px;
}

.vote-button {
  margin-top: 10px;
  padding: 12px 20px;
  font-size: 16px;
  background: #831518;
  /*background: #007bff;*/
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  /*align-self: flex-end;*/
}

.btn-wide{
  display: block;
}

.btn-narrow{
  display: none;
}

.vote-button:hover {
  background: #895556;
}

.popup-description{
  width: 90%;
}

.popup-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 40px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  z-index: 10000;
  line-height: 0.6;
  background: rgba(150,120,50,0.7);
  border: 1px solid black;
  border-radius: 4px;
  color: #831518;
}

.popup-close-btn:hover {
  color: #000;
}

/* 🎯 Mobilna verzija */
@media (max-width: 767px) {
  .popup-content {
    flex-direction: column;
    align-items: center;
    width: 85vw;
    height: 90dvh;
    max-height: 90dvh;
  }

  h2{
    margin-top: 5px;
    margin-bottom: 5px;
  }

  .popup-body {
    width: 100%;
  }

  .popup-content img {
    max-width: 250px;
    margin-left: auto;
    margin-right: auto;
  }

  .popup-text {
    max-height: 400px;
    text-align: center;
  }

  .popup-description{
    padding-left: 10px;
    padding-right: 10px;
    max-height: 62%;
    overflow-x: auto;
  }

  .vote-button {
    align-self: center;
  }

  .btn-wide{
    display: none;
  }
  .btn-narrow{
    display: block;
  }
}

/* Klasa koja onemogućava skrolovanje */
.no-scroll {
    overflow: hidden;
    padding-right: var(--scrollbar-width);
}