/* Base Layout */
body {
  font-family: sans-serif;
  margin: 2rem;
  background-color: #000;
  color: #fff;
}

@media (max-width: 600px) {
  body {
    margin: 1rem;
  }
}

a {
  color: #4fc3f7;
}

a:visited {
  color: #90caf9;
}

a:hover {
  color: #81d4fa;
}

nav {
  margin-bottom: 2rem;
}

nav a {
  margin-right: 1rem;
  text-decoration: none;
  color: #4fc3f7;
  font-weight: bold;
}

nav a:hover {
  text-decoration: underline;
}

/* Page Titles */
.section-title {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
}

.section-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.provider-list {
  max-width: 1400px;
  margin: 0 auto;
  list-style: none;
  padding: 0 1.5rem;
}

.provider-list li {
  padding: 0.3rem 0;
}

.provider-list li a {
  color: #4fc3f7;
  text-decoration: none;
}

.provider-list li a:hover {
  text-decoration: underline;
}

/* Top Nav Styles */
.top-nav {
  background-color: #111;
  color: white;
  padding: 0.5rem 1rem;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-area {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: bold;
}

.logo-link {
  text-decoration: none;
  color: #4fc3f7;
  font-size: 1.4rem;
}

.search-bar {
  justify-content: center;
  display: flex;
  gap: 0.5rem;
  flex: 1;
}

.search-bar input[type="text"] {
  padding: 0.65rem;
  border: none;
  border-radius: 4px;
  width: clamp(200px, 40vw, 400px);
  background: #333;
  color: white;
}

.search-bar button {
  padding: 0.65rem 0.9rem;
  border: none;
  background-color: #333;
  color: #4fc3f7;
  border-radius: 4px;
  cursor: pointer;
}

.user-menu-container {
  justify-content: flex-end;
  display: flex;
}

.nav-actions,
.user-menu-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#navMoreOptions {
  position: relative;
}

@media (max-width: 600px) {
  .nav-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .logo-area {
    justify-content: center;
  }

  .search-bar {
    width: 100%;
    flex: none;
    margin-bottom: 0.5rem;
  }

  .search-bar input[type="text"] {
    width: 100%;
  }

  .nav-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

.more-options-btn {
  background-color: #000;
  color: #44c3f7;
  border: none;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.4rem;       /* bump up size */
  line-height: 1.1;
}

.more-options-btn:hover {
  background-color: #333;
}

#submitModalTrigger {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #4fc3f7;
  color: #000;
  border: none;
  font-size: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  z-index: 1000;
}

@media (max-width: 600px) {
  #submitModalTrigger {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
}

.more-options-dropdown {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  top: 2.5rem;
  right: 0;
  background: #222;
  border: 1px solid #333;
  border-radius: 8px;
  min-width: 160px;
  z-index: 999;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
  display: none;
}

.more-options-dropdown li a {
  display: block;
  padding: 0.6rem 1rem;
  text-decoration: none;
  color: #44c3f7;
  font-weight: bold;
  font-size: 0.95rem;
}

.more-options-dropdown li a:hover {
  background: #333;
  color: white;
}

.more-options-dropdown li button {
  display: block;
  padding: 0.6rem 1rem;
  width: 100%;
  background: none;
  border: none;
  color: #44c3f7;
  font-weight: bold;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
}

.more-options-dropdown li button:hover {
  background: #333;
  color: white;
}

.nav-actions a,
.user-menu-container a {
  color: #4fc3f7;
  text-decoration: none;
  font-weight: bold;
}

/* Grid Layout */
.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
  grid-auto-rows: 1fr;
  max-width: 1400px;
  margin: 0 auto;
}

/* Playlists page layout */
.playlists-container {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  justify-content: flex-start;
  max-width: 1400px;
  margin: 0 auto;
}

.user-playlists {
  flex: 1;
  min-width: 0;
}

.playlist-actions {
  display: flex;
  justify-content: flex-start;
  margin: 1rem 0;
}

#playlistGrid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  margin: 0 auto;
}

@media (max-width: 800px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
  #playlistGrid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 500px) {
  .grid {
    grid-template-columns: 1fr;
  }
  #playlistGrid {
    grid-template-columns: 1fr;
  }
  .pagination button {
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 900px) {
  .playlists-container {
    flex-direction: column;
    align-items: center;
  }

  .user-playlists {
    order: 1;
    width: 100%;
  }

  .liked-playlists-wrapper {
    order: 2;
    justify-content: center;
    padding-right: 0;
    margin-top: 1.5rem;
    width: 100%;
  }

  #likedPlaylistsSidebar {
    max-width: 100%;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

/* Video Card */
.card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: auto; /* required to fill grid cell */
  padding: 1.5rem 1rem;
  background: #111;
  border: 1px solid #333;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  align-self: stretch;
  align-items: stretch;
  position: relative;
}

