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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #fafafa;
    color: #323130;
    line-height: 1.6;
}

/* Header Styles */
.shared-header {
    background-color: #ffffff;
    border-bottom: 1px solid #d2d0ce;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.header-left .home-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #323130;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.header-left .home-link:hover {
    background-color: #f3f2f1;
}

.header-right {
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background-color: #f3f2f1;
    border-radius: 6px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.avatar-placeholder {
    width: 100%;
    height: 100%;
    background-color: #0078d4;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: #323130;
}

.sign-in-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #ffffff;
    background-color: #0078d4;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.sign-in-btn:hover {
    background-color: #106ebe;
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 15px;
    }
    
    .user-name {
        display: none;
    }
    
    .header-left .home-link {
        padding: 8px 12px;
    }
}

.container {
    max-width: 90%;
    margin: 0 auto;
    padding: 20px;
}

@media (max-width: 768px) {
    .container {
        max-width: 100%;
    }
}

/* Book Header */
.book-header {
    text-align: center;
    margin-bottom: 40px;
    background-color: #f3f2f1;
    padding: 30px;
    border-radius: 8px;
}

.book-title {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #323130;
}

.author-name {
    font-size: 15px;
    font-style: italic;
    color: #605e5c;
    margin-bottom: 20px;
}

/* Section Titles */
.section-title {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
    border-bottom: 2px solid #d2d0ce;
    padding-bottom: 8px;
    margin-left: 10px;
    margin-right: 10px;
}

/* Synopsis */
.synopsis-section {
    margin-bottom: 40px;
}

.synopsis-content {
    background-color: #f3f2f1;
    padding: 20px;
    border-radius: 8px;
    margin-left: 20px;
    margin-right: 20px;
    font-size: 16px;
    line-height: 1.6;
}

.synopsis-content p {
    margin-bottom: 16px;
}

.synopsis-content p:last-child {
    margin-bottom: 0;
}

.expand-button {
    background: transparent;
    border: none;
    color: #0078d4;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    padding: 6px 16px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.expand-button:hover {
    background-color: #f3f2f1;
}

/* Chapters */
.chapters-section {
    margin-bottom: 60px;
}

.chapter-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-left: 10px;
    margin-right: 10px;
}

.chapter-item {
    display: flex;
    padding: 15px;
    align-items: center;
    background-color: #f3f2f1;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chapter-item:hover {
    background-color: #edebe9;
}

.chapter-number {
    font-weight: bold;
    color: #0078d4;
    min-width: 40px;
    margin-right: 20px;
}

.chapter-info {
    flex: 1;
}

.chapter-title {
    font-weight: 500;
}

/* Navigation */
.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 40px auto;
    max-width: 800px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 6px 16px;
    text-decoration: none;
    color: #323130;
    background-color: #ffffff;
    border-radius: 4px;
    border: 1px solid #d2d0ce;
    transition: background-color 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-link:hover {
    background-color: #f3f2f1;
}

.nav-link.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

.chapter-dropdown {
    min-width: 200px;
    max-width: 250px;
    padding: 8px 12px;
    border: 1px solid #d2d0ce;
    border-radius: 4px;
    background-color: #ffffff;
    font-size: 14px;
    cursor: pointer;
}

/* Story Content */
.story-content {
    margin: 0 auto;
    padding: 20px 30px;
    white-space: pre-wrap;
    line-height: 1.8;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
    color: #323130;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.story-content p {
    margin-bottom: 16px;
}

.story-content p:last-child {
    margin-bottom: 0;
}

.story-content h1,
.story-content h2,
.story-content h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: bold;
}

.story-content h1 {
    font-size: 24px;
}

.story-content h2 {
    font-size: 20px;
}

.story-content h3 {
    font-size: 18px;
}

.rtl-content {
    direction: rtl;
    text-align: right;
}

/* Error */
.error-container {
    text-align: center;
    color: #d13438;
    padding: 40px;
}

/* Responsive */
@media (max-width: 468px) {
    .container {
        padding: 10px;
    }
    
    .navigation {
        flex-direction: column;
        gap: 15px;
    }
    
    .chapter-dropdown {
        order: -1;
        width: 100%;
        max-width: none;
    }
    
    .story-content {
        padding: 15px 20px;
        font-size: 16px;
    }
    
    .book-title {
        font-size: 24px;
    }
}
