/* ==================== Global Styles ==================== */
.hide {
    display: none;
}
.card-fade-in {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.card-fade-in.show {
    opacity: 1;

}
.topRatedContainer>.topRated {
    min-height: 1414px;
}
body {
    background-color: var(--bs-gray-400);
}
body .text-secondary {
    color: #000;
    background: #6C757D;
    background: linear-gradient(to top, #6C757D 0%, #6C757D 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.bi:before {
    content: "";
    min-width: 16px;
    min-height: 16px;
    display: inline-block;
}
.descBtn {
    display: none!important;
}
.platform-icon a img {
    transition: transform 0.3s ease, filter 0.3s ease;
    max-width: 100px;
    height: auto;
    filter: grayscale(100%) contrast(1);
}

.platform-icon a:hover img {
    transform: scale(1.15);
    filter: grayscale(0%) contrast(1.1);
}

.genresLink:hover {
    -webkit-text-fill-color: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1))!important;
    color: rgba(var(--bs-link-color-rgb), var(--bs-link-opacity, 1))!important;
    
}
/* ==================== Rating Styles ==================== */
.rating-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem; 
}

.star {
    width: 1.5rem;
    height: 1.5rem;
    background: linear-gradient(to right, #ffc107 var(--rating), #e0e0e0 var(--rating));
    -webkit-mask-image: url('images/star.svg'); 
    mask-image: url('images/star.svg');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    display: inline-block;
}

.rating-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    font-size: 0.875rem; 
    line-height: 1.2;
}

.rating-value {
    font-weight: bold;
    font-size: 1rem; 
}

.ratings-count {
    font-size: 0.75rem; 
    color: #6c757d;
}

/* ==================== Form and Utility Classes ==================== */
.form-check .form-check-input, .form-check .form-check-label {
    cursor: pointer;
}
.form-check .form-check-label {
    padding: 0 10px;
    user-select: none;
}
.form-check .form-check-input {
    margin-left: -10px;
}

.rounded {
    border-radius: 5px;
}

.shadow-sm {
    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075);
}

form .form-select {
    min-width: 150px;
}


#filtersForm { --btn-stack-offset: 64px; }

#filtersForm #platformAccept,
#filtersForm #clearFiltersBtn {
  position: sticky;
  transition: bottom .3s ease-out;
}

#filtersForm .btn-secondary {
  bottom: -50px;
}

#filtersForm .btn-primary {
  bottom: 10px;
  box-shadow: var(--bs-box-shadow) !important;
}

#filtersForm:has(#clearFiltersBtn.btn-primary) #platformAccept.btn-primary {
  bottom: calc(-10px + var(--btn-stack-offset, 56px));
}

/* ==================== Card Styles ==================== */
.card {
    display: flex;
    flex-direction: column;
    width: 100%;
    background-color: #fff;
    background-image: linear-gradient(0deg, rgba(233, 236, 239, 1) 0%, rgba(233, 236, 239, 1) 100%);
}
/*.card-img-top {
    height: 300px;
    object-fit: contain;
    text-align: center;
    padding: 10px 10px 0 10px;
    user-select: none;
}*/
.card-img-top {
    text-align: center;
    padding: 10px 10px 0 10px;
    user-select: none;
    max-width: 200px;
    aspect-ratio: auto 200 / 285;
    margin: 0 auto;
}

.card-body {
    flex-grow: 1;
    padding: 15px;
    padding-top: 0px;
}

.card h3,
.card h4 {
    margin-bottom: 10px;
}

.card img.img-fluid {
/*    height: 285px;*/
    height: 100%;
    object-fit: contain;
/*    background: #e2e2e7;*/
    background: black;
    background: linear-gradient(90deg, rgba(226, 226, 231, 1) 0%, rgba(226, 226, 231, 1) 100%);
}

img.filmweb {
    max-width: 80px;
}

