:root {
  /* Dark theme (default) */
  --bg-primary: #0b1622;
  --bg-secondary: #1a2332;
  --bg-tertiary: #151f2e;
  --bg-quaternary: #32445b;
  --text-primary: #8596a5;
  --text-secondary: #a8b5c4;
  --text-tertiary: #cecece;
  --text-light: #edf1f5;
  --border-color: #32445b;
  --hover-bg: #2a3441;
  --table-bg: #1f2a38;
}

[data-theme="light"] {
  --bg-primary: #e7f0f8;
  --bg-secondary: #b7e0f7;
  --bg-tertiary: #b7e0f7;
  --bg-quaternary: #ffffff;
  --text-primary: #0b5f97;
  --text-secondary: #0b5f97;
  --text-tertiary: #97cdec;
  --text-light: #ffffff;
  --border-color: #DCECF8;
  --hover-bg: #cfe8f7;
  --table-bg: #DCECF8;
}

[data-theme="brown"] {
  --bg-primary: #271c19;
  --bg-secondary: #f8f8f8;
  --bg-tertiary: #55423d;
  --bg-quaternary: #af7f76;
  --text-primary: #faeee7;
  --text-secondary: #faeee7;
  --text-tertiary: #af7f76;
  --text-light: #faeee7;
  --border-color: #fffffe;
  --hover-bg: #fffffe;
  --table-bg: #74544d;
}

/* --- Star Rating Overlap Effect --- */
.star-rating {
  display: inline-block;
  position: relative;
  height: 1.1em;
  line-height: 1;
  top: -0.38em;
}
.star-rating .star-icon {
  width: 1.1em;
  height: 1.1em;
  display: inline-block;
  position: relative;
  margin-left: -0.85em; /* strong overlap for cool effect */
  z-index: 1;
  vertical-align: middle;
  transition: filter 0.2s;
}
.star-rating .star-icon:first-child {
  margin-left: 0;
}


.star-rating .star-icon.empty {
  opacity: 0.4;
}

body {
  background-color: var(--bg-primary);
  margin: 0;
  padding: 0;
  color: var(--text-primary);
}

html {
  overflow-y: scroll;
}

.status-header {
  margin-top: 50px;    /* adjust this value as you want */
  margin-bottom: 10px; /* adjust this value as you want */
  font-weight: bold;
}

.separator-bar {
  width: 100%;
  height: 45px;
  background-color: var(--bg-tertiary);
  margin-bottom: 1.5rem;
}

/* --- Page Layout --- */
.list-page-container {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 10rem 2rem;
  
}

/* --- Banner Rotator --- */
.banner-rotator {
  position: relative; /* Needed to contain the overlay */
  width: 100%;
  height: 330px;
  overflow: hidden;
}

.banner-rotator img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
  object-position: center 15%;

  /* Add smooth opacity transition */
  transition: opacity 1s ease-in-out;
  opacity: 1;
}

/* The overlay that covers the whole image */
.banner-overlay {
  position: absolute; /* sits over the image */
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(180deg, rgba(6, 13, 34, 0) 40%, rgba(6, 13, 34, 0.6) 100%);
  z-index: 1;
  pointer-events: none; /* let clicks pass through */
  display: flex;
  justify-content: flex-end; /* align quote container to right */
  align-items: stretch;
  padding-right: 2rem;
  box-sizing: border-box;
}

/* The quote container on right side, initially hidden */
.banner-quote {
  display: none; /* toggle via JS */
  color: white;
  font-style: italic;
  padding: 1rem 2rem;
  text-align: right;
  max-height: 50%;
  min-height: 10%;
  max-width: 30%;
  min-width: 5%;
  overflow-y: auto;
  white-space: pre-wrap;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.4);
  pointer-events: auto; /* allow text selection if needed */
  border-radius: 0 0 0 12px;

  margin-top: auto;       /* push it down inside flex container */
  margin-bottom: 2rem;    /* add some space from bottom */

  transition: opacity 1s ease-in-out;

  scrollbar-width: none; /* for Firefox */
  -ms-overflow-style: none;  /* for IE and Edge */
}
.banner-quote::-webkit-scrollbar {
  display: none;
}

/* --- Sidebar --- */
.sidebar {
  width: 15%;
  padding-right: 2.5rem;
  display: flex;
  flex-direction: column;
  
}

#search-input {
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  border: none;
  font-size: 1rem;
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
}

#search-input:focus {
  outline: none;
  box-shadow: none;
}

#search-input::placeholder {
  color: var(--text-tertiary);
}

.filter-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.view-toggle {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dual-toggle {
  display: flex;
  gap: 0.5rem;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-tertiary);
  max-height: 1.9rem;
}

.toggle-half {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.3s ease;
}