.card-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Thumbnail Handling */
.thumbnail-wrapper {
  position: relative;
  display: block;
  margin-bottom: 0rem;
}

iframe.thumbnail {
  width: 65%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: 8px;
  display: inline-block;
  overflow: hidden; 
}

img.thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: 8px;
  display: inline-block;
}

img.video-thumbnail {
  width: 65%;
  aspect-ratio: 16 / 9;
  border: none;
  border-radius: 8px;
  display: inline-block;
}

/* Duration Badge */
.badge-duration {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: white;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  min-width: 36px;
  text-align: center;
  pointer-events: none;
}

/* Text Styling */
.title {
  font-size: 1rem;
  font-weight: bold;
  line-height: 1.2;
  margin: 0 0 0.25rem 0;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: unset;
  max-height: unset;
}




.submitted,
.desc {
  font-size: 0.95rem;
  color: #ccc;
  text-align: left;
  word-break: break-word;
}

.desc {
  max-width: 65%;
}

/* Align action rows with player left edge */
.submitted {
  margin: 0.25rem 0;
}

.desc {
  margin: 0.25rem auto;
}

#likeArea {
  margin: 0.25rem auto;
  text-align: left;
  max-width: 65%;
}

.submitted a,
.desc a {
  color: #4fc3f7;
  text-decoration: none;
}

.submitted a:hover,
.desc a:hover {
  text-decoration: underline;
}

/* Delete Button */
button.delete-btn {
  margin-top: 0.5rem;
  background: #c00;
  color: white;
  border: none;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  border-radius: 4px;
  cursor: pointer;
}

button.delete-btn:hover {
  background: #a00;
}

/* Raw Submissions Table */
#rawWrapper {
  margin-top: 3rem;
}

#rawSubmissionsTable {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

#rawSubmissionsTable th,
#rawSubmissionsTable td {
  border: 1px solid #ccc;
  padding: 0.5rem;
  text-align: left;
}

#rawSubmissionsTable th {
  background: #f0f0f0;
}

/* Form Styling (Submit Form) */
#submitFormWrapper {
  margin-top: 0.5rem;
}

#submitForm {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#submitForm label {
  font-weight: bold;
}

#submitForm input[type="url"] {
  width: 50%;
  padding: 0.5rem;
  font-size: 1rem;
}

#submitForm button {
  padding: 0.5rem 1rem;
  font-size: 1rem;
  background: #06c;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#submitForm button:hover {
  background: #004999;
}

/* Spinner Animation */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #ccc;
  border-top-color: #3498db;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Status Messages */
.success-message {
  color: green;
  font-weight: bold;
}

.error-message {
  color: red;
  font-weight: bold;
}

.info-message {
  color: orange;
  font-weight: bold;
}

.message-area {
  margin-top: 1rem;
  min-height: 2rem;
}

/* Video Player Area */
#playerArea {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* Embed warning overlay */
.thumbnail-link {
  position: relative;
  display: block;
  width: 65%;
  max-width: 100%;
  margin: 2rem auto;
}

.thumbnail-link .embed-warning {
  position: absolute;
  bottom: 12px;
  left: 6px;
  right: 6px;
  background-color: rgba(216, 92, 0, 0.85);
  color: #fff;
  font-weight: bold;
  font-size: 0.9rem;
  padding: 4px;
  border-radius: 4px;
  text-align: center;
  line-height: 1.2;
  pointer-events: none;
}

/* Pagination Controls */
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0;
  padding: 0 1rem;
  box-sizing: border-box; 
}

.pagination button {
  flex-shrink: 1;
  background-color: #fff;
  color: #ccc;
  border: none;
  min-width: 2.5rem;
  padding: 0.4rem 0.8rem;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.pagination button:hover {
  background-color: #333;
  color: #fff;
}

.pagination button.active {
  background-color: rgb(0, 64, 255);
  color: #000;
}

.pagination button.disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

/* Filter layout */
#filterControls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  max-width: 1400px;
  margin: 0 auto 1rem;
}

#providerFilter,
#durationFilter,
#privacyFilter {
  margin-bottom: 0;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0;
}

@media (max-width: 600px) {
  #filterControls {
    flex-direction: column;
    align-items: flex-start;
  }

  #filterControls .filter-group {
    width: 100%;
  }

  #clearFiltersBtn {
    margin-left: 0;
  }
}

