* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Naskh Arabic', serif;
    background: linear-gradient(135deg, #d4c7a3 0%, #b89f76 100%);
    color: #333;
    direction: rtl;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

.book-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 2000px;
    background: url('https://www.transparenttextures.com/patterns/paper-fibers.png');
}

/* استایل کتاب */
.book {
    width: 80%;
    max-width: 600px;
    height: 85vh;
    position: relative;
    transform-style: preserve-3d;
    background: #e6d9c6;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.pages {
    width: 100%;
    height: 100%;
    position: relative;
}

.page {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #fffdf7;
    border: 2px solid #d3c8a6;
    border-radius: 10px;
    box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.2);
    padding: 30px;
    overflow-y: auto;
    transition: transform 1s ease, opacity 0.5s ease;
    transform-origin: right center;
    backface-visibility: hidden;
    opacity: 0;
    z-index: 1;
}

.page.active {
    opacity: 1;
    transform: rotateY(0deg);
    z-index: 2;
}

.page.next {
    transform: rotateY(180deg);
    opacity: 0;
}

.page.prev {
    transform: rotateY(-180deg);
    opacity: 0;
}

/* دکمه‌های ناوبری */
.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 215, 0, 0.8);
    border: none;
    color: #fff;
    font-size: 24px;
    padding: 15px;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.nav-button:hover {
    background: #ffd700;
    transform: translateY(-50%) scale(1.1);
}

.nav-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

#prev-page { right: 10px; }
#next-page { left: 10px; }

/* فهرست شناور */
.toc-button {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #2a5298;
    color: #ffd700;
    border: none;
    padding: 15px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
}

.toc-button:hover {
    transform: scale(1.1);
    background: #1e3c72;
}

.toc-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    padding: 20px;
    transition: right 0.3s ease;
    z-index: 99;
}

.toc-menu.active {
    right: 0;
}

.toc-menu h3 {
    color: #ffd700;
    margin-bottom: 20px;
}

#toc-list {
    list-style: none;
}

#toc-list li {
    padding: 10px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

#toc-list li:hover {
    background: rgba(255, 215, 0, 0.2);
}

/* تنظیمات */
.settings-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #2a5298;
    color: #ffd700;
    border: none;
    padding: 15px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
}

.settings-button:hover {
    transform: scale(1.1);
    background: #1e3c72;
}

.settings-panel {
    position: fixed;
    bottom: 0;
    right: -300px;
    width: 300px;
    background: rgba(0, 0, 0, 0.9);
    padding: 20px;
    transition: right 0.3s ease;
    z-index: 99;
}

.settings-panel.active {
    right: 0;
}

.settings-panel h3 {
    color: #ffd700;
    margin-bottom: 20px;
}

.settings-panel label {
    display: block;
    margin: 10px 0 5px;
    color: #fff;
}

.settings-panel input[type="range"],
.settings-panel input[type="color"] {
    width: 100%;
}

#close-settings {
    background: #ffd700;
    color: #000;
    border: none;
    padding: 10px;
    width: 100%;
    margin-top: 20px;
    border-radius: 10px;
    cursor: pointer;
}

/* استایل محتوا */
.page h2 {
    color: #2a5298;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.page p {
    line-height: 2;
}

.page blockquote {
    background: #f5f1e9;
    padding: 15px;
    border-right: 4px solid #ffd700;
    margin: 15px 0;
    border-radius: 8px;
}

.page-number {
    position: absolute;
    bottom: 10px;
    left: 10px;
    font-size: 0.8em;
    color: #666;
}

/* رسپانسیو */
@media (max-width: 600px) {
    .book { 
        width: 90%; 
        height: 90vh; 
        max-width: 100%; 
    }
    .page { 
        padding: 20px; 
        border-radius: 5px; 
    }
    .nav-button { 
        font-size: 18px; 
        padding: 10px; 
    }
    #prev-page { right: 5px; }
    #next-page { left: 5px; }
}

/* استایل‌های قبلی بدون تغییر */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Naskh Arabic', serif;
    background: linear-gradient(135deg, #d4c7a3 0%, #b89f76 100%);
    color: #333;
    direction: rtl;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* بقیه استایل‌های قبلی بدون تغییر */

/* استایل پخش‌کننده صوتی */
.audio-player {
    margin-top: 20px;
    text-align: center;
}

.audio-player audio {
    display: none; /* تگ audio رو مخفی می‌کنیم و فقط دکمه رو نشون می‌دیم */
}

.play-pause-button {
    background: #2a5298;
    color: #ffd700;
    border: none;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

.play-pause-button:hover {
    background: #1e3c72;
    transform: scale(1.1);
}

/* استایل‌های قبلی بدون تغییر */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Naskh Arabic', serif;
    background: linear-gradient(135deg, #d4c7a3 0%, #b89f76 100%);
    color: #333;
    direction: rtl;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* استایل پخش‌کننده صوتی ثابت */
.audio-player-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

#play-pause-button {
    background: #2a5298;
    color: #ffd700;
    border: none;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
}

#play-pause-button:hover {
    background: #1e3c72;
    transform: scale(1.1);
}

#progress-bar {
    width: 300px;
    height: 5px;
    background: #ccc;
    border-radius: 5px;
    cursor: pointer;
}

#progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 15px;
    height: 15px;
    background: #ffd700;
    border-radius: 50%;
}

#current-time, #duration {
    color: #fff;
    font-size: 14px;
}

/* بقیه استایل‌های قبلی بدون تغییر */

