:root {
  /* Dark theme (default) */
  --bg-primary: #0b1622;
  --bg-secondary: #1a2332;
  --bg-secondary-rgb: 26, 35, 50;
  --bg-tertiary: #151f2e;
  --bg-quaternary: #32445b;
  --bg-filter: #102031;
  --text-primary: #8596a5;
  --text-secondary: #a8b5c4;
  --text-tertiary: #cecece;
  --text-light: #edf1f5;
  --border-color: #32445b;
  --hover-bg: #2a3441;
  --table-bg: #1f2a38;
  --score-color: #ffd700;
}

[data-theme="light"] {
  --bg-primary: #e7f0f8;
  --bg-secondary: #b7e0f7;
  --bg-secondary-rgb: 183, 224, 247;
  --bg-tertiary: #DCECF8;
  --bg-quaternary: #ffffff;
  --bg-filter: #cfe8f7;
  --text-primary: #0b5f97;
  --text-secondary: #063e63;
  --text-tertiary: #97cdec;
  --text-light: #0b5f97;
  --border-color: #DCECF8;
  --hover-bg: #cfe8f7;
  --table-bg: #DCECF8;
  --score-color: #E846C4;
}

[data-theme="brown"] {
  --bg-primary: #271c19;
  --bg-secondary: #55423d;
  --bg-secondary-rgb: 85, 66, 61;
  --bg-tertiary: #55423d;
  --bg-quaternary: #af7f76;
  --bg-filter: #3b2b27;
  --text-primary: #e2c7b7;
  --text-secondary: #f1dbce;
  --text-tertiary: #af7f76;
  --text-light: #faeee7;
  --border-color: #fffffe;
  --hover-bg: #fffffe;
  --table-bg: #55423d;
  --score-color: #ffd700;
}

body {
  background-color: var(--bg-primary);
  margin: 0;
  padding: 0;
  color: var(--text-primary);
}

.separator-bar {
  width: 100%;
  height: 45px;
  margin-bottom: 5rem;
}

/* --- Page Layout --- */
.list-page-container {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 10rem 2rem;
}

/* --- 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(--table-bg);
  color: var(--text-primary);
}

#search-input:focus {
  outline: none;
  box-shadow: none;
}

#search-input::placeholder {
  color: var(--text-primary);
}

.sidebar h3 {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-btn {
  flex: 0 1 auto;
  min-width: 20px;
  max-width: 120px;
  justify-content: center;
  padding: 0.4rem 0.6rem;
  background: var(--bg-filter);
  border: none;
  color: var(--text-primary);
  font-size: 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.filter-btn:hover {
  background-color: var(--bg-quaternary);
}

.filter-btn.active {
  background-color: var(--table-bg);
}

#year-input, #season-year-input, #game-year-input, #tmdb-year-input {
  width: 100%;
  padding: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-light);
  background-color: var(--table-bg);
  border: none;
  border-radius: 6px;
  box-sizing: border-box;
  outline: none;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  margin-bottom: 0.3rem;
    /* For Firefox */
  -moz-appearance: textfield;
}

/* For Chrome, Safari, Edge, Opera */
#year-input::-webkit-outer-spin-button,
#year-input::-webkit-inner-spin-button,
#season-year-input::-webkit-outer-spin-button,
#season-year-input::-webkit-inner-spin-button,
#game-year-input::-webkit-outer-spin-button,
#game-year-input::-webkit-inner-spin-button,
#tmdb-year-input::-webkit-outer-spin-button,
#tmdb-year-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#year-input::placeholder, #season-year-input::placeholder, #game-year-input::placeholder, #tmdb-year-input::placeholder {
  color: var(--text-primary);
  opacity: 1;
}

/* --- Main List Content --- */
.list-content {
  width: 80%;
  margin-top: -20px;
}

/* --- Card View Grid --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(5, 180px);
  gap: 1.5rem;
}

/* Individual Card */
.card {
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.15s ease-in-out;
  cursor: pointer;
  width: 180px;
}

