/* CSS Custom Properties */
:root {
    --primary-color: #1a1a1a;
    --secondary-color: #333333;
    --accent-color: #007AFF;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --background: #f5f5f5;
    --surface: #ffffff;
    --border: #e5e7eb;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 12px 48px rgba(0, 0, 0, 0.3);
    --shadow-book: 0 20px 40px rgba(0, 0, 0, 0.2);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8f9fa; /* Clean neutral background */
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Loading screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000; /* Higher than logo header */
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    text-align: center;
    color: white;
    position: relative;
}

.loader-ring {
    width: 80px;
    height: 80px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    margin: 0 auto 30px;
    position: relative;
}

.loader-ring::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    border: 3px solid transparent;
    border-bottom: 3px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: spin-reverse 0.8s linear infinite;
}

.loader-ring::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 2px solid transparent;
    border-right: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: spin 0.6s linear infinite;
}

.loader-text {
    font-size: 20px;
    font-weight: 600;
    color: white;
    animation: pulse-text 2s ease-in-out infinite;
    letter-spacing: 0.5px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes spin-reverse {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(-360deg); }
}

@keyframes pulse-text {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Loading Progress Bar */
.loader-progress {
    margin-top: 30px;
    width: 200px;
}

.loader-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.loader-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fff, rgba(255, 255, 255, 0.8));
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.loader-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.loader-progress-text {
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
    font-weight: 600;
    color: white;
}

/* Main Container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.app-container.loaded {
    opacity: 1;
}

/* Header - Minimalist */
.header {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    padding: 0;
}

.header-content {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Floating Button Style */
.floating-btn {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.floating-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.floating-btn:active {
    transform: scale(0.95);
}

/* Download button special styling */
.download-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
}

.download-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(16, 185, 129, 0.4);
}

.download-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.download-btn:active::after {
    width: 60px;
    height: 60px;
}

/* Download animation */
.download-btn.downloading {
    animation: downloadPulse 1s ease-in-out;
}

.download-btn.downloading svg {
    animation: downloadBounce 1s ease-in-out;
}

@keyframes downloadPulse {
    0%, 100% {
        box-shadow: 0 5px 20px rgba(16, 185, 129, 0.4);
    }
    50% {
        box-shadow: 0 5px 30px rgba(16, 185, 129, 0.6);
    }
}

@keyframes downloadBounce {
    0%, 100% {
        transform: translateY(0);
    }
    25% {
        transform: translateY(2px);
    }
    75% {
        transform: translateY(-2px);
    }
}

/* Reader Container */
.reader-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    min-height: 100vh;
    background: #f8f9fa; /* Clean neutral background */
}

/* Navigation Arrows - Interactive Design */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    width: 56px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.nav-arrow:hover {
    background: white;
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}

.nav-arrow.visible {
    opacity: 1;
    visibility: visible;
}

.nav-prev {
    left: 2rem;
}

.nav-next {
    right: 2rem;
}

.nav-arrow svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
    color: var(--primary-color);
}

/* Book Container */
.book-container {
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 2000px;
    width: 100%;
    max-width: 1200px;
    height: 85vh;
    padding: 1rem;
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-book);
    overflow: hidden; /* Hidden by default */
    margin: 0 auto;
    position: relative;
}

/* Scrollable container when zoomed */
.book-container.zoomed {
    overflow: auto !important; /* Force scroll when zoomed */
    cursor: grab;
    position: relative;
    display: block !important; /* Change from flex to block for better scroll behavior */
    padding: 20px; /* Add padding for better scroll area */
    -webkit-overflow-scrolling: touch; /* Enable smooth scrolling on iOS/Mac */
    scroll-behavior: smooth; /* Smooth scrolling */
}

.book-container.zoomed:active {
    cursor: grabbing;
}

/* Dragging state */
.book-container.dragging {
    cursor: grabbing !important;
    user-select: none;
}

.book-container.dragging * {
    user-select: none;
}

/* Book styling when zoomed */
.book-container.zoomed .book {
    position: relative;
    transform-origin: center center;
    margin: 0 auto; /* Center horizontally in block layout */
    width: max-content !important; /* Allow book to grow beyond container */
    height: max-content !important; /* Allow book to grow beyond container */
    display: block !important; /* Change to block for better scroll behavior */
    padding: 40px; /* Add padding to ensure content is accessible */
    /* Override the default book width/height */
    min-width: auto;
    min-height: auto;
}

/* Page container adjustments for zoom */
.book-container.zoomed .page-container {
    width: max-content !important; /* Allow page container to grow */
    height: max-content !important; /* Allow page container to grow */
    overflow: visible !important; /* Ensure content is not clipped */
}

