/* Action Buttons Wrapper */
.tcl-action-buttons-wrapper {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Base Button Styles */
.tcl-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}
.tcl-button.loading {
    cursor: wait;
    opacity: 0.7;
}

/* Integrated Watchlist Button Group */
.tcl-button-group {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    overflow: hidden;
}
.tcl-watchlist-group {
    background-color: #facc15; /* yellow-400 */
    color: #1f2937; /* gray-800 */
}
.tcl-watchlist-action {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    cursor: pointer;
}
.tcl-button-text-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.tcl-button-text-main {
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
}
.tcl-button-text-sub {
    font-size: 0.75rem;
    color: #4b5563; /* gray-600 */
    margin-top: -2px;
}
.tcl-list-modal-trigger {
    padding: 0.75rem;
    border: none;
    background: none;
    cursor: pointer;
    border-left: 1px solid rgba(0,0,0,0.1);
}
.tcl-watchlist-group:hover .tcl-list-modal-trigger {
    background-color: rgba(0,0,0,0.05);
}

/* Watched Button */
.tcl-watched-button {
    background-color: #374151; /* gray-700 */
    color: #d1d5db; /* gray-300 */
}
.tcl-watched-button:hover {
    background-color: #4b5563; /* gray-600 */
}
.tcl-watched-button.active {
    background-color: #1d4ed8; /* blue-700 */
    color: #ffffff;
}

/* --- Watchlist Page Styles --- */
.tcl-list-item {
    position: relative;
}

.tcl-list-item-poster {
    position: relative;
    overflow: hidden; /* Hide actions that might poke out */
}

.tcl-list-item-poster img {
    display: block;
    width: 100%;
    transition: transform 0.2s ease-in-out;
}

/* On-Hover Actions Container for Grid View */
.tcl-item-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.tcl-list-item:hover .tcl-item-actions {
    opacity: 1;
    transform: translateX(0);
}

/* Small Action Buttons for Hover */
.tcl-watchlist-button-sm,
.tcl-watched-button-sm {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: background-color 0.2s ease-in-out;
}
.tcl-watchlist-button-sm:hover,
.tcl-watched-button-sm:hover {
    background-color: rgba(0, 0, 0, 0.8);
}
.tcl-watched-button-sm.active {
    background-color: #1d4ed8; /* blue-700 */
}
.tcl-watchlist-button-sm .lucide,
.tcl-watched-button-sm .lucide {
    width: 18px;
    height: 18px;
}

/* --- Watchlist List View Styles --- */
.tcl-list-item-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    padding: 0.75rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease-in-out;
}
.tcl-list-item-row:hover {
    background-color: #f9fafb; /* gray-50 */
}
.tcl-list-item-poster-row {
    flex-shrink: 0;
    width: 60px;
}
.tcl-list-item-poster-row img {
    width: 100%;
    height: auto;
    display: block;
}
.tcl-list-item-details {
    flex-grow: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.tcl-item-year {
    font-size: 0.8rem;
    color: #6b7280; /* gray-500 */
}
.tcl-item-title-link {
    text-decoration: none;
}
.tcl-item-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937; /* gray-800 */
    line-height: 1.2;
}
.tcl-item-title-link:hover .tcl-item-title {
    text-decoration: underline;
}
.tcl-item-type {
    font-size: 0.8rem;
    color: #6b7280; /* gray-500 */
    margin-top: 0.25rem;
}

/* Actions in List View (always visible) */
.tcl-item-actions-row {
    display: flex;
    gap: 0.5rem;
}

/* --- Watchlist Sub-Tab Navigation --- */
.tcl-sub-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}
.tcl-sub-nav-item {
    padding-bottom: 0.75rem;
    border-bottom: 3px solid transparent;
    color: #6b7280; /* gray-500 */
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    margin-bottom: -2px; /* Overlap the main border */
    white-space: nowrap;
}
.tcl-sub-nav-item:hover {
    color: #1f2937; /* gray-800 */
    border-bottom-color: #d1d5db; /* gray-300 */
}
.tcl-sub-nav-item.active {
    color: #4f46e5; /* indigo-600 */
    border-bottom-color: #4f46e5; /* indigo-600 */
}
.tcl-tab-count {
    margin-left: 0.5rem;
    background-color: #e5e7eb; /* gray-200 */
    color: #4b5563; /* gray-600 */
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 9999px;
}
.tcl-sub-nav-item.active .tcl-tab-count {
    background-color: #e0e7ff; /* indigo-100 */
    color: #4f46e5; /* indigo-600 */
}

