@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;600;700&family=Literata:opsz,wght@7..72,300;7..72,400;7..72,500;7..72,600;7..72,700&family=Patrick+Hand&family=Kalam:wght@400;700&family=Noto+Serif:wght@400;700&family=Roboto:wght@400;500;700&family=Open+Sans:wght@400;600;700&family=Lato:wght@400;700&family=Roboto+Mono:wght@400;500&display=swap');

#text-chapter-toolbar,
.reading-content .logo-chapter-toolbar,
.c-blog-post .logo-chapter-toolbar,
.go-to-top {
    display: none !important;
}

#lrs-coins-btn {
    position: fixed;
    bottom: 85px;
    left: 70px;
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99997;
    box-shadow: 0 4px 20px rgba(245,158,11,0.5);
}

#lrs-coins-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(245,158,11,0.7);
}

#lrs-info-btn {
    position: fixed;
    bottom: 85px;
    left: 20px;
    width: 42px;
    height: 42px;
    background: rgba(0,0,0,0.95);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99997;
    box-shadow: 0 2px 20px rgba(0,0,0,0.5);
}

#lrs-info-btn:hover {
    background: rgba(255,255,255,0.2) !important;
    transform: scale(1.05);
}

#lrs-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.95);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 99998;
    box-shadow: 0 -2px 20px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}

#lrs-toolbar.hide {
    transform: translateY(100%);
}

#lrs-info-btn.hide,
#lrs-coins-btn.hide {
    opacity: 0;
    visibility: hidden;
}

#lrs-aa-btn {
    width: 48px;
    height: 48px;
    background: #DC2626;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(220,38,38,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#lrs-aa-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(220,38,38,0.6);
}

#lrs-chapters-btn,
#lrs-scroll-top {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#lrs-chapters-btn:hover,
#lrs-scroll-top:hover {
    background: rgba(255,255,255,0.2) !important;
    transform: scale(1.05);
}

#lrs-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 340px;
    background: rgba(26,26,26,0.95);
    backdrop-filter: blur(16px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7);
    z-index: 1000001;
    transition: all 0.4s;
    opacity: 0;
    visibility: hidden;
    max-height: 90vh;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}

#lrs-panel.active {
    transform: translate(-50%, -50%) scale(1) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.lrs-panel-inner {
    padding: 18px;
    max-height: 90vh;
    overflow-y: auto;
}

.lrs-setting-group {
    margin-bottom: 16px;
}

.lrs-label {
    color: rgba(255,255,255,0.9);
    font-size: 13px;
    font-weight: 600;
    display: block;
    margin-bottom: 10px;
}

.lrs-themes-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.lrs-theme {
    background: rgba(255,255,255,0.03);
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 8px 2px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.lrs-theme:hover {
    background: rgba(102,126,234,0.1) !important;
    border-color: rgba(102,126,234,0.6) !important;
    transform: translateY(-2px);
}

.lrs-theme.active {
    border-color: #667eea !important;
    background: rgba(102,126,234,0.15) !important;
}

.lrs-theme-preview {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin: 0 auto 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.lrs-theme-preview span {
    font-size: 13px;
    font-weight: 700;
    font-family: Arial;
}

.lrs-theme-name {
    font-size: 9px;
    color: rgba(255,255,255,0.7);
    font-weight: 500;
    display: block;
}

#lrs-font {
    width: 100%;
    padding: 9px 14px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    padding-right: 40px;
}

#lrs-font:hover {
    border-color: rgba(102,126,234,0.5);
    background-color: rgba(255,255,255,0.15);
}

#lrs-font:focus {
    border-color: #667eea;
    background-color: rgba(255,255,255,0.15);
}

#lrs-font option {
    background: #1a1a1a;
    color: #fff;
    padding: 8px;
}

.lrs-control-row {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.lrs-control-row button {
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lrs-control-row button:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(102,126,234,0.5);
}

.lrs-control-row span {
    min-width: 45px;
    text-align: center;
    color: #fff;
    font-size: 17px;
    font-weight: 600;
}

.lrs-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
}

.lrs-toggle-row span {
    color: rgba(255,255,255,0.8);
    font-size: 13px;
}

.lrs-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.lrs-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.lrs-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transition: 0.3s;
    border-radius: 26px;
    background-color: rgba(30,30,30,0.9);
}

