/* Mobile-first optimizations */
* {
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
}

body {
    overflow-x: hidden;
}

.container {
    padding-left: 15px;
    padding-right: 15px;
}

.book-list-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px 0;
    color: white;
    margin-bottom: 25px;
}

.book-list-header h1 {
    font-size: 1.75rem;
    margin-bottom: 10px;
}

.book-list-header .lead {
    font-size: 0.95rem;
    margin-bottom: 0;
}

.filter-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.category-btn {
    padding: 8px 16px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
}

.category-btn:hover,
.category-btn.active {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-box input {
    width: 100%;
    padding: 12px 50px 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-box button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.book-card {
    background: white;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(0,0,0,0.06);
    height: 100%;
}

.book-card .book-image-wrapper {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 30%, #f0f2f5 100%);
    padding: 30px 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 340px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.book-card .book-image-wrapper::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.06) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.book-card:hover .book-image-wrapper::after {
    opacity: 1;
}

.book-card .book-image-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, rgba(118, 75, 162, 0.03) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.book-card:hover .book-image-wrapper::before {
    opacity: 1;
}

.book-card:hover {
    transform: translateY(-15px) scale(1.03);
    box-shadow: 0 30px 70px rgba(102, 126, 234, 0.35), 0 15px 35px rgba(0,0,0,0.12);
    border-color: rgba(102, 126, 234, 0.3);
}

.book-card.promoted::before {
    content: '⭐ TOP';
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: bold;
    z-index: 3;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.6);
    animation: pulse 2s infinite;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.book-image-wrapper {
    background: #f8f9fa;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    width: 100%;
}

.book-image {
    width: auto;
    max-width: 80%;
    height: auto;
    max-height: 280px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18), 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 1;
    background: white;
    padding: 8px;
    border: 1px solid rgba(0,0,0,0.05);
}

.book-card:hover .book-image {
    transform: scale(1.08) translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3), 0 8px 20px rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.2);
}

.book-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: white;
}

.book-category {
    color: #667eea;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
    display: inline-block;
    background: rgba(102, 126, 234, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
    width: fit-content;
}

.book-title {
    font-size: 17px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 48px;
    transition: color 0.3s ease;
}

.book-card:hover .book-title {
    color: #667eea;
}

.book-description {
    color: #555;
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.book-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-top: 18px;
    border-top: 2px solid #f0f0f0;
}

.book-price {
    font-size: 24px;
    font-weight: 700;
    color: #28a745;
    display: flex;
    align-items: center;
    gap: 5px;
}

.book-price::before {
    content: '৳';
    font-size: 22px;
    opacity: 0.8;
}

.book-site {
    font-size: 11px;
    color: #666;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 6px 12px;
    border-radius: 12px;
    font-weight: 500;
    border: 1px solid #e0e0e0;
}

.book-link {
    display: block;
    text-align: center;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.book-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.book-link:hover::before {
    width: 300px;
    height: 300px;
}

.book-link:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    color: white;
    text-decoration: none;
}

.book-link:active {
    transform: translateY(0);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
}

.pagination a,
.pagination span {
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    text-decoration: none;
    color: #667eea;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination .current {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.no-books {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.no-books i {
    font-size: 64px;
    margin-bottom: 20px;
    color: #ddd;
}

/* Touch-friendly improvements */
.book-link,
.category-btn,
.btn-buy {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Optimize for webview/iframe embedding */
html, body {
    width: 100%;
    overflow-x: hidden;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .book-list-header {
        padding: 20px 0;
        margin-bottom: 15px;
    }

    .book-list-header h1 {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }

    .book-list-header .lead {
        font-size: 0.85rem;
    }

    .filter-section {
        padding: 15px;
        margin-bottom: 20px;
        border-radius: 8px;
    }

    .category-filter {
        gap: 6px;
        margin-bottom: 15px;
    }

    .category-btn {
        padding: 6px 12px;
        font-size: 12px;
        border-radius: 15px;
    }

    .search-box {
        margin-bottom: 15px;
    }

    .search-box input {
        padding: 10px 45px 10px 15px;
        font-size: 14px;
        border-radius: 20px;
    }

    .search-box button {
        padding: 8px 15px;
        border-radius: 15px;
        font-size: 14px;
    }

    .book-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin-bottom: 25px;
    }

        .book-image-wrapper {
            padding: 15px;
            min-height: 260px;
        }

        .book-image {
            max-height: 230px;
            max-width: 75%;
        }

    .book-info {
        padding: 12px;
    }

    .book-title {
        font-size: 14px;
        min-height: 40px;
        margin-bottom: 6px;
    }

    .book-description {
        font-size: 12px;
        line-height: 1.5;
        margin-bottom: 10px;
    }

    .book-price {
        font-size: 18px;
    }

    .book-site {
        font-size: 11px;
        padding: 4px 8px;
    }

    .book-link {
        padding: 10px;
        font-size: 13px;
        border-radius: 6px;
    }

    .book-meta {
        margin-bottom: 12px;
        padding-top: 10px;
    }

    .pagination {
        margin-top: 25px;
        flex-wrap: wrap;
    }

    .pagination a,
    .pagination span {
        padding: 8px 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .book-list-header {
        padding: 15px 0;
    }

    .book-list-header h1 {
        font-size: 1.25rem;
    }

    .book-list-header .lead {
        font-size: 0.8rem;
    }

    .filter-section {
        padding: 12px;
    }

    .category-btn {
        padding: 5px 10px;
        font-size: 11px;
    }

    .book-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

        .book-image-wrapper {
            padding: 20px;
            min-height: 300px;
        }

        .book-image {
            max-height: 260px;
            max-width: 70%;
        }

    .book-title {
        font-size: 15px;
    }

    .book-price {
        font-size: 22px;
    }

    .pagination a,
    .pagination span {
        padding: 6px 10px;
        font-size: 12px;
    }

    .no-books {
        padding: 40px 15px;
    }

    .no-books i {
        font-size: 48px;
    }

    .no-books h3 {
        font-size: 1.25rem;
    }
}