/* Canvas adjustments for zoom */
.book-container.zoomed .page canvas {
    max-width: none; /* Remove max-width constraint when zoomed */
    max-height: none; /* Remove max-height constraint when zoomed */
}

/* Page adjustments for zoom */
.book-container.zoomed .page {
    width: max-content !important;
    height: max-content !important;
    overflow: visible !important;
    flex: none !important; /* Remove flex constraints */
}

/* Removed gradient hover effect for cleaner look */

.book {
    position: relative;
    background: var(--surface);
    border-radius: 8px;
    box-shadow: none;
    overflow: visible;
    transition: all 0.3s ease;
    width: 100%;
    height: 100%;
    display: flex;
}

.book:hover {
    transform: none;
}

.book.cover-mode {
    animation: bookEntrance 0.8s ease-out;
}

@keyframes bookEntrance {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.page-container {
    display: flex;
    background: white;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    overflow: hidden;
}

.page {
    position: relative;
    background: white;
    transition: var(--transition);
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0;
}

/* Remove gap between pages in spread */
.page-container:not(.single-page-mode) {
    gap: 0;
}

.page-container:not(.single-page-mode) .left-page {
    border-right: 1px solid #e0e0e0;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
    padding-right: 0;
}

.page-container:not(.single-page-mode) .right-page {
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.05);
    padding-left: 0;
}

/* Single page mode for cover */
.single-page-mode .left-page {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.single-page-mode .page canvas {
    margin: 0 auto;
}

/* Canvas styling */
.page canvas {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -webkit-font-smoothing: subpixel-antialiased;
    -moz-osx-font-smoothing: auto;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Book spine effect */
.book::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 30px;
    transform: translateX(-50%);
    background: linear-gradient(to right,
        transparent 0%,
        rgba(0, 0, 0, 0.02) 10%,
        rgba(0, 0, 0, 0.05) 40%,
        rgba(0, 0, 0, 0.08) 50%,
        rgba(0, 0, 0, 0.05) 60%,
        rgba(0, 0, 0, 0.02) 90%,
        transparent 100%);
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.book:not(.single-page)::before {
    opacity: 1;
}

.left-page {
    border-right: none;
}

.right-page {
    border-left: none;
}

/* Click Areas */
.click-area {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    cursor: pointer;
    z-index: 5;
    transition: background-color 0.2s ease;
}

.click-area:hover {
    background: rgba(74, 144, 226, 0.05);
}

.click-left {
    left: 0;
}

.click-right {
    right: 0;
}

/* Controls - Clean Design */
.controls {
    position: fixed;
    bottom: 20px; /* Add some space from bottom */
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    max-width: calc(100% - 40px); /* Prevent it from touching screen edges */
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    z-index: 1000; /* Higher z-index to stay above product recommendations */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-btn {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.control-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.control-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
    background: transparent;
}

.control-btn:disabled::before {
    display: none;
}

.page-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #000000; /* black text */
    font-size: 14px;
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    position: relative;
}

.page-info span {
    transition: all 0.3s ease;
}

.page-info #currentPage {
    color: #000000; /* black */
    font-size: 14px;
    font-weight: 500;
}

.page-info #totalPages {
    color: #000000; /* black with slight opacity for contrast */
    opacity: 0.7;
}

/* Zoom controls */
.zoom-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.zoom-level {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 50px;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border);
}

#zoomInBtn,
#zoomOutBtn,
#zoomResetBtn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#zoomInBtn svg,
#zoomOutBtn svg,
#zoomResetBtn svg {
    width: 18px;
    height: 18px;
    stroke: white;
}

#zoomInBtn:hover,
#zoomOutBtn:hover,
#zoomResetBtn:hover {
    background: var(--secondary-color);
    transform: translateY(-1px);
}

#zoomInBtn:active,
#zoomOutBtn:active,
#zoomResetBtn:active {
    transform: scale(0.95);
}

/* Progress Bar - Sleek Modern Design */
.progress-container {
    background: transparent;
    padding: 0;
    position: fixed;
    bottom: 57px;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 101;
}