.card .noPic:before {
    content: url(images/tb.webp);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.card .insteadPic {
    font-size: 30px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    line-break: anywhere;
    line-height: 32px;
    font-weight: 700;
    width: inherit;
    padding: 15px;
    color: white;
}
.card .noPic .insteadPic {
    display: none;
}
.card .card-link {
    text-decoration: none;
}
.card .title {
    background-color: #fff;
    border-top: 1px solid #d5d5d5;
    border-bottom: 1px solid #d5d5d5;
    background-image: linear-gradient(90deg, rgba(233, 236, 239, 1) 0%, rgba(255, 255, 255, 1) 50%, rgba(233, 236, 239, 1) 100%);
}
.card .mGrid>span{
    display: block;
}
.card .description {
    margin-top: 10px;
}


.cast-container table {
    table-layout: fixed;
}

.cast-container tr {
    display: flex;
}
.cast-list {
    white-space: nowrap;
    text-overflow: ellipsis;
    padding-left: 3px;
    width: 100%;
    position: relative;
}

.cast-container.expanded .cast-list {
    white-space: normal;
}

.cast-container.expanded .cast-list span.cast-item {
    display: block;
}

.cast-toggle {
    position: absolute;
    right: 10px;
    padding-left: 20px;
    background: rgb(233, 236, 239);
    background: linear-gradient(100deg, rgba(233, 236, 239, 0) 0%, rgba(233, 236, 239, 1) 50%);
}
.cast-container.expanded .cast-toggle {
    background: none;
}

.toggle-cast {
    padding: 0px 5px;
    font-size: 1rem;
    text-decoration: none;
    color: var(--bs-btn-hover-color);
}

/* ==================== Badges ==================== */
/*
.badge.bg-primary {background-color: #01579b !important;}
.badge.bg-success {background-color: #33691e !important;}
.badge.bg-warning {background-color: #ffd600 !important;color: black;}
.badge.bg-danger {background-color: #bf360c !important;}
*/
.badge-container .badge {
    background-color: #fff!important;
    background-image: linear-gradient(0deg, rgba(233, 236, 239, 1) 0%, rgba(233, 236, 239, 1) 100%)!important;
    font-size: 15px;

}
.badge-container {
    margin-bottom: 5px;
}
.badge.bg-primary {
    color: #01579b !important;
}
.badge.bg-success {
    color: #33691e !important;
}
.badge.bg-warning {
    color: #9f6b00 !important;
}
.badge.bg-danger {
    color: #bf360c !important;
}

/* ==================== Pagination Styles ==================== */
.pagination {
    flex-wrap: wrap; 
}

.pagination .page-item {
    flex: 0 1 auto;
    margin: 2px;
    user-select: none;
}

.pagination .page-link {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}
.itemsPerPageBox .btn-link.active {
    color: grey;
    pointer-events: none;
}
.itemsPerPageBox .btn-link {
    text-decoration: none;
}

/* ==================== Scroll To Top ==================== */
#topBtnWrapper {
    width: min-content;
    margin: 15px;
    padding: 5px;
    display: none;
    flex-direction: row;
    align-items: center;
    z-index: 1001;
    text-decoration: none;
    -webkit-box-shadow: rgb(0 0 0 / 20%) 0px 3px 3px -2px, rgb(0 0 0 / 14%) 0px 3px 4px 0px, rgb(0 0 0 / 12%) 0px 1px 8px 0px;
    box-shadow: rgb(0 0 0 / 20%) 0px 3px 3px -2px, rgb(0 0 0 / 14%) 0px 3px 4px 0px, rgb(0 0 0 / 12%) 0px 1px 8px 0px;
    transform: scale(0);
    opacity: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

#topBtnWrapper .topBtn {
    border-radius: 50%;
    height: 45px;
    width: 45px;
    transform: scale(0);
    opacity: 0;
    text-align: center;
}
#topBtnWrapper .topBtn:after {
    font-family: 'bootstrap-icons';
    content: "\F235";
    color: #fff;
    font-size: 27px;
    transition: color .3s;
    text-shadow: 0px 0px 0px rgba(255, 255, 255, 1);
}
#topBtnWrapper:hover .topBtn:after {
    text-shadow: 0px 0px 6px rgba(255, 255, 255, 1);
}

#topBtnWrapper.end {
    pointer-events: none;
}
#topBtnWrapper.start {animation: showingStart 0.3s cubic-bezier(.69,.08,.5,1.31) forwards;}
#topBtnWrapper.end {animation: showingEnd 0.3s 0.3s cubic-bezier(.69,.08,.5,1.31) backwards;}
#topBtnWrapper.start .topBtn {animation: showingStart 0.3s 0.3s cubic-bezier(.69,.08,.5,1.31) forwards;}
#topBtnWrapper.end .topBtn {animation: showingEnd 0.3s cubic-bezier(.69,.08,.5,1.31) backwards;}
@keyframes showingStart {
    from { 
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}
@keyframes showingEnd {
    from { 
        transform: scale(1);
        opacity: 1;
    }
    to {
        transform: scale(0);
        opacity: 0;
    }
}
#topBtnWrapper.start:hover {
    transform: scale(1.1);
}


/* ==================== Platform Logo ==================== */
.platform-logo {
    width: 4rem;
    height: 4rem;
    padding: 8px;
    top: 5px;
    right: 5px;
    position: absolute;
    object-fit: contain;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* ==================== Filter Styles ==================== */
#filtersCollapse form > label {
    margin-top: 10px;
}

