.movie-card-col {
    flex: 0 0 auto;
    width: 100%;
    max-width: 12rem;
}

.movie-poster {
    aspect-ratio: 2 / 3;
}

.movie-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.movie-poster-placeholder {
    height: 100%;
    font-size: 0.7rem;
    line-height: 1.2;
    word-break: break-word;
}

.movie-card-clickable {
    cursor: pointer;
}

.movie-card-clickable:hover {
    transform: translateY(-0.25rem);
    transition: transform 0.15s ease;
}

.grade {
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Letter grade colors */
.grade-a-plus { background-color: #1b9e3e !important; }
.grade-a { background-color: #28a745 !important; }
.grade-a-minus { background-color: #3cb556 !important; }
.grade-b-plus { background-color: #6abf4d !important; }
.grade-b { background-color: #8bc34a !important; }
.grade-b-minus { background-color: #a4c639 !important; }
.grade-c-plus { background-color: #c9c21a !important; }
.grade-c { background-color: #dbc400 !important; }
.grade-c-minus { background-color: #e8b309 !important; }
.grade-d-plus { background-color: #f59e0b !important; }
.grade-d { background-color: #f97316 !important; }
.grade-d-minus { background-color: #ea580c !important; }
.grade-f { background-color: #dc2626 !important; }
.grade-dnf { background-color: #7f1d1d !important; }

.movie-hero {
    position: relative;
    background: rgba(180, 180, 190, 0.3);
    min-height: 28rem;
    margin: -1.5rem -1.5rem 1.5rem -1.5rem;
}

.movie-hero-content {
    display: flex;
    gap: 2rem;
    padding: 2rem;
}

.movie-hero-poster {
    flex-shrink: 0;
    width: 18rem;
    border-radius: 0.5rem;
    box-shadow: 0 0 2rem rgba(0,0,0,0.5);
}

.movie-hero-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.movie-hero-info h1 {
    margin-bottom: 0.5rem;
}

.movie-hero-info .tagline {
    font-style: italic;
    opacity: 0.8;
    margin-bottom: 1rem;
}

/* Bootstrap's badges default to 0.75em */
#movie-badges .badge {
    font-size: 0.9em;
}

.rt-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
}

.rt-badge:hover {
    filter: brightness(1.15);
}

.rt-tomato {
    /* Same height as the badge text, so both badges come out the same size */
    width: 1em;
    height: 1em;
}

.movie-hero-info .overview {
    margin-top: 1.5rem;
    line-height: 1.6;
}

#reviews-section {
    margin-top: 2rem;
}

#reviews-section h3 {
    margin-bottom: 1rem;
}

.year-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--bs-body-color);
    font-weight: 600;
    /* The next card adds its own gutter above itself, so add the same gutter on top to even it out */
    margin-top: calc(var(--bs-gutter-y) + 1.5rem);
    margin-bottom: 1.5rem;
}

.year-divider::before,
.year-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--bs-secondary-color);
}

.review-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--bs-border-color);
    transition: background-color 0.15s ease;
}

/* Fixed width (fits the longest date, e.g. "Sept 30, 2026") so the grades line up */
.review-card .review-date {
    flex-shrink: 0;
    width: 13ch;
}

.review-card-editable {
    cursor: pointer;
}

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

.review-card:last-child {
    border-bottom: none;
}

.review-card .badge {
    flex-shrink: 0;
}

.review-content {
    flex: 1;
}

.review-author {
    margin: 0 0 0.25rem 0;
    font-weight: 600;
}

.review-text {
    margin: 0;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .movie-hero-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .movie-hero-poster {
        width: 12rem;
    }
}

@media (max-width: 576px) {
    .movie-card-col {
        max-width: 50%;
    }
}

/* Inline pill-style filters */
#filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    align-items: center;
}
#filters select, #filters input {
    border-radius: 50rem;
    padding: 0.25rem 1rem;
    height: 2.25rem;
}
#filters label {
    margin-bottom: 0;
    font-weight: 600;
    margin-right: 0.5rem;
}

#reviews-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem; /* spacing between title + filters */
  margin-bottom: 1.5rem;
}


#reviews-toolbar h2 {
    margin: 0;
    font-weight: 700;
    flex-shrink: 0;
}