.duration-label span {
  cursor: pointer;
  font-weight: bold;
}

.short-duration span {
  color: #ccc;
}

.medium-duration span {
  color: #0055cc;
}

.long-duration span {
  color: #cc7a00;
}

.very-long-duration span {
  color: #cc0000;
}

.card-meta {
  margin-top: 0.25rem;
}

.title-spacer {
  display: block;
  content: "";
}

.debug-output {
  background: #222;
  color: #0f0;
  padding: 10px;
  font-size: 12px;
  overflow: auto;
  max-height: 300px;
  white-space: pre-wrap;
  word-break: break-word;
  border-top: 1px solid #555;
  margin-top: 20px;
}

#debugOutput {
  display: none;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.fade-in {
  animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.highlight-new {
  animation: fadeBorderGlow 2.5s ease-in-out forwards;
  box-shadow: 0 0 10px 4px #f0c000;
}

@keyframes fadeBorderGlow {
  0% {
    box-shadow: 0 0 10px 4px #f0c000;
  }
  60% {
    box-shadow: 0 0 6px 2px #f0c000;
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
  }
}

.raw-submissions-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.raw-submissions-table th,
.raw-submissions-table td {
  border: 1px solid #ccc;
  padding: 0.5rem;
}

.settings-table {
  width: 100%;
  max-width: 1400px;
  margin: 1rem auto;
  border-collapse: collapse;
}

.settings-table td {
  padding: 0.5rem;
  vertical-align: middle;
}

.settings-table th {
  padding: 0.5rem;
  text-align: left;
}

.settings-table td:first-child,
.settings-table th:first-child {
  width: 20%;
}

.settings-table td:nth-child(2),
.settings-table th:nth-child(2) {
  width: 28%;
}

.settings-table td:nth-child(3),
.settings-table th:nth-child(3) {
  width: 28%;
}

.settings-table td:nth-child(4),
.settings-table th:nth-child(4) {
  text-align: center;
  width: 10%;
}

/* Adjust widths for the account settings table which has only three columns */
.account-settings-table td:first-child,
.account-settings-table th:first-child {
  width: 20%;
}

.account-settings-table td:nth-child(2),
.account-settings-table th:nth-child(2) {
  width: 65%;
}

.account-settings-table td:nth-child(3),
.account-settings-table th:nth-child(3) {
  width: 15%;
}

/* Adjust widths for the providers table which has two columns */
.providers-table td:first-child,
.providers-table th:first-child {
  width: 70%;
}

.providers-table td:nth-child(2),
.providers-table th:nth-child(2) {
  width: 30%;
  text-align: center;
}

@media (min-width: 768px) {
  .settings-table td:first-child,
  .settings-table th:first-child {
    white-space: nowrap;
  }
}

@media (max-width: 767px) {
  .settings-table {
    table-layout: fixed;
  }
  .settings-table td,
  .settings-table th {
    width: auto;
    word-break: break-word;
    white-space: normal;
  }
  .settings-label {
    width: 130px;
  }
}

/* Layout for settings page split view */
.settings-split {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  justify-content: center;
  max-width: 1400px;
  margin: 0 auto;
}

.settings-left, .settings-right {
  flex: 1;
}

@media (max-width: 800px) {
  .settings-split {
    flex-direction: column;
  }
}

/* Table layout for statistics with two columns */
.stats-table td:first-child,
.stats-table th:first-child {
  width: 70%;
}

.stats-table td:nth-child(2),
.stats-table th:nth-child(2) {
  width: 30%;
}

.settings-edit-btn {
  background: none;
  border: none;
  color: #4fc3f7;
  cursor: pointer;
}

.settings-edit-btn:hover {
  text-decoration: underline;
}

/* External account username and email display */
.ext-username-display,
.ext-email-display {
  display: inline-block;
  width: 35ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.ext-username,
.ext-email {
  display: inline-block;
  width: clamp(100px, 60vw, 35ch);
  max-width: 100%;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.5rem;
  margin-right: 0.5rem;
}

.ext-username-public-display,
.ext-email-public-display {
  display: inline-block;
  width: 7ch;
}

.ext-username-public,
.ext-email-public {
  margin-left: 0.5rem;
}

.readonly-checkbox {
  pointer-events: none;
  cursor: default;
}

.raw-submissions-table th {
  background: #f5f5f5;
  text-align: left;
}

.submitted strong,
.desc strong {
  font-weight: 800;
  display: inline-block;
  width: 12ch;
  white-space: nowrap;
  vertical-align: baseline;
}

.fade-out {
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
}

.like-btn {
  all: unset;
  display: inline;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.like-btn.liked {
  color: #007BFF; /* or red if you'd prefer */
}

.like-btn.liked strong {
  color: #007BFF;
}

.user-icon {
  cursor: pointer;
  font-size: 1.4rem;
  color: white;
  line-height: 1;
}

.user-dropdown {
  display: none;
  position: absolute;
  top: 2.5rem;
  right: 0;
  background: #222;
  border: 1px solid #333;
  border-radius: 8px;
  min-width: 220px;
  z-index: 999;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6); 
  padding: 0.5rem 0;   
}

.user-dropdown a {
  display: block;
  padding: 0.75rem 1rem; /* more padding */
  text-decoration: none;
  color: #4fc3f7;
  font-weight: bold;
  font-size: 0.95rem;
}

.user-dropdown a:hover {
  background: #333;
  color: white;
}

.user-menu-container {
  position: relative;
}

#userMenuContainer a {
  color: #4fc3f7;
  margin-left: 1rem;
  text-decoration: none;
  font-weight: bold;
}

.guest-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.25);
  position: relative;
}

