/**
 * Frontend Styles
 *
 * @package Hausa_Novel_Lite
 */

/* Book Container */
.hnl-book-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5px;
}

/* Fix for logged-in users (admin bar) */
body.admin-bar .hnl-book-container {
    margin-top: 0 !important;
    padding-top: 20px !important;
    padding-bottom: 20px !important;
    position: relative !important;
    z-index: 1 !important;
    max-width: 1200px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}

body.admin-bar .hnl-chapter-container {
    margin-top: 0 !important;
    padding-top: 20px !important;
    padding-bottom: 20px !important;
    position: relative !important;
    z-index: 1 !important;
    max-width: 900px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}

/* Override WordPress default styles that might interfere - ONLY for plugin pages */
body.admin-bar.single-hnl_book #wpadminbar,
body.admin-bar.single-hnl_chapter #wpadminbar,
body.admin-bar.post-type-archive-hnl_book #wpadminbar,
body.admin-bar.tax-hnl_categories #wpadminbar,
body.admin-bar.tax-hnl_tags #wpadminbar {
    position: fixed !important;
    top: 0 !important;
    z-index: 999999 !important;
}

body.admin-bar.single-hnl_book #wpbody-content,
body.admin-bar.single-hnl_chapter #wpbody-content,
body.admin-bar.post-type-archive-hnl_book #wpbody-content,
body.admin-bar.tax-hnl_categories #wpbody-content,
body.admin-bar.tax-hnl_tags #wpbody-content {
    margin-top: 0 !important;
}

.hnl-book-header {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
    flex-wrap: wrap;
    flex-direction: column; /* Mobile: stack vertically */
}

/* Mobile: Ensure correct order - cover, stats, info */
@media (max-width: 768px) {
    .hnl-book-header {
        flex-direction: column !important;
        flex-wrap: nowrap !important;
    }
    
    .hnl-book-cover {
        order: 1 !important;
        width: 100% !important;
    }
    
    .hnl-book-stats-mobile {
        order: 2 !important;
        width: 100% !important;
    }
    
    .hnl-book-info {
        order: 3 !important;
        width: 100% !important;
    }
}

/* Desktop: horizontal layout */
/* Tablet and Desktop: Row layout (only on large screens, 993px+) */
@media (min-width: 993px) {
    .hnl-book-header {
        flex-direction: row;
        flex-wrap: nowrap;
    }
    
    .hnl-book-cover {
        order: 1;
    }
    
    .hnl-book-stats-mobile {
        order: 2;
        display: none !important;
    }
    
    .hnl-book-info {
        order: 3;
    }
}

/* Tablet: Keep mobile layout (769px - 992px) */
@media (max-width: 992px) and (min-width: 769px) {
    .hnl-book-header {
        flex-direction: column;
        flex-wrap: wrap;
    }
    
    .hnl-book-cover {
        order: 1;
    }
    
    .hnl-book-stats-mobile {
        order: 2;
        display: grid !important;
    }
    
    .hnl-book-info {
        order: 3;
    }
}

/* Ensure proper layout when logged in - Desktop (only on large screens, 993px+) */
@media (min-width: 993px) {
    body.admin-bar .hnl-book-header {
        display: flex !important;
        flex-wrap: nowrap !important;
        flex-direction: row !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        gap: 30px !important;
        margin-bottom: 40px !important;
        padding-bottom: 30px !important;
        border-bottom: 2px solid #e0e0e0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        clear: both !important;
        overflow: visible !important;
        position: relative !important;
    }
}