.progress-bar {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #ffffff;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

/* Tablet-specific optimizations (iPad, etc.) */
@media (min-width: 769px) and (max-width: 1024px) {
    .book-container {
        max-width: 95vw;
        height: 80vh;
        padding: 1.5rem;
    }
    
    .nav-arrow {
        width: 48px;
        height: 72px;
    }
    
    .nav-prev {
        left: 1rem;
    }
    
    .nav-next {
        right: 1rem;
    }
    
    /* Slightly smaller controls for tablets */
    .control-btn {
        width: 40px;
        height: 40px;
        padding: 0.5rem;
    }
    
    .page-info {
        font-size: 13px;
    }
    
    /* Touch-friendly zoom controls */
    .zoom-controls {
        gap: 1rem;
    }
    
    #zoomInBtn,
    #zoomOutBtn,
    #zoomResetBtn {
        width: 44px;
        height: 44px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        top: 0.5rem;
        right: 0.5rem;
    }
    
    .header-content {
        gap: 0.5rem;
    }
    
    .floating-btn {
        width: 36px;
        height: 36px;
        padding: 0.5rem;
    }
    
    .reader-container {
        padding: 0;
        min-height: 100vh;
        background: #f8f9fa; /* Same clean background as desktop */
    }
    
    .book-container {
        max-width: 100vw;
        height: calc(100vh - 100px); /* Adjust height for mobile */
        border-radius: 0;
        box-shadow: none;
        margin-bottom: 0;
    }
    
    /* Remove bottom padding on mobile since controls are relative */
    #app {
        padding-bottom: 0;
    }
    
    /* Force single page mode on mobile */
    .page-container {
        justify-content: center !important;
    }
    
    .page-container .left-page {
        width: 100% !important;
        max-width: 100% !important;
        border: none !important;
        box-shadow: none !important;
    }
    
    .page-container .right-page {
        display: none !important;
    }
    
    /* Mobile controls adjustments */
    .controls {
        position: relative !important; /* Static position on mobile */
        bottom: auto;
        left: auto;
        transform: none;
        width: 100%;
        gap: 0.75rem;
        padding: 0.75rem;
        max-width: 100%;
        margin: 20px 10px 40px;
        border-radius: 16px;
        z-index: 100;
    }
    
    .control-group {
        gap: 0.25rem;
    }
    
    .control-btn {
        width: 36px;
        height: 36px;
        padding: 0.5rem;
        font-size: 16px;
    }
    
    .page-info {
        font-size: 12px;
        padding: 0.25rem 0.5rem;
        gap: 0.25rem;
    }
    
    .zoom-level {
        font-size: 12px;
        min-width: 40px;
        padding: 0.25rem;
    }
    
    /* Hide less important controls on very small screens */
    @media (max-width: 400px) {
        #zoomResetBtn {
            display: none;
        }
        
        .controls {
            gap: 0.5rem;
            padding: 0.5rem;
        }
        
        .zoom-controls {
            gap: 0.25rem;
        }
    }
    
    /* Mobile single page styling */
    .single-page-mode .left-page {
        max-width: 100% !important;
    }
    
    .page canvas {
        max-height: calc(100vh - 60px);
        width: auto !important;
        height: auto !important;
        max-width: 100vw;
        object-fit: contain;
    }
    
    /* Hide book spine effect on mobile */
    .book::before {
        display: none !important;
    }
    
    .nav-arrow {
        width: 44px;
        height: 60px;
        background: rgba(0, 0, 0, 0.5);
    }
    
    .nav-prev {
        left: 0;
        border-radius: 0 4px 4px 0;
    }
    
    .nav-next {
        right: 0;
        border-radius: 4px 0 0 4px;
    }
    
    .controls {
        padding: 0.5rem;
        height: 60px;
    }
    
    .control-group {
        gap: 0.5rem;
    }
    
    .control-btn {
        min-width: 32px;
        height: 32px;
        padding: 0.25rem;
    }
    
    .control-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .page-info {
        padding: 0.25rem 0.75rem;
        font-size: 12px;
    }
    
    .progress-container {
        bottom: 60px;
    }

    /* Hide zoom controls on mobile */
    .zoom-controls {
        display: none;
    }
}

@media (max-width: 480px) {
    .book-container {
        padding: 0 0.5rem;
    }
    
    .controls {
        gap: 0.5rem;
    }
    
    .zoom-controls {
        gap: 0.25rem;
    }
    
    #zoomLevel {
        min-width: 35px;
        font-size: 12px;
    }
}

/* Fullscreen Styles */
.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1000;
    background: var(--background);
}

.fullscreen .reader-container {
    min-height: calc(100vh - 120px);
}

.fullscreen .header {
    position: static;
}

