/* Handbook Styles - FULL SCREEN SIZE */
.handbook-wrapper {
    background-color: #f8fafc;
    min-height: 100vh;
    padding: 10px 20px;
}

.logo {
    max-height: 120px;
    max-width: auto;
}

/* BOOK WRAPPER - Takes full available width */
.book-wrapper {
    min-height: calc(100vh - 200px);
    padding: 10px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* BOOK BINDING EFFECT - Visual spine */
.book-binding {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(0,0,0,0.15) 0%, 
        rgba(0,0,0,0.05) 30%,
        rgba(255,255,255,0.1) 50%,
        rgba(0,0,0,0.05) 70%,
        rgba(0,0,0,0.15) 100%);
    border-radius: 5px;
    z-index: 10;
    pointer-events: none;
}

/* MAIN CONTAINER - Takes 95% of viewport */
#flipbook-container {
    width: 95vw;
    height: 80vh;
    margin: 0 auto;
    perspective: 2000px;
}

/* FLIPBOOK - Full container size */
#flipbook {
    width: 100%;
    height: 100%;
    margin: 0 auto;
    box-shadow: 0 30px 60px rgba(0,0,0,0.3);
    border-radius: 8px;
}

/* PAGES - Each page half of total width */
#flipbook .page {
    width: 50%;
    height: 100%;
    background-color: #fffef7;
    border-radius: 4px 8px 8px 4px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

/* HARD COVERS (First and Last Page) */
#flipbook .hard {
    width: 50%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-radius: 4px 8px 8px 4px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    color: white;
}

/* PAGE INNER CONTENT - Responsive padding */
.page-inner {
    height: 100%;
    overflow-y: auto;
    padding: clamp(20px, 5%, 50px) clamp(25px, 6%, 60px) !important;
    background: #fffef7;
}

/* Hard cover inner content */
.hard .page-inner {
    background: transparent !important;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.hard .logo img {
    max-height: 100px;
    width: auto;
    margin-bottom: 15px;
}

.hard hr {
    width: 60%;
    border-color: rgba(255,255,255,0.3);
    margin: 15px auto;
}

/* Custom Scrollbar for pages */
.page-inner::-webkit-scrollbar {
    width: 6px;
}

.page-inner::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.page-inner::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* Compact Table Styles for Book Pages */
.page-content .table-responsive {
    overflow-x: auto;
    margin: 15px 0;
    max-width: 100%;
}

.page-content .table {
    width: 100%;
    border-collapse: collapse;
    font-size: clamp(10px, 1.2vw, 13px);
    line-height: 1.4;
}

.page-content .table th,
.page-content .table td {
    padding: clamp(4px, 1vw, 10px) clamp(6px, 1.5vw, 12px);
    border: 1px solid #e2e8f0;
    word-wrap: break-word;
}

.page-content .table th {
    background-color: #667eea;
    color: white;
    font-weight: 600;
    font-size: clamp(10px, 1.2vw, 13px);
}

/* Column width optimization */
.page-content .table th:nth-child(1),
.page-content .table td:nth-child(1) {
    width: 18%;
}

.page-content .table th:nth-child(2),
.page-content .table td:nth-child(2) {
    width: 22%;
}

.page-content .table th:nth-child(3),
.page-content .table td:nth-child(3) {
    width: 15%;
}

.page-content .table th:nth-child(4),
.page-content .table td:nth-child(4) {
    width: 25%;
}

.page-content .table th:nth-child(5),
.page-content .table td:nth-child(5) {
    width: 20%;
}

.page-content .table td {
    white-space: normal;
    word-break: break-word;
}

.page-content .table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

.page-content .table tbody tr:hover {
    background-color: #e2e8f0;
    transition: background-color 0.2s ease;
}

/* Typography - Responsive sizes */
.notion-content {
    font-family: 'Georgia', serif;
    line-height: 1.8;
    color: #334155;
    font-size: clamp(14px, 1.5vw, 18px);
}

.notion-content h1 {
    font-family: 'Inter', sans-serif;
    color: #1e293b;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: clamp(24px, 3vw, 36px);
}

.notion-content h2 {
    font-family: 'Inter', sans-serif;
    color: #1e293b;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: clamp(20px, 2.5vw, 28px);
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

.notion-content h3 {
    font-family: 'Inter', sans-serif;
    color: #1e293b;
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: clamp(18px, 2vw, 22px);
}

.notion-content p {
    margin-bottom: 1rem;
    font-size: clamp(14px, 1.5vw, 18px);
}

/* Images */
.notion-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

/* Callouts */
.callout {
    background-color: #f1f5f9;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    margin: 1.25rem 0;
    border-left: 4px solid #667eea;
}

.callout-icon {
    font-size: 1.25rem;
    margin-right: 0.75rem;
}

.callout-content {
    flex: 1;
}

/* Quote */
blockquote {
    border-left: 4px solid #667eea;
    padding-left: 1.5rem;
    font-style: italic;
    color: #475569;
    margin: 1.5rem 0;
}

/* Lists */
.notion-content ul, 
.notion-content ol {
    margin: 0.75rem 0;
    padding-left: 1.75rem;
}

.notion-content li {
    margin: 0.35rem 0;
    line-height: 1.7;
}

/* Navigation Buttons */
.btn-primary {
    background-color: #667eea;
    border-color: #667eea;
    transition: all 0.3s ease;
    padding: 8px 20px;
    font-size: 14px;
}

.btn-primary:hover {
    background-color: #5a67d8;
    border-color: #5a67d8;
    transform: scale(1.02);
}

/* Page indicator */
#page-indicator {
    font-size: 14px;
    font-weight: 600;
    min-width: 100px;
    text-align: center;
    color: #475569;
}

/* Large Desktop - Extra large screens */
@media (min-width: 1920px) {
    #flipbook-container {
        width: 85vw;
        height: 75vh;
    }
}

