:root {
  /* Dark theme (default) */
  --bg-primary: #0b1622;
  --bg-secondary: #1a2332;
  --bg-tertiary: #151f2e;
  --bg-quaternary: #32445b;
  --text-primary: #8596a5;
  --text-secondary: #a8b5c4;
  --overlay-bg: #101820;
  --overview-border: #475a6d;
  --button-bg: #1f2a38;
  --activity-high:#abbacd;
  --activity-low: #7c899a;
}

[data-theme="light"] {
  --bg-primary: #e7f0f8;
  --bg-secondary: #f8f8f8;
  --bg-tertiary: #b7e0f7;
  --bg-quaternary: #97cdec;
  --text-primary: #0b5f97;
  --text-secondary: #0b5f97;
  --overlay-bg: #e7f0f8;
  --overview-border: #5fb3e4;
  --button-bg: #cfe8f7;
  --activity-high:#4b90b8;
  --activity-low: #73b2d6;
}

[data-theme="brown"] {
  --bg-primary: #271c19;
  --bg-secondary: #f8f8f8;
  --bg-tertiary: #55423d;
  --bg-quaternary: #af7f76;
  --text-primary: #faeee7;
  --text-secondary: #faeee7;
  --overlay-bg: #271c19;
  --overview-border: #3b2b27;
  --button-bg: #6b534c;
  --activity-high:#af7f76;
  --activity-low: #74544d;
}

/* --- Global Styles --- */
body {
  background-color: var(--bg-primary);
  margin: 0;
  padding: 0;
  color: var(--text-primary);
}

/* --- Banner Rotator --- */
.banner-rotator {
  position: relative;
  width: 100%;
  height: 330px;
  overflow: hidden;
}

.banner-rotator img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  object-position: center 15%;
  transition: opacity 1s ease-in-out;
  opacity: 1;
}

.banner-overlay {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  /* background: linear-gradient(to top, #060d22cc 0%, transparent 60%);
  background: linear-gradient(180deg, rgba(6, 13, 34, 0) 40%, rgba(6, 13, 34, 0.6) 100%); */
  z-index: 1;
  pointer-events: none;
  display: flex;
  justify-content: flex-end;
  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;
}

/* --- Section Separator --- */
.separator-bar {
  height: 45px;
  background-color: var(--bg-tertiary);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 5px;
}

/* --- Card Grid --- */
.card-grid {
  border-radius: 4px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(85px, 85px));
  background: var(--bg-tertiary);
  margin-bottom: 2rem;
  gap: 22px 22px;
  padding: 22px;
}

#characters-card-grid,
#actors-card-grid,
#games-card-grid,
#manga-card-grid,
#anime-card-grid,
#tv-shows-card-grid,
#movies-card-grid,
#books-card-grid,
#music-card-grid{
  background: none;
  border: 4px solid var(--overview-border);
  margin-bottom: 0!important;
}

/* --- Card Styles --- */
.card {
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.15s ease-in-out;
  width: 85px;
  height: 115px;
  overflow:visible;
}

.card-image {
/*
  width: 340px; 
  height: 460px;
  transform: scale(0.25);
*/
  transform-origin: top left;
  overflow:hidden;
  border-radius: 4px;
}

.card img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 4px;
}

.card a {
  display: block;           /* ensures it can have width/height */
  max-height: 115px;        /* or whatever height you want */
  overflow: hidden;         /* crop any overflow inside */
  border-radius: 4px;
}

.card[data-media-type="music"] {
  width: 85px;
  height: 85px;
}

.card[data-media-type="music"] .card-image {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 4px;
}

.card[data-media-type="music"] .card-image img {
  width: 178.8%; /* 152/85 = 1.788 - scales image to match your 152px container */
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  border-radius: 4px;
  /* Use transform for positioning instead of object-position */
  transform: translateX(-21.7%); /* Centers the zoomed portion: (178.8-100)/2/178.8 ≈ 21.2% */
  transform-origin: center;
}

