/**
 * Book Listing Cards Styles
 * Uses unified book-card-shared.css for card appearance
 * Additional styles for carousel navigation within individual cards and listing-specific features
 */

/* Carousel navigation within individual card images */
.listing-thumb-wrapper .carousel-prev,
.listing-thumb-wrapper .carousel-next,
.book-card-cover-wrapper .carousel-prev,
.book-card-cover-wrapper .carousel-next {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.5), transparent);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 12px;
    z-index: 10;
    opacity: 1;
    transition: all 0.2s ease;
}

.listing-thumb-wrapper .carousel-next,
.book-card-cover-wrapper .carousel-next {
    background: linear-gradient(to left, rgba(0, 0, 0, 0.5), transparent);
    left: auto;
    right: 0;
    justify-content: flex-end;
    padding-left: 0;
    padding-right: 12px;
}

.listing-thumb-wrapper .carousel-prev,
.book-card-cover-wrapper .carousel-prev {
    left: 0;
}

/* Arrow icons using CSS */
.listing-thumb-wrapper .carousel-prev::before,
.listing-thumb-wrapper .carousel-next::before,
.book-card-cover-wrapper .carousel-prev::before,
.book-card-cover-wrapper .carousel-next::before {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    border-top: 2.5px solid white;
    border-right: 2.5px solid white;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.listing-thumb-wrapper .carousel-prev::before,
.book-card-cover-wrapper .carousel-prev::before {
    transform: rotate(-135deg);
}

.listing-thumb-wrapper .carousel-next::before,
.book-card-cover-wrapper .carousel-next::before {
    transform: rotate(45deg);
}

/* Show on mobile, hide on desktop until hover */
@media (min-width: 769px) and (hover: hover) {
    .listing-thumb-wrapper .carousel-prev,
    .listing-thumb-wrapper .carousel-next,
    .book-card-cover-wrapper .carousel-prev,
    .book-card-cover-wrapper .carousel-next {
        opacity: 0;
    }
    
    .book-card:hover .carousel-prev,
    .book-card:hover .carousel-next,
    .listing-card:hover .carousel-prev,
    .listing-card:hover .carousel-next {
        opacity: 1;
    }
}

/* Hover effects only for devices that support hover */
@media (hover: hover) {
    .listing-thumb-wrapper .carousel-prev:hover,
    .listing-thumb-wrapper .carousel-next:hover,
    .book-card-cover-wrapper .carousel-prev:hover,
    .book-card-cover-wrapper .carousel-next:hover {
        background: linear-gradient(to right, rgba(0, 0, 0, 0.7), transparent);
    }

    .listing-thumb-wrapper .carousel-next:hover,
    .book-card-cover-wrapper .carousel-next:hover {
        background: linear-gradient(to left, rgba(0, 0, 0, 0.7), transparent);
    }
}

.listing-thumb-wrapper .carousel-prev:active,
.listing-thumb-wrapper .carousel-next:active,
.book-card-cover-wrapper .carousel-prev:active,
.book-card-cover-wrapper .carousel-next:active {
    opacity: 0.8;
}

.listing-thumb-wrapper .carousel-dots,
.book-card-cover-wrapper .carousel-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.listing-thumb-wrapper .carousel-dots .dot,
.book-card-cover-wrapper .carousel-dots .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: background 0.2s;
}

.listing-thumb-wrapper .carousel-dots .dot.active,
.book-card-cover-wrapper .carousel-dots .dot.active {
    background: rgba(255, 255, 255, 1);
}

/* Inactive badge tooltip - styles in book-card-shared.css */

/* Login/Unauthorized */
.listing-login-required,
.listing-unauthorized {
    text-align: center;
    padding: 2rem;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
}

/* Success notification */
.listing-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    opacity: 0;
    transform: translateX(100px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: 300px;
    font-weight: 500;
}

.listing-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.listing-notification.error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

/* Results info */
.no-listings {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

.listings-count {
    margin-bottom: 1rem;
    font-weight: 600;
    color: #555;
}

/* Legacy grid support - use .book-grid preferably */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .listings-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .listings-grid {
        grid-template-columns: 1fr;
    }
}
