/* --- DIGITAL READER & PLAYER STYLES --- */
.reader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000; /* Solid black to hide everything behind */
    z-index: 2100000000 !important; /* Extremely high, but BELOW security layers (2.1B < 2.14B) */
    display: flex;
    flex-direction: column;
    animation: readerFadeIn 0.3s ease;
    pointer-events: auto !important;
}

.reader-toolbar {
    padding: 15px 30px;
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10; /* Local stacking inside overlay */
    pointer-events: auto !important;
}

.reader-title {
    color: #FFD700;
    font-weight: 600;
    font-size: 1.1rem;
}

.reader-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.reader-canvas-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    background: #121212;
    scroll-behavior: smooth;
    gap: 30px;
}

.pdf-page-wrapper {
    position: relative;
    max-width: 95%;
    min-height: 1000px;
    /* Prevent collapse before render */
    background: white;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    margin: 0 auto;
}

canvas {
    max-width: 100%;
    height: auto !important;
}


.reader-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #FFD700;
}

.reader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 215, 0, 0.1);
    border-top: 4px solid #FFD700;
    border-radius: 50%;
    animation: readerSpin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes readerFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes readerSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.btn-icon {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    z-index: 2147483647 !important;
    pointer-events: auto !important;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.btn-icon:hover {
    color: #FFD700;
    background: rgba(255, 215, 0, 0.2);
    transform: scale(1.1);
}

#page-indicator {
    color: white;
    font-size: 0.9rem;
    min-width: 80px;
    text-align: center;
}

/* --- SECURITY & PROTECTION --- */
.security-blur {
    filter: blur(40px) brightness(0.3) !important;
    pointer-events: none !important;
    user-select: none !important;
}

.watermark-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15000;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-content: space-around;
    overflow: hidden;
    opacity: 0.15;
    user-select: none;
}

.watermark-item {
    font-size: 14px;
    color: #fff;
    transform: rotate(-30deg);
    white-space: nowrap;
    margin: 40px;
    font-weight: bold;
    font-family: monospace;
}

.no-select {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    -webkit-touch-callout: none !important;
}

.reader-overlay canvas {
    pointer-events: none;
    /* Prevent drag/save from right click */
}

/* --- RESUME PLAYBACK MODAL --- */
.resume-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

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

.resume-modal {
    background: rgba(25, 25, 25, 0.95);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 20px;
    padding: 35px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.resume-modal-overlay.active .resume-modal {
    transform: translateY(0);
}

.resume-modal i.fa-headphones {
    font-size: 3rem;
    color: #FFD700;
    margin-bottom: 20px;
    display: block;
}

.resume-modal h3 {
    color: #FFD700;
    margin-bottom: 12px;
    font-size: 1.5rem;
    font-weight: 700;
}

.resume-modal p {
    color: #e0e0e0;
    margin-bottom: 30px;
    font-size: 1rem;
    line-height: 1.6;
}

.resume-actions {
    display: flex;
    gap: 15px;
    flex-direction: column;
}

.btn-resume-primary {
    background: linear-gradient(135deg, #FFD700 0%, #FDB931 100%);
    color: #000;
    border: none;
    padding: 14px 20px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-resume-secondary {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-resume-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.btn-resume-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.4);
}