.modal-content h2 {
  margin-top: 0;
}

.modal .status {
  margin-top: 1rem;
  font-weight: bold;
}

.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  font-size: 1.5rem;
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  font-weight: bold;
}

.modal-close:hover {
  color: #000;
}

.modal-content {
  transition: max-width 0.3s ease-in-out;
  max-width: 400px;
}

.modal-content.two-column {
  display: flex;
  gap: 1.5rem;
  flex-direction: row;
  align-items: flex-start;
  justify-content: flex-start;
  max-width: 810px;
  width: 100%;
}

.modal-content:not(.two-column) {
  max-width: 400px;
}





.modal-body {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  align-items: flex-start;
  justify-content: flex-start;
}

.modal-form {
  flex: 1;
  min-width: 300px;
}

#submitPreview {
  flex-shrink: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.4s ease-out;
  max-width: 0;
}

#submitPreview.show {
  max-width: 480px;
  opacity: 1;
}

@media (max-width: 600px) {
  .modal-content.two-column {
    flex-direction: column;
    max-width: 100%;
  }

  .modal-content.two-column .modal-body {
    flex-direction: column;
  }

  #submitPreview.show {
    max-width: 100%;
  }

  #playlistModal .modal-body {
    flex-direction: column;
  }
}

#clearSearchBtn {
  margin-left: -8px;
  background: none;
  border: none;
  font-size: 0.9rem; /* was 1.2rem */
  padding: 0.2rem 0.4rem; /* tighten */
  cursor: pointer;
  line-height: 1;
  vertical-align: middle;
}

#clearSearchBtn:hover {
  color: red;
}

#clearFiltersBtn {
  background-color: #f3f3f3;
  border: 1px solid #ccc;
  border-radius: 999px;
  color: #333;
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
  margin-bottom: 0;
  margin-left: 1rem;
}
#clearFiltersBtn:hover {
  background-color: #eee;
  border-color: #999;
}

.private-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(255, 0, 0, 0.85);
  color: white;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  z-index: 10;
  pointer-events: none;
}

.badge-private {
  position: absolute;
  top: 4px;
  left: 4px;
  background-color: rgba(255, 0, 0, 0.8);
  color: white;
  padding: 2px 6px;
  font-size: 0.75rem;
  border-radius: 3px;
  z-index: 2;
}

.badge-watched {
  position: absolute;
  top: 4px;
  right: 4px;
  background-color: rgba(0, 128, 0, 0.8);
  color: white;
  padding: 2px 6px;
  font-size: 0.75rem;
  border-radius: 3px;
  z-index: 2;
}

.history-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(128, 0, 0, 0.8);
  color: white;
  border: none;
  border-radius: 3px;
  width: 22px;
  height: 22px;
  font-size: 0.75rem;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 3;
}
.card:hover .history-remove-btn {
  opacity: 1;
}
.history-remove-btn.confirming {
  background: rgba(255, 0, 0, 0.9);
  width: auto;
  padding: 0 6px;
}

.privacy-toggle-btn {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0,0,0,0.7);
  color: white;
  border: none;
  padding: 2px 6px;
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: 3px;
  z-index: 2;
}

#videoGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  align-items: start;
}

.tooltip-wrapper {
  position: relative;
  cursor: default;
  display: inline-block;
}

