body {
  margin: 0;
  padding: 0;
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  overflow-x: hidden;
  background-color: #282A2D;
  font-size: 16px;
  width: 100vw;
  max-width: 100%;
}

main {
  padding: 0;
  margin: 0;
  width: 100vw;
  max-width: 100%;
  background-color: #282A2D;
  display: flex;
  align-items: center;
  min-height: 100vh;
}

#section {
  background-color: #3A3C41;
  padding: 20px;
  position: relative;
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  grid-gap: 20px;
  text-align: left;
  width: 100vw;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

#img_background {
  z-index: 1;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover !important;
  opacity: .15;
}

.poster {
  max-width: 225px;
  min-width: 225px;
  height: auto;
  position: relative;
  z-index: 2;
}

.poster img {
  border-radius: 5px;
  width: 100%;
  height: auto;
  display: block;
  background-color: #FFFFFF;
}

.movie_poster, .movie_details, .button_container {
  margin: 0;
  position: relative;
  z-index: 2;
}

.movie_poster > img {
  width: 225px;
}

.movie_details {
  z-index: 10;
  color: #EAEAEC;
  font-weight: 300;
  text-align: left;
  align-self: start;
  font-size: 1rem;
}

#title {
  margin: 0;
  font-size: 3rem;
  font-weight: 600;
}

#actors {
  white-space: nowrap;
  overflow: hidden;
}

#description {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical;
    transition: all 0.3s ease;
}

#description.truncated {
    cursor: pointer;
}

#description.expanded {
    -webkit-line-clamp: unset !important;
    max-height: none !important;
}

.version-label {
  position: fixed;
  bottom: 10px;
  right: 10px;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  padding: 5px 10px;
  border-radius: 5px;
  font-size: 12px;
  z-index: 1000;
}

#year_duration {
  font-weight: 700;
}

.button_container {
  z-index: 20;
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  position: relative;
}

.button {
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 2em;
  border: 1px;
  padding: 5px;
  background-color: #E5A00D;
  color: #282A2D;
  cursor: pointer;
  margin-right: 10px;
  margin-bottom: 10px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.button:hover {
    background-color: #F8D68B;
    transform: translateY(-1px);
}

#btn_watch {
  width: 225px;
  height: 1.5em;
  flex-grow: 1;
  max-width: 225px;
}

#btn_next_movie, #btn_power {
  height: 1.5em;
  width: 1.5em;
  flex-grow: 0;
}

#btn_next_movie svg, #btn_power svg {
  width: 70%;
  height: 70%;
}

#switch_service {
  width: auto;
  height: 1.5em;
  padding: 5px 10px;
  font-size: 2em;
  display: flex;
  align-items: center;
  justify-content: center;
}

#switch_service .service-name {
  margin-right: 10px;
}

#switch_service .switch-icon {
  width: 0.8em;
  height: 0.8em;
  fill: currentColor;
}

.button:active {
  background-color: #F8D68B;
  transform: translateY(0);
}

#btn_get_movie {
  grid-column: 1 / -1; 
  justify-self: center; 
  align-self: center; 
  width: auto; 
  padding: 15px 30px; 
  font-size: 2.5em; 
  margin: 20px 0; 
  z-index: 10; 
}

.hidden {
  display: none !important;
}

#client_prompt, #device_prompt {
  background-color: rgba(40, 42, 45, 0.5);
  z-index: 2600;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

#client_prompt_close, #device_prompt_close {
  cursor: pointer;
  position: absolute;
  top: 30px;
  right: 30px;
  z-index: 1101;
}

#client_prompt_close > svg, #device_prompt_close > svg {
  fill: #EAEAEC;
}

#container_list_of_clients, #container_list_of_devices {
  background-color: rgba(67, 71, 76, 0.95);
  padding: 20px;
  border-radius: 10px;
  margin: 0 20px;
  text-align: center;
  max-height: 85vh;
  overflow-y: auto;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

#list_of_clients, #list_of_devices {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.client, .device {
  cursor: pointer;
  background-color: #E5A00D;
  margin: 0;
  padding: 15px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #282A2D;
  transition: all 0.2s;
  min-width: auto;
  width: 100%;
  min-height: 50px;
  border-radius: 8px;
  box-sizing: border-box;
}

.client:hover, .device:hover {
    background-color: #F8D68B;
    transform: translateY(-2px);
}

.client:active, .device:active {
  background-color: #F8D68B;
  transform: translateY(0);
}

.client, .device {
  margin: 0;
  text-transform: uppercase;
  font-size: 1.2rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  line-height: 1.4;
}

#trailer_popup {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 2001;
}

#trailer_iframe {
  width: 80vw;
  height: 45vw;
  max-width: 1200px;
  max-height: 675px;
  margin-top: 50px;
}

#trailer_popup_close {
  position: absolute;
  top: 20px;
  right: 20px;
  cursor: pointer;
  z-index: 2001;
  font-size: 2rem;
  z-index: 101;
}

#trailer_popup_close > svg {
  fill: #EAEAEC;
}

#trailer_popup_close:hover > svg {
    fill: #E5A00D;
}

.logo {
  width: auto;
  height: 24px;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.logo:hover {
    transform: scale(1.2);
}

.logo[src*="tmdb_logo"] {
    height: 20px;  
}

.logo[src*="imdb_logo"] {
    height: 28px;
}

.logo[src*="trakt_logo"] {
    height: 26px;
}

.logo[src*="youtube_logo"] {
    height: 36px;
}


.filter-button {
  background-color: #E5A00D;
  color: #282A2D;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex !important;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  padding: 0;
  transition: all 0.2s;
}

main, #section, #movieContent {
  overflow: visible;
}

.filter-button:hover {
    background-color: #F8D68B;
    transform: translateY(-1px);
}

.grid-view-button {
  background-color: #E5A00D;
  color: #282A2D;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex !important;
  justify-content: center;
  align-items: center;
  font-size: 24px;
  padding: 0;
  transition: all 0.2s;
}

.grid-view-button:hover {
    background-color: #F8D68B;
    transform: translateY(-1px);
}

.filter-button:active {
    transform: translateY(0);
}

.filter-icon {
  width: 24px;
  height: 24px;
  display: block !important;
  transition: all 0.2s;
  margin: auto;
}

.filter-dropdown {
  display: none;
  position: absolute;
  right: 0;
  background-color: #3A3C41;
  min-width: 200px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1;
  padding: 10px;
  border-radius: 5px;
  border: 1px solid #E5A00D;
}

.filter-option {
  margin-bottom: 10px;
}

.filter-option label {
  display: block;
  color: #EAEAEC;
  margin-bottom: 5px;
}

.filter-option select {
  width: 100%;
  padding: 5px;
  border: 1px solid #EAEAEC;
  background-color: #282A2D;
  color: #EAEAEC;
  border-radius: 3px;
}