.card img {
  width: 180px;
  height: 270px;
  object-fit: cover;
  display: block;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.card-title {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.3s ease;
}

.card:hover .card-title {
  color: var(--text-light);
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.add-to-list-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  display: none;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  border: none;
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 14px;
  font-weight: bold;
  z-index: 2;
}

.add-to-list-btn::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
}

.hover-tooltip {
  position: fixed;
  background: var(--bg-secondary);
  border: none;
  border-radius: 8px;
  padding: 12px;
  max-width: 350px;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  color: var(--text-primary);
  font-size: 0.9rem;
  display: block;
  overflow: hidden;
}

.tooltip-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 56%;
  background-size: cover;
  background-position: top center;
  background-repeat: no-repeat;
  border-radius: none;
  z-index: 0;
}

.tooltip-backdrop::after {
  content: '';
  position: absolute;
  inset: 0;

  background: 
    linear-gradient(to right,
      rgba(var(--bg-secondary-rgb), 1) 5%,
      rgba(var(--bg-secondary-rgb), 0.95) 20%,
      rgba(var(--bg-secondary-rgb), 0.90) 25%,
      rgba(var(--bg-secondary-rgb), 0.85) 30%,
      rgba(var(--bg-secondary-rgb), 0.1) 100%
    ),
    linear-gradient(to top,
      rgba(var(--bg-secondary-rgb), 1) 5%,
      rgba(var(--bg-secondary-rgb), 0.95) 20%,
      rgba(var(--bg-secondary-rgb), 0.90) 25%,
      rgba(var(--bg-secondary-rgb), 0.85) 30%,
      rgba(var(--bg-secondary-rgb), 0.1) 100%
    );

  border-radius: 8px 8px 0 0;
  z-index: 1;
}

.tooltip-content {
  position: relative;
  z-index: 2;
}

.hover-tooltip h3 {
  margin: 0 0 8px 0;
  color: var(--text-secondary);
  font-size: 1rem;
}

.tooltip-score {
  color: var(--score-color);
  font-weight: bold;
  margin-bottom: 4px;
}

.tooltip-date {
  color: var(--text-primary);
  margin-bottom: 4px;
}

.tooltip-genres {
  color: var(--text-primary);
  font-style: italic;
  margin-bottom: 4px;
}

.tooltip-next {
  color: #4CAF50;
  font-weight: bold;
  margin-bottom: 4px;
}

.tooltip-overview {
  color: var(--text-primary);
  line-height: 1.4;
  margin-top: 8px;
}



#loading {
  text-align: center;
  margin-top: 2rem;
  color: var(--text-tertiary);
  font-size: 1.1rem;
}



@media (orientation: portrait) {
  .hover-tooltip {
    display: none !important;
  }
  .list-page-container {
    flex-direction: column;
    padding-left: 16.3rem;
    padding-right: 0rem;
  }
  
  .sidebar {
    transform: scale(2);
    transform-origin: top;
    max-width: 40rem;
    width: 64%;
    padding-bottom: 24rem;
    padding-right: 0rem;
  }
  
  .list-content {
    transform: scale(2);
    transform-origin: top;
    max-width: 30rem;
    margin-left: 0.4rem;
  }
  
.card-grid {
  grid-template-columns: repeat(3, 155px);
  row-gap: 0.5rem;
  column-gap: 0;
  justify-content: center;
}
  
  .filter-group {
    flex-direction: row;
  }

  .status-filter{
    margin-bottom: 10rem;
  }
  
  .separator-bar {
    width: 100%;
    height: 45px;
    margin-bottom: 16rem;
  }
  
.card {
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.15s ease-in-out;
  cursor: pointer;
  width: 140px; /* smaller */
}

.card img {
  width: 140px;  /* same as card width */
  height: 210px; /* keeps 2:3 ratio */
  object-fit: cover;
  display: block;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

}