/* assets/css/flipbook.css */
/* Stylings for CV. Berkah Pratama Sejahtera Interactive Flipbook */

:root {
    --flipbook-bg: #1e293b;
    --flipbook-toolbar-bg: #0f172a;
    --flipbook-paper: #ffffff;
    --flipbook-shadow: rgba(0, 0, 0, 0.35);
    --flipbook-accent: #00478d;
    --flipbook-accent-gold: #ffc70f;
}

.flipbook-container {
    background-color: var(--flipbook-bg);
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.95) 100%),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.015) 0, rgba(255, 255, 255, 0.015) 1px, transparent 0, transparent 50%);
    background-size: 100% 100%, 20px 20px;
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    position: relative;
    user-select: none;
    overflow: hidden;
}

/* Header Controls Toolbar */
.flipbook-toolbar {
    background: var(--flipbook-toolbar-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    width: 100%;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 40;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.flipbook-toolbar .btn-tool {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f1f5f9;
    padding: 0.5rem 0.85rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.flipbook-toolbar .btn-tool:hover {
    background: var(--flipbook-accent);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.flipbook-toolbar .btn-tool.active {
    background: var(--flipbook-accent-gold);
    color: #0f172a;
    font-weight: 700;
}

.flipbook-page-indicator {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.375rem;
    padding: 0.35rem 0.75rem;
    color: #f8fafc;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.flipbook-page-input {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffc70f;
    width: 2.75rem;
    text-align: center;
    border-radius: 0.25rem;
    font-weight: 700;
}

/* Stage Area */
.flipbook-viewport {
    flex: 1;
    width: 100%;
    max-width: 1400px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 2500px;
    padding: 2rem 1rem;
    position: relative;
}

/* Book Frame & Spread */
.flipbook-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    transform-style: preserve-3d;
}

.flipbook-book {
    display: flex;
    position: relative;
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    background: #ffffff;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Single Page & Spread Styles */
.flipbook-page {
    width: 480px;
    height: 680px;
    background: #ffffff;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.02);
    backface-visibility: hidden;
}

@media (max-width: 1024px) {
    .flipbook-page {
        width: 380px;
        height: 538px;
    }
}

@media (max-width: 768px) {
    .flipbook-page {
        width: 320px;
        height: 452px;
    }
}

@media (max-width: 480px) {
    .flipbook-page {
        width: 290px;
        height: 410px;
    }
}

/* Spine Shadow effect */
.flipbook-page-left {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
}

.flipbook-page-left::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 100%;
    background: linear-gradient(to left, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.03) 50%, rgba(0,0,0,0) 100%);
    pointer-events: none;
    z-index: 10;
}

.flipbook-page-right {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

.flipbook-page-right::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.03) 50%, rgba(0,0,0,0) 100%);
    pointer-events: none;
    z-index: 10;
}

/* Navigation Arrow Overlays */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
    height: 80px;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 35;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
}

.nav-arrow:hover {
    background: var(--flipbook-accent);
    color: #ffc70f;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.nav-arrow.left {
    left: 1.5rem;
}

.nav-arrow.right {
    right: 1.5rem;
}

/* Dynamic Page Content Layout Styling */
.fb-paper-sheet {
    width: 100%;
    height: 100%;
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    font-family: 'Hanken Grotesk', sans-serif;
    color: #1e293b;
}

/* Header & Footer on Pages */
.fb-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #00478d;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.fb-header-title {
    font-weight: 800;
    color: #00478d;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fb-header-tag {
    background: #ffc70f;
    color: #1a1c1c;
    font-weight: 700;
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 2px;
    font-family: 'JetBrains Mono', monospace;
}

.fb-footer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e2e8f0;
    padding-top: 0.5rem;
    margin-top: auto;
    font-size: 0.75rem;
    color: #64748b;
}

.fb-page-num {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: #00478d;
}

/* Thumbnails Overlay Grid Modal */
.flipbook-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(12px);
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.flipbook-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1.25rem;
    overflow-y: auto;
    padding: 1rem;
    flex: 1;
}

.thumb-item {
    background: #ffffff;
    border-radius: 0.5rem;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    position: relative;
    aspect-ratio: 1 / 1.41;
}

.thumb-item:hover {
    border-color: var(--flipbook-accent-gold);
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.thumb-item.current {
    border-color: var(--flipbook-accent);
}

.thumb-item .thumb-num {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 71, 141, 0.9);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    font-family: 'JetBrains Mono', monospace;
}