/* Tablet: Keep mobile layout when logged in (769px - 992px) */
@media (max-width: 992px) and (min-width: 769px) {
    body.admin-bar .hnl-book-header {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: wrap !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 5px !important;
        margin-bottom: 30px !important;
        padding-bottom: 20px !important;
        border-bottom: 2px solid #e0e0e0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

/* Mobile: Ensure correct order when logged in */
@media (max-width: 768px) {
    body.admin-bar .hnl-book-header {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        gap: 5px !important;
    }
    
    body.admin-bar .hnl-book-cover {
        order: 1 !important;
        width: 100% !important;
    }
    
    body.admin-bar .hnl-book-stats-mobile {
        order: 2 !important;
        width: 100% !important;
        display: grid !important;
    }
    
    body.admin-bar .hnl-book-info {
        order: 3 !important;
        width: 100% !important;
    }
}

/* Force cover to be visible and properly positioned - but NOT on single book page */
body.admin-bar:not(.single-hnl_book) .hnl-book-cover {
    flex: 0 0 300px !important;
    max-width: 300px !important;
    width: 300px !important;
    min-width: 300px !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    display: block !important;
    position: relative !important;
    visibility: visible !important;
    opacity: 1 !important;
}

body.admin-bar:not(.single-hnl_book) .hnl-book-cover img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    max-width: 100% !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.hnl-book-cover {
    flex: 0 0 300px;
    max-width: 100%;
    width: 300px;
}

.hnl-book-cover img,
.hnl-book-cover-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: block;
}

/* Single book page - cover image should be 1024x1024 but container adjusts for layout */
.single-hnl_book .hnl-book-cover {
    flex: 0 0 auto;
    max-width: 100%;
    width: auto;
}

/* On desktop, show image at reasonable size but use 1024x1024 source for quality */
/* Desktop layout for book cover (only on large screens, 993px+) */
@media (min-width: 993px) {
    .single-hnl_book .hnl-book-header,
    body.admin-bar.single-hnl_book .hnl-book-header {
        flex-wrap: nowrap !important;
        align-items: flex-start !important;
        flex-direction: row !important;
    }
    
    .single-hnl_book .hnl-book-cover,
    body.admin-bar.single-hnl_book .hnl-book-cover {
        flex: 0 0 400px !important;
        max-width: 400px !important;
        width: 400px !important;
        min-width: 400px !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* Tablet: Full width cover (769px - 992px) */
@media (max-width: 992px) and (min-width: 769px) {
    .single-hnl_book .hnl-book-header,
    body.admin-bar.single-hnl_book .hnl-book-header {
        flex-direction: column !important;
        flex-wrap: wrap !important;
    }
    
    .single-hnl_book .hnl-book-cover,
    body.admin-bar.single-hnl_book .hnl-book-cover {
        flex: 0 0 auto !important;
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 auto 20px auto !important;
        padding: 0 !important;
    }
    
    /* Image uses 1024x1024 source but displays at container size for better quality */
    .single-hnl_book .hnl-book-cover img,
    .single-hnl_book .hnl-book-cover-image,
    body.admin-bar.single-hnl_book .hnl-book-cover img,
    body.admin-bar.single-hnl_book .hnl-book-cover-image {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        object-fit: cover !important;
        display: block !important;
        aspect-ratio: 1 / 1 !important;
    }
}
    
    .single-hnl_book .hnl-book-info,
    body.admin-bar.single-hnl_book .hnl-book-info {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        margin-left: 0px !important;
    }
}

/* On mobile, keep responsive */
@media (max-width: 768px) {
    .single-hnl_book .hnl-book-cover {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .single-hnl_book .hnl-book-cover img,
    .single-hnl_book .hnl-book-cover-image {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        aspect-ratio: 1 / 1 !important;
    }
}

/* Ensure cover doesn't break layout when logged in - but NOT on single book page */
body.admin-bar:not(.single-hnl_book) .hnl-book-cover {
    flex: 0 0 300px !important;
    max-width: 300px !important;
    width: 300px !important;
    min-width: 300px !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    display: block !important;
    position: relative !important;
}

body.admin-bar:not(.single-hnl_book) .hnl-book-cover img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    max-width: 100% !important;
}

.hnl-book-cover img {
    width: 100%;
    max-width: 1024px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: block;
}

.hnl-no-cover {
    width: 100%;
    height: 400px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #999;
}

/* Book Statistics Section - Base styles */
.hnl-book-stats,
.hnl-book-stats-mobile,
.hnl-book-stats-desktop {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Mobile: Show stats after cover (inside header) */
.hnl-book-stats-mobile {
    display: none; /* Hidden by default, shown on mobile */
    grid-template-columns: repeat(4, 1fr); /* 4 columns in one row */
    gap: 8px;
    margin: 15px 0 0 0;
    padding: 12px;
    width: 100%;
    box-sizing: border-box;
}

/* Mobile: Show stats in 4 columns (one horizontal row) with single background */
@media (max-width: 768px) {
    .hnl-book-stats-mobile {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        order: 2 !important; /* After cover, before info */
        gap: 8px !important;
        padding: 12px !important;
        margin: 15px 0 0 0 !important;
    }
    
    /* Remove individual backgrounds, use container background only */
    .hnl-book-stats-mobile .hnl-stat-item {
        padding: 6px 4px !important;
        gap: 4px !important;
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .hnl-book-stats-mobile .hnl-stat-icon {
        width: 16px !important;
        height: 16px !important;
        flex-shrink: 0 !important;
        margin: 0 !important;
    }
    
    /* Make Reads and Time icons more visible with darker blue color */
    .hnl-book-stats-mobile .hnl-stat-item:first-child .hnl-stat-icon,
    .hnl-book-stats-mobile .hnl-stat-item:last-child .hnl-stat-icon {
        color: #2563eb !important;
        stroke: #2563eb !important;
        fill: none !important;
    }
    
    /* Rating icon uses fill, keep it blue */
    .hnl-book-stats-mobile .hnl-stat-item:nth-child(2) .hnl-stat-icon {
        color: #3b82f6 !important;
        fill: #3b82f6 !important;
    }
    
    .hnl-book-stats-mobile .hnl-stat-content {
        align-items: center !important;
        text-align: center !important;
        gap: 2px !important;
        flex: 1 !important;
        min-width: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
    }
    
    .hnl-book-stats-mobile .hnl-stat-label {
        font-size: 0.6em !important;
        line-height: 1.2 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .hnl-book-stats-mobile .hnl-stat-value,
    .hnl-book-stats-mobile .hnl-rating-value {
        font-size: 0.75em !important;
        line-height: 1.2 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .hnl-book-stats-mobile .hnl-stars {
        font-size: 0.65em !important;
        justify-content: center !important;
        gap: 1px !important;
    }
    
    .hnl-book-stats-mobile .hnl-rating-count {
        font-size: 0.55em !important;
        text-align: center !important;
        line-height: 1.2 !important;
    }
    
    .hnl-book-stats-mobile .hnl-stat-rating {
        align-items: center !important;
        gap: 2px !important;
    }
}

/* Desktop: Hide mobile stats (only on large screens) */
@media (min-width: 993px) {
    .hnl-book-stats-mobile {
        display: none !important;
    }
}

/* Desktop stats version (after synopsis) - Hidden by default on mobile and tablet */
.hnl-book-stats-desktop {
    display: none !important;
}

/* Desktop: Show desktop stats (only on large screens, 993px+) */
@media (min-width: 993px) {
    .hnl-book-stats-desktop {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
        margin: 30px 0 0 0;
        padding: 25px;
        clear: both;
    }
    
    /* Remove individual backgrounds on desktop - use container background only */
    .hnl-book-stats-desktop .hnl-stat-item {
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 8px 12px !important;
        transition: none !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        gap: 8px !important;
    }
    
    .hnl-book-stats-desktop .hnl-stat-item:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    
    /* Center icon on desktop */
    .hnl-book-stats-desktop .hnl-stat-icon {
        margin: 0 auto !important;
    }
    
    /* Center content on desktop */
    .hnl-book-stats-desktop .hnl-stat-content {
        align-items: center !important;
        text-align: center !important;
        width: 100% !important;
    }
    
    /* Reduce number sizes to 1em on desktop */
    .hnl-book-stats-desktop .hnl-stat-value,
    .hnl-book-stats-desktop .hnl-rating-value {
        font-size: 1em !important;
        line-height: 1.2 !important;
    }
    
    /* Reduce stars size and center on desktop */
    .hnl-book-stats-desktop .hnl-stars {
        font-size: 0.9em !important;
        justify-content: center !important;
        gap: 2px !important;
    }
    
    /* Center rating content on desktop */
    .hnl-book-stats-desktop .hnl-stat-rating {
        align-items: center !important;
        text-align: center !important;
        width: 100% !important;
    }
}

.hnl-stat-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.hnl-stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.hnl-stat-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    color: #3b82f6;
    stroke-width: 2;
    fill: #3b82f6;
}

/* Make Reads and Time icons more visible with darker blue color on desktop */
.hnl-book-stats-desktop .hnl-stat-item:first-child .hnl-stat-icon,
.hnl-book-stats-desktop .hnl-stat-item:last-child .hnl-stat-icon {
    color: #2563eb !important;
    stroke: #2563eb !important;
    fill: none !important;
}

/* Rating icon uses fill, keep it blue */
.hnl-book-stats-desktop .hnl-stat-item:nth-child(2) .hnl-stat-icon {
    color: #3b82f6 !important;
    fill: #3b82f6 !important;
}

.hnl-stat-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    align-items: flex-start;
}

.hnl-stat-label {
    font-size: 0.75em;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.hnl-stat-value {
    font-size: 1.5em;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
}

.hnl-stat-rating {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
    width: 100%;
}

.hnl-rating-value {
    font-size: 1em;
    font-weight: 500;
    color: #2c3e50;
    line-height: 1.2;
}

.hnl-stars {
    display: flex;
    gap: 3px;
    font-size: 1.2em;
    line-height: 1;
    align-items: center;
}

/* Desktop: Reduce number sizes to 1em and center content (only on large screens, 993px+) */
@media (min-width: 993px) {
    .hnl-book-stats-desktop .hnl-stat-value,
    .hnl-book-stats-desktop .hnl-rating-value {
        font-size: 1em !important;
        line-height: 1.2 !important;
    }
    
    .hnl-book-stats-desktop .hnl-stars {
        font-size: 0.85em !important;
        justify-content: center !important;
        gap: 2px !important;
    }
    
    .hnl-book-stats-desktop .hnl-stat-content {
        align-items: center !important;
        text-align: center !important;
        width: 100% !important;
    }
    
    .hnl-book-stats-desktop .hnl-stat-rating {
        align-items: center !important;
        text-align: center !important;
        width: 100% !important;
    }
    
    .hnl-book-stats-desktop .hnl-stat-item {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
    }
    
    .hnl-book-stats-desktop .hnl-stat-icon {
        margin: 0 auto !important;
    }
}

.hnl-star {
    color: #ffd700;
    display: inline-block;
}

.hnl-star-empty {
    color: #ddd;
}

.hnl-star-half {
    background: linear-gradient(90deg, #ffd700 50%, #ddd 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hnl-rating-count {
    font-size: 0.7em;
    color: #888;
    line-height: 1.2;
}

.hnl-no-rating {
    font-size: 0.85em;
    color: #999;
    font-style: italic;
}

/* Tablet: Show mobile stats design (same as mobile) */
@media (max-width: 992px) and (min-width: 769px) {
    /* Hide desktop stats on tablet */
    .hnl-book-stats-desktop {
        display: none !important;
    }
    
    /* Show mobile stats on tablet with same design */
    .hnl-book-stats-mobile {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        order: 2 !important;
        gap: 8px !important;
        padding: 12px !important;
        margin: 15px 0 0 0 !important;
    }
    
    /* Remove individual backgrounds on tablet - use container background only */
    .hnl-book-stats-mobile .hnl-stat-item {
        padding: 6px 4px !important;
        gap: 4px !important;
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .hnl-book-stats-mobile .hnl-stat-icon {
        width: 16px !important;
        height: 16px !important;
        flex-shrink: 0 !important;
        margin: 0 !important;
    }
    
    /* Make Reads and Time icons more visible with darker blue color on tablet */
    .hnl-book-stats-mobile .hnl-stat-item:first-child .hnl-stat-icon,
    .hnl-book-stats-mobile .hnl-stat-item:last-child .hnl-stat-icon {
        color: #2563eb !important;
        stroke: #2563eb !important;
        fill: none !important;
    }
    
    /* Rating icon uses fill, keep it blue on tablet */
    .hnl-book-stats-mobile .hnl-stat-item:nth-child(2) .hnl-stat-icon {
        color: #3b82f6 !important;
        fill: #3b82f6 !important;
    }
    
    .hnl-book-stats-mobile .hnl-stat-content {
        align-items: center !important;
        text-align: center !important;
        gap: 2px !important;
        flex: 1 !important;
        min-width: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
    }
    
    .hnl-book-stats-mobile .hnl-stat-label {
        font-size: 0.6em !important;
        line-height: 1.2 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .hnl-book-stats-mobile .hnl-stat-value,
    .hnl-book-stats-mobile .hnl-rating-value {
        font-size: 0.75em !important;
        line-height: 1.2 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .hnl-book-stats-mobile .hnl-stars {
        font-size: 0.65em !important;
        justify-content: center !important;
        gap: 1px !important;
    }
    
    .hnl-book-stats-mobile .hnl-rating-count {
        font-size: 0.55em !important;
        text-align: center !important;
        line-height: 1.2 !important;
    }
    
    .hnl-book-stats-mobile .hnl-stat-rating {
        align-items: center !important;
        gap: 2px !important;
    }
}

/* Mobile stats are already 1 column, no changes needed */

/* Admin bar fixes for stats - only on large screens (993px+) */
@media (min-width: 993px) {
    body.admin-bar .hnl-book-stats-desktop {
        margin: 30px 0 !important;
        padding: 25px !important;
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 8px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Remove individual backgrounds on desktop when logged in */
    body.admin-bar .hnl-book-stats-desktop .hnl-stat-item {
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 8px 12px !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        gap: 8px !important;
    }
    
    body.admin-bar .hnl-book-stats-desktop .hnl-stat-item:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    
    /* Center content when logged in */
    body.admin-bar .hnl-book-stats-desktop .hnl-stat-content {
        align-items: center !important;
        text-align: center !important;
        width: 100% !important;
    }
    
    /* Reduce number sizes to 1em when logged in */
    body.admin-bar .hnl-book-stats-desktop .hnl-stat-value,
    body.admin-bar .hnl-book-stats-desktop .hnl-rating-value {
        font-size: 1em !important;
        line-height: 1.2 !important;
    }
    
    /* Reduce stars size and center when logged in */
    body.admin-bar .hnl-book-stats-desktop .hnl-stars {
        font-size: 0.85em !important;
        justify-content: center !important;
        gap: 2px !important;
    }
    
    /* Center rating content when logged in */
    body.admin-bar .hnl-book-stats-desktop .hnl-stat-rating {
        align-items: center !important;
        text-align: center !important;
        width: 100% !important;
    }
    
    /* Center icon when logged in */
    body.admin-bar .hnl-book-stats-desktop .hnl-stat-icon {
        margin: 0 auto !important;
    }
}

/* Tablet: Show mobile stats design when logged in (same as mobile) */
@media (max-width: 992px) and (min-width: 769px) {
    /* Hide desktop stats on tablet when logged in */
    body.admin-bar .hnl-book-stats-desktop {
        display: none !important;
    }
    
    /* Show mobile stats on tablet with same design when logged in */
    body.admin-bar .hnl-book-stats-mobile {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        order: 2 !important;
        gap: 8px !important;
        padding: 12px !important;
        margin: 15px 0 0 0 !important;
    }
    
    /* Remove individual backgrounds on tablet when logged in */
    body.admin-bar .hnl-book-stats-mobile .hnl-stat-item {
        padding: 6px 4px !important;
        gap: 4px !important;
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    body.admin-bar .hnl-book-stats-mobile .hnl-stat-icon {
        width: 16px !important;
        height: 16px !important;
        flex-shrink: 0 !important;
        margin: 0 !important;
    }
    
    /* Make Reads and Time icons more visible on tablet when logged in */
    body.admin-bar .hnl-book-stats-mobile .hnl-stat-item:first-child .hnl-stat-icon,
    body.admin-bar .hnl-book-stats-mobile .hnl-stat-item:last-child .hnl-stat-icon {
        color: #2563eb !important;
        stroke: #2563eb !important;
        fill: none !important;
    }
    
    body.admin-bar .hnl-book-stats-mobile .hnl-stat-item:nth-child(2) .hnl-stat-icon {
        color: #3b82f6 !important;
        fill: #3b82f6 !important;
    }
    
    body.admin-bar .hnl-book-stats-mobile .hnl-stat-content {
        align-items: center !important;
        text-align: center !important;
        gap: 2px !important;
        flex: 1 !important;
        min-width: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
    }
    
    body.admin-bar .hnl-book-stats-mobile .hnl-stat-label {
        font-size: 0.6em !important;
        line-height: 1.2 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    body.admin-bar .hnl-book-stats-mobile .hnl-stat-value,
    body.admin-bar .hnl-book-stats-mobile .hnl-rating-value {
        font-size: 0.75em !important;
        line-height: 1.2 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    body.admin-bar .hnl-book-stats-mobile .hnl-stars {
        font-size: 0.65em !important;
        justify-content: center !important;
        gap: 1px !important;
    }
    
    body.admin-bar .hnl-book-stats-mobile .hnl-rating-count {
        font-size: 0.55em !important;
        text-align: center !important;
        line-height: 1.2 !important;
    }
    
    body.admin-bar .hnl-book-stats-mobile .hnl-stat-rating {
        align-items: center !important;
        gap: 2px !important;
    }
}

@media (max-width: 768px) {
    body.admin-bar .hnl-book-stats-mobile {
        margin: 15px 0 0 0 !important;
        padding: 12px !important;
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 8px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Remove individual backgrounds for logged-in users too */
    body.admin-bar .hnl-book-stats-mobile .hnl-stat-item {
        padding: 6px 4px !important;
        gap: 4px !important;
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    body.admin-bar .hnl-book-stats-mobile .hnl-stat-icon {
        width: 16px !important;
        height: 16px !important;
        flex-shrink: 0 !important;
        margin: 0 !important;
    }
    
    /* Make Reads and Time icons more visible with darker blue color for logged-in users */
    body.admin-bar .hnl-book-stats-mobile .hnl-stat-item:first-child .hnl-stat-icon,
    body.admin-bar .hnl-book-stats-mobile .hnl-stat-item:last-child .hnl-stat-icon {
        color: #2563eb !important;
        stroke: #2563eb !important;
        fill: none !important;
    }
    
    /* Rating icon uses fill, keep it blue */
    body.admin-bar .hnl-book-stats-mobile .hnl-stat-item:nth-child(2) .hnl-stat-icon {
        color: #3b82f6 !important;
        fill: #3b82f6 !important;
    }
    
    body.admin-bar .hnl-book-stats-mobile .hnl-stat-content {
        align-items: center !important;
        text-align: center !important;
        gap: 2px !important;
        flex: 1 !important;
        min-width: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
    }
    
    body.admin-bar .hnl-book-stats-mobile .hnl-stat-label {
        font-size: 0.6em !important;
        line-height: 1.2 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    body.admin-bar .hnl-book-stats-mobile .hnl-stat-value,
    body.admin-bar .hnl-book-stats-mobile .hnl-rating-value {
        font-size: 0.75em !important;
        line-height: 1.2 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    body.admin-bar .hnl-book-stats-mobile .hnl-stars {
        font-size: 0.65em !important;
        justify-content: center !important;
        gap: 1px !important;
    }
    
    body.admin-bar .hnl-book-stats-mobile .hnl-rating-count {
        font-size: 0.55em !important;
        text-align: center !important;
        line-height: 1.2 !important;
    }
    
    body.admin-bar .hnl-book-stats-mobile .hnl-stat-rating {
        align-items: center !important;
        gap: 2px !important;
    }
    
    body.admin-bar .hnl-book-stats-desktop {
        display: none !important;
    }
}

.hnl-book-info {
    flex: 1;
    min-width: 0; /* Prevent flex item from overflowing */
}

/* Ensure info section displays correctly when logged in */
body.admin-bar .hnl-book-info {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
    display: block !important;
    position: relative !important;
    overflow: visible !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Desktop: ensure proper layout */
@media (min-width: 769px) {
    body.admin-bar .hnl-book-header {
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-start !important;
    }
    
    body.admin-bar .hnl-book-cover {
        flex: 0 0 300px !important;
        max-width: 300px !important;
        width: 300px !important;
        margin-right: 30px !important;
    }
    
    body.admin-bar .hnl-book-info {
        flex: 1 1 auto !important;
        max-width: calc(100% - 330px) !important;
    }
}

/* Override any WordPress admin styles that might interfere */
body.admin-bar .hnl-book {
    position: relative;
    width: 100%;
}

body.admin-bar .hnl-book-container {
    box-sizing: border-box;
}

/* Ensure chapters display correctly when logged in - only for screens < 1024px */
@media screen and (max-width: 1023px) {
    body.admin-bar .hnl-chapters {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

body.admin-bar .hnl-chapter-item {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    display: block !important;
    float: none !important;
    clear: both !important;
    box-sizing: border-box !important;
}

body.admin-bar .hnl-chapter-link {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 12px 15px !important;
    text-decoration: none !important;
    color: #fff !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

body.admin-bar .hnl-chapter-icon {
    flex: 0 0 auto !important;
    margin-left: 12px !important;
    margin-right: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 24px !important;
    width: auto !important;
}

body.admin-bar .hnl-chapter-icon img {
    width: 22px !important;
    height: 22px !important;
    max-width: 22px !important;
    max-height: 22px !important;
    display: block !important;
}

/* Ensure all book info elements display correctly */
body.admin-bar .hnl-book-author,
body.admin-bar .hnl-book-language {
    width: 100% !important;
    display: flex !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    float: none !important;
    clear: both !important;
    padding: 15px 20px !important;
    background: transparent !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

body.admin-bar .hnl-book-meta,
body.admin-bar .hnl-book-synopsis {
    width: 100% !important;
    display: block !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    float: none !important;
    clear: both !important;
}

body.admin-bar .hnl-book-tags,
body.admin-bar .hnl-book-categories {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    padding: 15px 20px !important;
    background: transparent !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

/* Ensure Start Reading button displays correctly */
body.admin-bar .hnl-start-reading {
    width: 100%;
    text-align: center;
}

/* Ensure chapters list displays correctly */
body.admin-bar .hnl-chapters-list {
    width: 100%;
}

body.admin-bar .hnl-chapters-list h2 {
    width: 100%;
    display: block;
}

.hnl-book-title {
    font-size: 1.5em;
    margin: 0 0 20px 0;
    display: block;
    width: 100%;
}

/* Ensure title displays correctly when logged in */
body.admin-bar .hnl-book-title {
    display: block !important;
    width: 100% !important;
    margin: 0 0 20px 0 !important;
    font-size: 1.5em !important;
}

.hnl-book-author {
    margin-bottom: 1px;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    padding: 15px 20px;
    background: transparent;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.hnl-book-author:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hnl-label {
    font-weight: 600;
    color: #aba6a6;
    margin-right: 10px;
    display: inline-block;
    vertical-align: middle;
    line-height: 1.5;
    min-width: 80px;
}

/* Author Button Styles */
.hnl-author-button {
    display: inline-block;
    padding: 10px 20px;
    margin: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff !important;
    text-decoration: none;
    border-radius: 9px;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
    border: none;
    cursor: pointer;
    vertical-align: middle;
    line-height: 1.5;
}

.hnl-author-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.hnl-author-button:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    color: #ffffff !important;
    text-decoration: none;
}

.hnl-author-button:hover::before {
    left: 100%;
}

.hnl-author-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

/* Responsive adjustments for author button */
@media (max-width: 768px) {
    .hnl-author-button {
        padding: 6px 10px;
        font-size: 0.75em;
    }
    
    .hnl-book-author,
    .hnl-book-language,
    .hnl-book-tags,
    .hnl-book-categories {
        padding: 12px 15px;
        font-size: 1em;
    }
    
    .hnl-label {
        min-width: 70px;
        font-size: 0.95em;
    }
}

.hnl-author-info {
    margin: 15px 0;
    padding: 15px;
    background: #f9f9f9;
    border-left: 3px solid #0073aa;
}

.hnl-book-description {
    margin: 20px 0;
    line-height: 1.6;
    color: #555;
}

.hnl-book-synopsis {
    margin: 30px 0;
    padding: 25px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #0073aa;
}

.hnl-synopsis-title {
    font-size: 1.5em;
    margin: 0 0 15px 0;
    color: #333;
    font-weight: 600;
}

.hnl-book-synopsis p {
    margin: 0;
    line-height: 1.8;
    color: #555;
    font-size: 1.05em;
}

.hnl-book-language {
    margin-bottom: 1px;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    padding: 15px 20px;
    background: transparent;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.hnl-book-language:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hnl-value {
    color: #555;
    font-weight: 500;
    margin: 0 1px 0 0;
    display: inline-block;
}

.hnl-book-meta {
    margin-top: 2px;
}

.hnl-book-tags,
.hnl-book-categories {
    margin: 1px 0;
    padding: 15px 20px;
    background: transparent;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.hnl-book-tags:hover,
.hnl-book-categories:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hnl-book-tags .hnl-label,
.hnl-book-categories .hnl-label {
    margin-bottom: 0;
    display: inline-block;
    min-width: 80px;
}

.hnl-book-tags .hnl-tag,
.hnl-book-categories .hnl-category {
    display: inline-block;
    margin: 0 1px 0 0;
}

.hnl-tag,
.hnl-category {
    display: inline-block;
    padding: 5px 12px;
    margin: 0 1px 0 0;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
    font-size: 0.9em;
}

.hnl-tag:hover,
.hnl-category:hover {
    background: #005a87;
}

/* Chapters List */
.hnl-chapters-list {
    margin: 30px 0;
}

.hnl-chapters-list h2 {
    font-size: 1.3em !important;
    margin-bottom: 12px !important;
    color: #333;
}

.hnl-chapters {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

/* 3 columns on desktop/PC only (≥1025px) - not affecting mobile or tablet */
@media screen and (min-width: 1025px) {
    .hnl-chapters-list .hnl-chapters,
    .hnl-book-content .hnl-chapters,
    .hnl-chapters {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    /* Also apply to logged-in users on PC */
    body.admin-bar .hnl-chapters-list .hnl-chapters,
    body.admin-bar .hnl-book-content .hnl-chapters,
    body.admin-bar .hnl-chapters {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

.hnl-chapter-item {
    margin: 0 !important;
    border-radius: 4px !important;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    position: relative;
    animation: gradient-shift 3s ease infinite;
    background-size: 200% 200% !important;
    list-style: none;
}

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.hnl-chapter-item:nth-child(even) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%) !important;
    background-size: 200% 200% !important;
}

.hnl-chapter-item:nth-child(3n) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
    background-size: 200% 200% !important;
}

.hnl-chapter-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.hnl-chapter-link {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 12px 15px !important;
    text-decoration: none !important;
    color: #fff !important;
    transition: all 0.3s ease;
    min-height: auto;
}

.hnl-chapter-link:hover {
    color: #fff !important;
    text-decoration: none !important;
}

.hnl-chapter-number {
    font-size: 1em !important;
    opacity: 1;
    font-weight: 500;
    letter-spacing: 0.2px;
    line-height: 1.5;
    flex: 1;
    display: flex;
    align-items: center;
}

.hnl-chapter-icon {
    flex: 0 0 auto !important;
    margin-left: 12px !important;
    margin-right: 0 !important;
    display: flex;
    align-items: center !important;
    justify-content: center !important;
    min-width: 24px;
    height: 100%;
}

.hnl-chapter-icon img {
    width: 22px !important;
    height: 22px !important;
    max-width: 22px !important;
    max-height: 22px !important;
    filter: brightness(0) invert(1);
    transition: transform 0.3s ease;
    display: block;
}

.hnl-chapter-item:hover .hnl-chapter-icon img {
    transform: scale(1.1) rotate(5deg);
}

.hnl-start-reading {
    text-align: center;
    margin: 30px 0 20px 0;
}

.hnl-button-primary {
    padding: 12px 30px;
    font-size: 1.1em;
}

.hnl-button {
    display: inline-block;
    padding: 12px 30px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.1em;
    transition: background 0.3s;
}

.hnl-button:hover {
    background: #005a87;
}

.hnl-button-primary {
    background: #0073aa;
    font-size: 1.2em;
    padding: 15px 40px;
}

/* Chapter Container */
/* =========================
   ESTILO BASE (Desktop)
   ========================= */
.hnl-chapter-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px;
  box-shadow: 0 1px 5px #ffffff57;
}

/* =========================
   TABLET (768px a 1024px)
   ========================= */
@media (max-width: 1024px) {
  .hnl-chapter-container {
    max-width: 790px;
    padding: 20px;
    box-shadow: 0 1px 5px #ffffff57;
    border-radius: 3px;
  }
}

/* =========================
   MÓVIL (hasta 767px)
   ========================= */
@media (max-width: 768px) {
  .hnl-chapter-container {
    max-width: 360px;
    padding: 20px;
    box-shadow: 0 1px 5px #ffffff57;
    border-radius: 3px;
  }
}

.hnl-chapter-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.hnl-chapter-book-link {
    margin-bottom: 15px;
}

.hnl-chapter-book-link a {
    color: #ffffff;
    text-decoration: none;
    background: linear-gradient(135deg, #047989, #809db9, #fb4c4c);
}

.hnl-chapter-title {
    font-size: 2em;
    margin: 0;
    color: #333;
    background: #d1d1d1;
}

.hnl-chapter-content {
    margin: 30px 0;
    line-height: 1.8;
    font-size: 1.1em;
    /* Disable text selection */
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
    /* Prevent image dragging */
    -webkit-user-drag: none !important;
    -khtml-user-drag: none !important;
    -moz-user-drag: none !important;
    -o-user-drag: none !important;
    user-drag: none !important;
}

.hnl-chapter-content * {
    /* Disable text selection on all child elements */
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-touch-callout: none !important;
    /* Prevent image dragging */
    -webkit-user-drag: none !important;
    -khtml-user-drag: none !important;
    -moz-user-drag: none !important;
    -o-user-drag: none !important;
    user-drag: none !important;
}

/* Allow selection on links and buttons for usability */
.hnl-chapter-content a,
.hnl-chapter-content button,
.hnl-chapter-content input,
.hnl-chapter-content textarea,
.hnl-chapter-content select {
    -webkit-user-select: auto !important;
    -moz-user-select: auto !important;
    -ms-user-select: auto !important;
    user-select: auto !important;
}

.hnl-chapter-content p {
    margin-bottom: 1.5em;
}

/* Chapter Navigation */
.hnl-chapter-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin: 40px 0;
    padding: 20px 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.hnl-nav-previous,
.hnl-nav-next {
    flex: 1;
}

.hnl-nav-previous a,
.hnl-nav-next a {
    display: block;
    padding: 15px 20px;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hnl-nav-previous a {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: 200% 200%;
    animation: gradient-shift-nav 3s ease infinite;
}

.hnl-nav-next a {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    background-size: 200% 200%;
    animation: gradient-shift-nav 3s ease infinite;
}

@keyframes gradient-shift-nav {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.hnl-nav-previous a:hover,
.hnl-nav-next a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Rating */
.hnl-rating-field {
    margin-bottom: 20px;
}

.hnl-star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.hnl-star-rating input[type="radio"] {
    display: none;
}

.hnl-star-rating label.star {
    font-size: 2em;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s;
}

.hnl-star-rating input[type="radio"]:checked ~ label.star,
.hnl-star-rating label.star:hover,
.hnl-star-rating label.star:hover ~ label.star {
    color: #ffc107;
}

.hnl-rating-display {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
}

.hnl-average-rating {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hnl-stars {
    font-size: 1.5em;
    color: #ffc107;
}

.hnl-rating-value {
    color: #666;
}

/* Comments */
.hnl-chapter-comments {
    margin-top: 40px;
}

.hnl-comment-like {
    display: inline-block;
    padding: 5px 10px;
    margin-left: 10px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    color: #333;
}

.hnl-comment-like:hover {
    background: #e0e0e0;
}

.hnl-comment-like.liked {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* Archive */
.hnl-books-archive {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0px;
}

.hnl-archive-header {
    margin-bottom: 30px;
}

.hnl-archive-header h1 {
    font-size: 2.5em;
    color: #333;
}

.hnl-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* Ensure shortcode grid displays correctly */
.hnl-shortcode-books .hnl-books-grid,
.hnl-shortcode-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 30px !important;
    margin-bottom: 40px !important;
    width: 100% !important;
}

/* Override for author archive - must be after general rule */
.hnl-author-archive .hnl-books-grid {
    grid-template-columns: repeat(6, 1fr) !important;
}

.hnl-book-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s;
    padding: 10px;
}

.hnl-book-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.hnl-book-card-cover {
    width: 100%;
    height: 241px;
    overflow: hidden;
    background: #f5f5f5;
    padding: 0;
    margin: 0;
}

.hnl-book-card-cover img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    margin: 0;
    padding: 0;
    display: block;
}

.hnl-book-card-info {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: flex-start;
    align-items: center;
}

.hnl-book-card-title {
    margin: 2px 0;
    font-size: 1em;
    line-height: 1.2;
    text-align: center;
}

.hnl-book-card-title a {
    color: #333;
    text-decoration: none;
}

.hnl-book-card-title a:hover {
    color: #0073aa;
}

.hnl-book-card-author {
    color: #666;
    margin: 2px 0;
    font-size: 0.9em;
    line-height: 1.3;
    text-align: center;
}

.hnl-book-card-description {
    margin: 15px 0;
    color: #555;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 768px) {
    .hnl-book-header {
        flex-direction: column !important;
        gap: 2px !important;
    }
    
    .hnl-book-cover {
        flex: 0 0 auto !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 auto !important;
    }
    
    body.admin-bar .hnl-book-header {
        flex-direction: column !important;
        flex-wrap: wrap !important;
        gap: 5px !important;
        align-items: center !important;
    }
    
    body.admin-bar .hnl-book-cover {
        flex: 0 0 auto !important;
        max-width: 100% !important;
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 auto !important;
        display: block !important;
    }
    
    body.admin-bar .hnl-book-info {
        width: 100% !important;
        max-width: 100% !important;
        flex: 1 1 auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .hnl-books-grid {
        grid-template-columns: 1fr;
    }
    
    /* Shortcode grid on mobile */
    .hnl-shortcode-books .hnl-books-grid,
    .hnl-shortcode-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    /* Author archive should still use 2 columns on mobile */
    .hnl-author-archive .hnl-books-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .hnl-chapter-navigation {
        flex-direction: column !important;
        gap: 3px !important;
    }
    
    .hnl-nav-previous,
    .hnl-nav-next {
        flex: 1;
        width: 100%;
    }
    
    .hnl-nav-previous a,
    .hnl-nav-next a {
        padding: 12px 18px !important;
        font-size: 0.95em;
    }
    
    /* Grid de 2 columnas para capítulos en móvil */
    .hnl-chapters {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }
    
    /* Force 2 columns for logged-in users on mobile */
    body.admin-bar .hnl-chapters {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
        display: grid !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    body.admin-bar .hnl-chapter-item {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        list-style: none !important;
        display: block !important;
    }
    
    body.admin-bar .hnl-chapter-link {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 10px 12px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        min-height: 50px !important;
    }
    
    body.admin-bar .hnl-chapter-number {
        font-size: 0.9em !important;
        line-height: 1.4 !important;
        flex: 1 !important;
    }
    
    body.admin-bar .hnl-chapter-icon {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin-left: 10px !important;
        flex: 0 0 auto !important;
        min-width: 20px !important;
    }
    
    body.admin-bar .hnl-chapter-icon img {
        width: 20px !important;
        height: 20px !important;
        max-width: 20px !important;
        max-height: 20px !important;
        display: block !important;
        vertical-align: middle !important;
    }
    
    .hnl-chapter-item {
        margin: 0 !important;
    }
    
    .hnl-chapter-link {
        padding: 10px 12px !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        min-height: auto;
    }
    
    .hnl-chapter-icon {
        flex: 0 0 auto !important;
        margin-left: 10px !important;
        margin-right: 0 !important;
        min-width: 20px;
        display: flex;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .hnl-chapter-icon img {
        width: 20px !important;
        height: 20px !important;
        max-width: 20px !important;
        max-height: 20px !important;
        display: block;
    }
    
    .hnl-chapter-number {
        font-size: 0.9em !important;
        line-height: 1.4;
        display: flex;
        align-items: center;
    }
    
    .hnl-chapters-list h2 {
        font-size: 1.2em !important;
        margin-bottom: 10px !important;
    }
    
    .hnl-start-reading {
        margin: 20px 0 12px 0 !important;
    }
    
    .hnl-button-primary {
        padding: 10px 25px !important;
        font-size: 0.95em !important;
    }
    
    .hnl-book-synopsis {
        padding: 20px;
    }
    
    .hnl-synopsis-title {
        font-size: 1.3em;
    }
}

/* CRITICAL FIXES FOR LOGGED-IN USERS - Must be at the end to override everything */
body.admin-bar .hnl-book-container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 20px !important;
    box-sizing: border-box !important;
}

body.admin-bar .hnl-book-header {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: flex-start !important;
    gap: 30px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

body.admin-bar .hnl-book-cover {
    flex: 0 0 300px !important;
    width: 300px !important;
    max-width: 300px !important;
    min-width: 300px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.admin-bar .hnl-book-cover img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
}

body.admin-bar .hnl-book-info {
    flex: 1 1 auto !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-width: 0 !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Force 2 columns for chapters on mobile when logged in */
@media screen and (max-width: 768px) {
    body.admin-bar .hnl-book-container {
        padding: 1px !important;
    }
    
    body.admin-bar .hnl-book-header {
        flex-direction: column !important;
        align-items: center !important;
        gap: 5px !important;
        width: 100% !important;
    }
    
    body.admin-bar .hnl-book-cover {
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 auto !important;
        display: block !important;
    }
    
    body.admin-bar .hnl-book-cover img {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        display: block !important;
    }
    
    body.admin-bar .hnl-book-info {
        width: 100% !important;
        max-width: 100% !important;
        flex: 1 1 auto !important;
        text-align: left !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    body.admin-bar .hnl-book-title {
        width: 100% !important;
        text-align: left !important;
    }
    
    body.admin-bar .hnl-chapters {
        grid-template-columns: repeat(2, 1fr) !important;
        display: grid !important;
        gap: 6px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    body.admin-bar .hnl-chapter-item {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        list-style: none !important;
        display: block !important;
    }
    
    body.admin-bar .hnl-chapter-link {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 10px 12px !important;
        min-height: 50px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    body.admin-bar .hnl-chapter-number {
        font-size: 0.9em !important;
        flex: 1 !important;
        line-height: 1.4 !important;
    }
    
    body.admin-bar .hnl-chapter-icon {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex: 0 0 auto !important;
        margin-left: 10px !important;
        min-width: 20px !important;
    }
    
    body.admin-bar .hnl-chapter-icon img {
        width: 20px !important;
        height: 20px !important;
        max-width: 20px !important;
        max-height: 20px !important;
        display: block !important;
    }
}

/* Premium Content Styles */
.hnl-premium-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.7em;
    font-weight: bold;
    margin-left: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hnl-premium-lock {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border: 2px solid #667eea;
    border-radius: 15px;
    padding: 40px 30px;
    margin: 30px 0;
    text-align: center;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
}

.hnl-premium-message h2 {
    color: #667eea;
    font-size: 2em;
    margin-bottom: 15px;
    font-weight: bold;
}

.hnl-premium-message p {
    color: #555;
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 25px;
}

.hnl-payment-methods {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #ddd;
}

.hnl-payment-methods h3 {
    color: #333;
    font-size: 1.5em;
    margin-bottom: 20px;
}

.hnl-payment-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.hnl-payment-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.hnl-whatsapp-btn {
    background: #25D366;
    color: #fff;
}

.hnl-whatsapp-btn:hover {
    background: #20ba5a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.3);
    color: #fff;
}

.hnl-telegram-btn {
    background: #0088cc;
    color: #fff;
}

.hnl-telegram-btn:hover {
    background: #0077b5;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.3);
    color: #fff;
}

.hnl-payment-btn .dashicons {
    width: 24px;
    height: 24px;
    font-size: 24px;
}

.hnl-no-payment-methods {
    color: #d63638;
    font-weight: bold;
    margin-top: 20px;
}

.hnl-login-required {
    margin-top: 20px;
    padding: 15px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 5px;
    color: #856404;
}

.hnl-login-required a {
    color: #0066cc;
    font-weight: bold;
    text-decoration: underline;
}

/* Mobile Responsive for Premium Lock */
@media (max-width: 768px) {
    .hnl-premium-lock {
        padding: 25px 15px;
        margin: 20px 0;
    }
    
    .hnl-premium-message h2 {
        font-size: 1.5em;
    }
    
    .hnl-premium-message p {
        font-size: 1em;
    }
    
    .hnl-payment-buttons {
        flex-direction: column;
    }
    
    .hnl-payment-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Author Archive Page Styles */
.hnl-author-archive {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0px;
}

.hnl-author-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 40px 30px;
    margin-bottom: 40px;
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.hnl-author-header-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.hnl-author-title {
    font-size: 2.5em;
    margin: 0 0 15px 0;
    color: #ffffff;
    font-weight: 700;
}

.hnl-author-info {
    margin-top: 20px;
}

.hnl-author-bio {
    font-size: 1.1em;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
}

/* Author Archive Grid - 6 columns on PC, 4 on tablet, 2 on mobile */
.hnl-author-archive .hnl-books-grid,
body .hnl-author-archive .hnl-books-grid,
.hnl-author-archive .hnl-books-archive .hnl-books-grid {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 3px !important;
    margin-bottom: 40px !important;
    width: 100% !important;
    max-width: 100% !important;
}

.hnl-author-archive .hnl-book-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hnl-author-archive .hnl-book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.hnl-author-archive .hnl-book-card-cover {
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: #f5f5f5;
}

.hnl-author-archive .hnl-book-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hnl-author-archive .hnl-book-card-info {
    padding: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: flex-start;
    align-items: center;
}

.hnl-author-archive .hnl-book-card-title {
    margin: 2px 0;
    font-size: .9em;
    line-height: 1.2;
}

.hnl-author-archive .hnl-book-card-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.hnl-author-archive .hnl-book-card-title a:hover {
    color: #667eea;
}

.hnl-book-card-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.hnl-book-card-language {
    display: inline-block;
    padding: 4px 12px;
    background: #f0f0f0;
    border-radius: 12px;
    font-size: 0.85em;
    color: #666;
}

.hnl-book-card-category {
    display: inline-block;
    padding: 4px 12px;
    background: #0073aa;
    color: #ffffff;
    border-radius: 12px;
    font-size: 0.85em;
    text-decoration: none;
    transition: background 0.3s ease;
}

.hnl-book-card-category:hover {
    background: #005a87;
    color: #ffffff;
    text-decoration: none;
}

.hnl-no-books {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 1.2em;
}

.hnl-book-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Responsive adjustments for author archive */
/* Tablet: 4 columns */
@media (max-width: 992px) and (min-width: 769px) {
    .hnl-author-archive .hnl-books-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 3px !important;
    }
    
    .hnl-author-header {
        padding: 35px 25px;
        margin-bottom: 35px;
    }
    
    .hnl-author-title {
        font-size: 2.2em;
    }
}

/* Mobile: 2 columns */
@media (max-width: 768px) {
    .hnl-author-archive .hnl-books-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 3px !important;
    }
    
    .hnl-author-header {
        padding: 30px 20px;
        margin-bottom: 30px;
    }
    
    .hnl-author-title {
        font-size: 1.8em;
    }
    
    .hnl-author-bio {
        font-size: 1em;
    }
    
    .hnl-author-archive {
        padding: 0px;
    }
    
    .hnl-author-archive .hnl-book-card-info {
        padding: 0px;
    }
    
    .hnl-author-archive .hnl-book-card-title {
        font-size: 0.9em;
    }
}

/* Book Number Styling */
.hnl-book-number {
    display: inline-block;
    background: #f7f7f7;
    color: #03875d;
    padding: 4px 20px;
    border-radius: 5px;
    font-size: 0.6em;
    font-weight: 500;
    margin: 0 auto 2px auto;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    width: fit-content;
}

/* Book Card Actions - Centered Read More Button */
.hnl-book-card-actions {
    text-align: center;
    margin-top: 4px;
    padding-top: 0;
}

.hnl-read-more-button {
    display: inline-block;
    background: linear-gradient(135deg, #000000 0%, #4f2f2f 100%);
    color: #ffffff !important;
    padding: 8px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.7em;
    transition: all 0.3s ease;
    box-shadow: 0 2px 15px rgba(219, 0, 0, 0.7);
    border: none;
    cursor: pointer;
    text-align: center;
    min-width: 170px;
}

.hnl-read-more-button:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    color: #ffffff !important;
    text-decoration: none;
}

.hnl-read-more-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

/* Archive page specific button styling */
.hnl-books-archive .hnl-read-more-button,
.hnl-author-archive .hnl-read-more-button {
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
}

/* Truncated title styling */
.hnl-book-card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    margin: 2px 0;
    text-align: center;
    width: 100%;
}

/* Ensure book card info has proper spacing */
.hnl-book-card-info {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 4px;
    padding: 8px;
}

.hnl-book-card-author {
    margin: 2px 0;
    font-size: 0.7em;
    color: #666;
    text-align: center;
}

/* Override any conflicting styles from general archive */
.hnl-author-archive .hnl-books-archive .hnl-books-grid {
    grid-template-columns: repeat(6, 1fr) !important;
}

@media (max-width: 992px) and (min-width: 769px) {
    .hnl-author-archive .hnl-books-archive .hnl-books-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .hnl-author-archive .hnl-books-archive .hnl-books-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Pagination Styling - Centered */
.hnl-books-archive .pagination,
.hnl-author-archive .pagination,
.hnl-books-archive nav.navigation,
.hnl-author-archive nav.navigation,
.hnl-books-archive .nav-links,
.hnl-author-archive .nav-links,
.hnl-shortcode-pagination {
    text-align: center !important;
    margin: 30px auto !important;
    padding: 10px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
}

.hnl-books-archive .page-numbers,
.hnl-author-archive .page-numbers,
.hnl-shortcode-pagination .page-numbers {
    display: inline-block !important;
    padding: 12px 20px !important;
    margin: 0 4px !important;
    text-decoration: none !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    color: #333 !important;
    background: #fff !important;
    transition: all 0.3s ease !important;
    text-align: center !important;
    font-size: 16px !important;
    min-width: 44px !important;
    line-height: 1.4 !important;
}

.hnl-books-archive .page-numbers:hover,
.hnl-author-archive .page-numbers:hover,
.hnl-shortcode-pagination .page-numbers:hover {
    background: #f0f0f0 !important;
    border-color: #999 !important;
    color: #000 !important;
    text-decoration: none !important;
}

.hnl-books-archive .page-numbers.current,
.hnl-author-archive .page-numbers.current,
.hnl-shortcode-pagination .page-numbers.current {
    background: #333 !important;
    color: #fff !important;
    border-color: #333 !important;
    font-weight: 600 !important;
}

.hnl-books-archive .page-numbers.dots,
.hnl-author-archive .page-numbers.dots {
    border: none !important;
    background: transparent !important;
    cursor: default !important;
    padding: 8px 4px !important;
}

.hnl-books-archive .page-numbers.dots:hover,
.hnl-author-archive .page-numbers.dots:hover {
    background: transparent !important;
    border: none !important;
}

/* Ensure pagination container is centered */
.hnl-books-archive > .pagination,
.hnl-author-archive .hnl-books-archive > .pagination,
.hnl-books-archive > nav.navigation,
.hnl-author-archive .hnl-books-archive > nav.navigation,
.hnl-shortcode-pagination > .pagination,
.hnl-shortcode-pagination > nav.navigation {
    display: block !important;
    text-align: center !important;
    width: 100% !important;
    margin: 30px auto !important;
}

/* Ensure pagination nav links are horizontal */
.hnl-shortcode-pagination .nav-links,
.hnl-shortcode-pagination nav.navigation .nav-links {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 3px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.hnl-shortcode-pagination .nav-links li,
.hnl-shortcode-pagination nav.navigation .nav-links li {
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* Ensure paginate_links output is horizontal */
.hnl-shortcode-pagination .nav-links a,
.hnl-shortcode-pagination .nav-links span,
.hnl-shortcode-pagination .page-numbers a,
.hnl-shortcode-pagination .page-numbers span {
    display: inline-block !important;
    margin: 0 4px !important;
}

/* Ensure paginate_links with type='list' displays horizontally */
.hnl-shortcode-pagination .page-numbers {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.hnl-shortcode-pagination .page-numbers li {
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* Author Profile Header */
.hnl-author-profile-header {
    position: relative;
    width: 100%;
    min-height: 400px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #2c3e50;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
}

.hnl-author-profile-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.6) 100%);
    z-index: 1;
}

.hnl-author-profile-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #ffffff;
    padding: 40px 20px;
    max-width: 800px;
    width: 100%;
}

.hnl-author-profile-photo-wrapper {
    margin-bottom: 20px;
}

.hnl-author-profile-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    margin: 0 auto;
    display: block;
}

.hnl-author-profile-photo-placeholder {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    font-weight: bold;
    border: 5px solid #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    margin: 0 auto;
}

.hnl-author-profile-name {
    font-size: 36px;
    font-weight: bold;
    margin: 0 0 15px 0;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hnl-author-profile-bio {
    font-size: 18px;
    line-height: 1.6;
    margin: 0 0 30px 0;
    color: #f0f0f0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.hnl-author-profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.hnl-follow-button,
.hnl-share-button,
.hnl-contact-button {
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hnl-follow-button {
    background: #ffffff;
    color: #333333;
}

.hnl-follow-button:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.hnl-follow-button.hnl-following {
    background: #25D366;
    color: #ffffff;
}

.hnl-follow-button.hnl-following:hover {
    background: #20BA5A;
}

.hnl-author-followers {
    margin-top: 10px;
    font-size: 14px;
    color: #f5f5f5;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.hnl-login-required-message {
    margin-top: 15px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
}

.hnl-login-required-message .hnl-login-button {
    display: inline-block;
    margin-top: 8px;
    padding: 8px 18px;
    background: #25D366;
    color: #ffffff;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
}

.hnl-login-required-message .hnl-login-button:hover {
    background: #20BA5A;
}

.hnl-share-button {
    background: #1877F2;
    color: #ffffff;
}

.hnl-share-button:hover {
    background: #166FE5;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.hnl-whatsapp-button {
    background: #25D366;
    color: #ffffff;
}

.hnl-whatsapp-button:hover {
    background: #20BA5A;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.hnl-telegram-button {
    background: #0088cc;
    color: #ffffff;
}

.hnl-telegram-button:hover {
    background: #0077B5;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* Books Section Header */
.hnl-books-section-header {
    margin-bottom: 30px;
    text-align: center;
}

.hnl-books-section-title {
    font-size: 32px;
    font-weight: bold;
    margin: 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

/* Responsive Design for Author Profile */
@media (max-width: 768px) {
    .hnl-author-profile-header {
        min-height: 300px;
    }
    
    .hnl-author-profile-photo,
    .hnl-author-profile-photo-placeholder {
        width: 120px;
        height: 120px;
        font-size: 48px;
    }
    
    .hnl-author-profile-name {
        font-size: 28px;
    }
    
    .hnl-author-profile-bio {
        font-size: 16px;
    }
    
    /* Keep action buttons in a horizontal row on mobile */
    .hnl-author-profile-actions {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 8px;
    }
    
    .hnl-follow-button,
    .hnl-share-button,
    .hnl-contact-button {
        flex: 1 1 0;
        width: auto;
        max-width: none;
        padding: 10px 16px;
        font-size: 14px;
        white-space: nowrap;
    }
    
    .hnl-books-section-title {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .hnl-author-profile-header {
        min-height: 250px;
    }
    
    .hnl-author-profile-photo,
    .hnl-author-profile-photo-placeholder {
        width: 100px;
        height: 100px;
        font-size: 40px;
    }
    
    .hnl-author-profile-name {
        font-size: 24px;
    }
    
    .hnl-author-profile-bio {
        font-size: 14px;
    }
}

