body {
    font-family: Arial, sans-serif;
    text-align: center;
    padding: 10px;
    margin: 0;
    background: #f4f4f4;
    overflow-x: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

h1 {
    margin-bottom: 10px;
}

/* Кнопки слева сверху */
.control-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 1px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    user-select: none;
}

.book-container {
    flex: 1;
    position: relative;
    width: 100%;
    max-height: calc(100vh - 120px);
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
}

#pdf-render {
    border: 1px solid #ccc;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

/* Стрелки по бокам — стиль "плавающие иконки" */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    color: rgba(0, 0, 0, 0.6);
    font-size: 36px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    user-select: none;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
}

.nav-arrow:hover {
    color: #007cba;
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#prev {
    left: 10%;
}

#next {
    right: 10%;
}

/* Вертикальная панель слева сверху */
.controls-panel {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10;
}

.control-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 1px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    user-select: none;
}

.control-btn2 {
    width: auto;
    height: 40px;
    display: grid;
    grid-template-columns: 30px auto;
    align-items: center;
    color: #333;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    user-select: none;
    text-align: justify;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.control-btn span {
    font-size: 18px;
}

/* Навигация по миниатюрам (для второй страницы с картинками) */
.thumbnails-nav {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.8);
    padding: 10px 15px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(6px);
}

.thumb-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.thumb-img {
    width: 40px;
    height: 40px;
    border: 2px solid transparent;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    pointer-events: auto;
}

.thumb-img:hover,
.thumb-img.active {
    border-color: #007cba;
    transform: scale(1.1);
}

.thumb-label {
    margin-top: 5px;
    font-size: 12px;
    font-weight: bold;
    color: #333;
}

/* Кнопка увеличения/уменьшения */
.zoom-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: 1px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    user-select: none;
}

.zoom-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Индикатор загрузки */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 20;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

#header {
    height: 50px;
    background-color: white;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: 2fr repeat(2, 2fr);
    align-items: center;
}

.logo {
    height: 100%;
    max-height: 44px;
    max-width: 166px;
    float: left;
    margin-left: 10px;
}

#canvas-wrapper {
    width: 100%;
    height: 100%;
    overflow: auto;
    position: relative;
    cursor: pointer; /* ← добавлено */
}

#header-page {
    font-size: 14px;
    font-weight: 700;
    line-height: 48px;
    text-align: center;
}

.burger-container {
    position: absolute;
    top: 20px;
    left: 55%;
    z-index: 20;
}

.burger {
    width: 30px;
    height: 22px;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4px;
    box-sizing: content-box;
}

.burger span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
    position: relative;
}

/* Анимация при клике */
.burger.active span:nth-child(1) {
    transform: rotate(45deg);
    top: 8px;
}

.burger.active span:nth-child(2) {
    opacity: 0;
}

.burger.active span:nth-child(3) {
    transform: rotate(-45deg);
    bottom: 8px;
}

/* Выпадающее меню */
.dropdown-menu {
    position: absolute;
    top: 40px;
    left: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 200px;
    padding: 8px 0;
    list-style: none;
    display: none;
    z-index: 30;
    backdrop-filter: blur(4px);
}

.dropdown-menu a {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s ease;
}

.dropdown-menu a:hover {
    background: #f4f4f4;
    color: #007cba;
}

.dropdown-menu a:last-child {
    margin-top: 4px;
    border-top: 1px solid #eee;
}

.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background: white;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    max-height: 90vh;
    overflow-y: auto;
}

.popup-content h3,
.popup-content p {
    padding: 20px;
    margin: 0;
    font-size: 48px;
    font-weight: bold;
}

.popup-content ul {
    list-style: disc;
    padding-left: 40px;
    margin: 0 0 20px 20px;
}

.popup-content a {
    color: #1a73e8;
    text-decoration: none;
}

.popup-content a:hover {
    text-decoration: underline;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 28px;
    color: #aaa;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
}

.close-btn:hover,
.close-btn:focus {
    color: #000;
    outline: none;
}

#loading-progress {
    transition: opacity 0.3s ease;
    font-family: Arial, sans-serif;
    pointer-events: none;
}