/* Netflix Landing Portal and View Transitions */

#netflixLanding {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    background: radial-gradient(circle at 50% 50%, #151b22 0%, #090b0e 100%);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: opacity 0.5s cubic-bezier(0.25, 1, 0.5, 1), transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 1;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: clamp(40px, 8vh, 80px) 20px 40px;
    box-sizing: border-box;
}

#netflixLanding.fade-out {
    opacity: 0;
    transform: scale(1.05);
    pointer-events: none;
}

.netflix-title {
    font-size: 3rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 50px;
    letter-spacing: -0.02em;
    text-align: center;
    animation: netflixSlideDown 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.profile-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
    max-width: 1000px;
    margin: 0 auto 60px;
    flex-shrink: 0;
    animation: netflixFadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.profile-card {
    width: 160px;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    background: transparent;
    border: none;
    padding: 0;
    outline: none;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 3px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

/* Customized profile background gradients for that Netflix-profile look */
.profile-card:nth-child(1) .profile-avatar {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}
.profile-card:nth-child(2) .profile-avatar {
    background: linear-gradient(135deg, #e52d27 0%, #b31217 100%);
}
.profile-card:nth-child(3) .profile-avatar {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}
.profile-card:nth-child(4) .profile-avatar {
    background: linear-gradient(135deg, #8a2387 0%, #e94057 100%, #f27121 100%);
}

.profile-avatar svg {
    width: 55%;
    height: 55%;
    stroke: #ffffff;
    stroke-width: 1.75;
    fill: none;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-name {
    margin-top: 18px;
    color: var(--text-muted);
    font-size: 1.15rem;
    font-weight: 500;
    transition: color 0.25s ease;
    display: block;
}

/* Hover effects */
.profile-card:hover .profile-avatar {
    border-color: #ffffff;
    transform: scale(1.08) translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 255, 255, 0.15);
}

.profile-card:hover .profile-avatar svg {
    transform: scale(1.1);
}

.profile-card:hover .profile-name {
    color: #ffffff;
}

.netflix-manage-btn {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.25s ease;
    border-radius: 4px;
    animation: netflixFadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.netflix-manage-btn:hover {
    border-color: #ffffff;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

/* Top Novels row on portal landing */
.top-novels-section {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px 40px;
    animation: netflixFadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both;
}

.top-novels-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.top-novels-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.top-novels-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.top-novels-tab {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted, #aaa);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.top-novels-tab:hover,
.top-novels-tab.active {
    color: #fff;
    border-color: rgba(0, 245, 255, 0.45);
    background: rgba(0, 245, 255, 0.1);
}

.top-novels-scroll-wrap {
    position: relative;
    width: 100%;
}

.top-novels-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    line-height: 1;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.top-novels-scroll-btn:hover {
    background: rgba(0, 245, 255, 0.2);
    border-color: rgba(0, 245, 255, 0.45);
}

.top-novels-scroll-btn.prev { left: -6px; }
.top-novels-scroll-btn.next { right: -6px; }

.top-novels-row {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 6px 8px;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.top-novels-row::-webkit-scrollbar {
    height: 6px;
}

.top-novels-row::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.top-novel-card {
    flex: 0 0 140px;
    scroll-snap-align: start;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    text-align: left;
    padding: 0;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.top-novel-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 245, 255, 0.35);
}

.top-novel-cover {
    position: relative;
    aspect-ratio: 2/3;
    background: #111;
    overflow: hidden;
}

.top-novel-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.top-novel-rank {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: #00f5ff;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 6px;
}

.top-novel-info {
    padding: 8px 10px 10px;
}

.top-novel-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.top-novel-meta {
    font-size: 0.68rem;
    color: var(--text-muted, #888);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-novel-badge {
    font-size: 0.62rem;
    color: #00f5ff;
    margin-top: 4px;
    font-weight: 600;
}

/* Layout Views Orchestration */
.app-view {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s cubic-bezier(0.25, 1, 0.5, 1), transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    width: 100%;
}

.app-view.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Release Libraries View from parent transform containment so fixed overlays (libraryLoader) cover the viewport */
#librariesView.app-view.active {
    transform: none !important;
}

/* Home back button styled nicely */
.back-to-portal-btn {
    position: fixed;
    top: 25px;
    left: 25px;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    z-index: 999;
}

.back-to-portal-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateX(-3px);
}

.back-to-portal-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
}

/* Keyframes */
@keyframes netflixSlideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes netflixFadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- LIBRARIES VIEW STYLES --- */

.libraries-wrapper {
    width: 100%;
    max-width: 1100px;
    margin: 80px auto 100px;
    padding: 0 24px;
}

.libraries-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
}

.libraries-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0 0 16px;
    background: linear-gradient(135deg, #fff 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px var(--primary-glow));
}

.libraries-tabs-container {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 24px;
    overflow-x: auto;
    flex-wrap: nowrap;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}
.libraries-tabs-container::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

.library-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
    padding: 10px 24px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.library-tab:hover {
    color: #ffffff;
}

.library-tab.active {
    background: var(--primary);
    color: #000000;
    font-weight: 700;
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* Import banner section styling */
.library-upload-section {
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-blur);
    padding: 24px;
    border-radius: 20px;
    margin-bottom: 40px;
    box-shadow: var(--shadow-lg);
}

/* Books Grid */
.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 30px;
    width: 100%;
}

.library-book-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.library-book-card:hover {
    border-color: var(--primary);
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 245, 255, 0.1);
}

.book-cover-wrap {
    width: 100%;
    aspect-ratio: 2/3;
    overflow: hidden;
    position: relative;
    background: #111;
}

.book-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.library-book-card:hover .book-cover-img {
    transform: scale(1.05);
}

.book-overlay-actions {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.book-cover-wrap:hover .book-overlay-actions {
    opacity: 1;
}

.book-action-btn {
    width: 85%;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.book-action-btn.read-btn-main {
    background: var(--primary);
    color: #000000;
}

.book-action-btn.read-btn-main:hover {
    filter: brightness(1.1);
    transform: scale(1.04);
}

.book-action-btn.download-btn-main {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.book-action-btn.download-btn-main:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.04);
}

.book-details {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.book-title {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 6px;
    white-space: normal;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.book-author {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    white-space: normal;
    line-height: 1.3;
}

.book-progress-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
    margin-top: auto;
}

.book-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
}

.book-delete-btn {
    background: transparent;
    border: none;
    color: #e25c5c;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.book-delete-btn:hover {
    background: rgba(226, 92, 92, 0.1);
    color: #ff7676;
}

/* Loading overlays inside sub-views */
.subview-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
}

.spinner-ring {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(0, 245, 255, 0.1);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .libraries-title {
        font-size: 1.8rem;
    }
    .library-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 16px;
    }
    .library-upload-section {
        padding: 16px;
    }
}

/* --- INTERMEDIARY BOOK DETAILS VIEW STYLES --- */
.book-details-wrapper {
    width: 100%;
    max-width: 1000px;
    margin: 80px auto 100px;
    padding: 0 24px;
    position: relative;
    animation: netflixFadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.details-back-btn {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s ease;
    margin-bottom: 30px;
    width: fit-content;
}

.details-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateX(-3px);
}

.details-back-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
}