/* Override base <a> rule so music cards aren't clipped by 115px limit */
.card[data-media-type="music"] a {
  max-height: 150px;     /* match music card height */
  overflow: hidden;
  border-radius: 4px;
}

/* Hover title overlay */
.hover-title-overlay {
  position: absolute;
  bottom:100%;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  background: var(--button-bg);
  padding: 6px 10px;
  min-height: 24px;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 1000;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  max-width: 1000px;
}
/* Hover title text */
.hover-title-text {
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Hovered state */
.card:hover .hover-title-overlay {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  margin-bottom: 8px;
}


/* --- 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: 4px 8px;
  cursor: pointer;
  border-radius: 4px;
}



/* --- Section Headers --- */
.status-header,
.favorites-header {
  margin-bottom: 10px;
  font-weight: bold;
  font-size: 1.3rem;
  color: var(--text-primary);
}

/* --- Stats Section Layout --- */
.stats-section {
  display: flex;
  justify-content: center;
  gap: 6.30rem;

}

.stats-activity {
  flex: 1;
  background: var(--bg-tertiary);
  height: 250px;
  border-radius: 12px;
}

.favorites-row {
  display: flex;
  justify-content: center;
  gap: 6rem;
  margin-bottom: 0rem;
}

.favorites-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 40%;
}

.favorites-header {
  display: inline;
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 0.8rem;
  cursor: pointer;
}

h2 {
  margin: 0;
  margin-bottom: 0.8rem;
  margin-top: 0.7rem;
}


.favorites-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(6, 13, 22, 0.95);
  z-index: 5000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  overflow-y: auto;
}

.favorites-overlay.hidden {
  display: none;
}

.overlay-content {
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  max-width: 1010px;
  width: 100%;
  background: var(--overlay-bg);
  padding: 2rem;
  border-radius: 12px;

  scrollbar-width: none;
  -ms-overflow-style: none;
}

.overlay-content::-webkit-scrollbar {
  display: none;                  /* Chrome, Safari */
}

.overlay-content h2 {
  color: #EDF1F5;
  margin-bottom: 1rem;
  text-align: center;
}

.overlay-content button {
  display: block;
  margin: 1rem auto;
  padding: 0.5rem 1rem;
  background: #2b2b2b;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.activity-graph {
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  max-width:600px;
}

.activity-graph h3 {
  color: var(--text-primary);
  max-width:530px;
  margin-bottom: 1rem;
}

.extra-stats-class h3 {
  color: var(--text-primary);
  max-width:530px;
  margin-bottom: 1rem;
}

.activity-grid {
  background: var(--bg-tertiary);
  display: flex;
  gap: 8px;
  padding: 15px;
  border-radius: 4px;
  max-width: 530px;
}

.activity-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.activity-cell {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}
.activity-none {
  background-color: var(--bg-primary);
  pointer-events: none;
}

.activity-low {
  background-color: var(--activity-low);
}

.activity-high {
  background-color: var(--activity-high);
}

/* --- Stats Section Layout --- */
.stats-summary-box {
  min-width: 31.5rem;
  padding: 2rem 1.5rem 1.5rem 1.5rem;
  background-color: var(--bg-tertiary);
  border-radius: 4px;
  color: var(--text-secondary);
}

.extra-stats-class h2 {
  font-size: 1.3rem;
  margin-bottom: 0.1rem;
  color: var(--text-primary);
  position: relative;
  padding: 0 0rem;
  width: fit-content;
  margin-left: 1.5rem;
  z-index: 1;
}

/* --- Stat Blocks --- */
.stats-blocks {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.2rem;
  justify-content: center;
}