/* Pagination Styles */
.tcl-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb; /* gray-200 */
}
.tcl-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 9999px;
    font-weight: 600;
    color: #374151; /* gray-700 */
    text-decoration: none;
    transition: background-color 0.2s ease-in-out;
}
.tcl-pagination .page-numbers:hover {
    background-color: #f3f4f6; /* gray-200 */
}
.tcl-pagination .page-numbers.current {
    background-color: #4f46e5; /* indigo-600 */
    color: white;
}
.tcl-pagination .prev, .tcl-pagination .next {
    color: #4f46e5; /* indigo-600 */
}

/* Style for the new "Edit Status" button on the watchlist page */
.tcl-edit-watchlist-status {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    background-color: rgba(31, 41, 55, 0.6); /* gray-800 with opacity */
    color: white;
    transition: background-color 0.2s ease-in-out;
}
.tcl-edit-watchlist-status:hover {
    background-color: rgba(31, 41, 55, 0.8);
}
.tcl-edit-watchlist-status .lucide {
    width: 16px;
    height: 16px;
}

/* Style for the "Edit Status" button on the watchlist page */
.tcl-edit-status-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    background-color: rgba(31, 41, 55, 0.6); /* gray-800 with opacity */
    color: white;
    transition: background-color 0.2s ease-in-out;
}
.tcl-edit-status-button:hover {
    background-color: rgba(31, 41, 55, 0.8);
}
.tcl-edit-status-button .lucide {
    width: 16px;
    height: 16px;
}

/* --- Watchlist Item Note Styles --- */
.tcl-item-note {
    display: flex;
    align-items: flex-start;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: #4b5563; /* gray-600 */
    background-color: #f3f4f6; /* gray-200 */
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    margin-top: 0.5rem;
    max-width: 95%;
}

.tcl-note-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    margin-top: 3px;
    float: left;
}

/* --- Voting Button Styles --- */
.tcl-vote-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f3f4f6; /* gray-200 */
    color: #4b5563; /* gray-600 */
    border: 1px solid #e5e7eb; /* gray-200 */
    border-radius: 0.5rem;
    padding: 0.25rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}
.tcl-vote-button:hover {
    background-color: #e5e7eb; /* gray-200 */
    border-color: #d1d5db; /* gray-300 */
}
.tcl-vote-button.active {
    background-color: #e0e7ff; /* indigo-100 */
    color: #4338ca; /* indigo-700 */
    border-color: #a5b4fc; /* indigo-300 */
}
.tcl-vote-button .lucide {
    width: 20px;
    height: 20px;
}
.tcl-vote-count {
    font-size: 0.9rem;
    font-weight: 700;
}

.tcl-list-meta-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.tcl-list-author-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* --- Single Custom List Page Layout --- */
.tcl-single-list-layout {
    display: grid;
    grid-template-columns: 1fr; /* Default to single column on mobile */
    gap: 1.5rem;
}

/* On medium screens and up, switch to two columns */
@media (min-width: 768px) {
    .tcl-single-list-layout {
        grid-template-columns: 2fr 1fr; /* Main content is twice as wide as sidebar */
    }
}

/* --- List Archive Page --- */
.tcl-archive-card-posters {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    aspect-ratio: 16 / 8;
    background-color: #e5e7eb;
}
.tcl-archive-card-posters img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tcl-archive-card-placeholder {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    font-weight: bold;
    color: #4b5563;
}
.tcl-archive-card-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: #6b7280;
}
.tcl-archive-card-stats span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.tcl-archive-card-stats .lucide {
    width: 12px;
    height: 12px;
}

/* --- New Archive List Card Styles --- */
.tcl-archive-card {
    transition: box-shadow 0.2s ease-in-out;
}



.tcl-archive-card-posters {
    display: flex;
    position: relative;
    border-radius: 0.5rem;
    margin: 0.75rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.tcl-archive-card-posters .tcl-poster-wrapper {
    height: 100%;
    flex-basis: 33.33%;
    transition: transform 0.3s ease;
}

.tcl-archive-card-posters .tcl-poster-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tcl-archive-card-posters .tcl-poster-wrapper:not(:first-child) {
    margin-left: -16.66%;
}

/* FIX: Apply the zoom/lift animation ONLY to the specific item being hovered. */
.tcl-archive-card-posters .tcl-poster-wrapper:hover {
    transform: scale(1.07) translateY(2px);
    z-index: 10; /* Ensure the hovered item comes to the front */
}

/* --- NEW: Poster Aspect Ratio Enforcement --- */
.tcl-poster-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3; 
    border-radius: 0.375rem;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
}

.tcl-poster-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; 
}