.toggle-half:hover {
  background-color: var(--bg-quaternary);
}

.toggle-half.active {
  background-color: var(--bg-tertiary);
}

.toggle-text {
  font-size: 0.85rem;
  white-space: nowrap;
}

.filter-btn,
.toggle-btn,
.type-filter-btn,
.sort-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  padding: 0.5rem;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  width: 100%;
}

.btn-count {
  opacity: 0;
  transition: opacity 0.3s ease;
  /* right side */
  font-weight: bold;
  /* optionally add color or spacing */
}

.filter-buttons-wrapper:hover .btn-count {
  opacity: 1;
}

.sidebar h3 {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.filter-btn:hover,
.type-filter-btn:hover,
.sort-btn:hover {
  background-color: var(--bg-quaternary);
}

#check-status-btn:hover{
  background-color: var(--bg-quaternary);
}

.filter-btn.active,
.toggle-btn.active,
.type-filter-btn.active,
.sort-btn.active {
  background-color: var(--bg-tertiary);
}

.sort-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sort-btn {
  flex: 1;
  justify-content: center;
  font-size: 0.85rem;
  white-space: nowrap;
}

/* --- Main List Content --- */
.list-content {
  width: 80%;
  margin-top: -45px;
}

/* --- Card View Grid --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 150px));
  gap: 0.9rem;
}

/* Default card (all media types) */
.card {
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.15s ease-in-out;
  cursor: pointer;
  width: 150px;
  height: 210px;
}

.card-image {
  overflow: hidden;
  border-radius: 3px;
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover; /* ensures image covers container */
  object-position: center top; /* default crop */
}

/* Card Image */
.card img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
  overflow: hidden;
  border-radius: 3px;
}

.card[data-media-type="music"] {
  width: 150px;
  height: 150px;
}

.card[data-media-type="music"] .card-image {
  width: 270px;
  height: 100%;
  left: -60px;
}

/* Override global .card img rule */
.card[data-media-type="music"] .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}



.repeat-indicator {
  position: absolute;
  top: 0.8rem;
  left: 0.8rem;
  z-index: 2;
}

.repeat-count {
  position: absolute;
  top: 0;
  left: 25px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 14px;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 4px;
  min-width: 20px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none
}

.repeat-indicator:hover .repeat-count {
  opacity: 1;
}

.repeat-icon {
  width: 16px;
  height: 16px;
  color: white;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
}



/* Title & Rating Overlay */
.card-title-overlay {
  background: rgba(14,15,15, .8);
  color: var(--text-light);
  padding: 0.5rem 0.6rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 0.8rem;
  gap: 0.5rem;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
  min-height: 48px;
}


.card-title {
  width: 100%;
  flex: 1;
}

.card-rating {
  align-self: flex-end;
  margin-left: auto;
  font-size: 1.1rem;
}

.rating-number {
  font-size: 0.82rem;
  color: var(--text-primary);
  vertical-align: top;
  position: relative;
}

.card-meta-row {
  display: flex;
  justify-content: space-between;
  width: 100%;
  gap: 0.5rem;
}

.card-progress {
  font-size: 0.75rem;
  color: grey;
}


/* Edit Button */
.edit-card-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  display: none;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 4px;
}

.edit-card-btn::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
}

.card:hover .edit-card-btn {
  display: block;
}

.list-table .edit-card-btn {
  display: none;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  padding: 4px 8px;
  font-size: 1rem;
  border-radius: 4px;
  cursor: pointer;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}

.list-table tr:hover .edit-card-btn {
  display: inline-block;
}

/* Rating Badge */
.face-field {
  background-color: none;
  padding: 4px 8px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.card-rating svg {
  width: 1em;
  height: 1em;
  color: grey;
}

/* --- List View Table --- */
.list-table {
  width: 100%;
  overflow-x: auto;
}

.list-table table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  table-layout: fixed;
}

.list-table th:nth-child(1),
.list-table td:nth-child(1) {
  width: 50%;
}

.list-table th:nth-child(2),
.list-table td:nth-child(2) {
  width: 10%;
  text-align: center;
}

.list-table th:nth-child(3),
.list-table td:nth-child(3) {
  color: var(--text-primary);
  width: 20%;
  text-align: center;
}

.list-table th:nth-child(4),
.list-table td:nth-child(4) {
  color: var(--text-primary);
  width: 10%;
  text-align: center;
}

.list-table th:nth-child(5),
.list-table td:nth-child(5) {
  color: var(--text-primary);
  width: 10%;
  text-align: center;
}

.list-table th,
.list-table td {
  padding: 0.8rem 1rem;
  text-align: left;
}

.list-table td {
  padding: 0.5rem 1rem;
  vertical-align: middle;
  position: relative;
}

