/* Center tables and align them side by side */
#home-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 300px; /* space between the two tables */
    padding: 32px 0;
}

/* Make both sections the same width and prevent stretching */
.popular-section, .updates-section {
    flex: 0 0 340px; /* fixed width, adjust as needed */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 0;
    margin-top: 0;
    
}

.popular-section h2, .updates-section h2 {
    margin-left: 0;
    padding-left: 0;
    align-self: flex-start;
    margin-top: 0;
    margin-bottom: 12px; /* or adjust as needed */
    padding: 0;
}


/* Table styling */
.popular_and_latest {
    width: 100%;
    border-collapse: collapse; /* Use collapse instead of separate */
    border-spacing: 0;         /* No extra space between rows */
    padding: 0;
    background: none;
   /* border: 3px solid #444857; */
    border-radius: 0;
}

.popular_and_latest td {
    background: none;
    padding: 0;
    vertical-align: middle;
    border: none;
}

/* Book row: horizontal layout */
.book-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px; /* Keeps the space between rows */
    border-bottom: none; /* Remove any existing row line */
}

.book-row::after {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #393c48; /* Adjust color as needed */
    bottom: -15px; /* Half of margin-bottom: 30px */
}


/* Book cover with shadow */
.book-cover {
    width: 100px;
    height: 140px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 8px 8px 16px rgba(0,0,0,0.22);
    background: #181a20;
    position: relative;
    z-index: 2;
    margin-top: 0;
    cursor: pointer;
}

/* Title to the right of cover */
.book-title {
    position: relative;
    z-index: 2;
    font-size: 1.1em;
    color: #e0e5ff;
    font-weight: 500;
    text-align: left;
    max-width: 180px;
    margin-left: 3px;     /* Moves the title further left */
    margin-top: 0px;      /* Adds padding at the top of the background card */
    white-space: nowrap;
    cursor: pointer;
}


.book-card-bg {
    position: absolute;
    left: -20px; /* cover width + gap */
    top: 40%;
    transform: translateY(-50%);
    height: 80px; /* desired thin card height */
    width: 300px; /* match or slightly exceed title width */
    background: #23242b;
    z-index: 1;
    border-radius: 0;
}

.popular_and_latest tr:last-child .book-row {
    border-bottom: none;
}