/**
 * Bengali PDF - Main Stylesheet
 * E-book Download Website
 */

/* ===== CSS Variables ===== */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --font-bengali: 'Noto Sans Bengali', 'SolaimanLipi', sans-serif;
    --font-english: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ===== Base Styles ===== */
* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-bengali);
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #0a58ca;
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== Header Styles ===== */
.site-header {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.site-title {
    color: #fff !important;
}

.search-form {
    min-width: 300px;
}

.search-form .form-control {
    border-radius: 20px 0 0 20px;
}

.search-form .btn {
    border-radius: 0 20px 20px 0;
}

/* Breadcrumb */
.breadcrumb {
    font-size: 0.9rem;
}

/* ===== Main Content ===== */
.main-content {
    min-height: calc(100vh - 300px);
}

.page-title {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: 1.25rem;
    margin-bottom: 0;
}

.section-header {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* ===== Book Card Styles ===== */
.book-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.book-card-link {
    display: block;
    text-decoration: none;
}

.book-cover-wrapper {
    position: relative;
    overflow: hidden;
    padding-top: 140%;
    background: #f8f9fa;
}

.book-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.book-card:hover .book-cover {
    transform: scale(1.05);
}

.discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger-color);
    color: #fff;
    padding: 2px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
}

.book-title {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.book-title a {
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-category .badge {
    font-weight: 400;
    font-size: 0.75rem;
}

.book-info {
    font-size: 0.85rem;
}

/* ===== Book Detail Page ===== */
.book-cover-large {
    max-width: 100%;
    max-height: 500px;
}

.book-cover-container {
    position: sticky;
    top: 100px;
}

.book-detail .book-title {
    font-size: 1.75rem;
}

.book-detail .book-subtitle {
    font-size: 1.1rem;
}

.author-link {
    color: var(--primary-color);
}

.author-link:hover {
    text-decoration: underline;
}

.description-content {
    white-space: pre-line;
}

/* ===== Download Table ===== */
.download-table {
    margin-bottom: 0;
}

.download-table th {
    background: var(--dark-color);
    color: #fff;
}

.download-table .book-title-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.download-btn {
    white-space: nowrap;
}

/* ===== Download Page ===== */
.download-page .countdown-timer {
    font-size: 5rem;
    font-weight: 700;
}

.download-page .countdown-icon i {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===== Author Card ===== */
.author-card {
    text-align: center;
}

.author-image-wrapper {
    width: 100px;
    height: 100px;
    margin: 0 auto;
}

.author-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
}

.author-placeholder {
    width: 100px;
    height: 100px;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #adb5bd;
}

.author-placeholder-sm {
    width: 80px;
    height: 80px;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #adb5bd;
}

.author-image-large {
    width: 120px;
    height: 120px;
    object-fit: cover;
}

.author-placeholder-large {
    width: 120px;
    height: 120px;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: #adb5bd;
    border-radius: 50%;
}

.author-name {
    font-size: 1rem;
}

/* ===== Category Card ===== */
.category-card {
    text-align: center;
}

.category-icon {
    font-size: 3rem;
    color: var(--primary-color);
}

.category-name {
    font-size: 1rem;
}

/* ===== Sidebar ===== */
.sidebar .card-header {
    font-size: 0.95rem;
}

.sidebar .list-group-item {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.sidebar .list-group-item a {
    color: #333;
}

.sticky-sidebar {
    position: sticky;
    top: 100px;
}

/* ===== Ad Containers ===== */
.ad-container {
    background: #f8f9fa;
    border: 1px dashed #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ad-header {
    min-height: 90px;
    margin-bottom: 15px;
}

.ad-footer {
    min-height: 90px;
    margin-top: 15px;
}

.ad-sidebar {
    min-height: 250px;
}

.ad-in-content {
    min-height: 100px;
}

.ad-slot {
    width: 100%;
    min-height: inherit;
}

/* ===== Footer ===== */
.site-footer {
    background: var(--dark-color);
}

.footer-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--primary-color);
}

.footer-description {
    font-size: 0.9rem;
    color: #adb5bd;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: #adb5bd;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #fff;
}

.social-links a {
    font-size: 1.25rem;
    transition: opacity 0.2s ease;
}

.social-links a:hover {
    opacity: 0.8;
}

/* ===== Hero Section ===== */
.hero-section .card {
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.hero-stats {
    font-size: 0.9rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
}

.stat-label {
    display: block;
    opacity: 0.8;
}

/* ===== SEO Content Section ===== */
.seo-content-section {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
}

.seo-content h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.seo-content h3 {
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.seo-content p {
    color: #666;
    line-height: 1.8;
}

.seo-content ul {
    padding-left: 1.5rem;
}

.seo-content li {
    margin-bottom: 0.5rem;
    color: #666;
}

/* ===== Pagination ===== */
.pagination {
    margin-bottom: 0;
}

.page-link {
    color: var(--primary-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ===== Error Pages ===== */
.error-page {
    padding: 3rem 0;
}

/* ===== Static Pages ===== */
.static-content {
    line-height: 1.8;
}

.static-content h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.static-content h3 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.static-content ul {
    padding-left: 1.5rem;
}

.static-content li {
    margin-bottom: 0.5rem;
}

/* ===== Contact Form ===== */
.contact-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* ===== Responsive ===== */
@media (max-width: 991.98px) {
    .search-form {
        min-width: auto;
        width: 100%;
        margin-top: 1rem;
    }

    .hero-stats {
        flex-wrap: wrap;
    }

    .stat-item {
        width: 33.333%;
        margin-bottom: 1rem;
    }

    .ad-sidebar {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .page-title {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 1.1rem;
    }

    .book-detail .book-title {
        font-size: 1.5rem;
    }

    .download-page .countdown-timer {
        font-size: 3rem;
    }

    .hero-section .display-5 {
        font-size: 1.75rem;
    }

    .hero-section .lead {
        font-size: 1rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }
}

@media (max-width: 575.98px) {
    .book-card .card-body {
        padding: 0.75rem;
    }

    .book-title {
        font-size: 0.85rem;
    }

    .btn-sm {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* ===== Utility Classes ===== */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Print Styles */
@media print {
    .ad-container,
    .sidebar,
    .site-footer,
    .navbar {
        display: none !important;
    }

    .main-content {
        width: 100% !important;
    }
}
