/* ============================================
   LightNovel Plus - Custom CSS Overrides
   ============================================ */

/* Live Search Results */
.ln-live-search-results {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--ln-bg-card);
    border-radius: 0 0 var(--ln-radius) var(--ln-radius);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    z-index: 1001;
}

.ln-live-search-list {
    padding: 5px 0;
}

.ln-live-search-item {
    display: flex;
    gap: 10px;
    padding: 8px 12px;
    transition: background 0.2s ease;
    color: var(--ln-text);
    align-items: center;
}

.ln-live-search-item:hover {
    background: var(--ln-accent-light);
}

.ln-live-search-item img {
    width: 40px;
    height: 55px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
}

.ln-live-search-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ln-live-search-title {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ln-live-search-type {
    font-size: 0.7rem;
    color: var(--ln-text-muted);
}

.ln-live-search-empty {
    padding: 20px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--ln-text-muted);
}

/* No Cover Placeholder */
.ln-no-cover {
    background: var(--ln-bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ln-text-muted);
    font-size: 2rem;
}

/* Chapter List Sortable */
.ln-chapter-list-wrapper {
    max-height: 500px;
    overflow-y: auto;
}

/* Volume header in chapter list */
.ln-volume-header {
    background: var(--ln-secondary);
    color: #fff;
    padding: 8px 12px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-top: 10px;
    border-radius: var(--ln-radius-sm);
}

/* Reading page specific */
.ln-reading-content p:first-child::first-letter {
    font-size: 2.5em;
    float: left;
    line-height: 1;
    margin-right: 8px;
    margin-top: 4px;
    font-weight: 700;
    color: var(--ln-accent);
}

/* Print styles for reading page */
@media print {
    .ln-header, .ln-footer, .ln-sidebar, .ln-reading-controls, .ln-social-share, .ln-back-to-top, .ln-reading-progress, .ln-next-chapter {
        display: none !important;
    }
    .ln-reading-content {
        max-width: 100% !important;
        font-size: 12pt !important;
        line-height: 1.6 !important;
    }
}

/* Genre tab loading state */
.ln-tabs-content.ln-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Custom scrollbar for chapter list */
.ln-chapter-list-wrapper::-webkit-scrollbar {
    width: 6px;
}
.ln-chapter-list-wrapper::-webkit-scrollbar-thumb {
    background: var(--ln-accent);
    border-radius: 3px;
}

/* Rating stars interactive */
.ln-rating-interactive .ln-star-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--ln-star-empty);
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0 2px;
}

.ln-rating-interactive .ln-star-btn:hover,
.ln-rating-interactive .ln-star-btn.active {
    color: var(--ln-star-filled);
}

/* 404 Page */
.ln-404 {
    text-align: center;
    padding: 60px 20px;
}

.ln-404 h1 {
    font-size: 6rem;
    font-weight: 800;
    color: var(--ln-accent);
    margin-bottom: 10px;
}

.ln-404 p {
    font-size: 1.1rem;
    color: var(--ln-text-secondary);
    margin-bottom: 20px;
}

/* Page Loading */
.ln-page-loading {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--ln-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.3s ease;
}

.ln-page-loading.loaded {
    opacity: 0;
    pointer-events: none;
}

.ln-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--ln-border);
    border-top-color: var(--ln-accent);
    border-radius: 50%;
    animation: lnSpin 0.8s linear infinite;
}

@keyframes lnSpin {
    to { transform: rotate(360deg); }
}

/* Novel type label in card */
.ln-type-label {
    background: var(--ln-secondary) !important;
    color: #fff !important;
    font-size: 0.65rem !important;
}

/* Responsive fine-tuning */
@media (max-width: 992px) {
    .ln-live-search-results {
        width: 280px;
    }
}

@media (max-width: 480px) {
    .ln-live-search-results {
        width: 100%;
        left: 0;
        right: 0;
    }
}
