.centered-content {
    background-color: var(--bs-white);
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

/* Reset */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: smooth;
    scroll-padding-top: 6.3125rem; 
}
:root {
    --black: #000000;
    --black-color-400: #141414;
    --blue-color-700: #083A54;
    --skyblue-color-700: #23BAB1;
    --grey-light-color-700: #D0E0E8;
    --Poppin-font: "Poppins", sans-serif;
}

body {-webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-family: var(--Poppin-font); background-color: var(--black); font-size: 1rem; margin: 0; background-image: url('/assets/images/best-background.jpg'); background-repeat: no-repeat; background-size: cover; transition: all .5s ease-in-out; -webkit-transition: all .5s ease-in-out; background-attachment: fixed;}
p {font-size: 1rem;}
p:last-child {margin-bottom: 0;}
strong {font-weight: 600;}
h1, .h1,
h2, .h2,
h3, .h3,
h4, .h4,
h5, .h5,
h6, .h6 {
  font-weight: 600;
  line-height: 1.3;
  line-height: normal;
}
h1, .h1 {   
    font-size: 2.5rem;
}
pre,
code {
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
}
.fs-22{font-size: 22px;}
.main {padding-top: 50px;}

@media (max-width:991px){
    .fs-22{font-size: 20px;}
}
.container {max-width: 100%;}

/* Track */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: var(--blue-color-700);
    border-radius: 10px;
}

.loader {
    background-color: rgba(0, 0, 0, 0.7);
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 1111;
}
.loader-span {
    width: 48px;
    height: 48px;
    border: 3px dotted var(--bs-white);
    border-style: solid solid dotted dotted;
    border-radius: 50%;
    display: inline-block;
    position: fixed;
    top: calc(50% - 48px/2);
    left: calc(50% - 48px/2); 
    animation: rotation 2s linear infinite;
    z-index: 11;
}
.loader::after {
    content: '';   
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    margin: auto;
    border: 3px dotted var(--skyblue-color-700);
    border-style: solid solid dotted;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    animation: rotationBack 1s linear infinite;
    transform-origin: center center;
}
      
@keyframes rotation {
    0% {
      transform: rotate(0deg);
    }
    100% {
      transform: rotate(360deg);
    }
  } 
  @keyframes rotationBack {
    0% {
      transform: rotate(0deg);
    }
    100% {
      transform: rotate(-360deg);
    }
}

/* Button - These global button styles should be in your main CSS, not page-specific CSS */
/* Commenting out to prevent navbar interference - restore to main CSS if needed */
/*
.btn {outline:0; display:inline-block; box-shadow:none!important;}
.btn-sm {font-size:.875rem; border-radius:5px; min-width: 90px;}
.btn-md {font-size:1rem; border-radius:7px; min-width: 110px; padding:.55rem 1rem;}
.btn-primary {color: var(--bs-white); background: linear-gradient(90deg, var(--skyblue-color-700) 0%, #0A6A64 100%); border:1px solid var(--skyblue-color-700); transition:all .5s ease-in-out; -webkit-transition:all .5s ease-in-out;}
.btn-primary:hover, .btn-primary:focus {background:transparent; border-color:#0A6A64; box-shadow:none!important;}
*/

/* Button styles scoped to listing page only */
#script-listing-wrapper .btn {outline:0; display:inline-block; box-shadow:none!important;}
#script-listing-wrapper .btn-sm {font-size:.875rem; border-radius:5px; min-width: 90px;}
#script-listing-wrapper .btn-md {font-size:1rem; border-radius:7px; min-width: 110px; padding:.55rem 1rem;}
#script-listing-wrapper .btn-primary {color: var(--bs-white); background: linear-gradient(90deg, var(--skyblue-color-700) 0%, #0A6A64 100%); border:1px solid var(--skyblue-color-700); transition:all .5s ease-in-out; -webkit-transition:all .5s ease-in-out;}
#script-listing-wrapper .btn-primary:hover, 
#script-listing-wrapper .btn-primary:focus {background:transparent; border-color:#0A6A64; box-shadow:none!important;}

/* Navbar styles removed - they were interfering with global navbar */
/* If you need navbar styles specific to the listing page, scope them to #script-listing-wrapper */

