/* Modal Navigation Tabs Styling */
#movieModal .modal-header {
  padding: 0.65rem 1rem;
}

#movieModal .modal-body-full {
  padding-top: 0.25rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#movieModal #tabs-movie-content {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

#movieModal #edit_tab.active {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding-block: 0.75rem;
}

#movieModal #movie_form {
  flex-shrink: 0;
  width: 100%;
  margin-block: auto;
}

.movie-edit-fields {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.movie-edit-notes {
  row-gap: 1.25rem;
}

#movieModal #info_tab,
#movieModal #movie_data {
  height: 100%;
}

#movieModal #movie_data {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding-block: 0.5rem;
}

#movieModal #movie_p {
  width: 85%;
  min-height: 0;
  object-fit: contain;
  object-position: center bottom;
}

#movieModal #movie_poster_info {
  flex-shrink: 0;
  max-width: 85%;
  overflow-wrap: anywhere;
}

#movieModal .modal-nav-tabs {
  flex-shrink: 0;
  width: calc(100% - 0.5rem);
  max-width: 24rem;
  margin-inline: auto;
  gap: 0.3rem;
  padding: 0.25rem;
}

#movieModal .modal-nav-link {
  padding: 0.45rem 0.5rem;
  font-size: 0.85rem;
}

.modal-nav-tabs {
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--bs-body-bg);
  border-radius: 8px;
}

.modal-nav-link {
  border-radius: 6px;
  border: 1.5px solid transparent;
  background: rgba(13, 110, 253, 0.08);
  color: #495057;
  font-weight: 500;
  padding: 0.6rem 0.8rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-nav-link:hover {
  border-color: rgba(13, 110, 253, 0.3);
  background: rgba(13, 110, 253, 0.15);
  color: #0d6efd;
}

.modal-nav-link.active {
  border-color: #0d6efd;
  background: linear-gradient(135deg, rgba(13, 110, 253, 0.25) 0%, rgba(13, 110, 253, 0.15) 100%);
  color: #0d6efd;
  box-shadow: 0 2px 8px rgba(13, 110, 253, 0.2);
}

body[data-bs-theme="dark"] .modal-nav-tabs {
  background: var(--bs-body-bg);
}

body[data-bs-theme="dark"] .modal-nav-link {
  background: rgba(110, 168, 254, 0.1);
  color: #adb5bd;
}

body[data-bs-theme="dark"] .modal-nav-link:hover {
  border-color: rgba(110, 168, 254, 0.4);
  background: rgba(110, 168, 254, 0.18);
  color: #6ea8fe;
}

body[data-bs-theme="dark"] .modal-nav-link.active {
  border-color: #6ea8fe;
  background: linear-gradient(135deg, rgba(110, 168, 254, 0.3) 0%, rgba(110, 168, 254, 0.15) 100%);
  color: #6ea8fe;
  box-shadow: 0 2px 8px rgba(110, 168, 254, 0.25);
}

body[data-bs-theme="dark"] #movies_link:hover,
body[data-bs-theme="dark"] #series_link:hover {
  border-color: rgba(110, 168, 254, 0.75);
  background: rgba(110, 168, 254, 0.2);
  color: #e8f1ff;
}

body[data-bs-theme="dark"] #movies_link.active,
body[data-bs-theme="dark"] #series_link.active {
  border-color: #6ea8fe;
  background: rgba(110, 168, 254, 0.28);
  box-shadow: 0 0 0 2px rgba(110, 168, 254, 0.3);
  color: #ffffff;
}

#stats-list {
  padding-top: 0.25rem;
}

#stats-list .stats-list-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border: 1px solid rgba(13, 110, 253, 0.18);
  border-radius: 0.8rem;
  margin-bottom: 0.55rem;
  padding: 0.75rem 0.8rem;
  background: linear-gradient(180deg, rgba(13, 110, 253, 0.05), rgba(13, 110, 253, 0.02));
}

#stats-list .stats-list-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 0.55rem;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(13, 110, 253, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

#stats-list .stats-list-item-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#stats-list .stats-list-item-main {
  flex: 1;
  min-width: 0;
}

#stats-list .stats-list-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
  gap: 0.5rem;
}

#stats-list .stats-list-item-title {
  text-transform: capitalize;
  font-weight: 500;
}

#stats-list .stats-list-item-total {
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  background: rgba(13, 110, 253, 0.15);
  color: #0d6efd;
}