.tooltip-wrapper .tooltip-text {
  visibility: hidden;
  white-space: nowrap;
  background-color: #333;
  color: #fff;
  text-align: center;
  padding: 6px 8px;
  border-radius: 6px;
  position: absolute;
  z-index: 1000;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.tooltip-wrapper:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

.tooltip-wrapper.unparsed-tt {
  position: relative;
  display: inline-block;
}

.tooltip-wrapper.unparsed-tt .unparsed-tt-text {
  visibility: hidden;
  white-space: normal;
  width: max-content;
  max-width: 180px;
  background-color: #333;
  color: #fff;
  text-align: left;
  padding: 6px 10px;
  border-radius: 6px;
  position: absolute;
  z-index: 1000;
  bottom: 125%;
  right: 0;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  line-height: 1.4;
  word-break: break-word;
  overflow-wrap: break-word;
  overflow-x: hidden; /* ✅ fixes phantom horizontal scroll */
}

.tooltip-wrapper.unparsed-tt:hover .unparsed-tt-text {
  visibility: visible;
  opacity: 1;
}

.thumbnail-collage {
  display: grid;
  gap: 2px;
  margin-bottom: 0.5rem;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.collage-1 {
  grid-template-columns: 1fr;
}
.collage-2 {
  grid-template-columns: 1fr 1fr;
}
.collage-3, .collage-4 {
  grid-template-columns: 1fr 1fr;
}

.collage-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.submitted-under-thumb {
  font-size: 0.85rem;
  color: #444;
  margin: 0.25rem 0 0.5rem;
  text-align: left;
}
.submitted-under-thumb a {
  color: #4fc3f7;
  text-decoration: none;
}
.submitted-under-thumb a:hover {
  text-decoration: underline;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
  align-items: center;
  margin-top: 0.5rem;
}
.actions-row button {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  background: #eee;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
}
.actions-row button:hover {
  background: #ddd;
}

.submitted-under-thumb-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #444;
  margin: 0.2rem 0 1.0rem;
}

.submitter-left {
  text-align: left;
}

.view-right {
  font-size: inherit;
  color: inherit;
  text-align: right;
}

#playlistModal .modal-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  width: 100%;
  max-width: 800px;
}

.thumbnail-preview {
  width: 100%;
  height: auto;
  border-radius: 6px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.modal-content {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  max-width: 800px;
  width: 100%;
}

.modal-form-section {
  flex: 1;
}

select option:disabled {
  color: #888;
}

/* Dark mode form elements */
select {
  background-color: #222;
  color: #fff;
  border: 1px solid #444;
  padding: 4px 8px;
  border-radius: 4px;
}

label,
select + label {
  color: #ddd;
}

/* Dark theme for modals */
.modal {
  background-color: rgba(0, 0, 0, 0.6); /* dark transparent overlay */
  color: #fff;
}

.modal-content {
  background-color: #111;
  color: #fff;
  border: 1px solid #333;
}

.modal input,
.modal select,
.modal textarea {
  background-color: #222;
  color: #fff;
  border: 1px solid #444;
}

.modal button {
  background-color: #333;
  color: #fff;
  border: 1px solid #555;
}

.modal button:hover {
  background-color: #444;
}

/* Unparsed Submissions Table - Dark Theme */
.unparsed-section {
  margin-top: 30px;
  color: white;
  width: 95%;
  margin-left: auto;
  margin-right: auto;
}

.raw-submissions-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background-color: #111;
}

.raw-submissions-table th,
.raw-submissions-table td {
  border: 1px solid #333;
  padding: 10px;
  text-align: left;
  color: white;
}

.raw-submissions-table th {
  background-color: #222;
  font-weight: bold;
}

.raw-submissions-table td a {
  color: #4da6ff;
  text-decoration: underline;
}

.raw-submissions-table .tooltip-wrapper {
  position: relative;
  cursor: help;
}

.raw-submissions-table .tooltip-text {
  visibility: hidden;
  background-color: #222;
  color: #fff;
  border: 1px solid #555;
  text-align: left;
  padding: 6px;
  border-radius: 6px;
  position: absolute;
  z-index: 10;
  width: 220px;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.2s;
}

.raw-submissions-table .tooltip-wrapper:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

