:root {
    --primary-bg: #121212;
    --secondary-bg: #1e1e1e;
    --accent-gold: #bb86fc;
    /* Using homepage accent color */
    --text-primary: #e0e0e0;
    --text-secondary: #aaaaaa;
    --glass-bg: rgba(30, 30, 30, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    display: flex;
}

/* Sidebar / Menu */
#sidebar {
    width: 300px;
    background: var(--secondary-bg);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.3s ease;
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
    background: linear-gradient(to bottom, rgba(15, 23, 42, 0.9), transparent);
}

.sidebar-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-gold);
    text-transform: uppercase;
}

.chapter-item {
    padding: 15px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.chapter-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.chapter-item.active {
    background: rgba(251, 191, 36, 0.1);
    border-color: var(--accent-gold);
}

.chapter-number {
    font-weight: 600;
    color: var(--text-primary);
    display: block;
}

.chapter-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main Reader Area */
#main-content {
    flex: 1;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    background-image: radial-gradient(circle at center, #1e1e1e 0%, #121212 100%);
}

#reader-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    scroll-behavior: smooth;
}

.manga-page {
    max-width: 100%;
    height: auto;
    margin-bottom: 0;
    /* Continuous scroll */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    display: block;
}

/* Loading State */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: var(--accent-gold);
    font-size: 1.2rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #sidebar {
        position: fixed;
        transform: translateX(-100%);
        width: 80%;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.5);
    }

    #sidebar.open {
        transform: translateX(0);
    }

    #mobile-menu-toggle {
        display: block;
        position: fixed;
        bottom: 20px;
        right: 20px;
        background: var(--accent-gold);
        color: var(--primary-bg);
        width: 50px;
        height: 50px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
        z-index: 200;
        border: none;
        cursor: pointer;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--primary-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-bg);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold);
}