.details-container {
    display: flex;
    gap: 40px;
    background: rgba(30, 30, 30, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 40px;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    position: relative;
    overflow: hidden;
}

/* Glassy background glow based on cover */
.details-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 120, 212, 0.08) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.details-cover-pane {
    width: 250px;
    flex-shrink: 0;
    z-index: 1;
}

.details-cover-img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
    background: #111;
}

.details-cover-img:hover {
    transform: scale(1.02);
}

.details-info-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.details-book-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0 0 8px;
    color: #ffffff;
    line-height: 1.2;
}

.details-book-author {
    font-size: 1.2rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 20px;
}

.details-meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.meta-tag {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.series-tag {
    background: rgba(0, 120, 212, 0.15);
    border: 1px solid rgba(0, 120, 212, 0.3);
    color: #7cc3ff;
}

.details-description-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 30px;
    flex: 1;
    overflow-y: auto;
    max-height: 250px;
}

.details-description-box h3 {
    margin: 0 0 10px;
    font-size: 1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.details-book-desc {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    white-space: pre-wrap;
}

.details-action-buttons {
    display: flex;
    gap: 16px;
}

.details-btn {
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.details-btn-primary {
    background: var(--primary);
    color: #000000;
    box-shadow: 0 4px 14px var(--primary-glow-strong);
}

.details-btn-primary:hover {
    filter: brightness(1.15);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 120, 212, 0.4);
}

.details-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.details-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .book-details-wrapper {
        margin: 60px auto 80px;
    }
    
    .details-container {
        flex-direction: column;
        align-items: center;
        padding: 24px;
        gap: 24px;
    }
    
    .details-cover-pane {
        width: 180px;
    }
    
    .details-book-title {
        font-size: 1.6rem;
        text-align: center;
    }
    
    .details-book-author {
        font-size: 1rem;
        text-align: center;
        margin-bottom: 16px;
    }
    
    .details-meta-tags {
        justify-content: center;
    }
    
    .details-action-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .details-btn {
        width: 100%;
    }
}

/* ── SOURCES VIEW STYLES ────────────────────── */
.sources-wrapper {
    width: 100%;
    max-width: 800px;
    margin: 80px auto 100px;
    padding: 0 24px;
    animation: netflixFadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.sources-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
    text-align: center;
}

.sources-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0 0 12px;
    background: linear-gradient(135deg, #fff 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px var(--primary-glow));
}

.sources-list-container {
    width: 100%;
    max-height: 450px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    background: rgba(30, 30, 30, 0.35);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    padding: 8px;
    gap: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

/* Custom scrollbar for sources list */
.sources-list-container::-webkit-scrollbar {
    width: 6px;
}
.sources-list-container::-webkit-scrollbar-track {
    background: transparent;
}
.sources-list-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
.sources-list-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.source-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.source-item-row:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(0, 245, 255, 0.2);
}

.source-item-name {
    font-size: 1rem;
    font-weight: 500;
    color: #ffffff;
}

.source-item-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.source-test-status {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    min-width: 80px;
    text-align: center;
    text-transform: uppercase;
}

.source-test-status.testing {
    background: rgba(234, 179, 8, 0.15);
    color: #facc15;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.source-test-status.success {
    background: rgba(20, 184, 166, 0.15);
    color: #14b8a6;
    border: 1px solid rgba(20, 184, 166, 0.3);
}

.source-test-status.failed {
    background: rgba(244, 63, 94, 0.15);
    color: #f43f5e;
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.source-test-btn {
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.source-test-btn:hover:not(:disabled) {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.source-test-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sources-list-empty {
    padding: 32px;
    text-align: center;
    color: var(--text-muted);
    font-size: 1rem;
}



.top-novels-empty {
    width: 100%;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 14px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px dashed var(--border-color);
}

/* Active Users Widget */
.active-users-widget {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 14px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 1010;
}

.active-users-widget:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.active-users-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px #10b981;
    animation: activeUsersPulse 2s infinite;
}

@keyframes activeUsersPulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}
