/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Arial, sans-serif;
}

body {
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
    animation: fadeIn 0.8s ease-in-out; /* Page aate hi ek smooth entry */
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Navbar */
.navbar {
    
    background: linear-gradient(135deg, #2c3e50 100%); /* Purple & Blue Gradient */
    height: 80px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    margin-right: 600px;
}
.logo-img {
    height: 95px; 
    width: auto;
    padding: 10px;
}

.nav-menu {
    display: flex;
    list-style: none;
    font-size: 17px;
}

.nav-menu li {
    margin-left: 20px;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 15px;
    transition: 0.3s;
}

.nav-menu a:hover {
    background-color: #1d1515;
    border-radius: 5px;
}

/*Categaries baar*/

html {
    scroll-behavior: smooth;
}

.dropdown-content a:active {
    background-color: #dddddd;
}

/* Dropdown content ko pehle se chupane ke liye */
    .dropdown-content { display: none; position: absolute;
    background-color: #ffffff;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1000;
    border-radius: 4px;
}

/* Jab 'show' class add ho tab dropdown dikhe */
.dropdown-content.show {
    display: block;
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
}

.dropdown-content a:hover {
    background-color: #7eacd6;
}

/* Smooth scrolling ke liye */
html {
    scroll-behavior: smooth;
}

/* Search Container */
.search-container {
    text-align: center;
    margin: 40px auto;
    max-width: 600px;
    padding: 0 20px;
}

/* Styled Search Input */
#myInput {
    width: 100%;
    padding: 15px 25px;
    font-size: 18px;
    border: none;
    border-radius: 50px; 
    
    /* Colorful Gradient Border Effect using Box Shadow */
    background: #ffffff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1), 
                0 0 20px rgba(231, 76, 60, 0.2); 
    
    outline: none;
    transition: all 0.4s ease; 
    color: #333;
}

/* Jab search bar pe click karein (Focus) */
#myInput:focus {
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3), 
                0 10px 25px rgba(0, 0, 0, 0.1);
    
    border: 2px solid #3498db;
    transform: scale(1.02);
}

/* Placeholder text ka color change karne ke liye */
#myInput::placeholder {
    color: #1d2323;
    font-style: italic;
    font-size: 16px;
}

#myInput {
    width: 100%;
    padding: 15px 25px;
    font-size: 16px;
    border: none;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    outline: none;
}

/* Main Content */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px; 
}

.category-title {
    background-color: #2c3e50;
    color: white;
    padding: 10px 20px;
    margin-bottom: 30px;
    border-radius: 300px;
    display: inline-block;
    margin-top: 20px;
    margin-bottom: 25px;
}

.book-section {
    margin-bottom: 10px; 
    padding: 14px 0;
}

/* Purane .grid ko isse badal dein */
.grid {
    display: flex;             
    overflow-x: auto;          
    gap: 30px;                
    padding: 20px;        
    scroll-behavior: smooth;   
    -webkit-overflow-scrolling: touch; 
}

/* --- Scroller --- */

/* Section Background */
.book-section{
    margin: 30px 0;
}
/* Heading */
.category-title{
    display:inline-block;
    background:#2c3e50;   /* Navbar same color */
    color:white;
    padding:12px 25px;
    border-radius:30px;
    margin-bottom:20px;
}

/* Horizontal Scrollbar */
.grid::-webkit-scrollbar{
    height: 12px;
}

.grid::-webkit-scrollbar-track{
    background: #929292;   /* Navbar wala blue */
    border-radius: 20px;
}

.grid::-webkit-scrollbar-thumb{
    background: #33505e;   /* Light blue thumb */
    border-radius: 20px;
}

.grid::-webkit-scrollbar-thumb:hover{
    background: #14171b;
}

.card {
    flex: 0 0 220px;           
    background: rgb(229, 198, 157);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    transition: 0.3s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    position: relative;        
    scroll-snap-align: start;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.card img {
    width: 98%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
}

.card h3 {
    margin: 15px 0;
    font-size: 1.1rem;
}

/* Responsive: Mobile par cards thode chote dikheinge */
@media (max-width: 600px) {
    .card { flex: 0 0 180px; }
}

.btn {
    display: block;
    background-color: #943d33;
    color: white;
    padding: 10px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: bold;
    transition: 0.3s;
}

.btn:hover {
    background-color: #3f2c25;
}

.book-meta-details {
    background: #fdfaf6;
    border: 1px solid #f1e5d5;
    border-radius: 8px;
    padding: 12px;
    margin: 15px 0;
}
.book-meta-details table {
    width: 100%;
    border-collapse: collapse;
}
.book-meta-details td {
    padding: 6px 10px;
    font-size: 14px;
    color: #555;
    width: 25%; /* Pantal rows ko block me stretch karne ke liye */
}
.book-meta-details td strong {
    color: #2c3e50;
}
.book-meta-details i {
    color: #e74c3c; /* Icons ka rang */
    margin-right: 4px;
}

/*book sumrry*/
/* Card ke andar ka summary button */
.summary-box-trigger {
    background-color: #915364;
    border: 1px dashed #050101;
    padding: 6px;
    cursor: pointer;
    border-radius: 5px;
    margin-top: 10px;
    font-size: 13px;
    color: white;
    font-weight: bold;
    text-align: center;
    transition: 0.3s;
}
.summary-box-trigger:hover {
    background-color: #261a1c;
    color: white;
}

/* Background Overlay (By default hidden rahega) */
.custom-popup-modal {
    display: none; 
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* Black background with opacity */
    align-items: center;
    justify-content: center;
}

/* Jab modal open hoga tab yeh class JS se add hogi */
.custom-popup-modal.show-modal {
    display: flex;
}

/* Popup Box Layout */
.popup-content {
    background-color: #fff;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    box-shadow: 0px 5px 20px rgba(0,0,0,0.3);
    animation: slideDown 0.3s ease;
    overflow: hidden;
}

@keyframes slideDown {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Popup Header */
.popup-header {
    background-color: #405366;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.popup-header h3 {
    margin: 0;
    font-size: 18px;
}
.popup-close-btn {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

/* Popup Body */
.popup-body {
    padding: 20px;
    text-align: left;
}
.popup-body h4 {
    margin: 0 0 5px 0;
    color: #333;
}
.popup-author {
    color: #666;
    font-style: italic;
    margin-bottom: 15px;
}
.popup-summary-section {
    background-color: #f9f9f9;
    padding: 12px;
    border-left: 4px solid #007bff;
    margin-bottom: 15px;
    border-radius: 4px;
}
.popup-summary-section h6 {
    margin: 0 0 5px 0;
    font-weight: bold;
}
.popup-summary-section p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #444;
}

/* Table Specs */
.popup-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin-top: 10px;
}
.popup-table td {
    padding: 8px;
    border: 1px solid #ddd;
}

/* Popup Footer Buttons */
.popup-footer {
    background-color: #f8f9fa;
    padding: 12px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #eee;
}
.popup-btn-close {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
}
.popup-btn-action {
    padding: 8px 15px;
    border-radius: 5px;
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
}
.btn-free { background-color: #28a745; }
.btn-paid { background-color: #e74c3c; }