/* eBooksWala Custom Styles */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

.fw-600 {
    font-weight: 600 !important;
}

.fw-700 {
    font-weight: 700 !important;
}

.fw-800 {
    font-weight: 800 !important;
}

/* Header Styles */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: var(--transition);
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color) !important;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0;
    margin-bottom: 50px;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.hero-section p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

/* Book Cards */
.book-card {
    border: none;
    border-radius: 0;
    box-shadow: none;
    transition: var(--transition);
    overflow: hidden;
    height: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.book-card .card-img-top {
    height: 250px;
    object-fit: contain;
    background: #fff;
    /* padding: 5px; */
    border-bottom: none;
    transition: var(--transition);
}

.book-card:hover .card-img-top {
    transform: scale(1.05);
}

.book-card .card-body {
    padding: 10px 0;
}

.book-title {
    /* font-size: 1rem; */
    /* font-weight: 800; */
    margin-top: 2px;
    color: #000;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* line-height: 1.2; */
    /* height: 2.4em; */
    margin-left: 10px;
}

.book-title:hover {
    color: var(--primary-color);
}

.book-author {
    /* font-size: 0.85rem;   */
    /* font-weight: 700; */
    color: #000;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    margin-left: 10px;
}

.book-price {
    font-size: 1rem;
    font-weight: 800;
    color: #000;
    margin-bottom: 0;
    margin-left: 10px;
}

.book-rating {
    color: #ffc107;
    font-size: 0.85rem;
    font-weight: 800;
    text-align: right;
    margin-right: 10px;
}

.price-rating-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
}

/* Category Grid Styles */
.category-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border-color: var(--primary-color);
}

.category-icon {
    width: 60px;
    height: 60px;
    background: #f0f4ff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.category-card:hover .category-icon {
    background: var(--primary-color);
    color: white;
}

.category-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.category-count {
    font-size: 0.9rem;
    color: #666;
    background: #f8f9fa;
    padding: 4px 12px;
    border-radius: 20px;
}

/* Filter Sidebar */
.filter-sidebar {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    padding: 30px;
    position: sticky;
    top: 100px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.filter-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-sidebar .form-label {
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.filter-sidebar .form-select,
.filter-sidebar .form-control {
    border-radius: 12px;
    border: 1.5px solid #f3f4f6;
    padding: 10px 15px;
    background-color: #f9fafb;
    transition: all 0.3s ease;
}

.filter-sidebar .form-select:focus,
.filter-sidebar .form-control:focus {
    border-color: var(--primary-color);
    background-color: white;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
}

/* Search Bar & Filter Row */
.search-filter-row {
    display: flex;
    gap: 12px;
    align-items: center;
    width: 100%;
}

.search-bar-reference {
    position: relative;
    flex-grow: 1;
}

.search-bar-reference input {
    width: 100%;
    height: 54px;
    padding: 10px 30px;
    background: white;
    border: 2px solid #000;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #000;
    transition: all 0.3s ease;
}

.search-bar-reference input::placeholder {
    color: #000;
    font-weight: 700;
}

.search-bar-reference input:focus {
    outline: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.filter-trigger-reference {
    height: 54px;
    width: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: none;
    border-radius: 12px;
    color: #2d005d;
    /* Dark purple from image */
    font-size: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.filter-trigger-reference:hover {
    background: #e9ecef;
    transform: scale(1.05);
}

/* Filter Offcanvas */
.filter-offcanvas {
    border-radius: 20px 0 0 20px !important;
    width: 350px !important;
}

.filter-offcanvas .offcanvas-header {
    border-bottom: 1px solid #f3f4f6;
    padding: 1.5rem;
}

.filter-offcanvas .offcanvas-title {
    font-weight: 700;
    font-size: 1.25rem;
}

.filter-offcanvas .offcanvas-body {
    padding: 1.5rem;
}

/* Buttons */
.btn-primary {
    background: var(--primary-color);
    border: none;
    border-radius: 25px;
    padding: 10px 25px;
    font-weight: 500;
    transition: var(--transition);
}

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 25px;
    padding: 8px 20px;
    font-weight: 500;
    transition: var(--transition);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* Cart Badge */
.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: white;
    padding: 50px 0 20px;
    margin-top: 80px;
}

.footer h5 {
    color: white;
    margin-bottom: 20px;
}

.footer a {
    color: #bdc3c7;
    text-decoration: none;
    transition: var(--transition);
}

.footer a:hover {
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-section p {
        font-size: 1rem;
    }

    .book-card .card-img-top {
        height: 200px;
    }

    .filter-sidebar {
        margin-bottom: 30px;
        position: relative;
    }
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Star Rating */
.star-rating {
    color: #ffc107;
    font-size: 1rem;
}

.star-rating .empty {
    color: #e0e0e0;
}

/* Alert Styles */
.alert {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

/* Form Styles */
.form-control {
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 12px 15px;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Pagination */
.pagination .page-link {
    border: none;
    color: var(--primary-color);
    margin: 0 2px;
    border-radius: var(--border-radius);
}

.pagination .page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* Book Detail Page */
.book-detail-cover {
    max-width: 100%;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.book-info h1 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.book-meta {
    background: #f8f9fa;
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
}

/* Demo Images */
.demo-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.demo-image {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.demo-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: var(--transition);
}

.demo-image:hover img {
    transform: scale(1.05);
}

/* Share Buttons */
.share-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.share-btn {
    padding: 8px 15px;
    border-radius: 20px;
    text-decoration: none;
    color: white;
    font-weight: 500;
    transition: var(--transition);
}

.share-whatsapp {
    background: #25d366;
}

.share-telegram {
    background: #0088cc;
}

.share-copy {
    background: var(--secondary-color);
}

.share-btn:hover {
    transform: translateY(-2px);
    color: white;
}

/* Book Card Carousel Styles */
.book-card .carousel {
    position: relative;
}

.book-card .carousel-inner {
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.book-card .carousel-control-prev,
.book-card .carousel-control-next {
    width: 30px;
    height: 30px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.book-card:hover .carousel-control-prev,
.book-card:hover .carousel-control-next {
    opacity: 1;
}

.book-card .carousel-control-prev {
    left: 5px;
}

.book-card .carousel-control-next {
    right: 5px;
}

.book-card .carousel-control-prev-icon,
.book-card .carousel-control-next-icon {
    width: 20px;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    padding: 15px;
}

.book-card .carousel-control-prev-icon:hover,
.book-card .carousel-control-next-icon:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.book-card .carousel-item img {
    height: 250px;
    object-fit: contain;
    background: #f8f9fa;
    width: 100%;
}
/* Rating & Reviews */
.rating-picker .rating-star { transition: transform 0.2s; }
.rating-picker .rating-star:hover { transform: scale(1.2); }
.review-content { line-height: 1.6; white-space: pre-line; }
.rating-distribution .progress { background-color: #f0f0f0; overflow: hidden; }
.rating-distribution .progress-bar { transition: width 0.6s ease; }
.reviews-list .card { border-color: #f0f0f0 !important; }
.pagination-sm .page-link { padding: 0.4rem 0.8rem; font-size: 0.875rem; }
.section-title { position: relative; padding-bottom: 10px; margin-bottom: 25px; font-weight: 700; }
.section-title::after { content: ''; position: absolute; left: 0; bottom: 0; width: 50px; height: 3px; background-color: var(--primary-color); }