#applyFilter,
#clearFilter {
  background-color: #E5A00D;
  color: #282A2D;
  border: none;
  padding: 5px 10px;
  margin-top: 10px;
  cursor: pointer;
  border-radius: 3px;
  width: 100%;
}

#applyFilter:hover,
#clearFilter:hover {
  background-color: #F8D68B;
}

.show {
  display: block !important;
}

#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(40, 42, 45, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3000;
}

#loading-content {
  background-color: #3A3C41;
  padding: 30px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  max-width: 80%;
  width: 400px;
}

#loading-content h2 {
  color: #EAEAEC;
  margin-bottom: 20px;
  font-size: 1.5em;
}

#loading-bar-container {
    width: 100%;
    height: 10px;
    background-color: #282A2D;
    border-radius: 5px;
    overflow: hidden;
    margin: 20px auto;
}

#loading-progress {
    width: 0;
    height: 100%;
    background-color: #E5A00D;
    transition: width 0.3s ease-in-out;
}

.loading-text {
    color: #EAEAEC;
    font-size: 1em;
    margin-bottom: 15px;
}

.loading-message {
  color: #EAEAEC;
  margin-top: 20px;
  font-size: 1em;
}

#movieContent {
  display: contents;
  position: relative;
  padding: 40px 0;
}

#messageContainer {
  grid-column: 1 / -1;
  position: relative;
  background-color: #3A3C41;
  height: 350px;
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.no-movies-message,
.error-message {
  background-color: rgba(58, 60, 65, 0.9);
  color: #EAEAEC;
  padding: 20px;
  border-radius: 10px;
  max-width: 80%;
  margin: 20px auto;
}

.no-movies-message h2,
.error-message h2 {
  font-size: 24px;
  margin-bottom: 10px;
}

.no-movies-message p,
.error-message p {
  font-size: 16px;
  margin-bottom: 20px;
}

.no-movies-message button,
.error-message button {
  background-color: #E5A00D;
  color: #282A2D;
  border: none;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.3s;
}

.no-movies-message button:hover,
.error-message button:hover {
  background-color: #F8D68B;
}

#movies_overlay,
#movie_data_overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(40, 42, 45, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index:2100;
  box-sizing: border-box;
}

#movies_overlay.hidden,
#movie_data_overlay.hidden {
  display: none;
}

#movies_overlay_content,
#movie_data_overlay_content {
  background-color: #3A3C41;
  border-radius: 15px;
  padding: 30px;
  color: #EAEAEC;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.movie-data-label {
    color: #E5A00D;
    font-weight: 500;
    margin-right: 8px;
}

.movie-data-value {
    color: #EAEAEC;
    font-weight: 400;
}

.close-button,
#movies_overlay_close {
  cursor: pointer;
  position: fixed;
  top: 30px;
  right: 30px;
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  padding: 0;
  z-index: 2002;
}

.close-button svg,
#movies_overlay_close svg {
  width: 100%;
  height: 100%;
  fill: #EAEAEC;
}

.close-button:hover svg,
#movies_overlay_close:hover svg {
  fill: #E5A00D;
}

#movie_data_overlay_content h2 {
  font-size: 2.5rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: #E5A00D;
}

#movie_data_overlay_content p {
  margin: 15px 0;
  font-size: 1.1rem;
  line-height: 1.6;
}

#movie_data_overlay_content .movie-links {
  display: flex;
  gap: 15px;
  margin: 25px 0;
}

#movie_data_overlay_content .movie-links a {
  background-color: #282A2D;
  color: #EAEAEC;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 8px;
  transition: all 0.3s ease;
  flex: 1;
  text-align: center;
  font-weight: 500;
}

#movie_data_overlay_content .movie-links a:hover {
  background-color: #E5A00D;
  color: #282A2D;
}

#movie_data_overlay_content #request_movie_button {
  background-color: #E5A00D;
  color: #282A2D;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s;
  width: 100%;
  margin-top: 20px;
}

#movie_data_overlay_content #request_movie_button:hover {
  background-color: #F8D68B;
}

#trailer_container {
  margin-top: 25px;
  border-radius: 8px;
  overflow: hidden;
  background-color: #282A2D;
}

#trailer_container iframe {
  width: 100%;
  aspect-ratio: 16/9;
}

#person_header {
  display: flex;
  align-items: center;
  margin-bottom: 30px;
}

#person_header img,
#person_header svg {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 50%;
  margin-right: 20px;
  border: 3px solid #E5A00D;
}

#person_header h2 {
  color: #EAEAEC;
  font-size: 24px;
  margin: 0;
}

#movies_container {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
}

.movie-card {
    position: relative;
    background-color: #3A3C41;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.year-info {
    font-size: 0.8rem;
    color: #EAEAEC;
    margin-top: 5px;
    opacity: 0.8;
}

.rating-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 5px;
    font-size: 0.9rem;
}

.rating-star {
    color: #E5A00D;
}

.rating-value {
    color: #EAEAEC;
}

.character-info {
    font-size: 0.8rem;
    color: #EAEAEC;
    margin-top: 5px;
    font-style: italic;
    opacity: 0.9;
}

.movie-card > * {
    margin-bottom: 5px;
}

.movie-card > *:last-child {
    margin-bottom: 0;
}

.movie-poster-link {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-radius: 5px;
  margin-bottom: 10px;
  aspect-ratio: 2/3;
  width: 100%;
  position: relative;
  background-color: #3A3C41;
}

.movie-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
  transition: transform 0.3s ease;
}

.movie-poster.no-poster {
    width: 80px !important;
    height: auto !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: transparent;
    padding: 0;
}

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

.movie-poster.no-poster:hover {
  transform: translate(-50%, -50%) scale(1.05);
}

.movie-card p {
  color: #EAEAEC;
  margin: 10px 0;
  font-size: 14px;
  line-height: 1.2;
}

.plex-badge, .jellyfin-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    z-index: 10;
}

.plex-badge {
    background-color: #e5a00d;
}

.jellyfin-badge {
    background-color: #00a4dc;
}

.emby-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    z-index: 10;
    background-color: #52B54B;
}

#movie_data_overlay_content #watch_movie_button,
#movie_data_overlay_content #request_movie_button {
    background-color: #E5A00D;
    color: #282A2D;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
    margin-top: 20px;
}

#movie_data_overlay_content #watch_movie_button:hover,
#movie_data_overlay_content #request_movie_button:hover {
    background-color: #F8D68B;
}

.search-input:focus {
    outline: none;
    border-color: #F8D68B;
}

.search-input::placeholder {
    color: #888;
}

.request-button {
  background-color: #E5A00D;
  color: #282A2D;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 5px;
  font-weight: 600;
  transition: background-color 0.3s;
}