.lrs-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.lrs-switch input:checked + .lrs-slider {
    background-color: #667eea !important;
}

.lrs-switch input:checked + .lrs-slider:before {
    transform: translateX(22px);
}

#lrs-reset-btn {
    width: 100%;
    padding: 11px;
    background: rgba(220,38,38,0.15);
    border: 1px solid rgba(220,38,38,0.3);
    border-radius: 6px;
    color: #DC2626;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

#lrs-reset-btn:hover {
    background: rgba(220,38,38,0.25);
    border-color: rgba(220,38,38,0.5);
}

#lrs-chapters-panel {
    position: fixed;
    top: 0;
    right: -420px;
    width: 380px;
    height: 100vh;
    background: rgba(26,26,26,0.98);
    backdrop-filter: blur(16px);
    box-shadow: none;
    z-index: 1000001;
    transition: right 0.4s ease;
    border-left: 1px solid rgba(255,255,255,0.1);
    overflow: hidden;
    visibility: hidden;
}

#lrs-chapters-panel.active {
    right: 0 !important;
    visibility: visible !important;
    box-shadow: -5px 0 30px rgba(0,0,0,0.7);
}

.lrs-chapters-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lrs-chapters-header h3 {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

#lrs-chapters-close {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

#lrs-chapters-close:hover {
    background: rgba(255,255,255,0.2);
}

#lrs-chapters-list {
    padding: 0;
    height: calc(100vh - 80px);
    overflow-y: auto;
}

#lrs-chapters-list::-webkit-scrollbar {
    width: 8px;
}

#lrs-chapters-list::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}

#lrs-chapters-list::-webkit-scrollbar-thumb {
    background: rgba(102,126,234,0.5);
    border-radius: 4px;
}

#lrs-chapters-list::-webkit-scrollbar-thumb:hover {
    background: rgba(102,126,234,0.7);
}

#lrs-chapters-overlay,
#lrs-settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1000000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

#lrs-chapters-overlay.active,
#lrs-settings-overlay.active {
    opacity: 1 !important;
    visibility: visible !important;
}

.lrs-content {
    transition: all 0.3s ease;
    padding: 40px 20px;
    padding-bottom: 100px;
    text-align: left !important;
}

.lrs-content * {
    text-align: left !important;
}

.lrs-content h1,
.lrs-content h2,
.lrs-content h3,
.lrs-content h4,
.lrs-content h5,
.lrs-content h6,
.lrs-content p,
.lrs-content span,
.lrs-content div,
.lrs-content strong,
.lrs-content em {
    color: inherit !important;
}

.lrs-content[data-theme="dark"] {
    background: #1a1a1a !important;
    color: #e5e5e5 !important;
}

.lrs-content[data-theme="pure-dark"] {
    background: #070707 !important;
    color: #ffffff !important;
}

.lrs-content[data-theme="night"] {
    background: #0f172a !important;
    color: #cbd5e1 !important;
}

.lrs-content[data-theme="dusk"] {
    background: #2d2d2d !important;
    color: #d1d1d1 !important;
}

.lrs-content[data-theme="sepia"] {
    background: #f4ecd8 !important;
    color: #5c4a3a !important;
}

.lrs-content[data-theme="silver"] {
    background: #e8e8e8 !important;
    color: #2d2d2d !important;
}

.lrs-content[data-theme="light"] {
    background: #ffffff !important;
    color: #1a1a1a !important;
}

/* Optimized Chapter List Items */
.lrs-chapter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border-radius: 0;
    margin-bottom: 0;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    color: rgba(255,255,255,0.9);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    border-left: 3px solid transparent;
    position: relative;
}

.lrs-chapter-item:hover {
    background: rgba(255,255,255,0.05);
}

.lrs-chapter-item.current {
    background: rgba(102,126,234,0.15);
    border-left-color: #667eea;
}

.lrs-chapter-item.read {
    opacity: 0.7;
}

.lrs-chapter-item.premium {
    border-left-color: #f8b500;
}

.lrs-chapter-item.purchased {
    border-left-color: #10b981;
}