/* Animation Classes - Smooth Page Transitions */
.page-turn-left {
    animation: pageFlipLeft 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-turn-right {
    animation: pageFlipRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Button pulse animation on hover */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}



@keyframes pageFlipLeft {
    0% { 
        transform: perspective(1000px) rotateY(0deg);
        opacity: 1;
    }
    50% { 
        transform: perspective(1000px) rotateY(-90deg);
        opacity: 0.8;
    }
    100% { 
        transform: perspective(1000px) rotateY(0deg);
        opacity: 1;
    }
}

@keyframes pageFlipRight {
    0% { 
        transform: perspective(1000px) rotateY(0deg);
        opacity: 1;
    }
    50% { 
        transform: perspective(1000px) rotateY(90deg);
        opacity: 0.8;
    }
    100% { 
        transform: perspective(1000px) rotateY(0deg);
        opacity: 1;
    }
}

/* Smooth transitions */
.smooth-transition {
    transition: all 0.3s ease;
}

/* Focus states for accessibility */
.control-btn:focus,
.nav-arrow:focus,
.click-area:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .header,
    .controls,
    .progress-container,
    .nav-arrow,
    .click-area {
        display: none !important;
    }
    
    .app-container {
        background: white;
    }
    
    .book {
        box-shadow: none;
        border: 1px solid #ccc;
    }
} 

/* Custom scrollbar styling */
.book-container.zoomed::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.book-container.zoomed::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.book-container.zoomed::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.book-container.zoomed::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Mobile view styling */
.mobile-view .page-container {
    justify-content: center !important;
}

.mobile-view .left-page {
    width: 100% !important;
    max-width: 100% !important;
}

.mobile-view .right-page {
    display: none !important;
}

/* Book spine effect */ 

/* Action controls */
.action-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Download button special styling in controls */
.control-btn.download-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
}

.control-btn.download-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
} 

/* Product Recommendations Section */
.product-recommendations {
    background: #f8faf7;
    padding: 80px 20px 120px; /* Extra bottom padding for fixed controls */
    margin-top: 60px;
    position: relative;
}

.product-recommendations::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #e0e0e0 20%, #e0e0e0 80%, transparent);
}

.recommendations-container {
    max-width: 1200px;
    margin: 0 auto;
}

.recommendations-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    color: #1a1a1a;
    margin-bottom: 60px;
    letter-spacing: -0.02em;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
    margin: 0 auto;
}

.product-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.product-link {
    text-decoration: none;
    color: inherit;
    display: block;
    padding: 30px;
}

.product-image-wrapper {
    width: 200px;
    height: 200px;
    margin: 0 auto 30px;
    position: relative;
    overflow: hidden;
    /* Ojämn rund form med CSS */
    border-radius: 50% 40% 50% 40% / 40% 50% 40% 50%;
    background: #f0f4f0;
    animation: morphShape 8s ease-in-out infinite;
    transition: all 0.3s ease;
}

@keyframes morphShape {
    0%, 100% {
        border-radius: 50% 40% 50% 40% / 40% 50% 40% 50%;
    }
    25% {
        border-radius: 40% 50% 40% 50% / 50% 40% 50% 40%;
    }
    50% {
        border-radius: 50% 45% 50% 45% / 45% 50% 45% 50%;
    }
    75% {
        border-radius: 45% 50% 45% 50% / 50% 45% 50% 45%;
    }
}

.product-card:hover .product-image-wrapper {
    border-radius: 50%;
    transform: scale(1.05);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.1);
}

.product-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 15px;
    text-align: center;
}

.product-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #666;
    text-align: center;
    margin-bottom: 20px;
}

.product-cta {
    display: inline-block;
    width: 100%;
    text-align: center;
    color: #10b981;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.product-card:hover .product-cta {
    color: #059669;
    letter-spacing: 0.5px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .product-recommendations {
        padding: 60px 20px;
        margin-top: 40px;
    }
    
    .recommendations-title {
        font-size: 1.8rem;
        margin-bottom: 40px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .product-image-wrapper {
        width: 180px;
        height: 180px;
    }
    
    .product-name {
        font-size: 1.2rem;
    }
    
    .product-description {
        font-size: 0.9rem;
    }
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Make sure recommendations don't interfere with fullscreen mode */
.fullscreen + .product-recommendations {
    display: none;
} 

/* Logo Header */
.logo-header {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 100;
    background: none;
    padding: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.logo-link {
    display: inline-block;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.logo-link:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.logo {
    height: 50px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
}

/* Remove app padding since logo is now inside */
#app {
    padding-top: 0;
    padding-bottom: 100px; /* Space for fixed controls */
    position: relative;
}

/* Hide logo in fullscreen mode */
.fullscreen .logo-header {
    display: none;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .logo-header {
        top: 15px;
        left: 15px;
    }
    
    .logo {
        height: 40px;
        max-width: 120px;
    }
} 

/* Header controls */
.header-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 50;
    display: flex;
    gap: 10px;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 15px;
    border-radius: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
} 