.page-title {margin-bottom:10px; background-color:var(--bs-white); padding:30px 15px;}
.page-title .h1 {color:var(--blue-color-700);}
.page-title p strong {margin-bottom: 15px; font-weight:500;}
.page-title p { font-size:1rem; color:var(--blue-color-700);}
@media (max-width:991px){
    .page-title {padding:15px;}
    .page-title .h1 {font-size:1.8rem; line-height:1.1;}
    .page-title p strong {margin-bottom: 10px;}
    .page-title p br { display:none;}
}
@media (max-width:767px){
    .page-title .h1 {font-size:1.5rem;}
    .page-title p {font-size:.875rem;}
    .fs-22 {font-size:1.1rem;}
}

/* Table - SCOPED to #script-listing-wrapper to prevent navbar interference */
#script-listing-wrapper div.custom-table {background: var(--bs-white); backdrop-filter: blur(2px); border-radius: 8px 8px 0 0; padding:0; border-width: 1px 1px 0; border-style: solid; border-image:linear-gradient(308deg, rgba(33,180,172,1) 0%, rgba(255,255,255,1) 25%, rgba(33,180,172,1) 49%, rgba(255,255,255,1) 75%, rgba(33,180,172,1) 100%); position: relative; z-index: 1;}
@media (max-width:991px) {
    #script-listing-wrapper .custom-table {border-radius: 5px 5px 0 0;}
}
#script-listing-wrapper .custom-table table {margin: 0; border-collapse: collapse;}
#script-listing-wrapper .custom-table thead {position: sticky !important; top: 0 !important;} 
#script-listing-wrapper .custom-table th {vertical-align: bottom; border: 0!important; max-width: 50px; padding-bottom: 30px!important; position: relative; font-size: .875rem; z-index: 1; white-space: nowrap; height: 160px;}
/* .custom-table th:first-child {min-width: 100px;}  */
#script-listing-wrapper .custom-table th h6 {
font-weight: 400; margin: 0; position: relative; font-size: .875rem; color:var(--black-color-400); line-height: 1.2; transform: rotate(-45deg); -webkit-transform: rotate(-45deg); transform-origin: center center;}
#script-listing-wrapper .script_color_th::before{
    content: ''; 
    background-color: var(--grey-light-color-700);
    height: 130%;
    width: 48px;
    position: absolute;
    bottom: -7px;
    left: 66px;
    transform: rotate(45deg);
    -webkit-transform: rotate(45deg);
    z-index: -1;
}
 #script-listing-wrapper .script_color_th::after{
    content: ''; 
    background-color: var(--grey-light-color-700);
    height: 55px;
    width: 99%;
    position: absolute;
    bottom: -14px;
    left: 0; 
    z-index: -1;
}
@media (max-width:1800px){ 
    #script-listing-wrapper .script_color_th::before {
        width: 40px;
        bottom: -4px;
    }
}
#script-listing-wrapper .custom-table th, #script-listing-wrapper .custom-table td { background: transparent !important; text-align:center; font-weight:400; line-height: 1.1; color: var(--black-color-400)!important; font-weight:normal!important; width: 50px;}
#script-listing-wrapper .custom-table td:nth-child(1) {
    max-width: 100px;
}
#script-listing-wrapper .custom-table th:nth-child(3) {
    max-width: 100px;
}
#script-listing-wrapper .sorting .arrows{cursor: pointer;}
#script-listing-wrapper .sorting .arrows img {width:9px; height:auto;}
#script-listing-wrapper .ar_down {display: none;}
#script-listing-wrapper .asc .ar_down {display: block;}
#script-listing-wrapper .asc .ar_up {display: none;}
#script-listing-wrapper .desc .ar_down{display: none;}
#script-listing-wrapper .desc .ar_up{display: block;}
#script-listing-wrapper .sorting_desc .ar_down, #script-listing-wrapper .sorting_asc .ar_up {opacity:.5; }

#script-listing-wrapper .custom-table * { box-sizing: border-box!important;}
#script-listing-wrapper .custom-table td {border:1px solid rgba(0,0,0,.05); vertical-align: middle; padding-block: 10px; font-size: .80rem; position: relative;}
#script-listing-wrapper .custom-table td:first-child {border: 0; padding-block: 0; width:auto;}
#script-listing-wrapper .custom-table td.light_blue {background-color: var(--grey-light-color-700);}
#script-listing-wrapper .custom-table td.dark-blue-bg { background: var(--blue-color-700)!important; color: var(--bs-white)!important;}