.request-button:hover {
  background-color: #F8D68B;
}

/* Scrollbar Styling */
#movie_data_overlay_content::-webkit-scrollbar,
#movies_overlay::-webkit-scrollbar {
  width: 8px;
}

#movie_data_overlay_content::-webkit-scrollbar-track,
#movies_overlay::-webkit-scrollbar-track {
  background: #282A2D;
  border-radius: 4px;
}

#movie_data_overlay_content::-webkit-scrollbar-thumb,
#movies_overlay::-webkit-scrollbar-thumb {
  background: #E5A00D;
  border-radius: 4px;
}

#movie_data_overlay_content::-webkit-scrollbar-thumb:hover,
#movies_overlay::-webkit-scrollbar-thumb:hover {
  background: #F8D68B;
}

/* Mobile styles (both PWA and browser) */
@media (max-width: 767px) {
  .grid-view-button {
    display: none !important;
  }

  body, main, #section {
    background-color: #282A2D;
    padding: 0;
    margin: 0;
  }

  main {
    padding-top: 80px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 100vh;
  }

  #section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    padding: 10px;
    margin-top: -20px;
    box-sizing: border-box;
    background-color: transparent;
    position: relative;
  }

  #movieContent {
    width: 100%;
    position: relative;
    z-index: 2;
    margin-top: 40px;
  }

  #img_background {
    height: 100%;
    bottom: 0;
    top: 0;
    position: absolute;
    z-index: 1;
  }

  .filter-container {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 30;
  }

  .movie_poster {
    width: 100%;
    padding: 0;
    margin-top: 0;
    box-sizing: border-box;
  }

  .movie_poster img {
    width: 100%;
    height: auto;
    object-fit: contain;
    max-height: 50vh;
    aspect-ratio: 2 / 3;
  }

  .movie_details {
    width: 100%;
    padding: 20px 10px;
    box-sizing: border-box;
  }

  #title {
    font-size: 2.5rem;
    text-align: center;
  }

  #actors {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  #movies_overlay_content {
    padding: 20px;
    margin: 10px;
  }
  #movies_container {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
    padding: 0;  
  }

  #sort_and_filter {
    flex-direction: column;
    align-items: stretch;
  }

  .search-container {
    width: 100%;
  }

  .search-input {
    width: 100%;
  }

  .sort-controls,
  .filter-buttons {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .sort-button,
  .filter-dropdown-button {
    flex: 1;
    margin: 5px 0;
    text-align: center;
  }

  .filter-dropdown-content {
    position: fixed;
    top: auto;
    left: 20px !important;
    right: 20px !important;
    width: calc(100% - 40px) !important;
    background-color: #282A2D;
    border: 1px solid #E5A00D;
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
  }

  .filter-buttons {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
  }

  .filter-dropdown-content .filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .filter-dropdown-content label {
    padding: 10px;
    border-radius: 4px;
  }

  #btn_watch,
  #btn_next_movie,
  #btn_power,
  #switch_service {
      height: 44px !important;
      margin: 0 !important;
  }

  .button_container {
    width: calc(100% - 16px);
    margin: 0 8px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }

  .button {
    box-sizing: border-box;
    font-size: 1.5em;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
  }

  #btn_watch {
    flex: 0 0 100%;
    max-width: 100%;
  }

  #btn_next_movie,
  #btn_power {
    flex: 0 0 calc(50% - 5px);
  }

  #btn_power[style*="display: none"] ~ #btn_next_movie,
  #btn_power.hidden ~ #btn_next_movie {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    margin-right: 0 !important;
  }

  #btn_next_movie {
    margin-right: 10px;
  }

  #switch_service {
    position: relative;
    flex: 0 0 auto;
    width: 100% !important;
    height: 44px !important;
    margin: 0 8px !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    background-color: #E5A00D !important;
    font-size: 1.5em;
    display: flex;
    align-items: center !important;
    justify-content: center !important;
  }

  #switch_service .switch-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    opacity: 0.8;
  }

  /* Ensure consistent text size */
  #switch_service .service-name {
    text-align: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  #btn_next_movie svg,
  #btn_power svg {
    width: 32px; 
    height: 32px;
  }

  .logo-container {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    width: calc(100% - 32px);
    margin: 0 16px;
  }

  .logo {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 24px;
  }

  .logo[src*="tmdb_logo"] {
    max-height: 20px;
  }
  .logo[src*="imdb_logo"] {
    max-height: 28px;
  }
  .logo[src*="trakt_logo"] {
    max-height: 26px;
  }
  .logo[src*="youtube_logo"] {
    max-height: 36px;
  }

  body.homepage-mode #description {
    display: block !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: unset !important;
    max-height: none !important;
    overflow: visible !important;
    padding-right: 0 !important;
  }

  body.homepage-mode #description.truncated::after {
    display: none !important;
  }

}

/* PWA Specific Styles */
@media all and (display-mode: standalone) and (max-width: 767px) {
  body {
    padding-top: 0;
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  #section {
    padding-top: env(safe-area-inset-top);
  }

  .filter-container {
    top: env(safe-area-inset-top);
    right: calc(10px + env(safe-area-inset-right));
  }

  .version-label {
    bottom: calc(10px + env(safe-area-inset-bottom));
    right: calc(10px + env(safe-area-inset-right));
  }

  .close-button,
  #movies_overlay_close,
  #client_prompt_close,
  #device_prompt_close,
  #trailer_popup_close {
    top: max(20px, env(safe-area-inset-top) + 20px);  
  }
}

  #person_header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
  }

  #person_header h2 {
    color: #EAEAEC;
    font-size: 24px;
    margin: 0;
    margin-left: 20px;
  }

/* Mobile specific styles for client/device prompts */
@media (max-width: 767px) {
  #container_list_of_clients, #container_list_of_devices {
    margin: 0 10px;
    padding: 15px;
    width: calc(100% - 20px);
  }

  .client, .device {
    padding: 12px 15px;
    font-size: 1.1rem;
  }

  #client_prompt_close, #device_prompt_close {
    top: 15px;
    right: 15px;
  }
}

@media screen and (orientation: landscape) and (max-height: 600px) {
  body:not(.in-iframe)::before {
    content: "Please rotate your device to portrait mode";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #282A2D;
    color: #EAEAEC;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    font-size: 1.2em;
  }

  body:not(.in-iframe) main {
    display: none !important;
  }
}

body.in-iframe .main-nav {
    display: none;
}

body.in-iframe main {
    padding-top: 0;
}