#stats-list .stats-list-progress {
  height: 0.6rem;
  border-radius: 999px;
  background-color: rgba(13, 110, 253, 0.12);
}

#stats-list .stats-list-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, #0d6efd 0%, #20c997 100%);
}

#stats-list .stats-list-item-footer {
  font-size: 0.72rem;
  opacity: 0.8;
  margin-top: 0.3rem;
}

body[data-bs-theme="dark"] #stats-list .stats-list-item {
  border-color: rgba(110, 168, 254, 0.4);
  background: linear-gradient(180deg, rgba(110, 168, 254, 0.16), rgba(110, 168, 254, 0.07));
}

body[data-bs-theme="dark"] #stats-list .stats-list-item-icon {
  background: rgba(110, 168, 254, 0.18);
}

body[data-bs-theme="dark"] #stats-list .stats-list-item-total {
  color: #dbe8ff;
  background: rgba(110, 168, 254, 0.25);
}

body[data-bs-theme="dark"] #stats-list .stats-list-progress {
  background-color: rgba(255, 255, 255, 0.12);
}

#myTab .nav-link {
  min-height: 46px;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.app-shell > .nav {
  overflow: hidden;
  background-color: #333;  
  position: fixed;
  bottom: 0;
  width: 100%;
}

.app-shell > .nav a {
  float: left;
  display: block;
  color: #f2f2f2;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
  font-size: 17px;
  flex: 1;
}

.app-shell > .nav a:hover {
  background-color: #4CAF50;
}

.app-shell > .nav a.active {
  background-color: #4CAF50;
}

.app-panel {
  display: none;
  margin-bottom: 60px;
}

.app-panel.active {
  display: block;
}

main {
  padding-bottom: 70px;
}

.modal-dialog-full{
    height:100%
}
.modal-content-full{
    height:90%
}
.modal-body-full{
    height:100%;
    min-height: 0;
    overflow:auto;
    overscroll-behavior-y: contain;
}

#movie_year:not(:empty) {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--bs-primary-border-subtle);
  border-radius: 50rem;
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary-text-emphasis);
  font-size: 0.95rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

#movie_year:not(:empty)::before {
  content: "\f214";
  font-family: bootstrap-icons;
  font-size: 0.9rem;
  font-weight: normal;
}

.movie-status-heading {
  float: none;
  width: auto;
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--bs-secondary-color);
}

.movie-status-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}

.movie-type-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
}

.movie-field-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding-block: 0.5rem;
  color: var(--bs-secondary-color);
  font-family: var(--bs-font-sans-serif);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.movie-field-label i {
  color: var(--bs-primary-text-emphasis);
  font-size: 0.95rem;
}

.movie-progress-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.movie-progress-card {
  padding: 0.65rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 1rem;
  background: var(--bs-tertiary-bg);
}

.movie-progress-card label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--bs-secondary-color);
  font-size: 0.8rem;
  font-weight: 600;
}

.movie-number-stepper {
  display: flex;
  align-items: center;
  border-radius: 0.7rem;
  background: var(--bs-body-bg);
}

.movie-number-stepper button {
  flex: 0 0 36px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0.7rem;
  background: transparent;
  color: var(--bs-primary-text-emphasis);
  font-size: 1.2rem;
}

.movie-number-stepper button:active {
  background: var(--bs-primary-bg-subtle);
}

.movie-number-stepper input {
  appearance: textfield;
  -moz-appearance: textfield;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: var(--bs-body-color);
  text-align: center;
  font-size: 1.25rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.movie-number-stepper input::-webkit-inner-spin-button,
.movie-number-stepper input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.movie-number-stepper :focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
}

#edit_media_picker:not(.d-none),
#edit_comment_picker:not(.d-none),
#edit_link_picker:not(.d-none),
.movie-editor-overlay:not(.d-none) {
  position: absolute;
  inset: 0;
  /* Above Bootstrap's sticky tabs (1020) within the details modal. */
  z-index: 1030;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border-radius: inherit;
  background: rgba(0, 0, 0, 0.4);
}

.edit-media-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 26rem;
  max-height: 90%;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
}

#edit_media_options {
  overflow-y: auto;
  min-height: 0;
}

#edit_media_options img {
  object-fit: contain;
}

.movie-comment-preview {
  background: var(--bs-tertiary-bg);
  color: var(--bs-body-color);
}