/* .best_role {max-width: 100px; min-width: 120px;}
.best_role em {min-width: 34px; max-width: 34px;}
.best_role em img {width: 100%; height: auto;}
.best_role span { color: var(--blue-color-700);} */
#script-listing-wrapper .toggle {cursor: pointer; padding-right: 20px; min-height: 35px; }
@media (min-width:1440.99px){
    #script-listing-wrapper .toggle {max-width: 160px; min-width:160px;}
    /* .custom-table td:first-child {max-width:100px;} */
}
@media (max-width:1440px){
    #script-listing-wrapper .toggle {min-width: 190px;}
    /* .custom-table td:first-child {max-width:130px;} */
} 
#script-listing-wrapper .collapse_bar {position: absolute; top: calc(50% - 8px / 2); right: 14px; border: 0; background-color: transparent; padding: 0; transition: all .5s ease-in-out; -webkit-transition: all .5s ease-in-out;}
#script-listing-wrapper .collapse_bar img {width: 8px; height:auto;}
#script-listing-wrapper .toggle.up .collapse_bar {transform:rotate(90deg); -webkit-transform:rotate(90deg);}

#script-listing-wrapper .screenplay_title {text-align: left; position: relative;}
#script-listing-wrapper .screenplay_title figure {min-width:50px; max-width:50px; margin:0;}
#script-listing-wrapper .screenplay_title figure img {border-radius: 5px; width:100%; height:50px; width:50px; object-fit:cover;}
#script-listing-wrapper .screenplay_title span { color:var(--skyblue-color-700); font-size:1.025rem; font-weight:700;}

#script-listing-wrapper.ungrouped_table table td.script_color {background-color:var(--grey-light-color-700)!important;}
#script-listing-wrapper.grouped_table table td.script_color {background-color:#f5f5f5!important;}

/* Collapse TR - SCOPED */
#script-listing-wrapper .hiddenRow td {padding: 0; border:0;}
#script-listing-wrapper .screenplay_info {background-color: var(--blue-color-700); padding:20px;}
#script-listing-wrapper .screenplay_info td{ padding: 0!important;}
#script-listing-wrapper .screenplay_info figure>img { height: auto; border: 1px solid var(--bs-white); border-radius:0px; }
/* .screenplay_info figure>img { height: 100%; border: 1px solid var(--bs-white); border-radius:0px; object-fit: cover; max-height:400px;} */
/* .graph_info { box-shadow: 0 0 10px rgba(0,0,0,.05); border: 1px solid var(--bs-white); border-radius:6px; padding: 10px; height: 100%;} */
#script-listing-wrapper .graph_info { box-shadow: 0 0 10px rgba(0,0,0,.05); border: 1px solid var(--bs-white); border-radius:6px; padding: 10px; }

#script-listing-wrapper .screenplay_content label { max-width: 100px; min-width: 100px; margin-right: 10px;}
#script-listing-wrapper .s-content label {margin: 0; color: var(--bs-white); padding-right: 14px;}
#script-listing-wrapper .s-content p {font-size: .875rem; color: rgba(255,255,255,1); margin-bottom:15px; padding-bottom:15px; border-bottom: 1px solid rgba(255,255,255,.2); font-weight: 300; line-height:1.2;}
#script-listing-wrapper .s-content:last-child p {margin-bottom:0; padding-bottom:0; border-bottom:0;}
@media (min-width:1440px) {
    #script-listing-wrapper .s-content p { padding-right:10%;}
}

#script-listing-wrapper .user-select-none.svg-container {
    margin: 0 auto!important;
}

/* Switch Toggle - SCOPED */
#script-listing-wrapper .switch_btn {min-width:240px; padding:10px 12px; border-radius:8px; display:inline-flex; align-items:center; justify-content:space-between; border: 2px solid var(--blue-color-700); background-color:var(--bs-white); position:absolute; top:10px; left:226px; z-index: 1111;}
#script-listing-wrapper .switch_btn>span {font-size: 1rem; color: var(--black-color-400); margin-right:16px;}
#script-listing-wrapper .switch {
    --secondary-container: #9D9D9D;
    --primary: var(--blue-color-700);
    font-size: 17px;
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}
#script-listing-wrapper .switch input {position:absolute; left:0; top:0; width:100%; height:100%; opacity:0; cursor:pointer; z-index:1;} 

