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

:root {
    --primary-color: #3a3238;
    --accent-color: #c19875;
    --page-color: #f8f5f0;
    --text-color: #3a3238;
    --border-color: #e6e0d4;
    --error-color: #c02b2b;
}

body {
    font-family: 'Source Serif 4', serif;
    background-color: #eae7de;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background-image: linear-gradient(135deg, #eae7de, #d5cfc2);
}

.book-container {
    width: 100%;
    max-width: 1400px;
    display: flex;
    height: 90vh;
}

/* Side panel for story navigation */
.story-nav {
    width: 320px;
    background-color: var(--primary-color);
    border-radius: 8px 0 0 8px;
    padding: 30px;
    color: var(--page-color);
    box-shadow: -10px 10px 30px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.story-nav h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: var(--accent-color);
    letter-spacing: 1px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.story-list {
    list-style: none;
}

.story-list-item {
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: color 0.3s;
}

.story-list-item:hover {
    color: var(--accent-color);
}

.story-list-item.active {
    color: var(--accent-color);
    font-weight: 600;
}

/* Book design */
.book {
    flex: 1;
    display: flex;
    background: transparent;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
}

/* Left page */
.book-cover {
    width: 100px;
    background: linear-gradient(to right, #8c7a6b, #a89688);
    position: relative;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 8px 0 0 8px;
}

.book-cover h1 {
    transform: rotate(-90deg);
    white-space: nowrap;
    color: var(--page-color);
    font-size: 2rem;
    letter-spacing: 2px;
    margin-bottom: 30px;
    font-family: 'Playfair Display', serif;
    font-weight: 600;
}

.author {
    transform: rotate(-90deg);
    white-space: nowrap;
    font-style: italic;
    color: rgba(248, 245, 240, 0.8);
    font-size: 1.2rem;
    font-family: 'Playfair Display', serif;
}

/* Right page - content */
.page-content {
    flex: 1;
    padding: 50px 70px;
    background-color: var(--page-color);
    position: relative;
    overflow: auto;
    border-radius: 0 8px 8px 0;
    box-shadow: inset 5px 0 20px rgba(0, 0, 0, 0.05);
}

/* Book binding effect */
.page-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 100%;
    background: linear-gradient(to right, 
        rgba(0,0,0,0.1) 0%, 
        rgba(0,0,0,0) 100%);
    z-index: 1;
}

#story-container {
    line-height: 1.9;
    margin-bottom: 30px;
    font-size: 1.15rem;
    transition: opacity 0.5s;
    height: calc(90vh - 120px);
    overflow-y: auto;
    padding-right: 20px;
    letter-spacing: 0.02em;
}

#story-container::-webkit-scrollbar {
    width: 6px;
}

#story-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 3px;
}

#story-container::-webkit-scrollbar-thumb {
    background: rgba(193, 152, 117, 0.5);
    border-radius: 3px;
}

#story-container::-webkit-scrollbar-thumb:hover {
    background: rgba(193, 152, 117, 0.8);
}

.story {
    margin-bottom: 50px;
}

.story-title {
    font-size: 2.2rem;
    margin-bottom: 30px;
    color: var(--primary-color);
    position: relative;
    font-weight: 700;
    font-family: 'Playfair Display', serif;
}

.story-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100px;
    height: 2px;
    background: var(--accent-color);
}

.story-content {
    text-align: justify;
    column-width: 350px;
    column-gap: 50px;
    column-rule: 1px solid var(--border-color);
}

.story-content p {
    margin-bottom: 1.4rem;
    text-indent: 1.8rem;
    font-size: 1.1rem;
    line-height: 1.85;
}

.story-content p:first-of-type::first-letter {
    font-size: 4rem;
    float: left;
    line-height: 0.8;
    margin-right: 0.15em;
    color: var(--accent-color);
    font-family: 'Playfair Display', serif;
    font-weight: 600;
}

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    height: 70px;
    position: sticky;
    bottom: 0;
    background: var(--page-color);
}

button {
    background: var(--accent-color);
    color: var(--page-color);
    border: none;
    padding: 10px 22px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Source Serif 4', serif;
    transition: all 0.3s;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

button:hover {
    background: #ab7f5e;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

button:disabled {
    background: #d5cfc2;
    color: #a39e8e;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#page-num {
    font-style: italic;
    color: #8c7a6b;
    font-size: 1.1rem;
}

/* Error message */
.error {
    color: var(--error-color);
    font-size: 1.1rem;
    text-align: center;
    padding: 2rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: rgba(192, 43, 43, 0.05);
    margin: 2rem auto;
}

/* Screen size warning */
.screen-warning {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);
    color: var(--page-color);
    z-index: 1000;
    padding: 2rem;
    text-align: center;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.screen-warning h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
}

.screen-warning p {
    font-size: 1.2rem;
    max-width: 500px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

.screen-warning-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
}

/* Continue anyway button styling */
#continue-anyway-btn {
    margin-top: 1.5rem;
    background-color: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    padding: 12px 24px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

#continue-anyway-btn:hover {
    background-color: var(--accent-color);
    color: var(--page-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .book-container {
        height: 92vh;
    }
    
    .page-content {
        padding: 40px 50px;
    }
    
    .story-content {
        column-width: 300px;
        column-gap: 40px;
    }
}

@media (max-width: 992px) {
    .book-container {
        flex-direction: column;
        height: auto;
    }
    
    .story-nav {
        width: 100%;
        border-radius: 8px 8px 0 0;
        max-height: 200px;
    }
    
    .book {
        border-radius: 0 0 8px 8px;
    }
    
    .book-cover {
        display: none;
    }
    
    .page-content {
        border-radius: 0 0 8px 8px;
    }
    
    #story-container {
        height: 60vh;
    }
}

@media (max-width: 768px) {
    .page-content {
        padding: 30px;
    }
    
    .story-content {
        column-width: auto;
        column-count: 1;
    }
    
    .screen-warning {
        display: flex;
    }
    
    /* Hide the main content when showing the warning */
    .book-container {
        display: none;
    }
} 