.unparsed-controls {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.unparsed-controls input[type="text"] {
  width: 200px;
  margin-right: 10px;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 4px 6px;
}
.unparsed-controls label {
  margin-right: 10px;
}
.note-count {
  font-size: 0.8em;
  margin-left: 4px;
  color: #bbb;
}

/* Inputs within the unparsed submissions table */
.raw-submissions-table input.weight-input,
.raw-submissions-table input.note-input {
  background: #333;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 4px 6px;
}

/* Row styling for unparsed submissions */
.raw-submissions-table tr.private-row {
  background-color: #1b1a30;
}
.raw-submissions-table tr.weighted-row {
  border-left: 4px solid #4fc3f7;
}
.raw-submissions-table tr.pinned-row {
  box-shadow: 0 0 6px gold;
}
.raw-submissions-table tr.pinned-row .pin-toggle {
  color: #4fc3f7;
}


/* Action menu positioning for table rows */
.raw-submissions-table .action-menu {
  position: relative;
}

.raw-submissions-table .menu-trigger {
  position: static;
  bottom: auto;
  right: auto;
  color: inherit;
  margin-left: 4px;
}

@media (max-width: 600px) {
  .unparsed-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .unparsed-controls input[type="text"] {
    width: 100%;
  }

  .raw-submissions-table,
  .raw-submissions-table thead,
  .raw-submissions-table tbody,
  .raw-submissions-table th,
  .raw-submissions-table td,
  .raw-submissions-table tr {
    display: block;
  }

  .raw-submissions-table thead {
    display: none;
  }

  .raw-submissions-table tr {
    margin-bottom: 1rem;
    border: 1px solid #333;
  }

  .raw-submissions-table td {
    border: none;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
  }

  .raw-submissions-table td:last-child {
    border-bottom: none;
  }

  .raw-submissions-table td::before {
    content: attr(data-label);
    font-weight: bold;
    margin-right: 0.5rem;
  }

  .raw-submissions-table input.weight-input,
  .raw-submissions-table input.note-input {
    width: 100%;
  }

  .raw-submissions-table .action-menu {
    text-align: right;
    width: 100%;
  }
}

.playlist-card.fade-out {
  opacity: 0;
  transition: opacity 300ms ease;
}

.playlist-card .card {
  min-height: 350px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.playlist-card-info {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.playlist-title-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.playlist-title {
  font-weight: bold;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 39ch;
}

.edit-title-button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
}

.rename-input {
  max-width: 39ch;
}

.rename-message {
  font-size: 0.9rem;
}

/* Playlist metadata row */
.meta-row {
  display: flex;
  justify-content: space-between;
}

.like-info {
  text-align: right;
  flex-grow: 1;
}

.url-input-group {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

#pasteClipboardBtn {
  background: #2a2a2a;
  border: 1px solid #444;
  color: #ddd;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 0.9rem;
  border-radius: 3px;
  height: 100%;
}

#pasteClipboardBtn:hover {
  background: #444;
}

.liked-playlist-item {
  margin-bottom: 1rem;
}

.liked-playlist-card {
  background-color: #111;
  padding: 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid #333;
  margin-bottom: 1rem;
  width: 140px;
  box-shadow: 0 0 4px rgba(0,0,0,0.4);
}

.liked-playlist-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.mini-collage {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 0.25rem;
}

.mini-collage-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.liked-text-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #ccc;
  margin-top: 0.25rem;
  width: 100%;
}

.liked-title {
  font-weight: bold;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 65%;
}

.liked-owner {
  text-align: right;
  font-style: italic;
  opacity: 0.8;
}

/* Wrapper pushes content to right */
.liked-playlists-wrapper {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  margin-top: 0;
}

/* Sidebar max width and internal grid */
#likedPlaylistsSidebar {
  max-width: 300px;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

/* Optional: center align section title across both columns */
#likedPlaylistsSidebar h3 {
  grid-column: span 2;
  text-align: left;
  margin-bottom: 0.5rem;
}

/* Ensure liked playlists center on smaller screens */
@media (max-width: 900px) {
  .liked-playlists-wrapper {
    justify-content: center;
    width: 100%;
  }

  #likedPlaylistsSidebar {
    max-width: 100%;
    margin: 0 auto;
  }
}

.already-added {
  white-space: nowrap;
}

.already-added-row {
  white-space: nowrap;
}

.copy-link-btn {
  margin-left: 6px;
  padding: 2px 6px;
  font-size: 0.75em;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #f0f0f0;
  cursor: pointer;
  transition: background 0.2s ease;
}

.copy-link-btn:hover {
  background: #e0e0e0;
}

.copy-link-btn:active {
  background: #d0d0d0;
}

/* ------------------ */

.menu-trigger {
  position: absolute;
  bottom: 6px;
  right: 8px;
  background: none;
  border: none;
  font-size: 1.2em;
  cursor: pointer;
  color: white;
}

