/* 1. ZAJEDNIČKI STILOVI (Skraćuje ponavljanje koda) */
/* Stakleni filter za sve modal elemente */
.modal,
.modal .close,
#myFilm .modal-content,
#mySerija .modal-content,
.header2 .akcije a,
.header2 h3,
.kat-wrapper .korisnik button,
.kat-wrapper .range-container .range,
.kat-wrapper .range-container .ocjena {
  -webkit-backdrop-filter: blur(var(--glass-blur))
    saturate(var(--glass-saturation)) brightness(0.6) url(#glass-filter);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation))
    brightness(0.6) url(#glass-filter);
}

/* Standardna sjena modala i gumbića */
.modal,
.modal .close,
#myFilm .modal-content,
#mySerija .modal-content,
.header2 .akcije a,
.kat-wrapper .korisnik button {
  box-shadow: var(--sjena-blur2);
}

/* Kompleksna sjena i pozadina za ocjene i naslov */
.header2 h3,
.kat-wrapper .range-container .range,
.kat-wrapper .range-container .ocjena {
  box-shadow:
    inset 0 0 2px 1px rgba(255, 255, 255, 0.1),
    inset 0 0 10px 4px rgba(255, 255, 255, 0.05),
    0 4px 16px rgba(17, 17, 26, 0.2),
    0 8px 24px rgba(17, 17, 26, 0.2),
    0 16px 56px rgba(17, 17, 26, 0.2);
  background: rgba(3, 37, 106, 0.5); /* Za naslov se poslije overwrita */
}

/* Hover efekti za sve gumbe */
.modal .close:hover,
.header2 .akcije a:hover,
.kat-wrapper .korisnik button:hover {
  opacity: 0.5;
  cursor: pointer;
}

/* Okrugli gumbi (Zatvori i Akcije u headeru) */
.modal .close,
.header2 .akcije a {
  color: var(--bijela);
  background-color: var(--max);
  border-radius: 50%;
  font-size: 2rem;
  width: 50px;
  height: 50px;
  padding: 10px;
  font-weight: bold;
  transition: 0.3s;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 2. SPECIFIČNI STILOVI MODALA */
.modal {
  display: none;
  position: fixed;
  z-index: 1001;
  align-items: center;
  justify-content: center;
  inset: 0; /* Zamjenjuje top:0, left:0, width:100%, height:100% */
  overflow: hidden;
  animation: fadeInModal 0.4s ease-out forwards;
}

.modal-content {
  display: flex;
  flex-direction: column;
  background-color: var(--srednja);
  border-radius: 10px;
  width: 50%;
  max-height: 95vh;
  overflow-y: auto;
  animation: popUpContent 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  -ms-overflow-style: none; /* IE i Edge */
  scrollbar-width: none; /* Firefox */
}
.modal-content::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* Modal filma i serije */
#myFilm.modal,
#mySerija.modal {
  padding: 0;
  z-index: 1000;
}

#myFilm .modal-content,
#mySerija .modal-content {
  width: 95%;
  height: 95vh;
  margin: 0;
  padding: 5px;
  background: rgba(41, 54, 129, 0.65);
  border-radius: 15px;
}

/* Header modala */
.modal-content .header2 {
  padding: 200px 0;
  background: center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
  z-index: 0;
  border-radius: 15px;
}
.header2::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 15px;
}
.header2 .akcije {
  display: flex;
  width: 100%;
  padding: 10px;
  justify-content: space-between;
  align-items: center;
  position: absolute;
  top: 10px;
}
.header2 .akcije a img {
  width: 2rem;
  height: 2rem;
}
.header2 h3 {
  font-size: 2rem;
  color: var(--bijela);
  max-width: 95%;
  text-align: center;
  background: rgba(66, 116, 217, 0.5); /* Pregazi gornji zajednički bg */
  padding: 25px;
  border-radius: 25px;
  z-index: 2;
  position: relative;
}
/* Zajednički omotači (Wrapperi) */
.info-wrapper,
.kat-wrapper,
.imdb-wrapper,
.rotten-wrapper,
.kor-wrapper {
  display: flex;
  width: 95%;
  margin: 10px auto;
  border-top: 2px solid var(--bijela);
  border-bottom: 2px solid var(--bijela);
  border-radius: 15px;
}
/* Info blok */
.info-wrapper {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 15px;
}
.info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 33%;
  padding: 15px;
}
.info h4 {
  font-size: 1.4rem;
  color: var(--bijela);
  text-transform: uppercase;
}
.info p {
  font-size: 1.4rem;
  opacity: 0.6;
  color: var(--bijela);
}
/*-------------------*/
/*------IMDB--------*/
/*-----------------*/
.imdb-wrapper {
  min-height: 100px;
  background-image: url("../slike/imdb.jpg");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  position: relative;
  z-index: 0;
  overflow: hidden;
  align-items: center;
  justify-content: center;
}
.imdb-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgb(0, 0, 0); /* Boja je sada ovdje */
  opacity: 0.8; /* Željena prozirnost pozadine */
  z-index: -1; /* Gura pozadinu iza teksta */
}
.imdb-wrapper .ocjena {
  display: flex;
  flex-direction: row;
}
.imdb-wrapper h2 {
  font-size: 1.4rem;
  color: var(--bijela);
}
.imdb-wrapper p {
  font-size: 1.4rem;
  opacity: 0.65;
  color: var(--bijela);
}
/*-------------------*/
/*-----ROTTEN-------*/
/*-----------------*/
.rotten-wrapper {
  min-height: 100px;
  background-image: url("../slike/rotten.jpg");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  position: relative;
  z-index: 0;
  overflow: hidden;
  align-items: center;
  justify-content: center;
}
.rotten-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgb(0, 0, 0); /* Boja je sada ovdje */
  opacity: 0.8; /* Željena prozirnost pozadine */
  z-index: -1; /* Gura pozadinu iza teksta */
}
.rotten-wrapper .ocjena {
  width: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.rotten-wrapper .ocjena img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  margin-right: 5px;
}
.rotten-wrapper .ocjena p {
  font-size: 1.4rem;
  color: var(--bijela);
  font-weight: 700;
}
/*-------------------*/
/*-OCJENE KORISNIKA-*/
/*-----------------*/
.kor-wrapper {
  flex-direction: row;
  justify-content: space-between;
  gap: 10px;
}
.kor-wrapper .korisnik {
  width: 30%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px;
  text-align: center;
  gap: 15px;
}
.kor-wrapper .korisnik p {
  font-size: 1.6rem;
  opacity: 0.6;
  color: var(--bijela);
}
.kor-wrapper .ocjena {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
}
.kor-wrapper .korisnik h4 {
  font-size: 1.4rem;
  color: var(--bijela);
  text-transform: uppercase;
}
/*---SVE ANIMACIJE---*/
/*------------------*/
/* Postepeno pojavljivanje tamne staklene pozadine */
@keyframes fadeInModal {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
/* Lagano "iskakanje" kartice iz sredine ekrana */
@keyframes popUpContent {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
/* =========================================
   Klase za glatko ZATVARANJE modala
   ========================================= */
/* Animacija za zatvaranje pozadine */
@keyframes fadeOutModal {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
/* Animacija za zatvaranje kartice */
@keyframes popDownContent {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
}
/* Ove klase će JavaScript dodati kada klikneš na 'X' */
.modal.closing {
  animation: fadeOutModal 0.4s ease-in forwards;
}
.modal.closing .modal-content {
  animation: popDownContent 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
/*=============================================*/
/*=== TABLETI I MANJI LAPTOPI (do 768px) ===*/
/*=============================================*/
@media (max-width: 768px) {
  .filmovi,
  .serije {
    width: 90%;
    margin: 20px auto;
  }
  .filmovi header,
  .serije header {
    text-align: center;
    width: 80%;
    margin: 15px auto;
  }
  .filmovi header h2,
  .serije header h2 {
    font-size: 1.8rem;
    padding: 15px;
  }
  /*-------------------*/
  /*------IMDB--------*/
  /*-----------------*/
  .imdb-wrapper {
    min-height: 100px;
  }
  .imdb-wrapper h2 {
    font-size: 1.25rem;
  }
  .imdb-wrapper p {
    font-size: 1.25rem;
  }
  /*-------------------*/
  /*-----ROTTEN-------*/
  /*-----------------*/
  .rotten-wrapper {
    min-height: 100px;
  }
  .rotten-wrapper .ocjena {
    width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
  }
  .rotten-wrapper .ocjena img {
    width: 30px;
    height: 30px;
  }
  .rotten-wrapper .ocjena p {
    font-size: 1.25rem;
  }

  /*-- Modal (Nasljeđuje ostalo s desktopa) --*/
  #myFilm .modal-content,
  #mySerija .modal-content {
    width: 90%;
  }
  .modal-content .header2 {
    padding: 150px 0;
  }
  .header2 h3 {
    font-size: 1.6rem;
    padding: 20px;
  }

  .info {
    padding: 10px;
  }
  .info h4,
  .info p {
    font-size: 1.25rem;
  }
  /*-------------------*/
  /*-OCJENE KORISNIKA-*/
  /*-----------------*/
  .kor-wrapper {
    gap: 10px;
  }
  .kor-wrapper .korisnik {
    width: 30%;
    flex-direction: column;
    padding: 15px;
    gap: 15px;
  }
  .kor-wrapper .korisnik p {
    font-size: 1.25rem;
    opacity: 0.6;
    color: var(--bijela);
  }
  .kor-wrapper .ocjena {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: row;
  }
  .kor-wrapper .korisnik h4 {
    font-size: 1.25rem;
    color: var(--bijela);
    text-transform: uppercase;
  }
}
/*=============================================*/
/*=== MOBITELI (do 500px) ===*/
/*=============================================*/
@media (max-width: 500px) {
  .filmovi,
  .serije {
    width: 95%;
    margin: 15px auto;
  }
  .filmovi header,
  .serije header {
    width: 95%;
    margin: 10px auto;
  }
  .filmovi header h2,
  .serije header h2 {
    font-size: 1.4rem;
  }
  /*-------------------*/
  /*------IMDB--------*/
  /*-----------------*/
  .imdb-wrapper h2 {
    font-size: 1.2rem;
  }
  .imdb-wrapper p {
    font-size: 1.2rem;
  }
  /*-------------------*/
  /*-----ROTTEN-------*/
  /*-----------------*/
  .rotten-wrapper {
    min-height: 100px;
    flex-direction: column;
    padding: 10px 0;
  }
  .rotten-wrapper .ocjena {
    width: 100%;
  }
  .rotten-wrapper .ocjena img {
    width: 30px;
    height: 30px;
  }
  .rotten-wrapper .ocjena p {
    font-size: 1.2rem;
  }
 
  /*-- Modal --*/
  #myFilm .modal-content,
  #mySerija .modal-content {
    width: 95%;
  }
  .modal-content .header2 {
    padding: 100px 0;
  }
  .header2 h3 {
    font-size: 1.25rem;
    padding: 15px;
  }

  .info-wrapper {
    flex-direction: column;
  }
  .info {
    width: 100%;
  }
  .info h4,
  .info p {
    font-size: 1.1rem;
  }
  /*-------------------*/
  /*-OCJENE KORISNIKA-*/
  /*-----------------*/
  .kor-wrapper {
    gap: 10px;
    flex-direction: column;
  }
  .kor-wrapper .korisnik {
    width: 100%;
    flex-direction: column;
    padding: 15px;
    gap: 15px;
  }
  .kor-wrapper .korisnik p {
    font-size: 1.1rem;
  }
  .kor-wrapper .ocjena {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: row;
  }
  .kor-wrapper .korisnik h4 {
    font-size: 1.1rem;
  }
}