.list-table th {
  background-color: var(--table-bg);
  color: var(--text-primary);
}

.list-table td {
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
}

.list-table a {
  color: var(--text-primary);
  text-decoration: none;
}

.list-table a:hover {
  text-decoration: underline;
}


#card-view, #list-view {
  display: none;
}

.status-dot {
  position: absolute;
  top: -10px;      /* align to top edge */
  left: -10px;     /* align to left edge */
  width: 30px;
  height: 30px;
  border-radius: 50%;
  z-index: 10;
  box-shadow: 0 0 8px 2px rgba(0,0,0,0.6);
}

#check-status-container {
  display: none;
}

.status-legend {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-tertiary);
}

.status-legend div {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
  box-shadow: 0 0 6px currentColor;
}

.legend-dot.green {
  background-color: green;
  color: green;
}

.legend-dot.orange {
  background-color: orange;
  color: orange;
}

.legend-dot.red {
  background-color: red;
  color: red;
}

.legend-dot.gray {
  background-color: gray;
  color: gray;
}

  @media (orientation: portrait) {


  .list-page-container{
    gap:8rem;
    padding-left: 3rem;

  }

  .modal{
    overflow: visible !important;
    min-height: 67rem;
  }

  .modal-content{
    transform: scale(2.1);
  }

  .sidebar{
    transform: scale(2);
    transform-origin: top;
    max-width: 40rem;
    width: 64%;
    padding-bottom: 12rem;
    padding-right: 0rem;
  }

  .list-content{
    transform: scale(2);
    transform-origin: top;
    max-width: 40rem;

  }

  .modal-actions-top{
    right: 14rem !important;
  }

  .danger-btn{
    margin-right: 12.5rem!important;
  }

.modal-title-block {
  transform: scale(1.2);
  left: 15rem !important;
  max-width: 12rem !important;       /* or any width you want */
  overflow: hidden !important;       /* hides excess text */
  text-overflow: ellipsis !important; /* adds "..." if text is too long */
  white-space: nowrap !important;    /* prevents text from wrapping to next line */
}

  .modal-body{
    overflow: visible !important;
  }

  .modal-banner{
    max-width: 24.5rem;
    margin-left: 13.40rem;
    border-radius:6px;
  }

  .close-btn{
    right: 14rem !important;
  }

  .list-page-container {
        flex-direction: column;
        padding-left: 16.3rem;
        padding-right: 0rem;
    }

    .card-grid{
       gap: 0.6rem 0.3rem;
    }

    .filter-buttons, .view-toggle{
      flex-direction: row;
    }

    .filter-btn{
      gap: 0.2rem;
    }

    .list-table{
      max-width: 29rem;
    }

    .list-content{
      max-width: 29rem;
    }

    .check-status-container{
        margin-bottom: 8rem;
    }

    .filter-btn{
      flex-wrap: wrap;
      justify-content: center;
    }

    .btn-count {
    display: none;
  }

  .filter-buttons-wrapper:has(.type-filter-btn[data-type="both"]) ~ h3 + .view-toggle {
    margin-bottom: 7rem;
  }
}

/* Music Player Button */
.music-player-btn {
  background: none;
  border: 1px solid var(--text-primary);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  user-select: none;
}

.music-player-btn input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

.music-player-btn input[type="checkbox"]:checked ~ span {
  color: var(--activity-high);
}

.music-player-btn:has(input:checked) {
  border-color: var(--activity-high);
  background: rgba(171, 186, 205, 0.1);
}

.music-player-btn:hover {
  border-color: var(--activity-high);
  color: var(--activity-high);
}

.music-player-btn {
  background: none !important;
  border: none !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 6px !important;
  user-select: none;
}

.music-player-btn input[type="checkbox"] {
  display: none;
}

.music-player-btn .music-icon {
  fill: var(--text-primary);
  transition: fill 0.3s ease;
}

.music-player-btn:has(input:checked) .music-icon {
  fill: var(--activity-high);
}

.music-player-btn:hover .music-icon {
  fill: var(--activity-high);
}

label.music-player-btn {
  background: none !important;
  border: none !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  padding: 6px !important;
  user-select: none !important;
}

label.music-player-btn input[type="checkbox"] {
  display: none !important;
}

label.music-player-btn .music-icon {
  fill: var(--text-primary) !important;
  transition: fill 0.3s ease !important;
}

label.music-player-btn:has(input:checked) .music-icon {
  fill: var(--activity-high) !important;
}

label.music-player-btn:hover .music-icon {
  fill: var(--activity-high) !important;
}

.music-player-container {
  position: fixed !important;
  bottom: 20px !important;
  left: 20px !important;
  z-index: 9999 !important;
  line-height: 0 !important;
}

.music-player-container iframe {
  display: block !important;
  border: none !important;
}
