/* Adjust Bootstrap grid for card layout */
.row {
  --bs-gutter-x: 1.5rem;
  --bs-gutter-y: 2.5rem;
}

.col {
  display: flex;
  justify-content: center;
}

/* Navbar coloration (light/dark) */
[data-bs-theme="light"] .navbar {
  background: #ffe4d4 !important;
}
[data-bs-theme="dark"] .navbar {
  background: #282e44 !important;
}

/* Highlight behavior handled via JS for left-to-right selection */
/* Smaller card size and more gap */
/* Unified card style */
.card {
  width: 450px;
  margin: 15px 0 40px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}
[data-bs-theme="dark"] .card { background: #232323; color: #e9ecef; box-shadow: 0 2px 8px rgba(0,0,0,0.5); }
[data-bs-theme="dark"] .list-group-item { background: #232323; color: #e9ecef; }
[data-bs-theme="dark"] .bg-light { background-color: #2b2b2b !important; }
[data-bs-theme="dark"] .text-muted { color: #adb5bd !important; }
[data-bs-theme="dark"] .border-top { border-top-color: rgba(255,255,255,0.1) !important; }
[data-bs-theme="dark"] .border { border-color: rgba(255,255,255,0.1) !important; }

/* Ensure poster images share the same aspect and fill */
.card-img-top {
  width: 100%;
  aspect-ratio: 3 / 4; /* consistent poster shape */
  object-fit: cover;   /* crop as needed, keep center */
  object-position: center;
  display: block;
}
.card-img-top:hover {
  filter: brightness(1.25);
  transform: scale(1.05);
  transition: filter 0.5s ease-in-out;
  transition: transform 0.4s;
}
[data-bs-theme="dark"] .card-img-top:hover { filter: brightness(1.1); }
.card-text {
  flex-grow:0 !important;
}

/* Card footer for actions */
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: #f8f9fa;
  min-height: 48px;
}
[data-bs-theme="dark"] .card-footer {
  background: #2b2b2b; /* match dark bg */
  color: #adb5bd;      /* muted text in dark */
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* Star rating spacing */
.star-rating {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Save button spacing */
.save-btn {
  margin-left: 16px;
}
/* 10-star rating widget */
.rating-widget {
  display: flex;
  align-items: center;
  gap: 0px; /* tighter spacing so stars fit one line */
  flex-wrap: wrap;
}
.rating-widget input[type="radio"] { display: none; }
.rating-widget label {
  cursor: pointer;
  font-size: 0;
  width: 20px;  /* 1.5x larger */
  height: 20px; /* 1.5x larger */
  display: inline-block;
  border: none;
  border-radius: 0;
  position: relative;
  color: #999; /* default star color; JS updates this */
}
.rating-widget label::before {
  content: "★";
  font-size: 16px; /* 1.5x larger */
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: currentColor; /* follow label color for JS hover/selection */
}
.rating-widget .btn {
  margin-left: 6px;
  flex-shrink: 0;
}

/* Inline numeric rating next to stars */
.rating-widget .rating-value {
  margin-left: 6px; /* slightly tighter next to stars */
  color: #6c757d; /* Bootstrap muted color */
  line-height: 1;
  white-space: nowrap;
}
.heart-btn { color: #d33; text-decoration: none; border: 0; background: transparent; }
.heart-btn .fa-heart { font-size: 20px; }

/* List view thumbnail */
.list-item-thumb {
  width: 48px;
  height: 72px; /* 2:3 aspect */
  object-fit: cover;
  object-position: center;
  border-radius: 4px;
  flex-shrink: 0;
}

/* Admin dashboard should not use global card width used for catalog cards */
.admin-dashboard .card {
  width: 100% !important;
  margin: 0; /* grid gutters manage spacing */
}

/* Settings page: allow cards to expand full width of main panel */
.settings-page .card {
  width: 100% !important;
  margin: 0; /* rely on grid spacing */
}

/* Detail page: prevent overlapping and use full-width cards in columns */
.item-detail .card {
  width: 100% !important;
  margin: 0;
}
.item-detail .poster-card .card-img-top {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

/* Dashboard: make grid cards and panels fill available width */
.dashboard-page .col { display: block; }
.dashboard-page .card:not(.h-card) { width: 100% !important; margin: 0; }

/* Dashboard upcoming carousel: fixed height */
.dashboard-page .h-scroll { height: auto; overflow-y: hidden; }
.dashboard-page .h-card { 
  height: auto; 
  margin: 0; 
  width: calc((100% - 4rem) / 5); /* 5 per row with 1rem gaps (me-3) */
  flex: 0 0 auto;
}
.dashboard-page .h-card .card-img-top { height: 100%; object-fit: cover; }
.dashboard-page .h-card .card-body { height: 30%; overflow: hidden; }

/* Horizontal carousel for upcoming */
.h-scroll {
  display: flex;
  overflow-x: auto;
  padding-bottom: 6px;
}
.h-scroll::-webkit-scrollbar { height: 8px; }
.h-scroll::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 4px; }
.h-card {
  width: 180px;
  flex: 0 0 auto;
}

/* Simple toast styles */
.toast-container {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast-item {
  padding: 10px 14px;
  border-radius: 6px;
  color: #fff;
  min-width: 220px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  opacity: 0.95;
}
.toast-success { background: #198754; }
.toast-info { background: #0d6efd; }
.toast-warning { background: #ffc107; color: #222; }
.toast-danger { background: #dc3545; }

/* Provider logos */
.provider-logo { width: 24px; height: 24px; object-fit: contain; }

.site-logo {
  height: 50px;
  width: auto;
  object-fit: contain;
}
[data-bs-theme="dark"] .site-logo { filter: brightness(125%);}

.navbar {
  font-size:18px;
}
.nav-item {
  background-color: #fff1e9;
  border:2px solid #ffddd2;
  border-radius: 10px;
  margin-right:10px;
}
.navbar .selected {
  background-color: #FFF;
  border: 2px solid #ffd0b5;
}
[data-bs-theme="dark"] .nav-item {
  background-color: #1c2236;
  border: 2px solid #354069;
}
[data-bs-theme="dark"] .navbar .selected {
  background-color: #2b3f88;
  border: 2px solid #1c2236;
}

#themeToggle {
  font-size: 24px;
  font-weight: 200;
}
