/* Global Styles */
body {
    padding-top: 60px;
    padding-bottom: 70px;
    /* Space for bottom toolbar */
    background-color: #f0f2f5;
    overflow-x: hidden;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(90deg, #0d6efd 0%, #0043a8 100%);
    color: white;
    padding: 10px 0;
    margin-bottom: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.hero-title {
    font-weight: 700;
    letter-spacing: 0.5px;
    font-size: 1.1rem;
    margin: 0;
    text-transform: uppercase;
}

.hero-section p {
    display: none;
    /* Hide subtitle for cleaner app look */
}

/* Swiper / Book Viewer Styles */
.book-viewer-container {
    width: 100%;
    height: calc(100vh - 130px);
    /* Fallback */
    height: calc(100dvh - 130px);
    /* Dynamic Viewport Height */
    margin: 0;
    position: relative;
    z-index: 10;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: height 0.3s ease;
}

.swiper-pagination {
    bottom: 20px !important;
}

.swiper {
    width: 100%;
    height: 100%;
    padding-top: 20px;
    padding-bottom: 50px;
}

.swiper-slide {
    background-position: center;
    background-size: cover;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.swiper-slide img {
    display: block;
    width: auto;
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background: transparent;
    margin: 0 auto;
    transition: all 0.3s ease;
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .swiper-slide img {
        max-width: 98%;
        /* Maximized width */
        max-height: 90%;
        /* Maximized height */
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        /* Lighter shadow for mobile */
    }

    .book-viewer-container {
        height: calc(100vh - 120px);
        /* Slightly more space */
    }
}

/* Sidebar Thumbnails */
.sidebar-thumb {
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    border-radius: 5px;
    overflow: hidden;
}

.sidebar-thumb:hover {
    transform: translateY(-3px);
}

.sidebar-thumb.active-thumb {
    border-color: #0d6efd;
    box-shadow: 0 0 10px rgba(13, 110, 253, 0.3);
}

.sidebar-thumb img {
    width: 100%;
    height: auto;
    display: block;
}

/* Toolbar Styles */
.catalog-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    height: 60px;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

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

.tool-btn {
    background: none;
    border: none;
    color: #555;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-btn:hover {
    background-color: #f0f0f0;
    color: #0d6efd;
}

.tool-btn.primary {
    background-color: #e7f1ff;
    color: #0d6efd;
}

.tool-btn.primary:hover {
    background-color: #cfe2ff;
}

/* Focus Mode (Fullscreen) Styles */
body.focus-mode .hero-section {
    transform: translateY(-100%);
}

body.focus-mode .catalog-toolbar {
    transform: translateY(100%);
}

body.focus-mode .book-viewer-container {
    height: 100vh;
    /* Fallback */
    height: 100dvh;
    padding-top: 0;
}

body.focus-mode {
    padding-top: 0;
    padding-bottom: 0;
}

/* Floating Focus Button (Mobile Only) */
.mobile-focus-btn {
    display: none;
    position: fixed;
    bottom: 80px;
    /* Above toolbar */
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #0d6efd;
    color: white;
    border: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 1100;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.mobile-focus-btn:hover {
    transform: scale(1.1);
    opacity: 1;
    background-color: #0b5ed7;
}

@media (max-width: 768px) {
    .mobile-focus-btn {
        display: flex;
    }
}

body.focus-mode .mobile-focus-btn {
    bottom: 20px;
    /* Move down when toolbar is gone */
    opacity: 0.5;
}

body.focus-mode .mobile-focus-btn:hover {
    opacity: 1;
}