@media all and (display-mode: standalone) {
    body.in-iframe main {
        padding-top: 0;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
  #section {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-gap: 20px;
    padding: 20px;
  }

  .movie_poster {
    grid-row: 1 / span 2;
    width: 300px;
  }

  .movie_details {
    grid-column: 2;
  }

  .button_container {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-start;
    flex-wrap: nowrap;
  }

  #btn_watch {
    flex-grow: 1;
    max-width: 300px;
  }

  #btn_next_movie, #btn_power, #switch_service {
    flex-basis: auto;
    margin-left: 10px;
  }

  .filter-container {
    position: absolute;
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    z-index: 30;
  }

  .filter-button {
    display: flex !important;
  }

  #movies_container {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

@supports (padding: max(0px)) {
  body {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
    padding-top: 0;
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }

  #section {
    padding-top: max(0px, env(safe-area-inset-top));
  }
}

/* Desktop and larger screens */
@media screen and (min-width: 1025px) and (orientation: landscape) {
  body, main, #section {
    width: 100vw !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  #section {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    grid-gap: 20px;
    padding: 20px !important;
  }

  .movie_poster {
    grid-row: 1 / span 2;
    max-width: 300px;
  }

  .movie_details {
    grid-column: 2;
    max-width: none;
  }

  .button_container {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
  }

  #btn_watch {
    width: 225px;
    height: 1.5em;
    flex-grow: 1;
    max-width: 225px;
  }

  #btn_next_movie, #btn_power {
    height: 1.5em;
    width: 1.5em;
    flex-grow: 0;
  }

  #switch_service {
    width: auto;
    height: 1.5em;
    padding: 5px 10px;
    font-size: 2em;
  }
}

/* Container for search bar and buttons */
#sort_and_filter {
    display: flex;
    align-items: center;
    gap: 10px; 
    width: 100%;
    margin-bottom: 20px;
}

/* Search container styles */
.search-container {
    flex-grow: 1;
    position: relative;
}

.clear-search {
    position: absolute;
    right: 190px;
    top: 40%;
    transform: translateY(-50%);
    cursor: pointer;
    padding: 0 10px;
    font-size: 20px;
    color: #888;
}

/* Search input styles */
.search-input {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    background: #3A3C41;
    border: 1px solid #E5A00D;
    color: #EAEAEC;
    height: 36px;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;  
}

.search-input::placeholder {
    color: #888;
}

.search-input:focus {
    outline: none;
    border-color: #F8D68B;
}

/* Sort controls (Year and Rating buttons) */
.sort-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Filter buttons (Library Status and Watch Status) */
.filter-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Sort and Filter Buttons */
.sort-button,
.filter-dropdown-button {
    height: 36px;
    padding: 0 16px;
    background-color: #282A2D;
    color: #EAEAEC;
    border: 1px solid #E5A00D;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
}

.sort-button:hover,
.filter-dropdown-button:hover {
    background-color: #3A3C41;
}

.sort-button.active,
.filter-dropdown-button.active {
    background-color: #E5A00D;
    color: #282A2D;
}

.filter-dropdown-content {
    position: fixed;
    background-color: #3A3C41;
    border-radius: 8px;
    padding: 12px;
    z-index: 2100;
    min-width: 200px;
    border: 1px solid #E5A00D;
}

.filter-dropdown-content.hidden {
    display: none;
}

.filter-dropdown-content .filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Sort button base styles */
.sort-button {
    background-color: #282A2D;
    color: #EAEAEC;
    border: 1px solid #E5A00D;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    min-width: 100px;
    justify-content: center;
}

.sort-button .sort-direction {
    font-size: 0.8em;
    opacity: 0.8;
    margin-left: 4px;
    white-space: nowrap;
}

.sort-button:hover {
    background-color: #3A3C41;
}

.sort-button.active {
    background-color: #E5A00D;
    color: #282A2D;
}

/* Sort direction indicator */
.sort-button .sort-icon {
    width: 12px;
    height: 12px;
    transition: transform 0.2s ease;
}

.sort-button.desc .sort-icon {
    transform: rotate(180deg);
}

@media (max-width: 767px) {
    .sort-button {
        padding: 8px;
        min-width: 0;
    }

    .sort-button .sort-text {
        display: none;
    }

    .sort-button .sort-direction {
        margin-left: 0;
    }
}

.setup-message {
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    color: white;
    border-left: 4px solid #e50914;
}

.setup-welcome {
    text-align: center;
}

.setup-welcome h2 {
    color: #e50914;
    margin-bottom: 15px;
}

.setup-welcome p {
    margin-bottom: 10px;
    line-height: 1.5;
}

.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #282A2D;
    padding: 10px 20px;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-link {
    color: #EAEAEC;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    transition: all 0.2s;
    font-weight: 500;
}

.movies-link-mobile {
    display: none;
}

.nav-link:hover {
    background-color: #3A3C41;
}

.nav-link.active {
    background-color: #E5A00D;
    color: #282A2D;
}

/* PWA support */
@media all and (display-mode: standalone) {
    .main-nav {
        padding-top: max(10px, env(safe-area-inset-top));
    }

    main {
        padding-top: calc(100px + env(safe-area-inset-top));
    }

    #section {
	margin-top: calc(-40px - env(safe-area-inset-top));
    }

    #movieContent {
        margin-top: calc(60px + env(safe-area-inset-top));
    }

    #img_background {
	top: 0
   }

   .filter-container {
        top: calc(0px + env(safe-area-inset-top));
    }
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .nav-links {
        justify-content: space-between;
    }

    .movies-menu-desktop {
        display: none;
    }

    .movies-link-mobile {
        display: block;
    }

    .nav-link {
        padding: 6px 12px;
        font-size: 0.9em;
    }

}

.more-directors,
.more-writers,
.more-actors {
    color: #E5A00D;
    text-decoration: underline;
    cursor: pointer;
}

.more-directors:hover,
.more-writers:hover,
.more-actors:hover {
    color: #F8D68B;
}

.cast-item .actor-name,
.cast-item .person-name {
    color: #E5A00D;
}

.cast-item:hover .actor-name,
.cast-item:hover .person-name {
    color: #F8D68B;
}

.cast-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(40, 42, 45, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2500;
}