.stats-block {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stats-block-label {
  color: #fff;
  font-weight: 600;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
  font-size: 1rem; 
}

.stats-block-count {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* --- Proportional Bar --- */
.stats-bar {
  display: flex;
  height: 10px;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.5);
}

.stats-bar-segment {
  height: 100%;
}

/* --- Extra Stats Section --- */
.extra-stats {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Layout for each extra stat row */
.extra-stat-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.5rem 0;
  border-radius: 6px;
}

/* Only color the label/title */
.extra-stat-label {
  color: #fff;
  font-size: 0.90rem;
  font-weight: 600;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  width: 100%;
  box-sizing: border-box;
}

/* Value below remains unstyled */
.extra-stat-value {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Background gradients now apply only to label */
.extra-stat-row:nth-child(1) .extra-stat-label { /* Days Watched */
  background: linear-gradient(
    135deg,
    #F4B400 0% 33.3%,   /* Movies - Yellow */
    #DB4437 33.3% 66.6%, /* TV Shows - Red */
    #4285F4 66.6% 100%   /* Anime - Blue */
  );
}

.extra-stat-row:nth-child(2) .extra-stat-label { /* Days Played */
  background-color: #0F9D58;
}

.extra-stat-row:nth-child(3) .extra-stat-label { /* Chapters Read */
  background-color: #F06292;
}

.extra-stat-row:nth-child(4) .extra-stat-label { /* Chapters Read */
  background-color: #A142F4;
}

.discover-button,
.notifications-wrapper, 
.board-button{
  position: relative;
  display: inline-block;
  font-family: Arial, sans-serif;
}

.discover-button,
.notifications-button,
.board-button {
  background-color: transparent;
  border: none;
  color: var(--text-primary);
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 6px 10px;
  user-select: none;
}

.notifications-button{
  margin-right: 14vw;
  gap: 6px;
}

.notifications-button:hover{
  color: var(--activity-high);
}

.discover-button,
.board-button {
  text-decoration: none;
}

.discover-button svg{
  fill: var(--activity-high);
}

.discover-button:hover,
.discover-button:hover svg,
.board-button:hover,
.board-button:hover svg {
  color: var(--activity-high); /* bright yellow/orange for text */
  fill: var(--activity-high);  /* same bright color for the flame SVG */
  transition: color 0.3s ease, fill 0.3s ease;
}

.notifications-button .notification-icon {
  fill: var(--activity-high);
  transition: fill 0.3s ease;
}

/* Pink icon and text when notifications exist */
.notifications-button.has-notifications {
  color: #e91e63; /* pink */
}

.notifications-button.has-notifications .notification-icon {
  fill: #e91e63;
}

/* Dropdown container */
.notifications-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: #222;
  color: white;
  min-width: 190px;
  max-height: 300px;
  overflow-y: auto;
  border-radius: 4px;
  box-shadow: 0 6px 12px rgba(0,0,0,0.3);
  margin-top: 6px;
  padding: 10px 10px;
  z-index: 1000;
  margin-right: 13vw;
  
}

#notifications-dropdown {
  white-space: nowrap;
}

#notifications-dropdown[hidden] {
  display: none !important;
}
/* Notification list */
.notifications-dropdown ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.notifications-dropdown li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 4px;
  border-bottom: 1px solid #444;
}

.notifications-dropdown li:last-child {
  border-bottom: none;
}

.notifications-dropdown li a {
  color: #fff;
  text-decoration: underline;
  flex-grow: 1;
  margin-right: 10px;
}

.notifications-dropdown li a:hover {
  color: #e91e63;
}

.dismiss-notification {
  background: none;
  border: none;
  color: #bbb;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0 6px;
  user-select: none;
  transition: color 0.3s ease;
  margin-bottom: 4px;
}

.dismiss-notification:hover {
  color: #e91e63;
}

.no-notifications {
  margin: 0;
  padding: 6px 4px;
  font-style: italic;
  color: #aaa;
}

.favorites-section {
  max-width: 1400px;
  margin: 0 auto;
}

/* Hide reorder buttons by default */
.reorder-buttons {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: row;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1000;
  bottom: -10px;
}
/* Show buttons when hovering over the card */
.card:hover .reorder-buttons {
  opacity: 1;
  pointer-events: auto;
}