/* Coin badge */
.lrs-ch-coin {
    display: flex;
    align-items: center;
    gap: 3px;
    background: #f8b500;
    color: #1a1a2e;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

/* Unlocked badge */
.lrs-ch-unlocked {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #10b981;
    padding: 4px 5px;
    border-radius: 4px;
    flex-shrink: 0;
}

.lrs-ch-unlocked i {
    font-size: 11px;
    color: #fff;
}

/* Chapter name */
.lrs-ch-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}

.lrs-chapter-item.read .lrs-ch-name {
    color: #888;
}

/* Lock icon */
.lrs-ch-lock {
    flex-shrink: 0;
    margin-left: auto;
}

/* Chapter meta */
.lrs-ch-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

/* Read mark */
.lrs-ch-read {
    display: flex;
    align-items: center;
    color: #10b981;
    font-size: 10px;
}

/* Free after badge */
.lrs-ch-free-after {
    font-size: 10px;
    color: #10b981;
    font-weight: 600;
}

/* Chapter date */
.lrs-ch-date {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
}

.lrs-chapter-separator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    margin: 30px 0;
}

.lrs-chapter-separator::before,
.lrs-chapter-separator::after {
    content: '';
    flex: 1;
    max-width: 150px;
    height: 2px;
    background: linear-gradient(to right, transparent, #DC2626, transparent);
}

.lrs-chapter-separator span {
    padding: 0 20px;
    color: #DC2626;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 4px;
    text-transform: uppercase;
    white-space: nowrap;
}

.lrs-loading {
    text-align: center;
    padding: 40px;
    color: rgba(255,255,255,0.5);
    font-size: 14px;
}

.lrs-volume-header {
    padding: 15px 20px;
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.9);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
}

.lrs-volume-header:hover {
    background: rgba(255,255,255,0.05);
}

.lrs-volume-header svg {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.lrs-volume-header.collapsed svg {
    transform: rotate(-90deg);
}

.lrs-volume-chapters {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.lrs-volume-chapters.collapsed {
    max-height: 0;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lrs-chapter-item,
.lrs-volume-header {
    animation: fadeInUp 0.3s ease forwards;
}

@media (max-width: 768px) {
    #lrs-toolbar {
        padding: 12px 15px;
        gap: 10px;
        flex-wrap: wrap;
    }

    #lrs-aa-btn,
    #lrs-scroll-top,
    #lrs-chapters-btn {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        padding: 0 !important;
    }

    #lrs-aa-btn {
        font-size: 16px;
    }

    #lrs-info-btn {
        bottom: 80px;
        left: 10px;
        width: 38px !important;
        height: 38px !important;
    }

    #lrs-coins-btn {
        bottom: 80px;
        left: 55px;
        width: 38px !important;
        height: 38px !important;
    }

    .lrs-chapter-separator {
        padding: 20px 10px;
        margin: 20px 0;
    }

    .lrs-chapter-separator::before,
    .lrs-chapter-separator::after {
        max-width: 80px;
    }

    .lrs-chapter-separator span {
        font-size: 13px;
        letter-spacing: 2px;
        padding: 0 12px;
    }

    #lrs-panel {
        width: 90%;
        max-width: 90%;
        max-height: 85vh;
    }

    .lrs-panel-inner {
        padding: 20px !important;
    }

    .lrs-content {
        padding: 20px 15px;
        padding-bottom: 90px;
    }

    #lrs-chapters-panel {
        width: 100%;
        right: -105%;
    }

    .lrs-chapters-header h3 {
        font-size: 18px;
    }

    .lrs-chapter-item {
        padding: 14px 20px;
        font-size: 15px;
    }

    .lrs-chapter-item.locked {
        padding-right: 50px;
    }

    .lrs-volume-header {
        padding: 16px 20px;
        font-size: 12px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    #lrs-info-btn {
        left: 20px;
        bottom: 85px;
    }

    #lrs-coins-btn {
        left: 70px;
        bottom: 85px;
    }

    #lrs-panel {
        width: 400px;
        max-height: 600px;
    }

    #lrs-chapters-panel {
        width: 400px;
        right: -430px;
    }
}

@media (min-width: 1025px) {
    #lrs-info-btn {
        left: 20px;
        bottom: 85px;
    }

    #lrs-coins-btn {
        left: 70px;
        bottom: 85px;
    }

    #lrs-panel {
        width: 380px;
        max-height: 650px;
    }

    #lrs-chapters-panel {
        width: 420px;
        right: -450px;
    }
}
