body {
    margin: 0;
    padding: 0;
    background-color: #2a2a2a;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    overflow: hidden;
    padding-bottom: 50px;
    box-sizing: border-box;
}

.container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
    height: calc(100vh - 50px);
}

.flip-book {
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    visibility: hidden;
    margin: 0 auto;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
}

.flip-book-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    perspective: 2000px;
}

.loading {
    color: white;
    font-size: 24px;
    position: absolute;
}

.page {
    background-color: #fff;
    overflow: hidden;
    position: relative; /* Needed for the shadow pseudo-element */
}

.page canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    transition: background 0.3s;
    z-index: 10;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.nav-btn svg {
    fill: white;
}

/* Page flip specific styles to ensure realistic look */

/* Inner shadows for pages to simulate depth */
.stf__block {
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
}

.page.--left::after, .page.--right::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30px;
    pointer-events: none;
    z-index: 10;
}

.page.--left::after {
    right: 0;
    background: linear-gradient(to left, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.0) 100%);
}

.page.--right::after {
    left: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.0) 100%);
}

/* Toolbar Styles */
.bottom-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background-color: #1a1a1a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
    border-top: 1px solid #333;
    z-index: 100;
}

.toolbar-left {
    flex: 1;
    display: flex;
    gap: 10px;
}

.toolbar-right {
    flex: 1;
}

.toolbar-center {
    display: flex;
    align-items: center;
    gap: 15px;
}

.tool-btn {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    border-radius: 4px;
    transition: background 0.2s;
}

.tool-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.tool-btn svg {
    fill: #ccc;
}
.tool-btn:hover svg {
    fill: #fff;
}

/* Text Button variant */
.text-btn {
    width: auto;
    padding: 0 16px;
    height: 40px;
    font-size: 12px;
    font-weight: bold;
}
.text-btn svg {
    margin-right: 6px;
    width: 20px;
    height: 20px;
}

/* Custom Zero-Delay Tooltip */
[data-title] {
    position: relative;
}

[data-title]::after {
    content: attr(data-title);
    position: absolute;
    bottom: 110%; /* Show right above the button */
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
    white-space: nowrap;
    pointer-events: none;
    display: none;
    z-index: 1000;
}

[data-title]:hover::after {
    display: block;
}

.page-indicator {
    color: #fff;
    background: rgba(255,255,255,0.1);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    min-width: 60px;
    text-align: center;
}

/* Catalog Modal */
.catalog-modal {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 320px;
    height: calc(100vh - 90px); /* Leave room for bottom toolbar and top padding */
    background: #1e1e1e;
    z-index: 90;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 20px rgba(0,0,0,0.8);
    border-radius: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateY(10px);
}

.catalog-modal.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.catalog-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    color: white;
}

.catalog-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: normal;
    display: flex;
    align-items: center;
}

.close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.catalog-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

/* Custom Scrollbar for Catalog */
.catalog-list::-webkit-scrollbar {
    width: 6px;
}
.catalog-list::-webkit-scrollbar-track {
    background: transparent;
}
.catalog-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.catalog-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    color: #e0e0e0;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
    font-size: 16px;
    margin-bottom: 2px;
}

.catalog-item:hover, .catalog-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.catalog-item-name {
    flex: 1;
}

.catalog-item-page {
    color: #999;
    font-size: 14px;
}

/* Download Item Links */
.download-item {
    text-decoration: none;
}