#filtersCollapse .text-primary {
    color: rgb(10 84 193) !important;
}
.toggle-btn .bi {
    color: var(--bs-primary);
}

.toggle-btn {
    border: none;
    font-size: 1.2rem;
    transition: transform 0.3s ease-in-out;
    min-height: 37px;
}

.toggle-container {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease-in-out;
}

/* Gdy kontener jest aktywny (rozwinięty) */
.toggle-container.show {
    max-height: 1900px; /* Ustal odpowiednią wartość dla checkboxów */
}


/* ==================== Header ==================== */
.header {
    position: relative;
    width: 100%;
    background-color: black; /* Czarne tło */
    display: flex;
    text-align: left;
    padding-bottom: 35px;
}
.header h1 {
    text-align: left;
}

/* Obrazek jako tło */
/* Obrazek jako tło */
.header-bg{
    position: absolute; 
    opacity: 0;                                /* startowo niewidoczny */
    transition: opacity 1.0s ease-in-out;      /* pierwszy fade-in */
    will-change: opacity; 
    top: 0;
    right: 0;
    width: 50%; 
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
}

/* Po pierwszym przejściu wyłączamy kolejne animacje na bazie */
.header-bg.no-transition { transition: none !important; }

/* >>> DODAJ TO: klasa, którą nadaje JS po wczytaniu pierwszego obrazka */
.header-bg.is-loaded { opacity: 1; }

/* Warstwa przejściowa do przenikania kolejnych obrazów */
.header-bg-swap {
  position: absolute; 
  top: 0; 
  right: 0; 
  width: 50%; 
  height: 100%;
  background-size: cover; 
  background-position: center; 
  background-repeat: no-repeat;
  z-index: 2;
  opacity: 0;
  transition: opacity 1.0s ease-in-out;
  will-change: opacity;
}
.header-bg-swap.is-visible { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .header-bg, .header-bg-swap { transition: none; }
}

/* Overlay na wierzchu */
.header-bg-overlay {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(275deg, rgba(0,0,0,1) 5%, rgba(0,0,0,0) 15%, rgba(0,0,0,0) 75%, rgba(0,0,0,1) 95%);
    z-index: 3;
}

/* Kontener na tekst */
.text-container {
    position: relative;
    z-index: 3;
    width: 60%; /* Tekst zajmuje 60% szerokości */
    color: white;
}
.main-container #startLine {
    top: -50px;
    position: relative;
    z-index: 3;
    margin-bottom: -20px;
}


/* Mobile: Tekst na całą szerokość, obrazek na 100% */

#toggleLayoutBtn {
    border: var(--bs-border-width) solid var(--bs-border-color);
}
#toggleLayoutBtn:hover, #toggleLayoutBtn:active {
    background-color: initial;
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
}

/* ==================== Media Queries ==================== */
/* Tablet and Larger Screens */
@media (min-width: 768px) {
    .card {
        height: 100%;
    }
}

/* Small Screens (Mobile) */
@media (max-width: 767px) {
    .pagination .disabled .page-link {
        width: 15px;
        padding: 0.4rem 0.01rem;
    }
    .header {
        height: auto;
        padding-right: var(--bs-gutter-x);
        padding-left: var(--bs-gutter-x);
        text-align: justify;
        padding-bottom: 55px;
    }
    .header h2 {
        text-align: left;
    }
    .main-container #startLine {
        top: -70px;
    }

    .text-container {
        width: 100%;
    }

    .header-bg, .header-bg-overlay, .header-bg-swap {
        width: 100%;
        
    }
    .header-bg-overlay {
        background: rgb(0 0 0 / 60%);
    }
}

@media (max-width: 461px) {
    .header {
        padding-bottom: 65px;
    }
    .main-container #startLine {
        top: -80px;
    }
}

@media (max-width: 444px) {
    .header {
        padding-bottom: 70px;
    }
    .main-container #startLine {
        top: -85px;
    }
    .main-container #startLine {
        margin-bottom: -50px;
    }
}

/* Extra Small Screens */
@media (max-width: 400px) {
    .header {
        padding-bottom: 85px;
    }
    .main-container #startLine {
        top: -100px;
    }
    #toggleLayoutBtn {
        display: none;
    }
    .pagination .page-item {
        display: none; 
    }
    .listHeader form>.d-flex {
        flex-direction: column;
    }
    .shareIcons.d-flex {
        flex-wrap: wrap;
    }

    .pagination .page-item:first-child,
    .pagination .page-item:last-child,
    .pagination .page-item.active,
    .pagination .page-item.disabled {
        display: block; 
    }
}
/* ==================== ListHeader Styles - Układ w dwóch kolumnach dla mobile==================== */