.movie-title-text {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.25rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

#newMovieModal .modal-dialog {
  width: 70vw;
  max-width: none;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
}

#newMovieModal .modal-content {
  height: 70vh;
  height: 70dvh;
}

/* Match the tablet breakpoint used by the home layout, including rotated phones. */
@media (max-width: 599.98px), (max-height: 599.98px) {
  #newMovieModal .modal-dialog {
    width: 95vw;
  }

  #newMovieModal .modal-content {
    height: 95vh;
    height: 95dvh;
  }
}

#newMovieModal .modal-header {
  padding: 0.65rem 1rem;
}

#newMovieModal .modal-body-full {
  padding-top: 0.5rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.new-movie-navigation {
  flex-shrink: 0;
  padding-bottom: 0.5rem;
}

.new-movie-step-viewport {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

.new-movie-step-content {
  flex-shrink: 0;
  margin-block: auto;
  margin-inline: auto;
  padding-block: 0.75rem;
}

#newMovieModal .modal-footer .progress {
  height: 0.7rem !important;
}

.new-field-summary {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--bs-secondary-color);
}

#new_title_summary,
#new_comment_summary {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.15rem;
}

#new_comment_summary {
  font-style: italic;
}

.new-year-badge {
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--bs-primary-border-subtle);
  border-radius: 50rem;
  color: var(--bs-primary-text-emphasis);
  background: var(--bs-primary-bg-subtle);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.new-year-row {
  padding: 0.25rem 0.5rem;
}

.new-movie-divider {
  margin: 1.85rem 0;
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--bs-primary-border-subtle) 15%, var(--bs-primary-border-subtle) 85%, transparent);
  opacity: 1;
}

.new-details-step .movie-field-label {
  padding-top: 0;
  margin-bottom: 0.6rem;
}

#newMovieModal #card_3 .movie-status-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

#newMovieModal #card_3 .movie-status-chip {
  min-height: 52px;
  padding: 0.65rem 0.8rem;
  font-size: 0.95rem;
  gap: 0.5rem;
}

.new-poster-image {
  display: block;
  width: 100%;
  height: clamp(120px, 30vh, 280px);
  flex-shrink: 0;
  object-fit: contain;
  background: var(--bs-tertiary-bg);
}

#new_media_picker #mediaRadioBlock {
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

#edit_poster_thumbnail {
  width: 48px;
  height: 64px;
  object-fit: contain;
  background: var(--bs-secondary-bg);
}

#edit_poster_preview {
  display: block;
  width: 100%;
  height: clamp(120px, 30vh, 280px);
  flex-shrink: 0;
  object-fit: contain;
  background: var(--bs-tertiary-bg);
}

#edit_comment_preview,
.movie-comment-input {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.15rem;
  font-style: italic;
  line-height: 1.6;
}

#edit_comment_preview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
  color: var(--bs-secondary-color);
}

.movie-comment-input {
  min-height: 6rem;
  resize: vertical;
}

.movie-vote-card {
  padding: 1rem;
  border: 1px solid var(--bs-primary-border-subtle);
  border-radius: 1rem;
  background: var(--bs-tertiary-bg);
}

.movie-vote-card .bi-star-fill {
  color: var(--bs-warning-text-emphasis);
}

.movie-vote-score {
  padding: 0.25rem 0.7rem;
  border-radius: 50rem;
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary-text-emphasis);
  font-size: 1.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.movie-vote-score small {
  font-size: 0.75rem;
  font-weight: 400;
}

.movie-vote-slider {
  --vote-fill: 50%;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  margin: 1rem 0;
  border-radius: 50rem;
  background: linear-gradient(to right, var(--bs-primary) 0%, var(--bs-primary) var(--vote-fill), var(--bs-border-color) var(--vote-fill), var(--bs-border-color) 100%);
  cursor: pointer;
}

