:root {
    --bg-color: #2c1a0e;
    --parchment-color: #fdf5e6;
    --text-color: #3e2723;
    --accent-color: #d84315;
    --highlight-color: #ffb300;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: 'Balsamiq Sans', cursive;
    background-color: var(--bg-color);
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><rect width="100" height="100" fill="%232c1a0e"/><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.2"/></svg>');
    overflow: hidden;
    color: var(--text-color);
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease-in-out;
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
}

/* Intro Screen */
.book-cover {
    background-color: var(--parchment-color);
    padding: 3rem 4rem;
    border-radius: 12px;
    box-shadow: inset 0 0 40px rgba(139, 69, 19, 0.4), 0 10px 30px rgba(0, 0, 0, 0.8);
    text-align: center;
    max-width: 600px;
    border: 8px solid #5d4037;
    position: relative;
}

.book-cover::before {
    content: '';
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
    border: 2px dashed #ffcc80;
    border-radius: 16px;
    pointer-events: none;
}

h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.book-cover p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: #5d4037;
}

button {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: bold;
    padding: 1rem 2rem;
    border: none;
    background: linear-gradient(145deg, var(--accent-color), #bf360c);
    color: white;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(216, 67, 21, 0.5);
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(216, 67, 21, 0.7);
}

/* Slide Container */
.navigation-overlay {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(253, 245, 230, 0.2);
    backdrop-filter: blur(5px);
    color: white;
    font-size: 3rem;
    padding: 1rem;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.3);
    z-index: 10;
}

.nav-btn:hover {
    background: rgba(253, 245, 230, 0.5);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

#prev-btn { left: 20px; }
#next-btn { right: 20px; }

#slide-container {
    width: 85%;
    height: 85%;
    background-color: var(--parchment-color);
    border-radius: 12px;
    box-shadow: inset 0 0 60px rgba(139, 69, 19, 0.2), 0 15px 40px rgba(0, 0, 0, 0.6);
    position: relative;
    overflow: hidden;
}

/* Slides */
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: translateX(50px);
    pointer-events: none;
}

.slide.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.slide.exit {
    opacity: 0;
    transform: translateX(-50px);
}

.slide-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.slide-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    color: var(--accent-color);
    margin: 0;
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
    padding-bottom: 0.5rem;
}

.slide-content {
    display: flex;
    flex: 1;
    gap: 2rem;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.slide-images {
    display: flex;
    gap: 1.5rem;
    flex: 1;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.image-container {
    flex: 1;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border: 4px solid #fff;
    transition: transform 0.3s;
}

.image-container img:hover {
    transform: scale(1.02);
}

.single-image .image-container img {
    max-width: 80%;
}

.slide-text-container {
    background: rgba(255, 255, 255, 0.6);
    padding: 1.5rem 2rem;
    border-radius: 12px;
    border-left: 6px solid var(--highlight-color);
    font-size: 1.4rem;
    line-height: 1.6;
    margin-top: 1.5rem;
    max-height: 30%;
    overflow-y: auto;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* Scrollbar for text */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(139, 69, 19, 0.3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(139, 69, 19, 0.6); }

@media (max-width: 1024px) {
    .slide-content { flex-direction: column; }
    .slide-images { height: 50%; width: 100%; }
    .slide-text-container { max-height: 40%; font-size: 1.2rem; }
    .slide-title { font-size: 1.8rem; }
}

@media (max-width: 768px) {
    .book-cover { padding: 2rem; }
    h1 { font-size: 2rem; }
    .nav-btn { width: 50px; height: 50px; font-size: 1.5rem; }
    #slide-container { width: 100%; height: 100%; border-radius: 0; }
    .slide-images { flex-direction: column; }
}
