/* Compact, fresh design for main lorebook cards */

/* Make cards wider with more content */
.lorebook-item {
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 1rem !important;
    position: relative !important;
    min-height: 100px !important;
    height: auto !important;
    perspective: none !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 12px !important;
    padding: 1rem !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    transition: all 0.2s ease !important;
    margin-bottom: 0.75rem !important;
}

/* When displayed */
.lorebook-item[style*="display: flex"] {
    display: flex !important;
}

.lorebook-item:hover {
    transform: translateX(5px) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(138, 43, 226, 0.3) !important;
    box-shadow: 0 4px 12px rgba(138, 43, 226, 0.1) !important;
}

/* Small icon/cover section */
.lorebook-cover {
    height: 50px !important;
    width: 50px !important;
    min-width: 50px !important;
    transform-style: flat !important;
    transition: none !important;
    box-shadow: none !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    margin-bottom: 0 !important;
    flex-shrink: 0 !important;
}

.lorebook-item:hover .lorebook-cover {
    transform: none !important;
    box-shadow: none !important;
}

/* Compact cover design */
.cover-design {
    height: 100% !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.1) !important;
    position: relative !important;
}

/* Category colors */
.cover-design.fantasy { background: rgba(107, 70, 193, 0.2) !important; }
.cover-design.sci-fi { background: rgba(59, 130, 246, 0.2) !important; }
.cover-design.historical { background: rgba(220, 38, 38, 0.2) !important; }
.cover-design.anime { background: rgba(236, 72, 153, 0.2) !important; }
.cover-design.game { background: rgba(16, 185, 129, 0.2) !important; }
.cover-design.original { background: rgba(139, 92, 246, 0.2) !important; }
.cover-design.modern { background: rgba(100, 116, 139, 0.2) !important; }
.cover-design.mystery { background: rgba(75, 85, 99, 0.2) !important; }
.cover-design.horror { background: rgba(127, 29, 29, 0.2) !important; }
.cover-design.romance { background: rgba(244, 63, 94, 0.2) !important; }
.cover-design.adventure { background: rgba(245, 158, 11, 0.2) !important; }
.cover-design.nsfw { background: rgba(239, 68, 68, 0.2) !important; }
.cover-design.sfw { background: rgba(34, 197, 94, 0.2) !important; }
.cover-design.rules { background: rgba(148, 163, 184, 0.2) !important; }

/* Small icon */
.cover-design i {
    font-size: 1.5rem !important;
    color: var(--text) !important;
    opacity: 0.8 !important;
}

/* Info section - takes up remaining space */
.lorebook-info {
    flex: 1 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.25rem !important;
}

/* Title styling */
.lorebook-info h3 {
    font-size: 1rem !important;
    font-weight: 600 !important;
    margin: 0 0 0.25rem 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    color: var(--text) !important;
}

/* Author styling */
.lorebook-author {
    font-size: 0.85rem !important;
    opacity: 0.7 !important;
    margin-bottom: 0.25rem !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* Description styling */
.lorebook-description {
    font-size: 0.85rem !important;
    opacity: 0.8 !important;
    margin-bottom: 0.5rem !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    line-height: 1.3 !important;
}

/* Small metadata line */
.lorebook-meta {
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
    font-size: 0.8rem !important;
    opacity: 0.7 !important;
}

.lorebook-meta .entries {
    flex-shrink: 0 !important;
}

/* Inline rating */
.rating-inline {
    display: flex !important;
    align-items: center !important;
    gap: 0.3rem !important;
    font-size: 0.8rem !important;
    color: #FBBF24 !important;
}

.rating-inline .stars {
    display: flex !important;
    gap: 0.1rem !important;
}

.rating-inline i {
    font-size: 0.7rem !important;
}

/* Compact action button */
.lorebook-actions {
    margin-left: auto !important;
    flex-shrink: 0 !important;
}

.view-btn {
    padding: 0.5rem 1rem !important;
    background: rgba(59, 130, 246, 0.2) !important;
    color: #3b82f6 !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    border-radius: 8px !important;
    font-weight: 500 !important;
    font-size: 0.85rem !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
}

.view-btn:hover {
    background: rgba(59, 130, 246, 0.3) !important;
    border-color: rgba(59, 130, 246, 0.5) !important;
    transform: scale(1.05) !important;
}

.view-btn i {
    font-size: 0.8rem !important;
}

/* Hide elements not needed in compact view */
.custom-cover-title-overlay {
    display: none !important;
}

.lorebook-cover .rating {
    display: none !important;
}

/* Custom cover images */
.custom-cover-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Top 3 Popular Rankings */
.lorebook-item.rank-1 {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 193, 7, 0.1) 100%) !important;
    border-color: rgba(255, 215, 0, 0.4) !important;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2) !important;
}