/* Standard Desktop */
@media (min-width: 1400px) and (max-width: 1919px) {
    #flipbook-container {
        width: 90vw;
        height: 78vh;
    }
}

/* Laptop */
@media (min-width: 1025px) and (max-width: 1399px) {
    #flipbook-container {
        width: 92vw;
        height: 75vh;
    }
}

/* Tablet Landscape */
@media (min-width: 769px) and (max-width: 1024px) {
    #flipbook-container {
        width: 95vw;
        height: 70vh;
    }
    
    .page-inner {
        padding: 20px 25px !important;
    }
}

/* Mobile and Small Tablets - Fallback to stacked view */
@media (max-width: 768px) {
    .book-wrapper {
        min-height: auto;
    }
    
    #flipbook-container {
        width: 100%;
        height: auto;
    }
    
    #flipbook {
        width: 100%;
        height: auto;
        position: relative !important;
        box-shadow: none;
    }
    
    #flipbook .page,
    #flipbook .hard {
        width: 100% !important;
        height: auto !important;
        margin-bottom: 20px;
        position: relative !important;
        float: none !important;
        clear: both !important;
        min-height: 500px;
    }
    
    .book-binding {
        display: none;
    }
    
    .page-inner {
        padding: 20px !important;
    }
    
    .btn-primary {
        padding: 6px 16px;
        font-size: 12px;
    }
    
    .page-content .table {
        font-size: 10px;
    }
    
    .page-content .table th,
    .page-content .table td {
        padding: 4px 6px;
    }
}

/* Animation for page load */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page {
    animation: fadeInUp 0.4s ease;
}

/* Print styles */
@media print {
    .book-wrapper {
        min-height: auto;
        padding: 0;
    }
    
    #flipbook-container,
    #flipbook {
        width: 100%;
        height: auto;
        box-shadow: none;
    }
    
    #flipbook .page,
    #flipbook .hard {
        page-break-after: always;
        box-shadow: none;
        margin: 0;
        padding: 0;
        width: 100% !important;
        height: auto !important;
    }
    
    .btn-primary,
    .book-binding,
    .flipbook-nav,
    .d-flex.justify-content-center.gap-3 {
        display: none;
    }
}