.cast-dialog-content {
    background-color: #3A3C41;
    border-radius: 15px;
    padding: 30px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.cast-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.actor-name {
    color: #E5A00D;
}

.cast-item {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background-color: #282A2D;
    border-radius: 5px;
    transition: all 0.2s ease;
}

.cast-item:hover {
    background-color: #4A4C51;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.movie_details .clickable-person {
    cursor: pointer;
    text-decoration: underline;
    color: #E5A00D;
}

.movie_details .clickable-person:hover {
    color: #F8D68B;
}

.more-actors {
    color: #E5A00D;
    cursor: pointer;
    text-decoration: underline;
}

.more-actors:hover {
    color: #F8D68B;
}

.actor-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.actor-character {
    font-size: 0.85em;
    color: #888;
    font-style: italic;
}

.cast-dialog h3 {
    color: #E5A00D;
    margin-top: 0;
    margin-bottom: 20px;
}

.cast-dialog-content::-webkit-scrollbar {
    width: 8px;
}

.cast-dialog-content::-webkit-scrollbar-track {
    background: #282A2D;
    border-radius: 4px;
}

.cast-dialog-content::-webkit-scrollbar-thumb {
    background: #E5A00D;
    border-radius: 4px;
}

.cast-dialog-content::-webkit-scrollbar-thumb:hover {
    background: #F8D68B;
}

.cast-search {
    width: 100%;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #282A2D;
    border: 1px solid #E5A00D;
    border-radius: 5px;
    color: #EAEAEC;
    font-size: 16px;
    box-sizing: border-box;
}

.cast-search:focus {
    outline: none;
    border-color: #F8D68B;
}

.actor-image {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #E5A00D;
    flex-shrink: 0;
}

#person_header a {
    display: block;
    transition: transform 0.3s ease;
    text-decoration: none;
}

#person_header a:hover {
    transform: scale(1.05);
}

/* Person details overlay styles */
#person_details_overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(40, 42, 45, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2200;
}

#person_details_overlay.visible {
    display: flex;
}

.person-details-content {
    background-color: #3A3C41;
    border-radius: 15px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    position: relative;
    color: #EAEAEC;
}

.person-details-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.person-details-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid #E5A00D;
    object-fit: cover;
}

.person-details-info h2 {
    margin: 0;
    color: #E5A00D;
    font-size: 24px;
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .person-details-content {
        margin: 20px;
        padding: 20px;
    }

    .person-details-header {
        flex-direction: column;
        text-align: center;
    }

}

.person-image-link {
    display: block;
    transition: transform 0.3s ease;
    text-decoration: none;
    cursor: pointer;
}

.person-image-link:hover {
    transform: scale(1.05);
}

.person-image-link .person-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #E5A00D;
}

/* For SVG placeholder */
.person-image-link svg.person-image {
    width: 100px;
    height: 100px;
}

/* Ensure proper sizing in the header */
#person_header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

#person_header h2 {
    color: #EAEAEC;
    font-size: 24px;
    margin: 0;
    margin-left: 20px;
}

#trailer_container p {
    text-align: center;
    color: #EAEAEC;
    opacity: 0.8;
    padding: 20px 0;
    font-size: 0.9em;
    font-weight: 300;
}

.person-biography {
    color: #EAEAEC;
    opacity: 0.8;
    font-size: 0.9em;
    font-weight: 300;
    line-height: 1.6;
    text-align: left;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 10px;
}

/* --- Collection Modal Styles --- */
#collection_modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.collection-modal-content {
    background-color: rgba(34, 34, 34, 0.9);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
    color: #eee;
    width: 90%;
    max-width: 1400px !important; 
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-height: 85vh;
    overflow-y: auto;
}

.main-page-modal .collection-modal-content {
    max-width: 800px !important;
}

.main-page-modal .movie-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.95em;
    gap: 10px;
}

.main-page-modal .movie-title {
    flex-grow: 1;
    margin-right: 10px;
    color: #eee;
    display: inline;
}

.main-page-modal .status-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

#collection_modal.two-movie-collection .collection-modal-content {
    max-width: 950px !important;
}

.collection-modal-content .close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.collection-modal-content .close-button svg {
    width: 20px;
    height: 20px;
    fill: #aaa;
    transition: fill 0.3s ease;
}

.collection-modal-content .close-button:hover svg {
    fill: #fff;
}

.collection-info-header h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--accent-color);
    font-weight: 700;
    text-align: center;
    font-size: 1.4em;
}

.unwatched-movies, .other-movies {
    margin-bottom: 20px;
}

.unwatched-movies p, .other-movies h4 {
    margin-bottom: 10px;
    font-weight: 500;
    color: #ccc;
}

.other-movies h4 {
    font-size: 1.1em;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
    margin-top: 15px;
}

.movie-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.movie-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.95em;
    gap: 10px;
}

.movie-item:last-child {
    border-bottom: none;
}

.movie-title {
    flex-grow: 1;
    margin-right: 5px;
    color: #eee;
    display: inline;
}

.request-icon-span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 5px;
    padding: 2px;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    vertical-align: middle;
    width: 22px;
    height: 22px;
}

.request-icon-span:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.request-icon {
    width: 16px;
    height: 16px;
    fill: #4CAF50;
}

.request-icon-span.requested {
    cursor: default;
    pointer-events: none;
}

.request-icon-span.requested:hover {
    background-color: transparent;
}

.request-icon.requested {
    fill: #aaa;
}

.request-icon-span .fa-spinner {
    font-size: 14px;
    color: var(--accent-color);
}


.movie-status {
    font-size: 0.85em;
    padding: 3px 8px;
    border-radius: 5px;
    white-space: nowrap;
    margin-left: auto;
}

.status-in-library {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.5);
}

.status-requested {
    background-color: rgba(33, 150, 243, 0.2);
    color: #2196F3;
    border: 1px solid rgba(33, 150, 243, 0.5);
}

.status-not-in-library {
    background-color: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.5);
}

.action-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.action-button {
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.1s ease;
    font-size: 0.9em;
}

.action-button:active {
    transform: scale(0.98);
}

.action-button.watch-button {
    background-color: var(--accent-color);
    color: #111;
}

.action-button.watch-button:hover {
    background-color: #ffd95a;
}

.action-button.request-button {
    background-color: #4CAF50;
    color: white;
}

.action-button.request-button:hover:not(:disabled) {
    background-color: #66bb6a;
}

.action-button.request-button:disabled {
    background-color: #555;
    color: #999;
    cursor: not-allowed;
    opacity: 0.7;
}

.action-button.dismiss-button {
    background-color: #666;
    color: #eee;
}

.action-button.dismiss-button:hover {
    background-color: #777;
}

#collection_modal .movie-item .action-button.watch-button,
#collection_modal .movie-item .movie-status {
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    padding: 0 12px !important;
    font-size: 14px !important;
    flex: 0 0 auto !important;
    line-height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* --- End Collection Modal Styles --- */

/* --- Toast Notification Styles --- */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
}

.toast {
    background-color: #3A3C41;
    color: #EAEAEC;
    padding: 16px 24px;
    border-radius: 8px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-out forwards;
    border-left: 4px solid #E5A00D;
}

.toast.success {
    border-left-color: #4CAF50;
}

.toast.error {
    border-left-color: #f44336;
}

.toast-icon {
    margin-right: 12px;
    display: flex;
    align-items: center;
}

.toast-message {
    font-weight: 500;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast.removing {
    animation: slideOut 0.3s ease-in forwards;
}

/* Unified close button style */
.close-button,
#movies_overlay_close,
#client_prompt_close,
#device_prompt_close,
#trailer_popup_close {
    position: fixed;
    top: 30px;
    right: 30px;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    padding: 0;
    z-index: 1001;
    cursor: pointer;
}