@media (min-width: 401px) and (max-width: 767px) {
    #toggleLayoutBtn {
        display: block !important; 
    }
    #toggleLayoutBtn>.bi {
        height: 24px;
        width: 16px;
        display: block;
    }

    .list-container {
        display: flex;
        flex-wrap: wrap;
    }
    .grid-layout .list-container .mGrid{ 
        display: none !important;
    }
    .grid-layout .list-container { 
/*        display: grid;
        grid-template-columns: repeat(2, 1fr);*/
    }
    
    .grid-layout .list-container .col-12 {
/*        width: 100%;*/
        width: 50%;
        padding-right: calc(var(--bs-gutter-x)* .2);
        padding-left: calc(var(--bs-gutter-x)* .2);
    }
    .grid-layout .list-container>.mb-4, .topRated .list-container>.mb-4 {
        margin-bottom: 10px !important;
    }
    .grid-layout .list-container .badge-container {
        border-bottom: #bac0c5 1px solid;
        padding: 4px;
    }

    /*Przyciski .card-buttons*/
    .grid-layout .card-buttons, .topRated .card-buttons {
        display: flex;
        flex-wrap: nowrap;
        justify-content: center; 
    }
    .grid-layout .card-buttons .btn, .grid-layout .descBtn .btn {
        justify-content: center;
        flex: 1;
        text-align: center;
        padding: 6px;
        font-size: 12px;
    }
    .grid-layout .card-buttons>a.btn img {
        width: 100%;
        max-width: 70px;
    }
    .grid-layout .card-buttons>a.btn .bi {
        margin-left: 2px !important;
    }
    .grid-layout .card-buttons>a.btn .bi:before {
        min-height: auto;
    }

    .grid-layout .descBtn {
        display: flex!important;
    }

    .grid-layout .card-body {
/*        padding: 8px;*/
    }
    .topRated .list-container { 
/*        display: grid;
        grid-template-columns: repeat(2, 1fr);*/
    }
    .topRated .list-container .col-12 {
        width: 50%;
        padding-right: calc(var(--bs-gutter-x)* .2);
        padding-left: calc(var(--bs-gutter-x)* .2);
    }
}
.modal .btn-close {
    position: absolute;
    right: 20px;
    top: 20px;
    z-index: 1;
    font-size: 18px;
}
.modal {
    backdrop-filter: blur(3px);
}
.grid-layout:not(.modal-open) .card .noPic .insteadPic {
    display: block;
}
.grid-layout:not(.modal-open) .card .noPic:before {
    display: none;
}

.topRated .list-container .mGrid, .topRated .card-buttons {
    display: none !important;
}
.topRated .list-container>.mb-4 {
    margin-bottom: 10px !important;
}
.topRated .list-container .badge-container {
    border-bottom: #bac0c5 1px solid;
    padding: 4px;
}
/*Przyciski .card-buttons*/
.topRated .card-buttons {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center; 
}
.topRated .card-buttons .btn, .topRated .descBtn .btn {
    justify-content: center;
    flex: 1;
    text-align: center;
    padding: 6px;
    font-size: 12px;
}
.topRated .card-buttons>a.btn img {
    width: 100%;
    max-width: 70px;
}
.topRated .card-buttons>a.btn .bi{
    margin-left: 2px !important;
}
.topRated .card-buttons>a.btn .bi:before {
    min-height: auto;
}
.topRated .descBtn{
    display: flex!important;
}
.topRated .card-body {

}

.platform-checkbox {
    border: 4px solid transparent;
    padding: 4px;
    border-radius: 50%;
    margin: 6px;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    display: inline-block;
}

.platform-checkbox img {
    position: relative;
    top: 0px;
    left: 0px;
    transition: scale 0.2s ease;
}
.platform-checkbox img:hover {
    scale: 1.1;
}

.topRatedCheckbox:checked + .platform-checkbox {
  border-color: #0d6efd;
  box-shadow: 0 0 0 2px rgba(13,110,253,0.25);
}

.topRated .card, .topRated .card .card-body  {
    color: white;
    background-color: #000000;
    background-image: linear-gradient(0deg, rgb(33 37 41) 0%, rgb(33 37 41) 100%);
}
.topRated .card .card-img-top {
    background-color: rgba(var(--bs-dark-rgb), var(--bs-bg-opacity))!important;
}

.topRated .card .badge-container {
    border-bottom: #000000 1px solid;
}
.topRated .card .badge-container .badge {
    background-color: #000000 !important;
    background-image: linear-gradient(0deg, rgb(33 37 41) 0%, rgb(33 37 41) 100%) !important;
}
.topRated .card .rating-container .rating-text .ratings-count {
    color: #b0b8bf;
}
.topRated .card img.img-fluid{
    background: #00000000;
}

