/* ═══════════════════════════════════════════
   پاپ‌آپ پارت‌خوان رمان آنلاین
   ═══════════════════════════════════════════ */

.avks-reader {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999999;
    background: #fff;
    flex-direction: column;
}

.avks-reader.is-open {
    display: flex;
    animation: readerFade .3s ease;
}

@keyframes readerFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

body.reader-open {
    overflow: hidden;
}

.avks-reader__bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background: #f8fafc;
    border-bottom: 1.5px solid #e2e8f0;
    flex-shrink: 0;
}

.avks-reader__bar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.avks-reader__bar-right h3 {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
}

.avks-reader__bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avks-reader__bar-left button {
    width: 34px;
    height: 34px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .2s;
}

.avks-reader__bar-left button:hover {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
}

#readerPageInfo {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 700;
    min-width: 50px;
    text-align: center;
}

.avks-reader__close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: #fef2f2;
    color: #ef4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .2s;
}

.avks-reader__close:hover {
    background: #ef4444;
    color: #fff;
}

.avks-reader__body {
    flex: 1;
    overflow-y: auto;
    padding: 30px 10%;
    background: #fff;
}

.avks-reader__text {
    font-size: 16px;
    line-height: 2.2;
    color: #1e293b;
    text-align: justify;
    max-width: 800px;
    margin: 0 auto;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.avks-reader__text p {
    margin-bottom: 20px;
}

.avks-reader__loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: #94a3b8;
}

.avks-reader__spin {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(99, 102, 241, .15);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: readerSpin .7s linear infinite;
    margin-bottom: 14px;
}

@keyframes readerSpin {
    to { transform: rotate(360deg); }
}

.avks-reader__error {
    text-align: center;
    padding: 60px 20px;
    color: #ef4444;
    font-weight: 700;
}

.avks-reader__nav {
    display: flex;
    justify-content: space-between;
    padding: 14px 24px;
    background: #f8fafc;
    border-top: 1.5px solid #e2e8f0;
    flex-shrink: 0;
}

.avks-reader__nav button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #fff;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: .2s;
    font-family: inherit;
}

.avks-reader__nav button:hover:not(:disabled) {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
}

.avks-reader__nav button:disabled {
    opacity: .4;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .avks-reader__body { padding: 24px 20px; }
    .avks-reader__bar { padding: 12px 16px; }
    .avks-reader__bar-right h3 { font-size: 13px; }
    .avks-reader__nav { padding: 12px 16px; }
    .avks-reader__nav button { padding: 10px 14px; font-size: 12px; }
}