/* Basic styling (responsive) */
body {font-family: Arial, sans-serif; margin:0; padding:0; background:#0f0f0f; color:#ddd}
header{background:#1f1f1f;color:#fff;padding:14px 10px;text-align:center}
.header-row{display:flex;align-items:center;justify-content:space-between;max-width:1100px;margin:0 auto}
.site-title{font-size:20px}
.controls{display:flex;gap:8px}
.control-btn{padding:8px 12px;border-radius:6px;border:none;cursor:pointer;background:#333;color:#fff}
.control-btn.active{background:#444}
.container{max-width:1100px;margin:18px auto;padding:18px;background:#171717;border-radius:10px;color:#fff}
.search-bar{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:12px;margin-bottom:18px}
.search-bar input[type="text"], .search-bar select {font-size:16px;padding:10px 12px;border-radius:8px;border:1px solid #333;background:#222;color:#fff}
.search-bar input[type="text"]{width:360px;min-width:220px}
.btn{font-size:16px;padding:10px 16px;border-radius:8px;border:none;cursor:pointer}
.apply-btn{background:#2ecc71;color:#042106}
.clear-btn{background:#e74c3c;color:#fff}
.card{width:160px;text-align:center;cursor:pointer;display:flex;flex-direction:column;align-items:center;background:#111;padding:8px;border-radius:8px}
.card img{width:100%;height:240px;object-fit:cover;border-radius:6px}
.card a{display:block;width:100%;color:inherit;text-decoration:none}
.card a:visited{color:inherit}
.card a:hover{text-decoration:none}

.detail-row{display:flex;gap:18px;margin-top:18px}
.detail-row img{width:200px;border-radius:8px}
.video-wrapper{position:relative;padding-bottom:56.25%;height:0;overflow:hidden;margin-top:18px;border-radius:10px;background:#000}
.video-wrapper iframe{position:absolute;width:100%;height:100%;border:none}
.scroll-row{display:flex;gap:12px;overflow-x:auto;padding:10px 0}
.hidden{display:none}
.player-dropdown, .season-episode-dropdown {display:flex;justify-content:center;align-items:center;gap:8px;margin:12px 0}
.player-dropdown label, .season-episode-dropdown label {color:#ddd}
.pagination{display:flex;gap:8px;justify-content:center;margin:12px 0}
.section-title{ text-align:center;margin-top:8px;color:#fff}
@media(max-width:720px){
  .detail-row{flex-direction:column;align-items:center}
  .card{width:130px}
  .detail-row img{width:160px}
  .search-bar input[type="text"]{width:100%}
}
label[for="playerSelect"] {
  font-size: 18px;       /* povećava tekst "Select Player:" */
  font-weight: 600;
  margin-right: 10px;
}
#playerSelect {
  font-size: 18px;       /* povećava veličinu teksta u dropdownu */
  padding: 10px 14px;    /* povećava visinu i širinu polja */
  border-radius: 8px;    /* zaobljeni rubovi */
  min-width: 220px;      /* širi dropdown */
}
#seasonSelect, #episodeSelect {
  font-size: 18px;
  padding: 10px 14px;
  border-radius: 8px;
  min-width: 180px;
}
.player-dropdown {
  text-align: center;           /* centriraj sve na sredinu */
  margin: 20px 0;
}

.player-dropdown label {
  font-size: 20px;              /* veći tekst za labelu */
  font-weight: 600;
  margin-right: 10px;
  color: #fff;                  /* bijela boja (ako imaš tamnu pozadinu) */
}

#moviePlayerSelect,
#seriesPlayerSelect {
  font-size: 18px;
  padding: 10px 14px;
  border-radius: 8px;
  min-width: 220px;
  background: #222;
  color: #fff;
  border: 1px solid #444;
}

#seasonSelect,
#episodeSelect {
  font-size: 18px;          /* usklađeno s player dropdownom */
  padding: 10px 14px;
  border-radius: 8px;
  min-width: 180px;
  background: #222;
  color: #fff;
  border: 1px solid #444;
}
/* Light mode (default) */
body {
    background: #f5f5f5;
    color: #222;
}
header {
    background: #fff;
    color: #222;
}
.container {
    background: #fff;
    color: #222;
}
.card {
    background: #eee;
    color: #222;
}
.search-bar input,
.search-bar select {
    background: #fff;
    color: #222;
    border: 1px solid #ccc;
}
#playerSelect, #seasonSelect, #episodeSelect {
    background: #fff;
    color: #222;
    border: 1px solid #ccc;
}
footer {
    background: #eee;
    color: #555;
}
/* Grid layout za popularne i search liste */
.grid {
    display: grid;
    grid-template-columns: repeat(6, 160px); /* 🔥 fiksno 6 kolona */
    gap: 14px;
    justify-content: center; /* centriraj cijeli grid */
}
/* Dark mode */
body.dark {
    background: #0a0a0a;
    color: #ddd;
}
body.dark header {
    background: #111;
    color: #fff;
}
body.dark .container {
    background: #1a1a1a;
    color: #ddd;
}
body.dark .card {
    background: #111;
    color: #ddd;
}
body.dark .search-bar input,
body.dark .search-bar select {
    background: #222;
    color: #fff;
    border: 1px solid #444;
}
body.dark #playerSelect,
body.dark #seasonSelect,
body.dark #episodeSelect {
    background: #222;
    color: #fff;
    border: 1px solid #444;
}
body.dark footer {
    background: #111;
    color: #aaa;
}

@media (max-width: 1024px){
    .grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 600px){
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Grid kontejner za kartice */
.cards-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 0 auto;
}

/* Kartice */
.card {
    width: 160px;
    flex: 0 0 160px;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #eee;
    color: #222;
    padding: 8px;
    border-radius: 8px;
}

.card:hover {
    transform: scale(1.05);
}

/* Kartice slike */
.card img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: 6px;
}

/* Naslov kartice */
.card span {
    margin-top: 6px;
    font-weight: 500;
    font-size: 14px;
    color: #222;
}

/* Responsive - mobilni uređaji */
@media (max-width: 600px) {
    .card {
        width: 45%;            /* dvije kartice po redu */
        padding: 3px;
    }

    .card img {
        height: auto;
        aspect-ratio: 16/9;
    }
}

@media (max-width: 400px) {
    .card {
        width: 90%;            /* jedna kartica po redu */
    }
}
/* section title */
.section-title {
    text-align: center;
    margin-top: 8px;
    color: #222;  /* default light mode */
}

/* Dark mode */
body.dark .section-title {
    color: #fff;
}
/* Default light mode */
.player-dropdown label,
.season-episode-dropdown label {
    color: #222;   /* tamna boja za light mode */
}

/* Dark mode */
body.dark .player-dropdown label,
body.dark .season-episode-dropdown label {
    color: #fff;   /* bijela boja za dark mode */
}

/* Gumbi za odabir sekcije */
.control-btn {
    padding: 8px 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

/* Light mode */
body:not(.dark) .control-btn {
    background: #ddd;
    color: #222;
}
body:not(.dark) .control-btn:hover {
    background: #ccc;
}
body:not(.dark) .control-btn.active {
    background: #2ecc71; /* zelena boja aktivnog */
    color: #fff;
}

/* Dark mode */
body.dark .control-btn {
    background: #333;
    color: #fff;
}
body.dark .control-btn:hover {
    background: #444;
}
body.dark .control-btn.active {
    background: #2ecc71; /* ista zelena aktivnog */
    color: #000;         /* bolji kontrast na dark */
}
.genre-title{
text-align:center;
margin:20px 0;
font-size:32px;
}

.movie-grid{
display:grid;
grid-template-columns:repeat(auto-fill,minmax(170px,1fr));
gap:20px;
padding:20px;
}

.movie-card{
text-align:center;
}

.movie-card img{
width:100%;
border-radius:10px;
transition:0.3s;
}

.movie-card img:hover{
transform:scale(1.05);
}

.movie-card span{
display:block;
margin-top:8px;
font-size:14px;
}

.pagination{
text-align:center;
margin:30px;
}

.pagination a{
padding:8px 14px;
margin:3px;
background:#222;
color:white;
border-radius:6px;
text-decoration:none;
}

.pagination a.active{
background:#e50914;
}
#seriesSection {
    margin-top: -20px;
}

/* Dark mode - naslovi filmova i serija */
body.dark .card span {
    color: #fff !important;
}

#movieYear a,
#seriesYear a {
    color: inherit;
    text-decoration: underline;
    font-weight: 600;
}

#movieYear a:hover,
#seriesYear a:hover {
    opacity: 0.8;
}

body.dark #movieGenres a,
body.dark #movieGenres a:visited {
    color: #fff !important;
}

/* =========================================
   MOVIE / TV DETAIL PAGE - MAIN CONTAINER
   ========================================= */

#app {
    width: min(1100px, calc(100% - 30px));
    max-width: 1100px;
    margin: 18px auto;
    padding: 18px;
    box-sizing: border-box;
    background: #171717;
    color: #fff;
    border-radius: 10px;
}

/* Movie / TV details */
#movieDetails,
#seriesDetails {
    width: 100%;
    box-sizing: border-box;
}

