.flipbook-wrap {
    font-family: 'Kanit', sans-serif;
    margin-bottom: 48px;
}

.flipbook-toolbar {
    background: linear-gradient(135deg, #11998e 0%, #17b978 50%, #38ef7d 100%);
    border-radius: 20px 20px 0 0;
    padding: 18px 24px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.flipbook-toolbar h2 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 700;
}

.flipbook-toolbar-meta {
    font-size: 13px;
    opacity: 0.9;
}

.btn-flip-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff !important;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.flipbook-shell {
    background: linear-gradient(180deg, #374151 0%, #1f2937 100%);
    border-radius: 0 0 20px 20px;
    padding: 28px 16px 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.flipbook-stage {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 480px;
    position: relative;
}

.flipbook-loading {
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
    padding: 60px 20px;
}

.flipbook-loading i {
    font-size: 42px;
    display: block;
    margin-bottom: 16px;
    color: #38ef7d;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.flipbook-loading-bar {
    width: 220px;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    margin: 16px auto 0;
    overflow: hidden;
}

.flipbook-loading-bar span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #11998e, #38ef7d);
    border-radius: 6px;
    transition: width 0.25s ease;
}

#flip-book-container {
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
    border-radius: 4px;
}

#flip-book-container .page {
    background: #fff;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

#flip-book-container .page img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #fff;
}

#flip-book-container .page-text-inner {
    padding: 28px 32px;
    height: 100%;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.85;
    color: #334155;
    box-sizing: border-box;
}

#flip-book-container .page-text-inner h1,
#flip-book-container .page-text-inner h2,
#flip-book-container .page-text-inner h3 {
    color: #11998e;
    margin-top: 0;
}

.flipbook-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.flipbook-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(17, 185, 120, 0.4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.flipbook-btn:hover:not(:disabled) {
    transform: scale(1.08);
}

.flipbook-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.flipbook-indicator {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    padding: 10px 22px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    min-width: 130px;
    text-align: center;
}

.flipbook-indicator input {
    width: 44px;
    text-align: center;
    border: none;
    border-radius: 8px;
    padding: 4px;
    margin: 0 4px;
    font-weight: 700;
    color: #11998e;
}

.flipbook-hint {
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    margin-top: 12px;
}

.flipbook-badge-pdf {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    margin-left: 8px;
}

@media (max-width: 768px) {
    .flipbook-stage { min-height: 380px; }
    .flipbook-btn { width: 42px; height: 42px; font-size: 16px; }
}
