/**
 * Testament Book List Styles
 * Scrollable book list with Turn.js flipbooks
 */

#testament-book-list {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.book-item {
    margin-bottom: 80px;
    padding: 40px 40px 0 40px;
    position: relative;
}

/* Book Header */
.book-header {
    position: absolute;
    left: calc(50% - 400px);
    top: 40px;
    z-index: 1;
    width: 400px;
    max-width: 400px;
    padding: 40px;
    text-align: left;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    height: 600px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.book-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    position: relative;
    z-index: 2;
}

.book-subtitle {
    font-size: 1.3rem;
    color: #f4d03f;
    font-style: italic;
    margin-bottom: 20px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
    position: relative;
    z-index: 2;
}

.book-description {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.95);
    line-height: 1.6;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
    position: relative;
    z-index: 2;
}

/* Flipbook Viewer */
.book-viewer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    position: relative;
    z-index: 10;
    margin-top: 0;
}

.flipbook {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    background: transparent;
    position: relative;
    margin-top: 0;
}

/* Center spine/border between pages */
.flipbook::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        rgba(0, 0, 0, 0.1) 100%);
    transform: translateX(-50%);
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Hide spine during page turn */
.flipbook.turning::after {
    opacity: 0;
}

.flipbook .page {
    background: transparent;
    background-size: cover;
    background-position: center;
}

.flipbook .page-cover,
.flipbook .page-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    overflow: hidden;
}

.flipbook .page-cover img,
.flipbook .page-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.flipbook .page-content {
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #333;
    position: relative;
}

.flipbook .page-inner h3 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: #1e3c72;
    text-align: center;
}

.flipbook .page-inner p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #555;
    text-align: justify;
}

.flipbook .page-number {
    position: absolute;
    bottom: 30px;
    right: 40px;
    font-size: 0.9rem;
    color: #999;
}

/* Flipbook Controls */
.flipbook-controls {
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 20px;
    position: relative;
    z-index: 10000;
    pointer-events: auto !important;
}

.flipbook-controls button {
    padding: 10px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    position: relative;
    z-index: 10001;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto !important;
}

.flipbook-controls button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.flipbook-controls button:active:not(:disabled) {
    transform: translateY(0);
    background: linear-gradient(135deg, #5568d3 0%, #653a8b 100%);
}

.flipbook-controls button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #666;
    pointer-events: none;
}

.page-indicator {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    min-width: 120px;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 1100px) {
    .book-header {
        left: calc(50% - 300px);
        width: 300px;
        max-width: 300px;
        padding: 25px;
        height: 450px;
    }

    .flipbook {
        width: 600px !important;
        height: 450px !important;
    }

    .book-title {
        font-size: 1.8rem;
    }

    .book-subtitle {
        font-size: 1rem;
    }

    .book-description {
        font-size: 0.95rem;
    }
}

@media (max-width: 900px) {
    .book-item {
        padding: 30px 20px 0 20px;
    }

    .book-header {
        position: static;
        transform: none;
        width: 100%;
        max-width: 100%;
        height: auto;
        padding: 30px 20px;
        margin-bottom: 20px;
        text-align: center;
        left: auto;
        top: auto;
        background: rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-radius: 8px;
    }

    .flipbook {
        width: 100% !important;
        max-width: 600px !important;
        height: 450px !important;
    }

    .flipbook .page-content {
        padding: 40px 30px;
    }

    .flipbook .page-inner h3 {
        font-size: 1.6rem;
    }

    .flipbook .page-inner p {
        font-size: 1rem;
    }
}

@media (max-width: 650px) {
    .book-item {
        padding: 20px 15px;
    }

    .book-header {
        position: static;
        transform: none;
        max-width: 100%;
        width: 100%;
        height: auto;
        padding: 25px 15px;
        margin-bottom: 20px;
        text-align: center;
        background: rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-radius: 8px;
    }

    .book-viewer {
        margin-top: 0;
        overflow: visible !important;
    }

    .flipbook {
        margin: 0 auto;
        max-height: 600px !important;
        overflow: visible !important;
        pointer-events: none !important;
    }

    .flipbook * {
        pointer-events: none !important;
    }

    /* Hide center spine on mobile since we show single pages */
    .flipbook::after {
        display: none;
    }

    .book-title {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }

    .book-subtitle {
        font-size: 0.95rem;
        margin-bottom: 15px;
    }

    .book-description {
        font-size: 0.9rem;
    }

    .flipbook-controls {
        flex-direction: column;
        gap: 12px;
        width: 100%;
        padding: 15px;
    }

    .flipbook-controls button {
        width: 100%;
        min-width: auto;
        padding: 16px 20px;
        font-size: 1.1rem;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(102, 126, 234, 0.3);
    }

    .flipbook-controls button:active:not(:disabled) {
        transform: scale(0.95);
        background: linear-gradient(135deg, #5568d3 0%, #653a8b 100%);
    }

    .page-indicator {
        width: 100%;
        font-size: 1.05rem;
    }

    .flipbook .page-content {
        padding: 30px 20px;
    }

    .flipbook .page-inner h3 {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }

    .flipbook .page-inner p {
        font-size: 0.9rem;
        line-height: 1.6;
    }
}

/* Turn.js specific styles */
.turn-page {
    background-color: transparent;
}

.flipbook .even {
    background: transparent;
}

.flipbook .odd {
    background: transparent;
}
