.list-card {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.list-card:hover {
    transform: translateY(-0.25rem);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Room between the description and the owner/date along the bottom edge */
.list-card .card-body {
    padding-bottom: 1.75rem;
}

/* Editor styles */
.list-editor-header {
    margin-bottom: 1.5rem;
}

.editable-text {
    cursor: pointer;
}

.editable-text:hover {
    text-decoration: underline;
}

.list-title-input {
    font-size: 2rem;
    font-weight: 500;
    padding: 0;
    border: none;
    border-bottom: 2px solid #0d6efd;
    border-radius: 0;
    background: transparent;
}

.list-title-input:focus {
    box-shadow: none;
    outline: none;
}

.list-description-input {
    color: var(--bs-secondary-color);
    border: none;
    border-bottom: 2px solid #0d6efd;
    border-radius: 0;
    padding: 0;
    background: transparent;
    resize: none;
    width: 100%;
    overflow: hidden;
    min-height: 1.5em;
}

.list-description-input:focus {
    box-shadow: none;
    outline: none;
}

.empty-description {
    font-style: italic;
    opacity: 0.6;
}

.list-editor-header .form-control:not(.list-description-input) {
    max-width: 400px;
}

/* Tier styles */
.tier {
    background: var(--bs-tertiary-bg);
    border: 2px solid var(--bs-border-color);
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    transition: border-color 0.15s ease;
}

.tier.sortable-ghost {
    opacity: 0.4;
    border-color: #0d6efd;
}

.tier.sortable-chosen {
    border-color: #0d6efd;
}

.tier-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: var(--bs-secondary-bg);
    border-bottom: 1px solid var(--bs-border-color);
    border-radius: 0.25rem 0.25rem 0 0;
    font-size: 0.875rem;
}

.tier-handle {
    cursor: grab;
    color: var(--bs-secondary-color);
}

.tier-handle:active {
    cursor: grabbing;
}

.tier-name {
    flex: 1;
    font-weight: 600;
    cursor: pointer;
}

.tier-name:hover {
    text-decoration: underline;
}

.tier-name-input {
    flex: 1;
    font-weight: 600;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
}

/* Entry styles */
.tier-entries {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    min-height: 50px;
}

.tier-entries.sortable-ghost-container {
    background: rgba(13, 110, 253, 0.15);
}

.entry {
    position: relative;
    width: 72px;
    cursor: grab;
    transition: transform 0.15s ease;
}

.entry:active {
    cursor: grabbing;
}

.entry.sortable-ghost {
    opacity: 0.4;
}

.entry.sortable-chosen {
    /* No transform - keep original size while dragging */
}

.entry-poster {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 0.25rem;
    overflow: hidden;
    background: var(--bs-secondary-bg);
    cursor: pointer;
}

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

.entry-poster-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--bs-secondary-color);
    font-size: 0.6rem;
    text-align: center;
    padding: 0.25rem;
}

.entry-delete {
    position: absolute;
    top: -0.35rem;
    right: -0.35rem;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    background: #dc3545;
    color: white;
    border: none;
    font-size: 0.6rem;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.entry:hover .entry-delete {
    display: flex;
}

/* Empty state for tier */
.tier-empty {
    color: var(--bs-secondary-color);
    font-style: italic;
    font-size: 0.8rem;
    width: 100%;
    text-align: center;
    padding: 0.25rem 0;
}

/* Movie search section */
.movie-search-section {
    position: sticky;
    bottom: 0;
    background: var(--bs-body-bg);
    border-top: 1px solid var(--bs-border-color);
    padding: 1rem;
    margin: 2rem -1.5rem -1.5rem -1.5rem;
    box-shadow: 0 -0.25rem 0.5rem rgba(0, 0, 0, 0.4);
}

.movie-search-section .movie-search-by {
    flex: 0 0 auto;
    width: auto;
}

.movie-search-section h5 {
    margin-bottom: 0.75rem;
}

.movie-search-results {
    max-height: 240px;
    overflow-y: auto;
}

.movie-search-results .movie-card-col {
    max-width: 6rem;
}

.movie-search-results .card-body {
    display: none;
}

.movie-search-results .movie-search-result {
    overflow: hidden;
    height: auto !important;
}

.movie-search-results .movie-poster {
    border-radius: 0.25rem;
    aspect-ratio: 2 / 3;
}

.movie-search-results .movie-poster img {
    display: block;
}

.movie-search-results .card {
    border: none;
}

.movie-search-results .movie-card-col {
    cursor: grab;
}

.movie-search-results .movie-card-col:active {
    cursor: grabbing;
}

/* Keep search result size while dragging */
.movie-search-results .movie-card-col.sortable-chosen,
.movie-search-results .movie-card-col.sortable-ghost,
.tier-entries .movie-card-col {
    max-width: 5rem !important;
    width: 5rem !important;
}

.tier-entries .movie-card-col .card {
    height: auto !important;
}

.tier-entries .movie-card-col .card-body {
    display: none !important;
}

.movie-search-results .movie-search-result {
    position: relative;
}

/* Add tier button */
.add-tier-btn {
    width: 100%;
    border: 2px dashed var(--bs-border-color);
    background: transparent;
    color: var(--bs-secondary-color);
    padding: 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.add-tier-btn:hover {
    border-color: #0d6efd;
    color: #0d6efd;
}

/* Viewing someone else's list (or signed out). The editing controls aren't rendered at all; this just drops the edit affordances. */
.list-read-only .entry {
    cursor: default;
}

.list-read-only .tier-name {
    cursor: default;
}

.list-read-only .tier-name:hover {
    text-decoration: none;
}

/* Enlarged poster shown while hovering a movie; positioned by ListEditor._initPosterHoverCard */
.poster-hover-card {
    position: fixed;
    z-index: 1080;
    width: 7.33rem; /* 2/3 of the original 11rem */
    aspect-ratio: 2 / 3;
    border-radius: 0.25rem;
    overflow: hidden;
    background: var(--bs-secondary-bg);
    box-shadow: 0 0.35rem 1rem rgba(0, 0, 0, 0.35);
    pointer-events: none;
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.poster-hover-card.visible {
    opacity: 1;
    transform: scale(1);
}

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

.poster-hover-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0.5rem;
    color: var(--bs-secondary-color);
    font-size: 0.75rem;
    text-align: center;
}

.poster-hover-card-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    font-size: 0.65rem;
    text-align: center;
    padding: 0.3rem 0.35rem;
    line-height: 1.3;
}