/* Each filter group: label above select */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Reviews toolbar filters: inline on larger screens (the wrapper doesn't affect layout), a panel on phones */
.review-filters {
    display: contents;
}

.filters-toggle {
    display: none;
}

@media (max-width: 767.98px) {
    #reviews-toolbar {
        position: relative;
        flex-wrap: nowrap;
        gap: 0.5rem;
    }

    #reviews-toolbar .toolbar-search {
        flex: 1;
    }

    #reviews-toolbar .toolbar-search input {
        width: 100%;
    }

    .filters-toggle {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        flex-shrink: 0;
        padding: 0.4rem 0.9rem;
        border: 1px solid var(--bs-border-color);
        border-radius: 50rem;
        background: var(--bs-body-bg);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
        color: var(--bs-body-color);
        font-size: 0.875rem;
        font-weight: 500;
    }

    .filters-toggle.active {
        border-color: #86b7fe;
        box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
    }

    .review-filters {
        display: none;
    }

    .review-filters.open {
        position: absolute;
        top: calc(100% + 0.5rem);
        left: 0;
        right: 0;
        z-index: 1025;
        display: flex;
        flex-direction: column;
        gap: 1rem;
        padding: 1.25rem 1rem 1rem;
        border-radius: 1rem;
        background: var(--bs-tertiary-bg);
        box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.5);
    }

    /* Each filter spans the panel */
    .review-filters .dropdown,
    .review-filters .toolbar-select {
        width: 100%;
    }

    .review-filters .grade-range-slider {
        flex: 1;
    }
}

.toolbar-search {
    position: relative;
}

.toolbar-search .bi-search {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    font-size: 0.8rem;
    pointer-events: none;
}

.toolbar-search input {
    width: 12rem;
    padding: 0.4rem 1rem 0.4rem 2.2rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 50rem;
    background: var(--bs-body-bg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-size: 0.875rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.toolbar-search input:focus {
    outline: none;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* Grade range slider: two range inputs stacked on one track, A+ on the left to DNF on the right */
.grade-range {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--bs-secondary-color);
    font-size: 0.75rem;
    font-weight: 600;
}

.grade-range-slider {
    --grade-gradient: linear-gradient(to right,
        #1b9e3e, #28a745, #3cb556, #6abf4d, #8bc34a, #a4c639, #c9c21a,
        #dbc400, #e8b309, #f59e0b, #f97316, #ea580c, #dc2626, #7f1d1d);
    position: relative;
    width: 11rem;
    height: 1.25rem;
}

.grade-range-track,
.grade-range-fill {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 0.35rem;
    transform: translateY(-50%);
    border-radius: 50rem;
    background: var(--grade-gradient);
}

/* Outside the selected range the gradient is faded */
.grade-range-track {
    opacity: 0.2;
}

.grade-range-slider input[type="range"] {
    position: absolute;
    inset: 0;
    width: 100%;
    margin: 0;
    background: none;
    appearance: none;
    -webkit-appearance: none;
    /* Only the handles take the mouse, so the two inputs don't block each other */
    pointer-events: none;
}

.grade-range-slider input[type="range"]::-webkit-slider-runnable-track {
    background: none;
}

.grade-range-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 1rem;
    height: 1rem;
    border: 2px solid #495057;
    border-radius: 50%;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    cursor: grab;
    pointer-events: auto;
}

.grade-range-slider input[type="range"]::-moz-range-thumb {
    width: 0.75rem;
    height: 0.75rem;
    border: 2px solid #495057;
    border-radius: 50%;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    cursor: grab;
    pointer-events: auto;
}

.grade-range-slider input[type="range"]:active::-webkit-slider-thumb {
    cursor: grabbing;
}

/* A handle's grade, shown above it once it's moved off its end */
.grade-range-bubble {
    position: absolute;
    bottom: 100%;
    transform: translateX(-50%);
    margin-bottom: 0.1rem;
    color: var(--bs-body-color);
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
}

/* Each selected user's grade on a card, highest first: the usual grade badge with muted initials below */
.grade-list {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.4rem;
}

.grade-entry {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}

.grade-initials {
    color: var(--bs-secondary-color);
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1;
}

/* Pills */
.pill-select {
    border-radius: 50rem !important;
    padding: 0.25rem 1rem !important;
    min-width: 10rem; /* prevents truncation */
    text-align: center;
}

/* Readonly text box showing "Today"/"Sept 18, 2026", with the native date input hidden behind it for its calendar */
.review-date-picker {
    position: relative;
}

.review-date-picker input[type="text"] {
    /* Just wider than the longest date, "Sept 25, 2026", plus padding and border */
    width: calc(14ch + 1.5rem + 2px);
    cursor: pointer;
    background-color: var(--bs-body-bg);
}

.review-date-picker input[type="date"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

/* Takes the width of its container without widening it, so it ends where the Date box does */
.user-select-fill {
    width: 0;
    min-width: 100%;
}

/* Floating "New Review" button pinned to the bottom right of the reviews page */
.new-review-fab {
    position: fixed;
    right: 2rem;
    bottom: 2rem;
    z-index: 1030;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.25);
}
