/* ============================================
   UNIFIED BOOK CARD STYLES
   Used by: book-card-grid.blade.php, book-carousel.blade.php
   ============================================ */

.book-item {
    display: flex;
}

.book-card {
    width: 100%;
    max-width: 280px;
    background: white;
    border-radius: 15px;
    padding: 0;
    /* Remove padding to allow full-width image */
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.book-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    transform: scaleX(0);
    transition: transform 0.3s ease;
    transform-origin: left;
}

.book-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 30px rgba(44, 75, 121, 0.18);
    border-color: var(--color-secondary);
}

.book-card:hover::before {
    transform: scaleX(1);
}

/* Book Image - Full Width Design */
.book-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    border-radius: 0;
}

.book-card:hover img {
    transform: scale(1.1);
}

.book-card .book-image-wrapper {
    display: block;
    margin-bottom: 0;
    /* Remove margin */
    position: relative;
    z-index: var(--z-base);
    border-radius: 15px 15px 0 0;
    /* Only round top corners */
    overflow: hidden;
    height: 350px;
    /* Taller to match screenshot */
    width: 100%;
    /* Full width */
    flex-shrink: 0;
    background: #f5f5f5;
}

.book-card .book-image-wrapper img {
    margin-bottom: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0;
    transform: scale(1.05);
}

/* Card Content Padding */
.book-card>h6,
.book-card>.book-author,
.book-card>.price-section {
    padding-left: 20px;
    padding-right: 20px;
}

/* Card Badges */
.card-badges {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 5px;
    height: 30px;
    margin-top: -18px;
    margin-bottom: 10px;
    padding: 0 15px;
    position: relative;
    z-index: 3;
}

.card-badges .badge {
    font-size: 12px;
    padding: 5px 12px;
    border-radius: var(--radius-md);
    border: 2px solid #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Book Title */
.book-card h6 {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    margin-top: 15px;
    /* Add top margin since no image margin */
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.3;
}

.book-card h6 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.book-card h6 a:hover {
    color: var(--color-primary);
}

/* Author */
.book-card .book-author {
    color: var(--color-text-grey);
    font-size: 14px;
    margin-bottom: 15px;
    min-height: 20px;
}

.book-card .book-author a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.book-card .book-author a:hover {
    color: var(--color-secondary);
}

/* Star Rating on Cards */
.book-card-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 2px 20px 0;
}

.book-card-rating i {
    color: var(--color-warning);
    font-size: 11px;
}

.book-card-rating .rating-count {
    font-size: 11px;
    color: var(--color-text-grey);
    margin-right: 4px;
    font-weight: 500;
}

/* List view rating */
.book-item.list-style .book-card-rating {
    justify-content: flex-start;
    padding: 0;
    margin-bottom: 4px;
}

.book-item.list-style .book-card-rating i {
    font-size: 12px;
}

.book-item.list-style .book-card-rating .rating-count {
    font-size: 12px;
}

/* Price Section */
.book-card .price-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: auto;
    padding: 10px 20px 20px;
    /* Bottom padding for card */
    border-top: 1px solid #e2e8f0;
}

.book-card .price {
    color: var(--color-primary);
    font-weight: 700;
    font-size: 18px;
}

.book-card .original-price {
    color: var(--color-text-grey);
    font-size: 14px;
    text-decoration: line-through;
    margin-left: 8px;
}

/* Add to Cart Button */
.book-card .add-btn {
    width: 100%;
    padding: 12px;
    background: var(--color-secondary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    font-size: clamp(0.85rem, 2vw, 1rem);
    position: relative;
    overflow: hidden;
}

.book-card .add-btn::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 -100%;
    width: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.book-card .add-btn:hover::before {
    left: 100%;
}

.book-card .add-btn:hover {
    background: var(--color-secondary-darker);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(44, 75, 121, 0.35);
}

.book-card .add-btn i {
    font-size: 1rem;
}

/* View Button */
.book-card .view-btn {
    display: inline-block;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--color-success), #20c997);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-xl);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-base);
    margin-top: 10px;
}

.book-card .view-btn:hover {
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Quick Actions (wishlist, cart buttons on hover) */
.quick-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 4;
    /* Higher than badges */
    display: flex;
    flex-direction: column;
    gap: 5px;
    opacity: 0;
    transform: translateX(10px);
    transition: var(--transition-base);
}