.menu-popup {
  background-color: #222;
  color: #44c3f7;
  border: 1px solid #333;
  padding: 0.5rem;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.menu-popup ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu-popup li {
  padding: 6px 12px;
  cursor: pointer;
  font-weight: bold;
  white-space: nowrap;
  color: #44c3f7;
}

.menu-popup li:hover {
  background-color: #333;
  color: #fff;
}

/* ---------- */

#actionContainer {
  position: relative;
  width: 65%;
  margin: 1rem auto 0;
}

.action-menu {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 10;
}

.action-menu .menu-popup {
  position: absolute;
  bottom: 100%;
  right: 0;
  padding: 4px 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  z-index: 20;
}

.divider {
  margin: 0 6px;
  color: gray;
}

#contextNavBar {
  display: flex;
  gap: 0;
  padding: 0;
  align-items: stretch;
  max-width: 1400px;
  margin: 0 auto;
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0 10px 5px;
  background-color: #111;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
}

.right-nav-group {
  margin-left: auto;
}

.nav-button {
  padding: 0.4rem 0.75rem;
  border: none;
  border-radius: 4px;
  background-color: #000;
  color: #4fc3f7;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.95rem;
}

.nav-button:hover {
  background-color: #444;
}

.nav-separator {
  color: #666;
  margin: 0 0.5rem;
  font-weight: bold;
  font-size: 1rem;
  user-select: none;
}

.site-footer {
  margin-top: 4rem;
  padding: 1rem;
  text-align: center;
  background-color: #111;
  color: #ccc;
  position: relative; /* allow absolute positioning inside */
}

.site-footer .footer-row {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.25rem 0;
}

.site-footer a {
  color: #4fc3f7;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.site-footer .separator {
  color: #666;
}


.footer-bottom-row {
  display: flex;
  align-items: center;
  position: relative; /* anchor return-top-btn */
}