/* Style for the buttons */
.reorder-buttons button {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px 6px;
  border-radius: 4px;
  user-select: none;
  line-height: 1;
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
  z-index: 1000;
}

.reorder-buttons button:hover {
  
  transform: scale(1.2);
}
.favorites-overlay .close-button {
  position: absolute;
  top: -0.4rem;
  right: 0.2rem;
  background: none;
  color: white;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border: none;
  cursor: pointer;
}


.favorites-overlay .close-button:hover {
  color: rgb(212, 212, 212);
}

.recent-activity ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.recent-activity li {
  padding: 0.4rem 0;
  font-size: 1rem;
  border-bottom: 2px solid var(--bg-tertiary);
}

.recent-activity {
  max-width:35rem;
}

.recent-activity a {
  text-decoration: none;
  color: inherit;
  margin-left: 0.5rem;
}

.recent-activity a:hover {
  color: var(--activity-high); /* on hover, maybe yellow to match your theme */
}

.recent-activity-hidden {
  display: none;
}

.activity-entry {
  position: relative; /* Add this */
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
}

.activity-left {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 27rem;
}

.activity-right {
  flex-shrink: 0;
  font-size: 1em;
}

.activity-thumbnail {
  position: absolute;
  top: 50%;
  left: calc(100% + 1rem); /* 1rem gap from the right edge of the link box */
  transform: translateY(-50%);
  display: none;
  z-index: 10;
}

.activity-thumbnail img {
  width: 120px;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 0 10px rgba(0,0,0,0.4);
}

/* For music thumbnails - apply the same zoomed crop */
.activity-thumbnail[data-media-type="music"] {
  width: 120px;
  height: 120px;
  overflow: hidden;
  border-radius: 0.5rem;
}

.activity-thumbnail[data-media-type="music"] img {
  width: 178.8%; /* Same scale factor as before */
  height: 100%;
  object-fit: cover;
  object-position: center center;
  /* Adjust translateX to match your desired crop position */
  transform: translateX(-22.3%);
  transform-origin: center;
  border-radius: 0.5rem;
}

/* Show thumbnail only on hover */
.activity-entry:hover .activity-thumbnail {
  display: block;
}

.show-more-activity-wrapper {
  text-align: right;
  margin-top: 0.5rem;
}

#show-more-activity-btn {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#show-more-activity-btn:hover {
  background-color: var(--bg-quaternary);
}

#advanced-activity-btn,
#toggle-activity-btn{
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background-color: var(--button-bg);
  color: var(--text-primary);
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#advanced-activity-btn:hover,
#toggle-activity-btn:hover{
  background-color: var(--bg-quaternary);
}

/* --- Responsive --- */
@media (orientation: portrait) {
  .stats-section {
  display: flex;
  flex-direction: column; /* stack items vertically */
  justify-content: center; /* centers them along main axis (vertical now) */
  gap: 2rem; /* vertical spacing between sections */
  align-items: center;
  transform: scale(1.5);
  margin-top: 15rem;
  margin-bottom: 15rem;
  max-width: 67vw;
  margin-left: 10rem;
}
  .stats-summary-box{
    max-width: 32rem !important;
  }
.separator-bar {
  transform: scale(2);
  max-width: 67vw;       /* makes it fill the viewport */
  box-sizing: border-box; /* makes padding count toward width */
  transform-origin: center;
}
  .notifications-button{
    margin-right: 2rem;
  }

  .stats-summary-box{
    min-width: 0;
    max-width: 32rem;
    max-width: 70vw;
  }
  .favorites-column{
    max-width: 35%;
    transform: scale(1.2);
    padding-block: 4rem;
  }
  /* Show thumbnail only on hover */
.activity-entry:hover .activity-thumbnail {
  display: none;;
}

  .favorites-section{
    margin-top: 3rem;
  }

  .activity-graph{
    margin-bottom: 2.5rem;
  }
}

/* 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 Container */
.music-player-container {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 9999;
  display: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  overflow: hidden;
}

.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);
}

.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;
}