.book-card:hover .quick-actions {
    opacity: 1;
    transform: translateX(0);
}

.action-btn {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-circle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-base);
    box-shadow: 0 2px 10px rgba(44, 75, 121, 0.15);
}

.action-btn:hover {
    background: var(--gradient-primary);
    color: white;
    transform: scale(1.12);
    box-shadow: 0 4px 14px rgba(44, 75, 121, 0.35);
}

/* ===== Notify Me Button ===== */
.notify-btn {
    width: 100%;
    padding: 11px 12px;
    background: transparent;
    border: 2px solid var(--color-warning-alt);
    border-radius: var(--radius-md);
    color: var(--color-warning-alt);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    font-size: clamp(0.78rem, 1.8vw, 0.92rem);
}

.notify-btn:hover {
    background: var(--color-warning-alt);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(243, 156, 18, 0.3);
}

.notify-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

/* ===== Out-of-stock card state ===== */
.book-card.out-of-stock .book-image-wrapper img {
    opacity: 0.65;
    filter: grayscale(25%);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.book-card.out-of-stock:hover .book-image-wrapper img {
    opacity: 0.8;
    filter: grayscale(10%);
}

/* Followed badge (personalized) */
.badge.badge-followed {
    background:  var(--color-secondary);
    color: #fff;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: var(--radius-md);
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(44, 75, 121, 0.2);
}

.badge.badge-followed i {
    font-size: 9px;
    margin-left: 2px;
}

/* Out-of-stock badge */
.badge.out-of-stock-badge {
    background: var(--color-text-grey);
    color: #fff;
    font-size: 12px;
    padding: 5px 12px;
    border-radius: var(--radius-md);
    border: 2px solid #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* List-view notify button */
.btn-notify-outline {
    border: 2px solid var(--color-warning-alt) !important;
    color: var(--color-warning-alt) !important;
    background: transparent !important;
    font-weight: 600;
    border-radius: 25px;
    transition: var(--transition-base);
    font-size: 0.88rem;
}

.btn-notify-outline:hover {
    background: var(--color-warning-alt) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.btn-notify-outline:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* ===== Responsive */
@media (max-width: 768px) {
    .book-card .book-image-wrapper {
        height: 280px;
    }

    .book-card:hover {
        transform: translateY(-4px) scale(1.01);
    }

    /* Smaller badges */
    .card-badges {
        margin-top: -14px;
        margin-bottom: 6px;
        gap: 4px;
        height: 24px;
    }

    .card-badges .badge {
        font-size: 10px;
        padding: 3px 8px;
        border-radius: 10px;
    }

    /* Smaller quick action buttons */
    .quick-actions {
        top: 6px;
        right: 6px;
        gap: 4px;
    }

    .action-btn {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
}

@media (max-width: 576px) {
    .book-card .book-image-wrapper {
        height: 220px;
    }

    .book-card h6 {
        font-size: 13px;
        height: 36px;
        margin-top: 10px;
        margin-bottom: 5px;
    }

    .book-card .book-author {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .book-card .price {
        font-size: 15px;
    }

    .book-card .original-price {
        font-size: 12px;
    }

    .book-card .price-section {
        padding: 8px 12px 14px;
    }

    .book-card-rating {
        padding: 2px 12px 0;
    }

    .book-card-rating i {
        font-size: 10px;
    }

    .book-card-rating .rating-count {
        font-size: 10px;
    }

    .book-card>h6,
    .book-card>.book-author,
    .book-card>.price-section {
        padding-left: 12px;
        padding-right: 12px;
    }

    .book-card .add-btn {
        padding: 10px;
        border-radius: 10px;
        font-size: 0.85rem;
    }

    .book-card .notify-btn {
        padding: 8px 10px;
        border-radius: 10px;
        font-size: 0.8rem;
    }

    /* Badges even smaller */
    .card-badges {
        margin-top: -12px;
        margin-bottom: 4px;
        height: 22px;
    }

    .card-badges .badge {
        font-size: 9px;
        padding: 2px 7px;
        border-width: 1.5px;
    }

    .badge.out-of-stock-badge {
        font-size: 9px;
        padding: 2px 7px;
        border-width: 1.5px;
    }

    /* Quick actions always visible on touch */
    .quick-actions {
        opacity: 1;
        transform: translateX(0);
    }

    .action-btn {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
}