.movie-vote-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  border: 3px solid var(--bs-body-bg);
  border-radius: 50%;
  background: var(--bs-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.movie-vote-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 3px solid var(--bs-body-bg);
  border-radius: 50%;
  background: var(--bs-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.movie-vote-slider:focus-visible {
  outline: 3px solid var(--bs-primary);
  outline-offset: 6px;
}

.movie-status-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  min-height: 44px;
  padding: 0.4rem 0.3rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.8rem;
  background: var(--bs-tertiary-bg);
  color: var(--bs-body-color);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.movie-status-check {
  display: none;
}

.btn-check:checked + .movie-status-chip {
  border-color: var(--bs-primary);
  background: var(--bs-primary-bg-subtle);
  color: var(--bs-primary-text-emphasis);
}

.btn-check:checked + .movie-status-chip-giveup {
  border-color: var(--bs-danger);
  background: var(--bs-danger-bg-subtle);
  color: var(--bs-danger-text-emphasis);
}

.btn-check:checked + .movie-status-chip .movie-status-check {
  display: inline;
}

.btn-check:focus-visible + .movie-status-chip {
  outline: 3px solid var(--bs-primary);
  outline-offset: 2px;
}

.btn-check:disabled + .movie-status-chip {
  opacity: 0.45;
  cursor: default;
}

#movie_year_editor {
  position: static;
  width: 100%;
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  z-index: 1;
}

#mediaRadioBlock .media-radio-list {
  border-radius: 0.375rem;
  border: 0;
}

#mediaRadioBlock {
  --media-radio-selected-bg: rgba(13, 110, 253, 0.14);
  --media-radio-selected-border: #0d6efd;
  --media-radio-selected-text: var(--bs-body-color);
}

body[data-bs-theme="dark"] #mediaRadioBlock {
  --media-radio-selected-bg: rgba(110, 168, 254, 0.24);
  --media-radio-selected-border: #6ea8fe;
  --media-radio-selected-text: #f8f9fa;
}

.scroll-top-btn {
  position: fixed;
  right: 14px;
  bottom: 76px;
  z-index: 1052;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0.25rem 0.6rem rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.scroll-top-btn.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#mediaRadioBlock .media-radio-list .list-group-item {
  flex: 0 0 auto;
  overflow: hidden;
  border: 0;
}

#mediaRadioBlock .media-radio-item {
  min-height: 64px;
}

#mediaRadioBlock .media-radio-item img {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  object-fit: contain;
}

#mediaRadioBlock .media-radio-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

#mediaRadioBlock .media-radio-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

#mediaRadioBlock .media-radio-item {
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

#mediaRadioBlock .media-radio-input:checked + .media-radio-item {
  background-color: var(--media-radio-selected-bg);
  box-shadow: inset 0 0 0 2px var(--media-radio-selected-border);
  color: var(--media-radio-selected-text);
  font-weight: 500;
}

/* ========== DataTable Albums Modernization ========== */


.album-import-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 0.75rem;
  font-size: 1.3rem;
}

.top-list-info-overlay:not(.d-none) {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  border-radius: inherit;
  background: rgba(0, 0, 0, 0.4);
}

.top-list-info-card {
  width: 100%;
  max-width: 28rem;
  max-height: 100%;
  overflow-y: auto;
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
}


/* Tablet-sized browser layout. */
#movieModal .modal-dialog, #newMovieModal .modal-dialog { width: calc(100% - 3rem); max-width: 960px; margin: 1.5rem auto; }
#movieModal .modal-content, #newMovieModal .modal-content { max-height: calc(100dvh - 3rem); }
#home_page { padding: 2rem 1rem 6rem; }
#home_page .page-header { margin-top: 0 !important; }
#home_page h2 { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(2.25rem, 4.5vw, 3.5rem); letter-spacing: .04em; color: var(--bs-primary-text-emphasis); }
#cover_img { width: min(45vmax, 85vw, calc(100dvh - 280px)); height: min(45vmax, 85vw, calc(100dvh - 280px)); object-fit: cover; }
.albums-toolbar { flex-wrap: wrap; }
@media (max-width: 599.98px) { #movieModal .modal-dialog, #newMovieModal .modal-dialog { width: calc(100% - 1rem); margin: .5rem auto; } }

/* Keep all four movie tabs usable on narrow screens. */
#movieModal .modal-nav-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
#movieModal .modal-nav-link {
  padding: 0.65rem 0.15rem;
  font-size: 1.2rem;
}
#movieModal .modal-nav-link > i {
  display: block;
  margin-right: 0 !important;
  margin-bottom: 0;
}

#vote_form {
  padding-top: 1.25rem;
}

#vote_form .movie-status-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#newMovieModal .new-required-missing {
  outline: 2px solid var(--bs-danger);
  outline-offset: 3px;
}

#giveup:disabled + .movie-status-chip { filter: grayscale(1); }

#movieModal #comments_tab_link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

#movieModal #comms_count {
  font-size: 0.65rem;
}