.close-button svg,
#movies_overlay_close svg,
#client_prompt_close svg,
#device_prompt_close svg,
#trailer_popup_close svg {
    width: 100%;
    height: 100%;
    fill: #EAEAEC;
    transition: fill 0.2s;
}

.close-button:hover svg,
#movies_overlay_close:hover svg,
#client_prompt_close:hover svg,
#device_prompt_close:hover svg,
#trailer_popup_close:hover svg {
    fill: #E5A00D;
}

/* Loading overlay unified styles */
.custom-loading {
    background-color: #3A3C41;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    color: #EAEAEC;
    max-width: 500px;
    position: relative;
}

.custom-loading h3 {
    color: #E5A00D;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.progress-ring {
    width: 80px;
    height: 80px;
    margin: 20px auto;
    position: relative;
    animation: rotate 2s linear infinite;
}

.progress-ring circle {
    fill: none;
    stroke: #E5A00D;
    stroke-width: 4;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

.loading-status {
    margin-top: 20px;
    color: #EAEAEC;
    font-size: 0.9em;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* PWA support for close buttons */
@supports (padding: max(0px)) {
    .close-button,
    #movies_overlay_close,
    #client_prompt_close,
    #device_prompt_close,
    #trailer_popup_close {
        top: max(30px, env(safe-area-inset-top) + 10px);
        right: max(30px, env(safe-area-inset-right) + 10px);
    }

    #trailer_iframe {
        margin-top: max(50px, env(safe-area-inset-top) + 30px);
    }
}

body.homepage-mode .movie_details .clickable-person {
    color: #EAEAEC !important;  
    cursor: default !important;
    text-decoration: none !important;
}

body.homepage-mode .movie_details .more-actors {
    color: #EAEAEC !important;
    cursor: default !important;
    text-decoration: none !important;
}

.no-clients-message {
  background-color: #3A3C41;
  color: #EAEAEC;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  font-size: 1.1em;
  margin: 20px;
  border: 1px solid #E5A00D;
}

body.homepage-mode #description {
    display: block !important;  
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: unset !important;
    max-height: none !important;
    overflow: visible !important;
}

body.homepage-mode #description.truncated::after {
    display: none !important;
}

.trakt-confirm-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(40, 42, 45, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.dialog-content {
    background-color: #3A3C41;
    border-radius: 15px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    margin: auto;
    position: relative;
}

.dialog-content h3 {
    color: #E5A00D;
    margin: 0 0 20px 0;
    font-size: 24px;
}

.changelog {
    background-color: #282A2D;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    max-height: 60vh;
    overflow-y: auto;
}

.changelog h4 {
    color: #E5A00D;
    margin: 0 0 12px 0;
    font-size: 1.1em;
}

.changelog-content {
    color: #EAEAEC;
    white-space: pre-line;
    line-height: 1.6;
    padding-right: 10px;
}

.version-info {
    color: #EAEAEC;
    font-size: 16px;
    line-height: 1.4;
}

.dialog-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}

.dialog-buttons .cancel-button,
.dialog-buttons .submit-button {
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    border: none;
    text-decoration: none;
}

.dialog-buttons .cancel-button {
    background-color: #282A2D;
    color: #EAEAEC;
}

.dialog-buttons .submit-button {
    background-color: #E5A00D;
    color: #282A2D;
}

.dialog-buttons .cancel-button:hover {
    background-color: #3A3C41;
}

.dialog-buttons .submit-button:hover {
    background-color: #F8D68B;
}

.trakt-confirm-dialog .dialog-content p,
.trakt-confirm-dialog .version-info {
    color: #EAEAEC;
    font-weight: 300;
}

.trakt-confirm-dialog .changelog-content {
    color: #EAEAEC;
    font-weight: 300;
    white-space: pre-line;
    line-height: 1.6;
}

#switch_service {
    position: relative;
}

#switch_service .service-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
}

#switch_service .service-count {
    font-size: 1em;
    opacity: 0.8;
    display: inline-flex;
    align-items: center;
}

@media (max-width: 767px) {
    #switch_service .service-info {
        width: 100%;
	justify-content: space-between;
        position: relative;
    }

    #switch_service .service-count {
    	margin-right: 24px;
	font-size: inherit;
        margin-left: auto;
    }
}

.filter-container {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 30;
    display: flex;
    flex-direction: row;  
    gap: 10px;
}

.search-button {
    background-color: #E5A00D;
    color: #282A2D;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex !important;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    padding: 0;
    transition: all 0.2s;
}

.search-button:hover {
    background-color: #F8D68B;
    transform: translateY(-1px);
}

.search-icon {
    width: 24px;
    height: 24px;
    display: block !important;
    transition: all 0.2s;
    margin: auto;
}

#search_modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(40, 42, 45, 0.95);
    display: flex;
    justify-content: center;
    padding: 20px;
    z-index: 2100;
    box-sizing: border-box;
    overflow-y: auto;
}

.search-modal-content {
    width: 90%;
    max-width: 1200px;
    margin-top: 60px;
    position: relative;
}

.search-modal-input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    background: #282A2D;
    border: 1px solid #E5A00D;
    color: #EAEAEC;
    font-size: 18px;
    margin-bottom: 20px;
}

#search_results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

#search_results .movie-card {
    position: relative;
    width: 150px;
    display: flex;
    flex-direction: column;
}

#search_results .movie-poster-link {
    position: relative;
    display: block;
    width: 150px;
    height: 225px;
}

#search_results .movie-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
    transition: transform 0.3s ease;
}

#search_results .movie-poster.no-poster {
    width: 80px !important;
    height: auto !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#search_results p {
    margin: 10px 0;
    color: #EAEAEC;
    font-size: 14px;
    text-align: center;
    flex: 0 0 auto;
}

#search_results .request-button {
    margin-top: auto;
    flex: 0 0 auto;
}

.loading-indicator {
    color: #EAEAEC;
    text-align: center;
    padding: 40px 20px;
    font-size: 1.2em;
}

.search-error {
    color: #ff6b6b;
    text-align: center;
    padding: 40px 20px;
    font-size: 1.2em;
}

.no-results {
    text-align: center;
    width: 100%;
}

.no-results div {
    width: 100%;
    text-align: center;
}

.no-results div:first-child {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: #E5A00D;
}

.no-results div:last-child {
    font-size: 1em;
    color: #EAEAEC;
    opacity: 0.8;
}

@media (max-width: 767px) {
    .filter-container {
        flex-direction: column;  
    }

    #search_modal {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
    }

    .search-modal-content {
        width: 90%;
        max-width: 1200px;
        margin: 0;
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .search-modal-input {
        width: 100%;
        text-align: center;
    }

    .search-modal-input::placeholder {
        text-align: center;
    }

    #search_results {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        justify-content: center;
        gap: 20px;
        padding: 20px 0;
    }
}