#script-listing-wrapper .slider {position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;  background-color: var(--secondary-container); transition: .2s; border-radius: 30px; }   
#script-listing-wrapper .slider:before {
    position: absolute;
    content: "";
    height: 1.3em;
    width: 1.3em;
    border-radius: 20px;
    left: 0.2em;
    top:.2rem;
    bottom: 0.2em;
    background-color: var(--bs-white);
    transition: .4s;
} 
#script-listing-wrapper .switch input:checked + .slider::before {
    background-color: var(--bs-white);
} 
#script-listing-wrapper .switch input:checked + .slider { 
    background-color: var(--primary);
}  
#script-listing-wrapper .switch input:focus + .slider {
    box-shadow: 0 0 1px var(--secondary-container);
}
#script-listing-wrapper .switch input:checked + .slider:before {
    transform: translateX(1.38em);
    -webkit-transform: translateX(1.38em);
}

/* Group Button - SCOPED */
#script-listing-wrapper .group_sort { position:absolute; left:10px; top:9px; z-index:1111;}  
#script-listing-wrapper .group_btn {padding:7px .725rem; display:flex; align-items:center; justify-content:center; border-radius:5px; background:#d0e0e8; border:0; min-width:206px;}
#script-listing-wrapper .group_btn span {margin-right:7px; color:var(--black); font-size:1rem; font-weight:600; text-transform:capitalize; line-height:1;}
#script-listing-wrapper .group_btn img {width:36px;}
#script-listing-wrapper .group_btn.in-active img{transform:rotate(90deg); -webkit-transform:rotate(90deg);} 
  
#script-listing-wrapper .action_btns {gap:10px; margin-top:15px; margin-left: 100px;}
#script-listing-wrapper .action_btns a { text-transform:capitalize; color:rgba(255,255,255,.9); font-size:.875rem; padding:4px 10px; border-radius: 5px; text-decoration:none; height:40px; display: inline-flex; align-items:center; justify-content: center;}
#script-listing-wrapper .action_btns a em {vertical-align:middle;}
#script-listing-wrapper .action_btns a em img {width:20px;}

#script-listing-wrapper .t_tips {display:block; border:0; padding:0; margin:0 auto 7px;}

/* Video Modal - SCOPED */
#script-listing-wrapper .video-btn { position:absolute; right:10px; top: 10px; border:0; background-color: transparent; transition: all .5s ease-in-out; -webkit-transition: all .5s ease-in-out;}
#script-listing-wrapper .video-btn img {width:45px; height:45px; }
#script-listing-wrapper .video-btn:hover {transform:scale(1.05); -webkit-transform:scale(1.05);}
#script-listing-wrapper .btn-close {position:absolute; right:10px; top:10px; z-index:1; background-color:var(--bs-white); padding:4px; border-radius:50%; width:32px; height:32px; opacity:1;}

/* Tooltip styling - SCOPED */
#script-listing-wrapper .table-responsive {overflow-y:hidden;}
#script-listing-wrapper #customTooltip {
    pointer-events: none; 
    transition: opacity 0.5s;
    -webkit-transition: opacity 0.5s;
    opacity: 0; top: 20px; right:20px;  
}
#script-listing-wrapper #customHoverInfo {display:none; padding: 8px; border-radius:5px;
    position:absolute; left:50%; bottom:0; pointer-events: none; background: var(--blue-color-700);
    transform:translateX(-50%); -webkit-transform: translateX(-50%); 
    border:1px solid #ccc; color:var(--bs-white); 
    min-width:300px; max-width:300px;
    text-align:left; z-index: 1000;
}

@media (max-width:991px){
    #script-listing-wrapper #customHoverInfo {max-width: 100px;} 
	#script-listing-wrapper .switch_btn>span {margin-right:10px;}
}	

@media (max-width:767px){
    #script-listing-wrapper .switch_btn>span {font-size: .875rem;}
    #script-listing-wrapper .screenplay_title span {font-size: 1rem;}
}

#script-listing-wrapper .dataTables_empty {height:100px;}
#script-listing-wrapper table.dataTable thead .sorting {background-image:none!important;}

#script-listing-wrapper .overall_average { max-width:80px!important; width:80px!important;}

