:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    background-color: #f5f6fa;
}

.nav-menu {
    background: var(--primary-color);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    top: 10px;
    z-index: 100;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    transition: all 0.3s;
}

.nav-link:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
}

.file-structure {
    margin-bottom: 30px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

details {
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

summary {
    padding: 10px;
    background: #f8f9fa;
    cursor: pointer;
    font-weight: 500;
}

.book-section {
    background: white;
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.verse {
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border-left: 4px solid var(--accent-color);
    border-radius: 3px;
}

.file-list {
    list-style-type: none;
    padding-left: 20px;
}

.file-list li::before {
    content: "📄";
    margin-right: 8px;
}

@media (max-width: 768px) {
    .nav-menu {
        position: static;
        flex-direction: column;
    }
    .book-section {
        padding: 15px;
    }
}

.stats {
    background: white;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    font-weight: bold;
    color: var(--primary-color);
}

.custom-text {
    background: white;
    padding: 20px;
    margin-bottom: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.custom-text h2 {
    color: var(--primary-color);
    margin-top: 0;
}

.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
    transition: opacity 0.3s ease-in-out;
}

.scroll-to-top:hover {
    background: #0056b3;
}

@media (max-width: 600px) {
    .scroll-to-top {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
}

/* Красивые ссылки */
a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease-in-out;
}

a:hover {
    color: #ff4500;
}

a:active {
    color: #ff6347;
}

.chapters-nav { 
    margin: 15px 0; 
    padding: 10px; 
    background: #f5f5f5; 
    border-radius: 5px; 
}

.chapter-link { 
    display: inline-block;
    margin: 3px;
    padding: 5px 10px;
    background: #e9ecef;
    border-radius: 3px;
    text-decoration: none;
    color: #2c3e50;
}

.chapter-link:hover { 
    background: #dee2e6; 
}

.chapter-section { 
    margin-top: 20px; 
    padding-top: 10px; 
    border-top: 1px solid #ddd; 
}

.chapter-title {
    font-size: 1.3em;
    color: #2c3e50;
    margin: 15px 0;
    padding-bottom: 5px;
    border-bottom: 2px solid #3498db;
}

/* Стили для динамической загрузки */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,0,0,.3);
    border-radius: 50%;
    border-top-color: #007bff;
    animation: spin 1s ease-in-out infinite;
    vertical-align: middle;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#loading-indicator {
    position: fixed;
    top: 10px;
    right: 10px;
    background: white;
    border: 1px solid #ddd;
    padding: 5px 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: none;
    z-index: 1000;
}

.book-content {
    display: none;
}

.book-content.active {
    display: block;
}

.chapter-content {
    display: none;
}

.chapter-content.active {
    display: block;
}

/* Активные элементы */
.nav-link.active {
    background-color: var(--accent-color);
}

.chapter-link.active {
    background-color: var(--accent-color);
    color: white;
}

/* Стили для сообщений об ошибках */
.error-message {
    padding: 15px;
    margin: 15px 0;
    background-color: #ffdddd;
    color: #990000;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Улучшения для мобильных устройств */
@media (max-width: 768px) {
    #loading-indicator {
        top: 5px;
        right: 5px;
        font-size: 14px;
    }
    
    .chapter-link {
        padding: 4px 8px;
        margin: 2px;
        font-size: 0.9em;
    }
}

/* Улучшения для мобильных устройств */
@media (max-width: 768px) {
  /* Уменьшаем отступы для экономии места */
  body {
    padding: 10px;
  }
  
  /* Уменьшаем размер основного контента */
  .book-section, .custom-text, .file-structure, .stats {
    padding: 15px 10px;
    margin-bottom: 15px;
  }
  
  /* Улучшаем навигацию по главам */
  .chapters-nav {
    padding: 8px 5px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  
  .chapter-link {
    font-size: 0.9em;
    padding: 4px 8px;
    margin: 3px;
    min-width: 24px;
    text-align: center;
  }
  
  /* Более компактные стихи */
  .verse {
    padding: 8px;
    margin: 8px 0;
  }
}