/* PWA support */
@supports (padding: max(0px)) {
    .filter-container {
        top: max(10px, env(safe-area-inset-top));
        right: max(10px, env(safe-area-inset-right));
    }
}

/* Button spinner */
.button-spinner {
    width: 16px;
    height: 16px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 5px;
    animation: rotateButton 1s linear infinite;
}

.button-spinner circle {
    fill: none;
    stroke: currentColor;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 31.4;
    stroke-dashoffset: 31.4;
    transform-origin: center;
    animation: dashButton 1.5s ease-in-out infinite;
}

@keyframes rotateButton {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dashButton {
    0% {
        stroke-dashoffset: 31.4;
    }
    50% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: -31.4;
    }
}

/* Collection button styling */
.collection-button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background-color: #e5a00d;
    cursor: pointer;
    animation: breath 2s infinite;
    position: relative;
    z-index: 10;
}

.collection-button.hidden {
    display: none;
}

.collection-icon {
    width: 24px;
    height: 24px;
    color: white;
}

.collection-button .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

#collection_modal .movie-list {
    list-style: none;
    padding: 0;
}

#collection_modal .movie-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #444;
}

#collection_modal .movie-title-link {
    color: #EAEAEC;
    text-decoration: none;
}

#collection_modal .movie-title-link:hover {
    text-decoration: underline;
}

#collection_modal .request-icon-span {
    cursor: pointer;
    margin-left: 10px;
}

#collection_modal .request-icon {
    fill: #E5A00D;
}

#collection_modal .movie-status {
    font-size: 0.9em;
    padding: 2px 6px;
    border-radius: 4px;
}

#collection_modal .status-in-library {
    background-color: #27ae60;
    color: white;
}

#collection_modal .status-requested {
    background-color: #2980b9;
    color: white;
}

#collection_modal .status-not-in-library {
    background-color: #c0392b;
    color: white;
}

#collection_modal .action-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

#collection_modal .action-button {
    padding: 10px 20px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
}

#collection_modal .request-button {
    background-color: #E5A00D;
    color: #282A2D;
}

#collection_modal .dismiss-button {
    background-color: #7f8c8d;
    color: white;
}

.collection-movies {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.5rem;
}

.modal-movie-card {
    display: flex;
    background-color: #000;
    border-radius: 10px;
    box-shadow: 0px 20px 30px 3px rgba(0, 0, 0, 0.55);
    width: 100%;
    margin: 0;
    overflow: hidden;
    position: relative;
}

.modal-movie-card .card_left {
    width: 40%;
    overflow: hidden;
}

.modal-movie-card .card_left img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px 0 0 10px;
}

.modal-movie-card .card_right {
    width: 60%;
    padding: 1.5rem;
    color: white;
    font-family: 'Montserrat', sans-serif;
    display: flex;
    flex-direction: column;
}

.modal-movie-card .card_right h1 {
    font-size: 1rem;
}

.modal-movie-card .card_right__review {
    overflow-y: auto;
    margin-bottom: 1rem;
    flex-grow: 1;
    padding-bottom: 50px;
}

.modal-movie-card .card_right__review p {
    font-size: 0.7rem;
    color: #EAEAEC;
    max-height: 6.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
}

.modal-movie-card .card_right__details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 0;
}

.modal-movie-card .collection-movie-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    position: absolute;
    bottom: 0.5rem;
    right: 1.5rem;
    left: 35%;
    padding-left: 1.5rem;
    box-sizing: border-box;
}

.modal-movie-card .collection-movie-actions > * {
    height: 32px;
    padding: 0 12px;
    line-height: 32px;
}

.modal-movie-card .read-more-link {
    font-size: 0.7rem;
    color: #E5A00D;
    text-decoration: none;
    display: block;
    margin-top: 0.5rem;
}