/* .top_title { min-width:150px;} */
#script-listing-wrapper #table-custom thead tr th.top_title {font-weight:700!important; font-size:1rem; color:#083A54!important; vertical-align:bottom!important; word-break: break-word; white-space: normal;}
#script-listing-wrapper.grouped_table #table-custom tr .group_border{border-left:3px solid #083A54!important; padding-bottom:0!important;}
#script-listing-wrapper .group_title tr th {padding-top:40px; padding-bottom: 10px !important;}
#script-listing-wrapper.grouped_table thead tr th, #script-listing-wrapper.grouped_table thead tr td { background: #fff!important; height:auto;}
#script-listing-wrapper.grouped_table thead tr th:not(:first-child):not(:nth-child(2)):not(:nth-child(3)):not(:nth-child(4)):not(:nth-child(5)) h6, 
#script-listing-wrapper.grouped_table thead tr th::before, #script-listing-wrapper.grouped_table thead tr th::after, 
#script-listing-wrapper.grouped_table .sorting {display:none;} 
#script-listing-wrapper.grouped_table .colspan_group {display:none;}

#script-listing-wrapper.ungrouped_table .overall_average,
#script-listing-wrapper.ungrouped_table [colspan="3"],
#script-listing-wrapper.ungrouped_table [colspan="5"],
#script-listing-wrapper.ungrouped_table .group_title {
	display:none;
}
#script-listing-wrapper.grouped_table th {
    padding-bottom: 15px!important;
}
#script-listing-wrapper.grouped_table .no_rotate {
    width: auto;
    max-width: 55px;
    white-space: normal;
}
#script-listing-wrapper.grouped_table .no_rotate h6{
    white-space: nowrap;
    transform: none;
}

@media (max-width:1200px){
    #script-listing-wrapper .custom-table th { max-width:60px;}
}

/* Percentile Heatmap Highlighting - SCOPED */
/* Higher specificity to override script_color */
#script-listing-wrapper table td.highlight-green,
#script-listing-wrapper.ungrouped_table table td.highlight-green,
#script-listing-wrapper.grouped_table table td.highlight-green {
    background-color: #97f5b8 !important; /* A light, "good" green */
    color: #000 !important;
}

#script-listing-wrapper table td.highlight-blue,
#script-listing-wrapper.ungrouped_table table td.highlight-blue,
#script-listing-wrapper.grouped_table table td.highlight-blue {
    background-color: #e6f0fa !important; /* A light, "noteworthy" blue */
    color: #000 !important;
}

/* --- START: FILTER BAR STYLES - SCOPED --- */

/* 1. The Placeholder - holds space to prevent layout shift */
#script-listing-wrapper #filter-bar-placeholder {
    /* This height should match your trigger bar height.
       Adjust if needed based on your actual trigger bar. */
    height: 51px; 
    position: relative;
    z-index: 1000;
}

/* 2. The Main Container */
#script-listing-wrapper #filter-bar-container {
    /* Absolute so it can become fixed without affecting layout */
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

/* 3. The Sticky State */
#script-listing-wrapper #filter-bar-container.is-sticky {
    position: fixed;
    top: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1020; /* Will sit on top of the placeholder */
}

/* 4. The Trigger Bar */
#script-listing-wrapper #filter-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--blue-color-700);
}
#script-listing-wrapper #filter-trigger .filter-arrow {
    transition: transform 0.3s ease;
}
#script-listing-wrapper #filter-bar-container.is-expanded .filter-arrow {
    transform: rotate(180deg);
}

/* 5. The Popover Drawer */
#script-listing-wrapper #filter-popover {
    display: none; /* Hidden by default */
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #dee2e6;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 1.5rem 1.5rem;
    z-index: 1001;
}
#script-listing-wrapper #filter-bar-container.is-expanded #filter-popover {
    display: block; /* Show when expanded */
}

/* 6. Genre Pill Styling */
#script-listing-wrapper .genre-filter-btn {
    border: 2px solid var(--genre-color, #6c757d);
    background-color: var(--genre-color, #6c757d);
    color: #fff;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
}

/* Special case: Comedy (yellow) needs black text */
#script-listing-wrapper .genre-filter-btn[data-genre="Comedy"] {
    color: #000;
}

/* "All Genres" button styling */
#script-listing-wrapper .genre-filter-btn[data-genre="all"] {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

/* Active state - add glow effect */
#script-listing-wrapper .genre-filter-btn.active {
    box-shadow: 0 0 12px var(--genre-color);
    transform: scale(1.05);
}

/* Hover state - slightly darken */
#script-listing-wrapper .genre-filter-btn:hover {
    opacity: 0.85;
    transform: translateY(-2px);
}

#script-listing-wrapper .genre-filter-btn.active:hover {
    transform: translateY(-2px) scale(1.05);
}
/* --- END: FILTER BAR STYLES --- */