.footer-bottom-row .footer-links {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.return-top-btn {
  background-color: #000;
  color: #44c3f7;
  border: none;
  border-radius: 4px;
  width: 2rem; /* square dimensions */
  height: 2rem;
  display: flex;
  justify-content: center;
  align-items: center; /* center triangle */
  cursor: pointer;
  font-size: 1.4rem;
  position: absolute; /* sit above footer */
  top: 0;
  right: 20px;
  transform: translateY(-50%);
  margin-right: 0;
}

.return-top-btn:hover {
  background-color: #444;
}


/* simple upward triangle icon */
.triangle-up {
  display: block;
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 12px solid #44c3f7;
}


.settings-table td {
  vertical-align: middle;
}

.settings-table td > input[type="text"]:not(.ext-username),
.settings-table td > input[type="email"]:not(.ext-email),
.settings-table td > input[type="password"] {
  width: 100%;
  max-width: 180px;
  text-align: left;
  margin-right: 0.5rem;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.5rem;
}

.settings-table td > input[type="checkbox"] {
  vertical-align: middle;
  margin-left: 0.25rem;
}

.settings-table td span,
.settings-table td input {
  white-space: nowrap;
}

/* Ensure external account inputs keep consistent width when editing */
.settings-table td .ext-username,
.settings-table td .ext-email {
  width: clamp(100px, 60vw, 35ch);
  max-width: 100%;
  background: #333;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.5rem;
  margin-right: 0.5rem;
}

@media (max-width: 480px) {
  .settings-table td > input[type="text"]:not(.ext-username),
  .settings-table td > input[type="email"]:not(.ext-email),
  .settings-table td > input[type="password"],
  .settings-table td .ext-username,
  .settings-table td .ext-email {
    max-width: 150px;
  }
}

/* Admin page layout */
.admin-container {
  display: flex;
  gap: 2rem;
  width: 100%;
  margin: 0;
}

.admin-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-tab {
  padding: 0.5rem 1rem;
  background: #222;
  border: 1px solid #444;
  color: #fff;
  cursor: pointer;
}

.admin-tab.active {
  background: #444;
}

.admin-search {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.admin-search input[type="text"] {
  padding: 0.5rem;
  border: 1px solid #444;
  background: #333;
  color: #fff;
  border-radius: 4px;
}

.admin-search button {
  padding: 0.5rem 0.9rem;
  border: none;
  background-color: #333;
  color: #4fc3f7;
  border-radius: 4px;
  cursor: pointer;
}

.clear-search-btn {
  margin-left: -8px;
  background: none;
  border: none;
  font-size: 0.9rem;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
  line-height: 1;
  vertical-align: middle;
}

.clear-search-btn:hover {
  color: red;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  border: 1px solid #444;
  padding: 0.5rem;
  text-align: left;
}

.admin-thumb {
  /* Thumbnail size for admin video table */
  width: 50px; /* Adjust width/height to resize thumbnails */
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
}

.title-cell {
  max-width: 35ch;
}


.video-admin-details {
  margin-top: 1rem;
}

.submission-list {
  margin-top: 2rem;
}

.submission-list div {
  margin-bottom: 0.25rem;
}

.video-admin-thumb-wrapper {
  position: relative;
  width: 65%;
  display: inline-block;
}

.video-admin-thumb-wrapper .video-thumbnail {
  width: 100%;
}

.video-admin-delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(192, 0, 0, 0.8);
  color: #fff;
  border: none;
  padding: 2px 6px;
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 4px;
  z-index: 5;
}

.video-admin-delete-btn:hover {
  background: rgba(160, 0, 0, 0.9);
}

/* Settings page visual containers */
.settings-section {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 24px;
}

.settings-section .section-title {
  margin: 0 0 16px 0;
  padding: 0;
}

/* Responsive grid for settings blocks */
.settings-container {
  max-width: 1400px;
  margin: 1.5rem auto 0;
  padding: 0 10px;
}

@media (max-width: 600px) {
  .settings-container {
    font-size: 0.9rem;
  }

  .settings-container .copy-btn {
    font-size: 0.65rem;
  }
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .settings-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Row separators */
.settings-row {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-row:last-child {
  border-bottom: none;
}

.provider-row {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.provider-row:last-child {
  border-bottom: none;
}

/* Card-specific styling for provider row */
.card-meta .provider-row {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: none;
}

/* Hover feedback for editable fields */
.editable {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.editable:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Aligned label/value layout */
.settings-label {
  width: 180px;
  font-weight: bold;
  text-align: left;
  margin-right: 12px;
}

.settings-value {
  flex: 1;
  text-align: left;
}

/* Accordion layout for external accounts */
.ext-account summary {
  cursor: pointer;
  font-weight: bold;
}

.ext-account summary.has-data {
  color: #4fc3f7;
}

.ext-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 4px 0;
}

.ext-label {
  width: 90px;
  font-weight: bold;
}

.ext-actions {
  margin-top: 0.5rem;
}

.copy-btn {
  padding: 2px 6px;
  font-size: 0.75rem;
  border: 1px solid rgba(255,255,255,0.2);
  background: none;
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
}

.copy-btn:hover {
  background-color: rgba(255,255,255,0.1);
}


/* Cookie Consent Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  color: #fff;
  padding: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  z-index: 9998;
}

.cookie-banner button {
  margin-left: 0.5rem;
  background-color: #333;
  color: #fff;
  border: 1px solid #555;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
}

.cookie-banner button:hover {
  background-color: #444;
}

/* Age Verification Overlay */
#ageVerificationOverlay .modal-content {
  max-width: 520px;
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#ageVerificationOverlay .av-logo {
  width: 300px;
  margin: 0 auto 1rem;
  display: block;
}

#ageVerificationOverlay .age-verification-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1rem;
}

#ageVerificationOverlay .nav-button {
  font-size: 1.05rem;
  padding: 0.44rem 0.825rem;
}

#ageVerificationOverlay .intro {
  font-size: 1.1rem;
  font-weight: bold;
}

#ageVerificationOverlay .age-verification-divider {
  border: none;
  border-top: 1px solid #fff;
  margin-top: 1.5rem;
}

#ageVerificationOverlay .rta-label {
  position: absolute;
  right: 10px;
  bottom: 8px;
  font-size: 0.8rem;
  color: #fff;
}

/* Early Access Overlay */
#earlyAccessOverlay .modal-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#earlyAccessOverlay #earlyAccessError {
  color: red;
}

/* Cookie Preferences Modal */
#cookiePreferenceModal .modal-content {
  max-width: 420px;
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cookie-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.5rem 0;
  width: 100%;
}

.cookie-modal-buttons {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background-color: #4fc3f7;
}

.switch input:checked + .slider:before {
  transform: translateX(18px);
}

body.blurred > :not(#ageVerificationOverlay):not(#cookiePreferenceModal):not(#earlyAccessOverlay) {
  filter: blur(12px);
  pointer-events: none;
}

body.blurred {
  overflow: hidden;
}

.terms-content {
  margin-bottom: 50px;
  font-size: 1.1rem;
  line-height: 1.6;
  color: #ccc;
  text-align: left;
}

.terms-content p {
  margin: 0;
}

.compliance-block {
  margin-bottom: 20px;
}