.lorebook-item.rank-2 {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.15) 0%, rgba(169, 169, 169, 0.1) 100%) !important;
    border-color: rgba(192, 192, 192, 0.4) !important;
    box-shadow: 0 0 15px rgba(192, 192, 192, 0.2) !important;
}

.lorebook-item.rank-3 {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.15) 0%, rgba(184, 115, 51, 0.1) 100%) !important;
    border-color: rgba(205, 127, 50, 0.4) !important;
    box-shadow: 0 0 10px rgba(205, 127, 50, 0.2) !important;
}

/* Ranking badges */
.ranking-badge {
    position: absolute !important;
    top: -12px !important;
    right: 20px !important;
    padding: 0.5rem 1rem !important;
    border-radius: 20px !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    z-index: 10 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

.ranking-badge.gold {
    background: linear-gradient(135deg, #FFD700 0%, #FFC107 100%) !important;
    color: #000 !important;
}

.ranking-badge.silver {
    background: linear-gradient(135deg, #C0C0C0 0%, #A9A9A9 100%) !important;
    color: #000 !important;
}

.ranking-badge.bronze {
    background: linear-gradient(135deg, #CD7F32 0%, #B87333 100%) !important;
    color: #FFF !important;
}

.ranking-badge i {
    font-size: 1rem !important;
}

/* Pookie's Favorite banner for #1 */
.pookie-favorite {
    position: absolute !important;
    top: -12px !important;
    left: 20px !important;
    background: linear-gradient(135deg, #FF1493 0%, #FF69B4 100%) !important;
    color: white !important;
    padding: 0.4rem 0.8rem !important;
    border-radius: 15px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    box-shadow: 0 3px 10px rgba(255, 20, 147, 0.3) !important;
}

.pookie-favorite i {
    font-size: 0.8rem !important;
}

/* Container spacing */
.library-controls {
    margin-top: 3rem !important;
}

.bookshelf-container {
    margin-top: 2rem !important;
}

/* Grid adjustment for better spacing */
.bookshelf,
#bookshelf {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    max-width: 800px !important;
    margin: 0 auto !important;
    padding: 3.5rem 2.5rem 2.5rem 2.5rem !important;
}

/* Fixed width cards */
.lorebook-item {
    width: 100% !important;
    max-width: 800px !important;
}

/* Responsive */
@media (max-width: 992px) {
    .bookshelf {
        max-width: 700px !important;
    }
}

@media (max-width: 768px) {
    .bookshelf {
        max-width: 100% !important;
        padding: 0 1rem !important;
    }
    
    .lorebook-item {
        min-height: 90px !important;
        padding: 0.75rem !important;
        gap: 0.75rem !important;
    }
    
    .lorebook-cover {
        height: 45px !important;
        width: 45px !important;
        min-width: 45px !important;
    }
    
    .cover-design i {
        font-size: 1.3rem !important;
    }
    
    .lorebook-info h3 {
        font-size: 0.95rem !important;
    }
    
    .lorebook-author {
        font-size: 0.8rem !important;
    }
    
    .lorebook-description {
        font-size: 0.8rem !important;
        -webkit-line-clamp: 1 !important;
        line-clamp: 1 !important;
    }
    
    .lorebook-meta {
        font-size: 0.75rem !important;
    }
    
    .view-btn {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.8rem !important;
    }
}