/* Poster + info */
.detail-row {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    width: 100%;
    min-width: 0;
    margin-top: 18px;
}

.detail-row > img {
    width: 200px;
    min-width: 200px;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
}

.detail-col {
    flex: 1;
    min-width: 0;
}

.detail-col h2 {
    margin-top: 0;
}

.detail-col p {
    line-height: 1.6;
    overflow-wrap: anywhere;
}

/* Player */
.player-dropdown {
    width: 100%;
    box-sizing: border-box;
}

.video-wrapper {
    width: 100%;
    max-width: 100%;
    position: relative;
    padding-bottom: 45%;
    height: 0;
    overflow: hidden;
    margin-top: 18px;
    border-radius: 10px;
    background: #000;
}

.video-wrapper iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Cast / Similar */
.scroll-row {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 0;
}

/* Don't let cards break the main container */
.scroll-row .card {
    flex: 0 0 160px;
}

/* Mobile */
@media (max-width: 720px) {

    #app {
        width: calc(100% - 20px);
        margin: 10px auto;
        padding: 12px;
        border-radius: 8px;
    }

    .detail-row {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .detail-row > img {
        width: 180px;
        min-width: 180px;
    }

    .detail-col {
        width: 100%;
        text-align: left;
    }

    .video-wrapper {
        margin-top: 12px;
    }

    .player-dropdown {
        flex-wrap: wrap;
    }
}

/* =========================================
   WIDER MOVIE / SERIES CONTAINER
   ========================================= */

#app {
    width: min(1600px, calc(100% - 40px));
    max-width: 1600px;
    margin: 18px auto;
    padding: 18px;
    box-sizing: border-box;
}

/* Movies + Series grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    justify-content: stretch;
    width: 100%;
}

/* Cards inside movie/series grid */
.grid .card {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* Poster */
.grid .card img {
    width: 100%;
    height: 240px;
    object-fit: cover;
}