.collection-movie-card {
    background-color: #282A2D;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

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

.collection-movie-poster {
    width: 100%;
    height: auto;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.collection-movie-card-content {
    padding: 10px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.collection-movie-card {
}

.collection-movie-card .movie-title {
    font-size: 0.9em;
    font-weight: 600;
    color: #EAEAEC;
    margin-bottom: 10px;
}

.collection-movie-overview {
    font-size: 0.8em;
    color: #b0b0b0;
    margin-bottom: 10px;
    flex-grow: 1;
}

.collection-movie-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.collection-movie-actions .request-icon-span {
    margin-right: 5px;
}

.collection-movie-actions .movie-status,
.collection-movie-actions .watch-button {
    font-size: 0.8em;
    padding: 5px 8px;
    border-radius: 5px;
}

.collection-movie {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.collection-movie img {
    width: 100%;
    border-radius: 5px;
}

.collection-movie p {
    margin-top: 0.5rem;
    text-align: center;
}

.button-container {
    margin-top: 0.5rem;
}

.request-all-button {
    margin-top: 1rem;
    width: 100%;
    padding: 0.75rem;
    background-color: #E5A00D;
    color: #282A2D;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

@keyframes breath {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(229, 160, 13, 0.7); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(229, 160, 13, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(229, 160, 13, 0); }
}

/* Mobile layout adjustments */
@media (max-width: 767px) {
    .filter-container {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 8px;
    }

    .filter-button, .search-button, .collection-button {
        margin-bottom: 8px;
    }
}

/* Collection button styling */
.collection-button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background-color: #e5a00d;
    cursor: pointer;
    animation: breath 2s infinite;
    position: relative;
    z-index: 10;
    font-size: 24px;
    color: black !important;
    font-weight: normal !important;
}

.collection-button.hidden {
    display: none;
}

.collection-button .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

@keyframes breath {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(229, 160, 13, 0.7); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(229, 160, 13, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(229, 160, 13, 0); }
}

/* Mobile layout adjustments */
@media (max-width: 767px) {
    .filter-container {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 8px;
    }

    .filter-button, .search-button, .collection-button {
        margin-bottom: 8px;
    }
}

/* Collection button styling */
.collection-button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background-color: #e5a00d;
    cursor: pointer;
    animation: breath 2s infinite;
    position: relative;
    z-index: 10;
    font-size: 24px;
    color: white;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.collection-button.hidden {
    display: none;
}

.collection-button .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

@keyframes breath {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(229, 160, 13, 0.7); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(229, 160, 13, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(229, 160, 13, 0); }
}

/* Collection button styling */
.collection-button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background-color: #e5a00d;
    cursor: pointer;
    animation: breath 2s infinite;
    position: relative;
    z-index: 10;
    font-size: 24px;
    color: white;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.collection-button.hidden {
    display: none;
}

.collection-button .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

@keyframes breath {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(229, 160, 13, 0.7); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(229, 160, 13, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(229, 160, 13, 0); }
}

/* Mobile layout adjustments */
@media (max-width: 767px) {
    .filter-container {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 8px;
    }

    .filter-button, .search-button, .collection-button {
        margin-bottom: 8px;
    }
}

/* Collection modal styling */
#collection_modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#collection_modal.hidden {
    display: none;
}

.collection-modal-content {
    background: #3A3C41;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 25px;
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

#collection_info_container {
    margin-top: 20px;
}

/* Collection info styles within the modal */
.collection-info-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.collection-info-header h3 {
    font-size: 1.8rem;
    margin: 0;
    color: #e5a00d;
    font-weight: bold;
}

.unwatched-movies, .other-movies {
    margin-top: 20px;
}

.unwatched-movies p {
    font-size: 1.1rem;
    margin-bottom: 12px;
    font-weight: normal;
    color: #ddd;
}

.other-movies h4 {
    color: #e5a00d;
    margin-bottom: 12px;
    font-size: 1.4rem;
    font-weight: bold;
}

.movie-list {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}

.movie-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.movie-title {
    flex: 1;
    font-size: 1rem;
    font-weight: normal;
}

.movie-status,
#collection_modal .movie-item .watch-button {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-left: 8px;
    text-align: center;
    min-width: 100px;
    font-weight: normal;
    height: 28px;
    box-sizing: border-box;
    line-height: 20px;
}

.status-in-library {
    background-color: #4CAF50;
    color: white;
}

.status-requested {
    background-color: #f44336;
    color: white;
}

.status-not-in-library {
    background-color: #ff9800;
    color: white;
}

.status-unwatched {
    background-color: #4CAF50;
    color: white;
}

.status-watched-again {
    background-color: #008CBA;
    color: white;
}

.action-buttons {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    gap: 12px !important;
    margin-top: 30px !important;
    width: 100% !important;
    align-items: stretch !important;
    position: relative !important;
}

.action-button {
    flex: 1 1 0 !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    padding: 0 16px !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important;
    margin: 0 !important;
    white-space: nowrap !important;
    position: relative !important;
    vertical-align: middle !important;
    line-height: 1 !important;
    float: none !important;
}

.watch-button {
    background-color: #2ecc71 !important;
    color: white !important;
}

.request-button {
    background-color: #e74c3c !important;
    color: white !important;
    position: relative !important;
    top: 0 !important;
    bottom: 0 !important;
    align-self: stretch !important;
}

#request_collection_movies {
    flex: 1 1 0 !important;
    height: 48px !important;
    min-height: 48px !important;
    position: relative !important;
    top: 0 !important;
    margin: 0 !important;
    padding: 0 16px !important;
}

.dismiss-button {
    background-color: #7f8c8d !important;
    color: white !important;
}

.action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.watch-button:hover {
    background-color: #27ae60 !important;
}

.request-button:hover {
    background-color: #c0392b !important;
}

.dismiss-button:hover {
    background-color: #95a5a6 !important;
}

.action-button.disabled,
.action-button:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    box-shadow: none !important;
    transform: none !important;
}

.action-buttons > * {
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Modal scrollbar styling */
.collection-modal-content::-webkit-scrollbar {
    width: 8px;
}

.collection-modal-content::-webkit-scrollbar-track {
    background: #282A2D;
    border-radius: 4px;
}

.collection-modal-content::-webkit-scrollbar-thumb {
    background: #E5A00D;
    border-radius: 4px;
}

.collection-modal-content::-webkit-scrollbar-thumb:hover {
    background: #F8D68B;
}

/* Media query for mobile devices */
@media (max-width: 480px) {
    .collection-modal-content {
        padding: 20px;
        width: 95%;
        max-height: 85vh;
    }

    .action-buttons {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .action-button {
        width: 100% !important;
    }

    .collection-info-header h3 {
        font-size: 1.5rem;
    }
}

@supports (padding: max(0px)) {
    .collection-modal-content {
        padding-left: max(25px, env(safe-area-inset-left));
        padding-right: max(25px, env(safe-area-inset-right));
        padding-bottom: max(25px, env(safe-area-inset-bottom));
    }
}

.movie-card {
    position: relative;
    background-color: #3A3C41;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 360px; 
    overflow: visible; 
}

.movie-info {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 60px; 
}

.movie-title {
    margin: 8px 0 4px 0;
    font-size: 0.9rem;
    font-weight: bold;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

.movie-character {
    margin: 0 0 8px 0;
    font-size: 0.8rem;
    color: #aaa;
    font-style: italic;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    max-height: 2.4em;
}

@media (min-width: 768px) {
    .movie-card:hover .movie-title,
    .movie-card:hover .movie-character {
        -webkit-line-clamp: unset;
        max-height: none;
        height: auto;
        overflow: visible;
        z-index: 10;
        background-color: #3A3C41;
        position: relative;
    }
}

.movie-card .request-button {
    margin-top: auto;
    margin-bottom: 5px;
    width: 100%;
}

.movie-poster-link {
    height: 225px;
}

body.homepage-mode #movie-logo-container {
    display: none !important;
}

#movie-logo-container {
  position: absolute; 
  top: 80px; 
  left: 50%; 
  transform: translateX(-50%); 
  z-index: 5; 
  width: 80%; 
  max-width: 500px; 
  text-align: center; 
  pointer-events: none; 
}

#movie-logo-img {
  max-height: 100px; 
  max-width: 100%; 
  height: auto; 
  width: auto; 
  object-fit: contain; 
  display: block; 
  margin: 0 auto; 
  background-color: transparent !important; 
  border: none !important; 
  outline: none !important; 
  box-shadow: none !important; 
}

@media (max-width: 767px) {
  #movie-logo-container {
    display: none !important; 
  }

  #movie-logo-img {
    display: none !important; 
  }
}

#btn_get_movie.initially-hidden {
    display: none;
}

/* Styling for TMDB/IMDb links in person biography modal */
#person_details_overlay .person-details-content .movie-links {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  margin-bottom: 15px;
  justify-content: center;
}

#person_details_overlay .person-details-content .movie-links a {
  background-color: #282A2D;
  color: #EAEAEC;
  text-decoration: none;
  padding: 10px 15px;
  border-radius: 8px;
  transition: all 0.3s ease;
  display: inline-block; 
  text-align: center;
  font-weight: 500;
}

#person_details_overlay .person-details-content .movie-links a:hover {
  background-color: #E5A00D;
  color: #282A2D;
}

#collection_modal .modal-movie-card .collection-movie-actions > * {
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    padding: 0 12px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-grow: 1;
    flex-basis: 0;
}

#collection_modal .modal-movie-card .collection-movie-actions > *:hover {
    transform: none !important;
}
